show method

  1. @override
Future<bool?> show({
  1. required String time,
  2. required String title,
  3. required String description,
  4. required AlertType type,
  5. required void onClose(),
})
override

Implementation

@override
Future<bool?> show({
  required String time,
  required String title,
  required String description,
  required AlertType type,
  required void Function() onClose,
}) async {
  if (Platform.isAndroid) {
    listenBroadcastStream();
    final onCloseHandle = PluginUtilities.getCallbackHandle(onClose);
    var args = {
      'time': time,
      'title': title,
      'description': description,
      'alert_type': type.name,
      'on_close': onCloseHandle?.toRawHandle()
    };
    return await methodChannel.invokeMethod('showAlert', args);
  }
  return Future.value(false);
}