diff --git a/lib/lightning/lightning.dart b/lib/lightning/lightning.dart deleted file mode 100644 index 1630994b2..000000000 --- a/lib/lightning/lightning.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:cw_core/transaction_priority.dart'; -import 'package:cw_core/wallet_info.dart'; -import 'package:cw_core/unspent_coins_info.dart'; -import 'package:cw_core/wallet_service.dart'; -import 'package:cw_core/receive_page_option.dart'; -import 'package:cw_core/crypto_amount_format.dart'; -import 'package:hive/hive.dart'; -import 'package:mobx/mobx.dart'; -import 'package:intl/intl.dart'; - - - -Lightning? lightning; - -abstract class Lightning { - String formatterLightningAmountToString({required int amount}); - double formatterLightningAmountToDouble({required int amount}); - int formatterStringDoubleToLightningAmount(String amount); - WalletService createLightningWalletService( - Box<WalletInfo> walletInfoSource, Box<UnspentCoinsInfo> unspentCoinSource); - List<ReceivePageOption> getLightningReceivePageOptions(); - String satsToLightningString(int sats); - ReceivePageOption getOptionInvoice(); - ReceivePageOption getOptionOnchain(); - String bitcoinAmountToLightningString({required int amount}); - int bitcoinAmountToLightningAmount({required int amount}); - double bitcoinDoubleToLightningDouble({required double amount}); - double lightningDoubleToBitcoinDouble({required double amount}); - Map<String, int> getIncomingPayments(Object wallet); - void clearIncomingPayments(Object wallet); - String lightningTransactionPriorityWithLabel(TransactionPriority priority, int rate, {int? customRate}); - List<TransactionPriority> getTransactionPriorities(); - TransactionPriority getLightningTransactionPriorityCustom(); - int getFeeRate(Object wallet, TransactionPriority priority); - int getMaxCustomFeeRate(Object wallet); - Future<void> fetchFees(Object wallet); - Future<int> calculateEstimatedFeeAsync(Object wallet, TransactionPriority? priority, int? amount); - Future<int> getEstimatedFeeWithFeeRate(Object wallet, int feeRate, int? amount); - TransactionPriority getDefaultTransactionPriority(); - TransactionPriority deserializeLightningTransactionPriority({required int raw}); - String getBreezApiKey(); -} - \ No newline at end of file diff --git a/lib/src/screens/settings/connection_sync_page.dart b/lib/src/screens/settings/connection_sync_page.dart index 6b8eb943f..f330a52ac 100644 --- a/lib/src/screens/settings/connection_sync_page.dart +++ b/lib/src/screens/settings/connection_sync_page.dart @@ -44,43 +44,44 @@ class ConnectionSyncPage extends BasePage { : S.current.rescan, handler: (context) => Navigator.of(context).pushNamed(Routes.rescan), ), - // if (DeviceInfo.instance.isMobile && FeatureFlag.isBackgroundSyncEnabled) ...[ - Observer(builder: (context) { - return SettingsPickerCell<SyncMode>( - title: S.current.background_sync_mode, - items: SyncMode.all, - displayItem: (SyncMode syncMode) => syncMode.name, - selectedItem: dashboardViewModel.syncMode, - onItemSelected: (syncMode) async { - dashboardViewModel.setSyncMode(syncMode); + if (DeviceInfo.instance.isMobile && FeatureFlag.isBackgroundSyncEnabled) ...[ + Observer(builder: (context) { + return SettingsPickerCell<SyncMode>( + title: S.current.background_sync_mode, + items: SyncMode.all, + displayItem: (SyncMode syncMode) => syncMode.name, + selectedItem: dashboardViewModel.syncMode, + onItemSelected: (syncMode) async { + dashboardViewModel.setSyncMode(syncMode); - if (Platform.isIOS) return; + if (Platform.isIOS) return; - if (syncMode.type != SyncType.disabled) { - final isDisabled = await isBatteryOptimizationDisabled(); + if (syncMode.type != SyncType.disabled) { + final isDisabled = await isBatteryOptimizationDisabled(); - if (isDisabled) return; + if (isDisabled) return; - await showPopUp<void>( - context: context, - builder: (BuildContext dialogContext) { - return AlertWithTwoActions( - alertTitle: S.current.disableBatteryOptimization, - alertContent: S.current.disableBatteryOptimizationDescription, - leftButtonText: S.of(context).cancel, - rightButtonText: S.of(context).ok, - actionLeftButton: () => Navigator.of(dialogContext).pop(), - actionRightButton: () async { - await requestDisableBatteryOptimization(); + await showPopUp<void>( + context: context, + builder: (BuildContext dialogContext) { + return AlertWithTwoActions( + alertTitle: S.current.disableBatteryOptimization, + alertContent: S.current.disableBatteryOptimizationDescription, + leftButtonText: S.of(context).cancel, + rightButtonText: S.of(context).ok, + actionLeftButton: () => Navigator.of(dialogContext).pop(), + actionRightButton: () async { + await requestDisableBatteryOptimization(); - Navigator.of(dialogContext).pop(); - }, - ); - }, - ); - } - }); - }), + Navigator.of(dialogContext).pop(); + }, + ); + }, + ); + } + }); + }), + ], Observer(builder: (context) { return SettingsSwitcherCell( title: S.current.sync_all_wallets,