onSamplingStart method
Handler called when sampling period starts.
Implementation
@override
void onSamplingStart() {
_data = Bluetooth();
// startScan is async - a plain try/catch would not catch its errors
// (e.g. adapter not ready yet on iOS: CBManagerStateUnknown).
FlutterBluePlus.startScan(
withServices: services,
withRemoteIds: remoteIds,
timeout:
samplingConfiguration?.duration ??
const Duration(milliseconds: DEFAULT_TIMEOUT),
).catchError((Object error) {
_data = Error(message: 'Error scanning for bluetooth - $error');
});
}