Update
This commit is contained in:
parent
41b191bdd3
commit
5865aa445f
4 changed files with 7 additions and 4 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
A new Flutter project.
|
A new Flutter project.
|
||||||
|
|
||||||
|
https://streamlabs.readme.io/docs/alerts
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
This project is a starting point for a Flutter application.
|
This project is a starting point for a Flutter application.
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Mailer {
|
||||||
MailLoadEvent mailLoadEvent, StreamController streamController) async {
|
MailLoadEvent mailLoadEvent, StreamController streamController) async {
|
||||||
final message =
|
final message =
|
||||||
customMessages[Random.secure().nextInt(customMessages.length)];
|
customMessages[Random.secure().nextInt(customMessages.length)];
|
||||||
await Requests.sendAlert(message);
|
await Requests.sendAlert(message, type: AlertType.host);
|
||||||
streamController.add(StreamElement(StreamElementType.alert, message));
|
streamController.add(StreamElement(StreamElementType.alert, message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ class Requests {
|
||||||
await dio.post('https://streamlabs.com/api/v1.0/token', data: data);
|
await dio.post('https://streamlabs.com/api/v1.0/token', data: data);
|
||||||
|
|
||||||
if (response.statusCode == HttpStatus.ok) {
|
if (response.statusCode == HttpStatus.ok) {
|
||||||
jsonDecode(response.data).forEach((key, value) =>
|
response.data.forEach((key, value) =>
|
||||||
prefs.setString('credentials.$key', value.toString()));
|
prefs.setString('credentials.$key', value.toString()));
|
||||||
Logger.log(LoggerType.info, Requests,
|
Logger.log(LoggerType.info, Requests,
|
||||||
'Authorization success : ${response.data}');
|
'Authorization success : ${response.data}');
|
||||||
|
@ -98,7 +98,7 @@ class Requests {
|
||||||
|
|
||||||
if (response.statusCode == HttpStatus.ok) {
|
if (response.statusCode == HttpStatus.ok) {
|
||||||
Logger.log(LoggerType.info, Requests,
|
Logger.log(LoggerType.info, Requests,
|
||||||
'Authorization success : ${response.data}');
|
'Authorization success : ${objectMap} ${response.data}');
|
||||||
} else {
|
} else {
|
||||||
Logger.log(LoggerType.error, Requests,
|
Logger.log(LoggerType.error, Requests,
|
||||||
'Authorization error : ${response.data} with $data and ${response.requestOptions.headers}');
|
'Authorization error : ${response.data} with $data and ${response.requestOptions.headers}');
|
||||||
|
|
|
@ -48,7 +48,8 @@ class StreamElementCard extends StatelessWidget {
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.send),
|
icon: const Icon(Icons.send),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await Requests.sendAlert(streamElement.message);
|
await Requests.sendAlert(streamElement.message,
|
||||||
|
type: AlertType.host);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue