createTimer method

  1. @override
Future<void> createTimer({
  1. required int id,
  2. required int intervalMicroseconds,
  3. required bool backgroundMode,
})
override

Implementation

@override
Future<void> createTimer({
  required int id,
  required int intervalMicroseconds,
  required bool backgroundMode,
}) async {
  if (_backgroundCallback != null && !_backgroundCallbacksRegistered) {
    await _methodChannel.invokeMethod<void>('registerBackgroundCallback');
    _backgroundCallbacksRegistered = true;
  }
  await _methodChannel.invokeMethod<void>('createTimer', <String, dynamic>{
    'id': id,
    'intervalMicroseconds': intervalMicroseconds,
    'backgroundMode': backgroundMode,
  });
}