create static method

Future<android_app_Notification> create({
  1. required String contentTitle,
  2. required String contentText,
  3. int? when,
  4. required String channelId,
  5. required String channelName,
  6. bool enableLights = true,
  7. bool showBadge = true,
})

Implementation

static Future<android_app_Notification> create({
  required String contentTitle,
  required String contentText,
  int? when,
  required String channelId,
  required String channelName,
  bool enableLights = true,
  bool showBadge = true,
}) async {
  final result = await kMethodChannel.invokeMethod<Ref>(
    'android.app.Notification::create',
    {
      'contentTitle': contentTitle,
      'contentText': contentText,
      'when': when ?? DateTime.now().millisecondsSinceEpoch,
      'channelId': channelId,
      'channelName': channelName,
      'enableLights': enableLights,
      'showBadge': showBadge,
    },
  );
  return android_app_Notification()..refId = result?.refId;
}