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 {
  // collect the current connectivity status on sampling start
  var connectivityStatus =
      await connectivity.Connectivity().checkConnectivity();
  addMeasurement(Measurement.fromData(
      Connectivity.fromConnectivityResult(connectivityStatus)));

  return super.onStart();
}