chore(mobile): styling and linter (#1807)

* chore(mobile): styling and linter

* style: adaptive SwitchListTile
This commit is contained in:
Alex 2023-02-20 21:40:19 -06:00 committed by GitHub
parent 88a2966666
commit 03d484aba2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 48 deletions

View file

@ -301,12 +301,11 @@ class BackgroundService {
// indefinitely and can run later
// Android is fine to wait here until the lock releases
final waitForLock = Platform.isIOS
? acquireLock()
.timeout(
const Duration(seconds: 5),
onTimeout: () => false,
)
: acquireLock();
? acquireLock().timeout(
const Duration(seconds: 5),
onTimeout: () => false,
)
: acquireLock();
final bool hasAccess = await waitForLock;
if (!hasAccess) {
@ -381,7 +380,8 @@ class BackgroundService {
}
// Android should check for new assets added while performing backup
} while (Platform.isAndroid &&
true == await _backgroundChannel.invokeMethod<bool>("hasContentChanged"));
true ==
await _backgroundChannel.invokeMethod<bool>("hasContentChanged"));
return true;
}
@ -555,8 +555,8 @@ class BackgroundService {
Future<DateTime?> getIOSBackupLastRun(IosBackgroundTask task) async {
// Seconds since last run
final double? lastRun = task == IosBackgroundTask.fetch
? await _foregroundChannel.invokeMethod('lastBackgroundFetchTime')
: await _foregroundChannel.invokeMethod('lastBackgroundProcessingTime');
? await _foregroundChannel.invokeMethod('lastBackgroundFetchTime')
: await _foregroundChannel.invokeMethod('lastBackgroundProcessingTime');
if (lastRun == null) {
return null;
}
@ -565,15 +565,11 @@ class BackgroundService {
}
Future<int> getIOSBackupNumberOfProcesses() async {
return await _foregroundChannel
.invokeMethod('numberOfBackgroundProcesses');
return await _foregroundChannel.invokeMethod('numberOfBackgroundProcesses');
}
}
enum IosBackgroundTask {
fetch,
processing
}
enum IosBackgroundTask { fetch, processing }
class _Throttle {
_Throttle(this._fun, Duration interval) : _interval = interval.inMicroseconds;