init static method

Future<void> init({
  1. bool showDebugLogs = true,
})

Initializes Alarm services.

Also calls checkAlarm that will reschedule alarms that were set before app termination.

Set showDebugLogs to false to hide all the logs from the plugin.

Implementation

static Future<void> init({bool showDebugLogs = true}) async {
  alarmPrint = (String? message, {int? wrapWidth}) {
    if (showDebugLogs) print('[Alarm] $message');
  };

  if (android) AndroidAlarm.init();
  await AlarmStorage.init();

  await checkAlarm();
}