showNotification method
Future<int>
showNotification({
- int? id,
- required String title,
- required String message,
- String? channelId,
- NotificationImportance? importance,
- bool? autoCancel,
- String? targetScreen,
- Map<
String, dynamic> ? extraData,
override
Implementation
@override
Future<int> showNotification({
int? id,
required String title,
required String message,
String? channelId,
NotificationImportance? importance,
bool? autoCancel,
String? targetScreen,
Map<String, dynamic>? extraData,
}) async {
final args = <String, dynamic>{
'id': id,
'title': title,
'message': message,
'channelId': channelId,
'autoCancel': autoCancel,
'targetScreen': targetScreen,
'extraData': extraData,
};
if (importance != null) args['priority'] = importance.value;
final result =
await methodChannel.invokeMethod<int>('showNotification', args);
return result ?? -1;
}