onStart method

  1. @override
Future<bool> onStart()
override

Callback when this executor is started. Returns true if successfully started, false otherwise.

Implementation

@override
Future<bool> onStart() async {
  // Ask for permission before starting probe.
  var status = await Permission.activityRecognition.request();

  return (status == PermissionStatus.granted)
      ? super.onStart()
      : Future.value(false);
}