1
0
Fork 0
This commit is contained in:
Florian RICHER (MrDev023) 2022-04-17 22:32:27 +02:00
parent 41b191bdd3
commit 5865aa445f
4 changed files with 7 additions and 4 deletions

View file

@ -2,6 +2,8 @@
A new Flutter project.
https://streamlabs.readme.io/docs/alerts
## Getting Started
This project is a starting point for a Flutter application.

View file

@ -100,7 +100,7 @@ class Mailer {
MailLoadEvent mailLoadEvent, StreamController streamController) async {
final message =
customMessages[Random.secure().nextInt(customMessages.length)];
await Requests.sendAlert(message);
await Requests.sendAlert(message, type: AlertType.host);
streamController.add(StreamElement(StreamElementType.alert, message));
}
}

View file

@ -47,7 +47,7 @@ class Requests {
await dio.post('https://streamlabs.com/api/v1.0/token', data: data);
if (response.statusCode == HttpStatus.ok) {
jsonDecode(response.data).forEach((key, value) =>
response.data.forEach((key, value) =>
prefs.setString('credentials.$key', value.toString()));
Logger.log(LoggerType.info, Requests,
'Authorization success : ${response.data}');
@ -98,7 +98,7 @@ class Requests {
if (response.statusCode == HttpStatus.ok) {
Logger.log(LoggerType.info, Requests,
'Authorization success : ${response.data}');
'Authorization success : ${objectMap} ${response.data}');
} else {
Logger.log(LoggerType.error, Requests,
'Authorization error : ${response.data} with $data and ${response.requestOptions.headers}');

View file

@ -48,7 +48,8 @@ class StreamElementCard extends StatelessWidget {
IconButton(
icon: const Icon(Icons.send),
onPressed: () async {
await Requests.sendAlert(streamElement.message);
await Requests.sendAlert(streamElement.message,
type: AlertType.host);
},
),
],