init method

  1. @override
Future<void> init({
  1. bool? isScreenLockEnabled,
  2. bool? isBackgroundLockEnabled,
  3. double? backgroundTimeout,
  4. bool? isTouchTimeoutEnabled,
  5. double? touchTimeout,
})
override

Implementation

@override
Future<void> init({
  bool? isScreenLockEnabled,
  bool? isBackgroundLockEnabled,
  double? backgroundTimeout,
  bool? isTouchTimeoutEnabled,
  double? touchTimeout,
}) {
  final Map<String, dynamic> arguments = {};

  if (isScreenLockEnabled != null) {
    arguments['isScreenLockEnabled'] = isScreenLockEnabled;
  }
  if (isBackgroundLockEnabled != null) {
    arguments['isBackgroundLockEnabled'] = isBackgroundLockEnabled;
  }
  if (backgroundTimeout != null) {
    arguments['backgroundTimeout'] = backgroundTimeout;
  }
  if (isTouchTimeoutEnabled != null) {
    arguments['isTouchTimeoutEnabled'] = isTouchTimeoutEnabled;
  }
  if (touchTimeout != null) {
    arguments['touchTimeout'] = touchTimeout;
  }
  return methodChannel.invokeMethod(
      'init', arguments.isEmpty ? null : arguments);
}