From 59001252baebb24e80a934a6fb49c71aabc055d5 Mon Sep 17 00:00:00 2001 From: Reuben Yap Date: Thu, 17 Sep 2026 03:15:47 +0800 Subject: [PATCH 1/7] feat: add rsFIRO Ethereum token --- lib/utilities/default_eth_tokens.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/utilities/default_eth_tokens.dart b/lib/utilities/default_eth_tokens.dart index 63cd7f62b3..ca6591ed8f 100644 --- a/lib/utilities/default_eth_tokens.dart +++ b/lib/utilities/default_eth_tokens.dart @@ -47,5 +47,12 @@ abstract class DefaultTokens { decimals: 18, type: EthContractType.erc20, ), + EthContract( + address: "0x2744ea5ac9b11cb5e3cd63d3a88e858336aeddc2", + name: "rsFIRO", + symbol: "rsFIRO", + decimals: 8, + type: EthContractType.erc20, + ), ]; } From 276f879fd3ed10e863083ae15a80ff8e5dc0727e Mon Sep 17 00:00:00 2001 From: Reuben Yap Date: Thu, 17 Sep 2026 03:34:37 +0800 Subject: [PATCH 2/7] fix: remove invalid final parameter modifiers --- tool/process_pubspec_deps.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/process_pubspec_deps.dart b/tool/process_pubspec_deps.dart index 80110b748b..d6c2b09cd0 100644 --- a/tool/process_pubspec_deps.dart +++ b/tool/process_pubspec_deps.dart @@ -16,7 +16,7 @@ void main(List args) { _process(args[0], args.sublist(1)); } -void _process(final String filePath, final List enableCoinMarkers) { +void _process(String filePath, List enableCoinMarkers) { final lines = File(filePath).readAsLinesSync(); String? activeMarker; From 45abd001c9d702f38bd556b5a8fd54b47ec7b22d Mon Sep 17 00:00:00 2001 From: Reuben Yap Date: Thu, 17 Sep 2026 12:57:27 +0800 Subject: [PATCH 3/7] fix: repair CI test compilation --- .github/workflows/test.yaml | 4 ++++ lib/wallets/wallet/impl/bitcoin_frost_wallet.dart | 6 +++--- .../wallet_mixin_interfaces/electrumx_interface.dart | 8 ++++---- test/wallets/firo_transaction_type_test.dart | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index eca0145f8b..2389ceb6af 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -56,6 +56,10 @@ jobs: const kShopInBitPartnerSecret = ""; const kCakePayApiToken = ""; const kExolixApiKey = ""; + const kLetsExchangeId = ""; + const kLetsExchangeToken = ""; + const kCypherGoatApiKey = ""; + const kCypherGoatAffiliate = ""; EOF fi diff --git a/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart b/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart index 00537b12b8..b5fc45bcf5 100644 --- a/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart +++ b/lib/wallets/wallet/impl/bitcoin_frost_wallet.dart @@ -837,11 +837,11 @@ class BitcoinFrostWallet extends Wallet const changeChain = 1; final List addresses})>> receiveFutures = [ - _checkGapsLinearly(serializedKeys, receiveChain, secure: true), + _checkGapsLinearly(serializedKeys!, receiveChain, secure: true), ]; final List addresses})>> changeFutures = [ - _checkGapsLinearly(serializedKeys, changeChain, secure: true), + _checkGapsLinearly(serializedKeys!, changeChain, secure: true), ]; // io limitations may require running these linearly instead @@ -898,7 +898,7 @@ class BitcoinFrostWallet extends Wallet await mainDB.updateOrPutAddresses(addressesToStore); - await _legacyInsecureScan(serializedKeys); + await _legacyInsecureScan(serializedKeys!); }); GlobalEventBus.instance.fire( diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart index 100aa9f9fe..bbab009800 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart @@ -2491,11 +2491,11 @@ mixin ElectrumXInterface canBatch ? checkGapsBatched( txCountBatchSize, - root, + root!, type, receiveChain, ) - : checkGapsLinearly(root, type, receiveChain), + : checkGapsLinearly(root!, type, receiveChain), ); } } @@ -2515,11 +2515,11 @@ mixin ElectrumXInterface canBatch ? checkGapsBatched( txCountBatchSize, - root, + root!, type, changeChain, ) - : checkGapsLinearly(root, type, changeChain), + : checkGapsLinearly(root!, type, changeChain), ); } } diff --git a/test/wallets/firo_transaction_type_test.dart b/test/wallets/firo_transaction_type_test.dart index 89abfa3f03..52304949f7 100644 --- a/test/wallets/firo_transaction_type_test.dart +++ b/test/wallets/firo_transaction_type_test.dart @@ -1,5 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; -import 'package:paymint/wallets/wallet/impl/firo_transaction_type.dart'; +import 'package:stackwallet/wallets/wallet/impl/firo_transaction_type.dart'; void main() { test('recognizes Spark spend transaction types', () { From ceceae38f48888bd54e3846feb9a1769350e0778 Mon Sep 17 00:00:00 2001 From: Reuben Yap Date: Thu, 17 Sep 2026 13:56:02 +0800 Subject: [PATCH 4/7] feat: add Ethereum assets to Campfire --- .../edit_wallet_tokens_view.dart | 99 +++++++++++-------- .../add_wallet_view/add_wallet_view.dart | 28 ++++-- lib/utilities/default_eth_tokens.dart | 13 +++ scripts/app_config/configure_campfire.sh | 3 +- test/utilities/default_eth_tokens_test.dart | 15 +++ 5 files changed, 112 insertions(+), 46 deletions(-) create mode 100644 test/utilities/default_eth_tokens_test.dart diff --git a/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart b/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart index d81afe51e5..0d0d2a89bf 100644 --- a/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart +++ b/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart @@ -15,6 +15,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:isar_community/isar.dart'; +import '../../../app_config.dart'; import '../../../db/isar/main_db.dart'; import '../../../models/isar/models/ethereum/eth_contract.dart'; import '../../../models/isar/models/solana/sol_contract.dart'; @@ -80,6 +81,7 @@ class _EditWalletTokensViewState extends ConsumerState { final List tokenEntities = []; final bool isDesktop = Util.isDesktop; + final bool isCampfire = AppConfig.appName == "Campfire"; List filter( String text, @@ -244,6 +246,13 @@ class _EditWalletTokensViewState extends ConsumerState { _searchFocusNode = FocusNode(); final wallet = ref.read(pWallets).getWallet(widget.walletId); + final walletContracts = ref.read(pWalletTokenAddresses(widget.walletId)); + final shouldMarkAsSelectedContracts = [ + ...walletContracts, + ...(widget.contractsToMarkSelected ?? []), + ]; + final selectedContractAddresses = + shouldMarkAsSelectedContracts.map((e) => e.toLowerCase()).toSet(); if (wallet is SolanaWallet) { final contracts = MainDB.instance @@ -266,29 +275,39 @@ class _EditWalletTokensViewState extends ConsumerState { .getEthContracts() .sortByName() .findAllSync(); - - if (contracts.isEmpty) { - contracts.addAll(DefaultTokens.list); + final defaults = DefaultTokens.forApp(AppConfig.appName); + final existingAddresses = + contracts.map((e) => e.address.toLowerCase()).toSet(); + final missingDefaults = + defaults + .where( + (token) => existingAddresses.add(token.address.toLowerCase()), + ) + .toList(); + + if (missingDefaults.isNotEmpty) { + contracts.addAll(missingDefaults); MainDB.instance - .putEthContracts(contracts) + .putEthContracts(missingDefaults) .then( (_) => ref.read(priceAnd24hChangeNotifierProvider).updatePrice(), ); } + contracts.retainWhere( + (token) => + DefaultTokens.isAllowedForApp(AppConfig.appName, token) || + selectedContractAddresses.contains(token.address.toLowerCase()), + ); + tokenEntities.addAll(contracts.map((e) => AddTokenListElementData(e))); } - // Get token addresses. - final walletContracts = ref.read(pWalletTokenAddresses(widget.walletId)); - - final shouldMarkAsSelectedContracts = [ - ...walletContracts, - ...(widget.contractsToMarkSelected ?? []), - ]; - for (final e in tokenEntities) { - e.selected = shouldMarkAsSelectedContracts.contains(e.token.address); + e.selected = + wallet is EthereumWallet + ? selectedContractAddresses.contains(e.token.address.toLowerCase()) + : shouldMarkAsSelectedContracts.contains(e.token.address); } super.initState(); @@ -318,7 +337,7 @@ class _EditWalletTokensViewState extends ConsumerState { walletName, style: STextStyles.desktopSubtitleH2(context), ), - trailing: widget.contractsToMarkSelected == null + trailing: widget.contractsToMarkSelected == null && !isCampfire ? Padding( padding: const EdgeInsets.only(right: 24), child: SizedBox( @@ -410,14 +429,15 @@ class _EditWalletTokensViewState extends ConsumerState { padding: const EdgeInsets.symmetric(horizontal: 32), child: Row( children: [ - Expanded( - child: SecondaryButton( - label: "Add custom token", - buttonHeight: ButtonHeight.l, - onPressed: _addToken, + if (!isCampfire) + Expanded( + child: SecondaryButton( + label: "Add custom token", + buttonHeight: ButtonHeight.l, + onPressed: _addToken, + ), ), - ), - const SizedBox(width: 16), + if (!isCampfire) const SizedBox(width: 16), Expanded( child: PrimaryButton( label: "Done", @@ -526,28 +546,29 @@ class _EditWalletTokensViewState extends ConsumerState { }, ), actions: [ - Padding( - padding: const EdgeInsets.only(top: 10, bottom: 10, right: 20), - child: AspectRatio( - aspectRatio: 1, - child: AppBarIconButton( - size: 36, - shadows: const [], - color: Theme.of( - context, - ).extension()!.background, - icon: SvgPicture.asset( - Assets.svg.circlePlusFilled, + if (!isCampfire) + Padding( + padding: const EdgeInsets.only(top: 10, bottom: 10, right: 20), + child: AspectRatio( + aspectRatio: 1, + child: AppBarIconButton( + size: 36, + shadows: const [], color: Theme.of( context, - ).extension()!.topNavIconPrimary, - width: 20, - height: 20, + ).extension()!.background, + icon: SvgPicture.asset( + Assets.svg.circlePlusFilled, + color: Theme.of( + context, + ).extension()!.topNavIconPrimary, + width: 20, + height: 20, + ), + onPressed: _addToken, ), - onPressed: _addToken, ), ), - ), ], ), body: SafeArea( @@ -620,7 +641,7 @@ class _EditWalletTokensViewState extends ConsumerState { child: AddTokenList( walletId: widget.walletId, items: filter(_searchTerm, tokenEntities), - addFunction: _addToken, + addFunction: isCampfire ? null : _addToken, ), ), const SizedBox(height: 16), diff --git a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart index 13cb7a022e..70acd0472d 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart @@ -178,17 +178,30 @@ class _AddWalletViewState extends ConsumerState { if (AppConfig.coins.whereType().isNotEmpty) { final contracts = MainDB.instance.getEthContracts().sortByName().findAllSync(); + final defaults = DefaultTokens.forApp(AppConfig.appName); + final existingAddresses = + contracts.map((e) => e.address.toLowerCase()).toSet(); + final missingDefaults = + defaults + .where( + (token) => existingAddresses.add(token.address.toLowerCase()), + ) + .toList(); - if (contracts.isEmpty) { - contracts.addAll(DefaultTokens.list); + if (missingDefaults.isNotEmpty) { + contracts.addAll(missingDefaults); MainDB.instance - .putEthContracts(contracts) + .putEthContracts(missingDefaults) .then( (value) => ref.read(priceAnd24hChangeNotifierProvider).updatePrice(), ); } + contracts.retainWhere( + (token) => DefaultTokens.isAllowedForApp(AppConfig.appName, token), + ); + tokenEntities.addAll(contracts.map((e) => EthTokenEntity(e))); } @@ -358,9 +371,12 @@ class _AddWalletViewState extends ConsumerState { entities: filter(_searchTerm, tokenEntities), initialState: ExpandableState.expanded, animationDurationMultiplier: 0.5, - trailing: AddCustomTokenSelector( - addFunction: _addToken, - ), + trailing: + AppConfig.appName == "Campfire" + ? null + : AddCustomTokenSelector( + addFunction: _addToken, + ), ), if (solTokenEntities.isNotEmpty) ExpandingSubListItem( diff --git a/lib/utilities/default_eth_tokens.dart b/lib/utilities/default_eth_tokens.dart index ca6591ed8f..7b85c60fc6 100644 --- a/lib/utilities/default_eth_tokens.dart +++ b/lib/utilities/default_eth_tokens.dart @@ -11,6 +11,12 @@ import '../models/isar/models/ethereum/eth_contract.dart'; abstract class DefaultTokens { + static const _campfireTokenAddresses = { + "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + "0xdac17f958d2ee523a2206206994597c13d831ec7", + "0x2744ea5ac9b11cb5e3cd63d3a88e858336aeddc2", + }; + static List list = [ EthContract( address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", @@ -55,4 +61,11 @@ abstract class DefaultTokens { type: EthContractType.erc20, ), ]; + + static bool isAllowedForApp(String appName, EthContract token) => + appName != "Campfire" || + _campfireTokenAddresses.contains(token.address.toLowerCase()); + + static List forApp(String appName) => + list.where((token) => isAllowedForApp(appName, token)).toList(); } diff --git a/scripts/app_config/configure_campfire.sh b/scripts/app_config/configure_campfire.sh index e12697b35e..e4cf54312e 100755 --- a/scripts/app_config/configure_campfire.sh +++ b/scripts/app_config/configure_campfire.sh @@ -77,6 +77,7 @@ const ({String light, String dark})? _appIconAsset = ( final List _supportedCoins = List.unmodifiable([ Firo(CryptoCurrencyNetwork.main), + Ethereum(CryptoCurrencyNetwork.main), ]); final ({String from, String fromFuzzyNet, String to, String toFuzzyNet}) @@ -87,4 +88,4 @@ _swapDefaults = ( toFuzzyNet: "firo", ); -EOF \ No newline at end of file +EOF diff --git a/test/utilities/default_eth_tokens_test.dart b/test/utilities/default_eth_tokens_test.dart new file mode 100644 index 0000000000..012e2674f6 --- /dev/null +++ b/test/utilities/default_eth_tokens_test.dart @@ -0,0 +1,15 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:stackwallet/utilities/default_eth_tokens.dart'; + +void main() { + test('Campfire Ethereum defaults are allowlisted', () { + expect( + DefaultTokens.forApp('Campfire').map((e) => (e.symbol, e.address)), + unorderedEquals([ + ('USDC', '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'), + ('USDT', '0xdac17f958d2ee523a2206206994597c13d831ec7'), + ('rsFIRO', '0x2744ea5ac9b11cb5e3cd63d3a88e858336aeddc2'), + ]), + ); + }); +} From aa1ac2bba7da49d9765e599b16287f6609832822 Mon Sep 17 00:00:00 2001 From: Reuben Yap Date: Thu, 17 Sep 2026 13:58:51 +0800 Subject: [PATCH 5/7] chore: retry CI From 255687006bcf3e34e237cb850f8c21b5d09b71c2 Mon Sep 17 00:00:00 2001 From: Reuben Yap Date: Thu, 17 Sep 2026 14:06:53 +0800 Subject: [PATCH 6/7] style: format Campfire token views --- .../edit_wallet_tokens_view.dart | 91 +++---- .../add_wallet_view/add_wallet_view.dart | 254 +++++++++--------- 2 files changed, 171 insertions(+), 174 deletions(-) diff --git a/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart b/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart index 0d0d2a89bf..da02153572 100644 --- a/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart +++ b/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart @@ -102,11 +102,10 @@ class _EditWalletTokensViewState extends ConsumerState { } Future onNextPressed() async { - final selectedTokens = - tokenEntities - .where((e) => e.selected) - .map((e) => e.token.address) - .toList(); + final selectedTokens = tokenEntities + .where((e) => e.selected) + .map((e) => e.token.address) + .toList(); final wallet = ref.read(pWallets).getWallet(widget.walletId); @@ -121,13 +120,11 @@ class _EditWalletTokensViewState extends ConsumerState { Navigator.of(context).pop(42); } else { if (isDesktop) { - Navigator.of( - context, - ).popUntil(ModalRoute.withName(DesktopHomeView.routeName)); + Navigator.of(context) + .popUntil(ModalRoute.withName(DesktopHomeView.routeName)); } else { - await Navigator.of( - context, - ).pushNamedAndRemoveUntil(HomeView.routeName, (route) => false); + await Navigator.of(context) + .pushNamedAndRemoveUntil(HomeView.routeName, (route) => false); } if (mounted) { unawaited( @@ -162,9 +159,8 @@ class _EditWalletTokensViewState extends ConsumerState { ), ); } else { - final result = await Navigator.of( - context, - ).pushNamed(AddCustomTokenView.routeName); + final result = await Navigator.of(context) + .pushNamed(AddCustomTokenView.routeName); contract = result as EthContract?; } @@ -179,7 +175,9 @@ class _EditWalletTokensViewState extends ConsumerState { tokenEntities.add( AddTokenListElementData(contract!)..selected = true, ); - tokenEntities.sort((a, b) => a.token.name.compareTo(b.token.name)); + tokenEntities.sort( + (a, b) => a.token.name.compareTo(b.token.name), + ); } }); } @@ -201,9 +199,7 @@ class _EditWalletTokensViewState extends ConsumerState { ), ); } else { - final result = await Navigator.of( - context, - ).pushNamed( + final result = await Navigator.of(context).pushNamed( AddCustomSolanaTokenView.routeName, arguments: widget.walletId, ); @@ -230,9 +226,7 @@ class _EditWalletTokensViewState extends ConsumerState { if (tokenEntities .where((e) => e.token.address == token!.address) .isEmpty) { - tokenEntities.add( - AddTokenListElementData(token!)..selected = true, - ); + tokenEntities.add(AddTokenListElementData(token!)..selected = true); tokenEntities.sort((a, b) => a.token.name.compareTo(b.token.name)); } }); @@ -251,8 +245,9 @@ class _EditWalletTokensViewState extends ConsumerState { ...walletContracts, ...(widget.contractsToMarkSelected ?? []), ]; - final selectedContractAddresses = - shouldMarkAsSelectedContracts.map((e) => e.toLowerCase()).toSet(); + final selectedContractAddresses = shouldMarkAsSelectedContracts + .map((e) => e.toLowerCase()) + .toSet(); if (wallet is SolanaWallet) { final contracts = MainDB.instance @@ -276,14 +271,12 @@ class _EditWalletTokensViewState extends ConsumerState { .sortByName() .findAllSync(); final defaults = DefaultTokens.forApp(AppConfig.appName); - final existingAddresses = - contracts.map((e) => e.address.toLowerCase()).toSet(); - final missingDefaults = - defaults - .where( - (token) => existingAddresses.add(token.address.toLowerCase()), - ) - .toList(); + final existingAddresses = contracts + .map((e) => e.address.toLowerCase()) + .toSet(); + final missingDefaults = defaults + .where((token) => existingAddresses.add(token.address.toLowerCase())) + .toList(); if (missingDefaults.isNotEmpty) { contracts.addAll(missingDefaults); @@ -304,10 +297,9 @@ class _EditWalletTokensViewState extends ConsumerState { } for (final e in tokenEntities) { - e.selected = - wallet is EthereumWallet - ? selectedContractAddresses.contains(e.token.address.toLowerCase()) - : shouldMarkAsSelectedContracts.contains(e.token.address); + e.selected = wallet is EthereumWallet + ? selectedContractAddresses.contains(e.token.address.toLowerCase()) + : shouldMarkAsSelectedContracts.contains(e.token.address); } super.initState(); @@ -468,9 +460,8 @@ class _EditWalletTokensViewState extends ConsumerState { _searchTerm = value; }); }, - style: STextStyles.desktopTextMedium( - context, - ).copyWith(height: 2), + style: STextStyles.desktopTextMedium(context) + .copyWith(height: 2), decoration: standardInputDecoration( "Search", @@ -536,9 +527,9 @@ class _EditWalletTokensViewState extends ConsumerState { } else { return Background( child: Scaffold( - backgroundColor: Theme.of( - context, - ).extension()!.background, + backgroundColor: Theme.of(context) + .extension()! + .background, appBar: AppBar( leading: AppBarBackButton( onPressed: () { @@ -548,20 +539,24 @@ class _EditWalletTokensViewState extends ConsumerState { actions: [ if (!isCampfire) Padding( - padding: const EdgeInsets.only(top: 10, bottom: 10, right: 20), + padding: const EdgeInsets.only( + top: 10, + bottom: 10, + right: 20, + ), child: AspectRatio( aspectRatio: 1, child: AppBarIconButton( size: 36, shadows: const [], - color: Theme.of( - context, - ).extension()!.background, + color: Theme.of(context) + .extension()! + .background, icon: SvgPicture.asset( Assets.svg.circlePlusFilled, - color: Theme.of( - context, - ).extension()!.topNavIconPrimary, + color: Theme.of(context) + .extension()! + .topNavIconPrimary, width: 20, height: 20, ), diff --git a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart index 70acd0472d..cba861bc2a 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart @@ -103,17 +103,15 @@ class _AddWalletViewState extends ConsumerState { if (isDesktop) { contract = await showDialog( context: context, - builder: - (context) => const DesktopDialog( - maxWidth: 580, - maxHeight: 500, - child: AddCustomTokenView(), - ), + builder: (context) => const DesktopDialog( + maxWidth: 580, + maxHeight: 500, + child: AddCustomTokenView(), + ), ); } else { - contract = await Navigator.of( - context, - ).pushNamed(AddCustomTokenView.routeName); + contract = await Navigator.of(context) + .pushNamed(AddCustomTokenView.routeName); } if (contract != null) { @@ -137,17 +135,15 @@ class _AddWalletViewState extends ConsumerState { if (isDesktop) { token = await showDialog( context: context, - builder: - (context) => const DesktopDialog( - maxWidth: 580, - maxHeight: 500, - child: AddCustomSolanaTokenView(), - ), + builder: (context) => const DesktopDialog( + maxWidth: 580, + maxHeight: 500, + child: AddCustomSolanaTokenView(), + ), ); } else { - token = await Navigator.of( - context, - ).pushNamed(AddCustomSolanaTokenView.routeName); + token = await Navigator.of(context) + .pushNamed(AddCustomSolanaTokenView.routeName); } if (token != null) { @@ -176,17 +172,17 @@ class _AddWalletViewState extends ConsumerState { } if (AppConfig.coins.whereType().isNotEmpty) { - final contracts = - MainDB.instance.getEthContracts().sortByName().findAllSync(); + final contracts = MainDB.instance + .getEthContracts() + .sortByName() + .findAllSync(); final defaults = DefaultTokens.forApp(AppConfig.appName); - final existingAddresses = - contracts.map((e) => e.address.toLowerCase()).toSet(); - final missingDefaults = - defaults - .where( - (token) => existingAddresses.add(token.address.toLowerCase()), - ) - .toList(); + final existingAddresses = contracts + .map((e) => e.address.toLowerCase()) + .toSet(); + final missingDefaults = defaults + .where((token) => existingAddresses.add(token.address.toLowerCase())) + .toList(); if (missingDefaults.isNotEmpty) { contracts.addAll(missingDefaults); @@ -287,60 +283,60 @@ class _AddWalletViewState extends ConsumerState { _searchTerm = value; }); }, - style: STextStyles.desktopTextMedium( - context, - ).copyWith(height: 2), - decoration: standardInputDecoration( - "Search", - _searchFocusNode, - context, - ).copyWith( - contentPadding: const EdgeInsets.symmetric( - vertical: 10, - ), - prefixIcon: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16, - // vertical: 20, - ), - child: SvgPicture.asset( - Assets.svg.search, - width: 24, - height: 24, - color: - Theme.of(context) + style: STextStyles.desktopTextMedium(context) + .copyWith(height: 2), + decoration: + standardInputDecoration( + "Search", + _searchFocusNode, + context, + ).copyWith( + contentPadding: const EdgeInsets.symmetric( + vertical: 10, + ), + prefixIcon: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16, + // vertical: 20, + ), + child: SvgPicture.asset( + Assets.svg.search, + width: 24, + height: 24, + color: Theme.of(context) .extension()! .textFieldDefaultSearchIconLeft, - ), - ), - suffixIcon: - _searchFieldController.text.isNotEmpty + ), + ), + suffixIcon: + _searchFieldController.text.isNotEmpty ? Padding( - padding: const EdgeInsets.only( - right: 10, - ), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon( - width: 24, - height: 24, + padding: const EdgeInsets.only( + right: 10, + ), + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon( + width: 24, + height: 24, + ), + onTap: () async { + setState(() { + _searchFieldController + .text = + ""; + _searchTerm = ""; + }); + }, ), - onTap: () async { - setState(() { - _searchFieldController - .text = ""; - _searchTerm = ""; - }); - }, - ), - ], + ], + ), ), - ), - ) + ) : null, - ), + ), ), ), ), @@ -371,17 +367,19 @@ class _AddWalletViewState extends ConsumerState { entities: filter(_searchTerm, tokenEntities), initialState: ExpandableState.expanded, animationDurationMultiplier: 0.5, - trailing: - AppConfig.appName == "Campfire" - ? null - : AddCustomTokenSelector( - addFunction: _addToken, - ), + trailing: AppConfig.appName == "Campfire" + ? null + : AddCustomTokenSelector( + addFunction: _addToken, + ), ), if (solTokenEntities.isNotEmpty) ExpandingSubListItem( title: "Solana tokens", - entities: filter(_searchTerm, solTokenEntities), + entities: filter( + _searchTerm, + solTokenEntities, + ), initialState: ExpandableState.expanded, animationDurationMultiplier: 0.5, trailing: AddCustomTokenSelector( @@ -411,8 +409,9 @@ class _AddWalletViewState extends ConsumerState { } else { return Background( child: Scaffold( - backgroundColor: - Theme.of(context).extension()!.background, + backgroundColor: Theme.of(context) + .extension()! + .background, appBar: AppBar( leading: AppBarBackButton( onPressed: () { @@ -435,8 +434,7 @@ class _AddWalletViewState extends ConsumerState { Constants.size.circularBorderRadius, ), child: Semantics( - label: - "Search Text Field. Inputs Text To Search In Wallets.", + label: "Search Text Field. Inputs Text To Search In Wallets.", excludeSemantics: true, child: TextField( autofocus: isDesktop, @@ -444,49 +442,53 @@ class _AddWalletViewState extends ConsumerState { enableSuggestions: !isDesktop, controller: _searchFieldController, focusNode: _searchFocusNode, - onChanged: - (value) => setState(() => _searchTerm = value), + onChanged: (value) => + setState(() => _searchTerm = value), style: STextStyles.field(context), - decoration: standardInputDecoration( - "Search", - _searchFocusNode, - context, - desktopMed: isDesktop, - ).copyWith( - prefixIcon: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, - vertical: 16, - ), - child: SvgPicture.asset( - Assets.svg.search, - width: 16, - height: 16, - ), - ), - suffixIcon: - _searchFieldController.text.isNotEmpty + decoration: + standardInputDecoration( + "Search", + _searchFocusNode, + context, + desktopMed: isDesktop, + ).copyWith( + prefixIcon: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 16, + ), + child: SvgPicture.asset( + Assets.svg.search, + width: 16, + height: 16, + ), + ), + suffixIcon: + _searchFieldController.text.isNotEmpty ? Padding( - padding: const EdgeInsets.only(right: 0), - child: UnconstrainedBox( - child: Row( - children: [ - TextFieldIconButton( - child: const XIcon(), - onTap: () async { - setState(() { - _searchFieldController.text = - ""; - _searchTerm = ""; - }); - }, - ), - ], + padding: const EdgeInsets.only( + right: 0, ), - ), - ) + child: UnconstrainedBox( + child: Row( + children: [ + TextFieldIconButton( + child: const XIcon(), + onTap: () async { + setState(() { + _searchFieldController + .text = + ""; + _searchTerm = ""; + }); + }, + ), + ], + ), + ), + ) : null, - ), + ), ), ), ), From 62f32da5362dc199638a6b1d1321704d43be0969 Mon Sep 17 00:00:00 2001 From: Reuben Yap Date: Thu, 17 Sep 2026 14:14:37 +0800 Subject: [PATCH 7/7] style: match CI Dart formatter --- .../edit_wallet_tokens_view.dart | 38 ++++++++++--------- .../add_wallet_view/add_wallet_view.dart | 24 +++++++----- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart b/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart index da02153572..d75a3d827f 100644 --- a/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart +++ b/lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart @@ -120,11 +120,13 @@ class _EditWalletTokensViewState extends ConsumerState { Navigator.of(context).pop(42); } else { if (isDesktop) { - Navigator.of(context) - .popUntil(ModalRoute.withName(DesktopHomeView.routeName)); + Navigator.of( + context, + ).popUntil(ModalRoute.withName(DesktopHomeView.routeName)); } else { - await Navigator.of(context) - .pushNamedAndRemoveUntil(HomeView.routeName, (route) => false); + await Navigator.of( + context, + ).pushNamedAndRemoveUntil(HomeView.routeName, (route) => false); } if (mounted) { unawaited( @@ -159,8 +161,9 @@ class _EditWalletTokensViewState extends ConsumerState { ), ); } else { - final result = await Navigator.of(context) - .pushNamed(AddCustomTokenView.routeName); + final result = await Navigator.of( + context, + ).pushNamed(AddCustomTokenView.routeName); contract = result as EthContract?; } @@ -460,8 +463,9 @@ class _EditWalletTokensViewState extends ConsumerState { _searchTerm = value; }); }, - style: STextStyles.desktopTextMedium(context) - .copyWith(height: 2), + style: STextStyles.desktopTextMedium( + context, + ).copyWith(height: 2), decoration: standardInputDecoration( "Search", @@ -527,9 +531,9 @@ class _EditWalletTokensViewState extends ConsumerState { } else { return Background( child: Scaffold( - backgroundColor: Theme.of(context) - .extension()! - .background, + backgroundColor: Theme.of( + context, + ).extension()!.background, appBar: AppBar( leading: AppBarBackButton( onPressed: () { @@ -549,14 +553,14 @@ class _EditWalletTokensViewState extends ConsumerState { child: AppBarIconButton( size: 36, shadows: const [], - color: Theme.of(context) - .extension()! - .background, + color: Theme.of( + context, + ).extension()!.background, icon: SvgPicture.asset( Assets.svg.circlePlusFilled, - color: Theme.of(context) - .extension()! - .topNavIconPrimary, + color: Theme.of( + context, + ).extension()!.topNavIconPrimary, width: 20, height: 20, ), diff --git a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart index cba861bc2a..50df83b65a 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart @@ -110,8 +110,9 @@ class _AddWalletViewState extends ConsumerState { ), ); } else { - contract = await Navigator.of(context) - .pushNamed(AddCustomTokenView.routeName); + contract = await Navigator.of( + context, + ).pushNamed(AddCustomTokenView.routeName); } if (contract != null) { @@ -142,8 +143,9 @@ class _AddWalletViewState extends ConsumerState { ), ); } else { - token = await Navigator.of(context) - .pushNamed(AddCustomSolanaTokenView.routeName); + token = await Navigator.of( + context, + ).pushNamed(AddCustomSolanaTokenView.routeName); } if (token != null) { @@ -283,8 +285,9 @@ class _AddWalletViewState extends ConsumerState { _searchTerm = value; }); }, - style: STextStyles.desktopTextMedium(context) - .copyWith(height: 2), + style: STextStyles.desktopTextMedium( + context, + ).copyWith(height: 2), decoration: standardInputDecoration( "Search", @@ -409,9 +412,9 @@ class _AddWalletViewState extends ConsumerState { } else { return Background( child: Scaffold( - backgroundColor: Theme.of(context) - .extension()! - .background, + backgroundColor: Theme.of( + context, + ).extension()!.background, appBar: AppBar( leading: AppBarBackButton( onPressed: () { @@ -434,7 +437,8 @@ class _AddWalletViewState extends ConsumerState { Constants.size.circularBorderRadius, ), child: Semantics( - label: "Search Text Field. Inputs Text To Search In Wallets.", + label: + "Search Text Field. Inputs Text To Search In Wallets.", excludeSemantics: true, child: TextField( autofocus: isDesktop,