From f88ff4fb5c18ffe8775e10eaccff3debb729dad3 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 10 Sep 2022 11:46:51 -0500 Subject: [PATCH] fix(mobile): background backup not working in release mode (#664) --- .../background.service.dart | 8 ++++++-- .../backup/views/backup_controller_page.dart | 20 +++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/mobile/lib/modules/backup/background_service/background.service.dart b/mobile/lib/modules/backup/background_service/background.service.dart index a7b4ef046d..1af6dc9816 100644 --- a/mobile/lib/modules/backup/background_service/background.service.dart +++ b/mobile/lib/modules/backup/background_service/background.service.dart @@ -173,7 +173,8 @@ class BackgroundService { } } catch (error) { debugPrint( - "[_clearErrorNotifications] failed to communicate with plugin"); + "[_clearErrorNotifications] failed to communicate with plugin", + ); } return false; } @@ -344,7 +345,9 @@ class BackgroundService { } Future _runBackup( - BackupService backupService, HiveBackupAlbums backupAlbumInfo) async { + BackupService backupService, + HiveBackupAlbums backupAlbumInfo, + ) async { _errorGracePeriodExceeded = _isErrorGracePeriodExceeded(); if (_canceledBySystem) { @@ -445,6 +448,7 @@ class BackgroundService { } /// entry point called by Kotlin/Java code; needs to be a top-level function +@pragma('vm:entry-point') void _nativeEntry() { WidgetsFlutterBinding.ensureInitialized(); BackgroundService backgroundService = BackgroundService(); diff --git a/mobile/lib/modules/backup/views/backup_controller_page.dart b/mobile/lib/modules/backup/views/backup_controller_page.dart index 715b449f7c..eec0277421 100644 --- a/mobile/lib/modules/backup/views/backup_controller_page.dart +++ b/mobile/lib/modules/backup/views/backup_controller_page.dart @@ -173,19 +173,19 @@ class BackupControllerPage extends HookConsumerWidget { ).tr(), ), actions: [ - TextButton( + OutlinedButton( onPressed: () => launchUrl( - Uri.parse('https://dontkillmyapp.com'), - mode: LaunchMode.externalApplication), - child: Text( + Uri.parse('https://dontkillmyapp.com'), + mode: LaunchMode.externalApplication, + ), + child: const Text( "backup_controller_page_background_battery_info_link", - style: TextStyle(color: buttonTextColor), ).tr(), ), - TextButton( - child: Text( + ElevatedButton( + child: const Text( 'backup_controller_page_background_battery_info_ok', - style: TextStyle(color: buttonTextColor), + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 12), ).tr(), onPressed: () { Navigator.of(context).pop(); @@ -636,8 +636,8 @@ class BackupControllerPage extends HookConsumerWidget { backupState.backupProgress == BackUpProgressEnum.inProgress ? ElevatedButton( style: ElevatedButton.styleFrom( - primary: Colors.red[300], - onPrimary: Colors.grey[50], + foregroundColor: Colors.grey[50], + backgroundColor: Colors.red[300], // padding: const EdgeInsets.all(14), ), onPressed: () {