disable method
Disables background execution.
Returns true if background execution is now disabled, and false if
initialize has not succeeded or disabling failed.
Implementation
Future<bool> disable() async {
if (!_initialized) {
warning('$runtimeType - Background service is not initialized.');
return false;
}
info('Disabling background service...');
_enabled = await FlutterBackground.disableBackgroundExecution();
if (_enabled) {
warning('$runtimeType - Failed to disable background service.');
}
debug('$runtimeType - Background service disabled: $_enabled');
return !_enabled;
}