showNotificationManager static method Null safety
- {dynamic title = '',
- dynamic author = '',
- dynamic imageUrl = '',
- dynamic isPlaying = true}
To show your media notification you have to pass title
and
author
and Image of music. If music is pausing you have to set
isPlaying
false.
Implementation
static Future showNotificationManager(
{title = '', author = '', imageUrl = '', isPlaying = true}) async {
try {
final Map<String, dynamic> params = <String, dynamic>{
'title': title,
'author': author,
'imageUrl': imageUrl,
'isPlaying': isPlaying
};
await _channel.invokeMethod('showNotificationManager', params);
_channel.setMethodCallHandler(_utilsHandlerManager);
} on PlatformException catch (e) {
print("Failed to show notification: '${e.message}'.");
}
}