onResume method

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

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

Implementation

@override
Future<bool> onResume() async {
  // check permission to access the AR on Android
  final status = await Permission.activityRecognition.status;
  if (!status.isGranted) {
    warning(
        '$runtimeType - permission not granted to use to activity recognition: $status - trying to request it');
    try {
      await Permission.activityRecognition.request();
    } catch (error) {
      warning(
          '$runtimeType - error trying to request access to activity recognition, error: $error');
    }
  }

  return super.onResume();
}