@@ -15,6 +15,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
1515import 'package:flutter_svg/svg.dart' ;
1616import 'package:isar_community/isar.dart' ;
1717
18+ import '../../../app_config.dart' ;
1819import '../../../db/isar/main_db.dart' ;
1920import '../../../models/isar/models/ethereum/eth_contract.dart' ;
2021import '../../../models/isar/models/solana/sol_contract.dart' ;
@@ -25,7 +26,6 @@ import '../../../providers/global/wallets_provider.dart';
2526import '../../../themes/stack_colors.dart' ;
2627import '../../../utilities/assets.dart' ;
2728import '../../../utilities/constants.dart' ;
28- import '../../../utilities/default_eth_tokens.dart' ;
2929import '../../../utilities/default_sol_tokens.dart' ;
3030import '../../../utilities/text_styles.dart' ;
3131import '../../../utilities/util.dart' ;
@@ -100,11 +100,10 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
100100 }
101101
102102 Future <void > onNextPressed () async {
103- final selectedTokens =
104- tokenEntities
105- .where ((e) => e.selected)
106- .map ((e) => e.token.address)
107- .toList ();
103+ final selectedTokens = tokenEntities
104+ .where ((e) => e.selected)
105+ .map ((e) => e.token.address)
106+ .toList ();
108107
109108 final wallet = ref.read (pWallets).getWallet (widget.walletId);
110109
@@ -119,13 +118,11 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
119118 Navigator .of (context).pop (42 );
120119 } else {
121120 if (isDesktop) {
122- Navigator .of (
123- context,
124- ).popUntil (ModalRoute .withName (DesktopHomeView .routeName));
121+ Navigator .of (context)
122+ .popUntil (ModalRoute .withName (DesktopHomeView .routeName));
125123 } else {
126- await Navigator .of (
127- context,
128- ).pushNamedAndRemoveUntil (HomeView .routeName, (route) => false );
124+ await Navigator .of (context)
125+ .pushNamedAndRemoveUntil (HomeView .routeName, (route) => false );
129126 }
130127 if (mounted) {
131128 unawaited (
@@ -160,9 +157,8 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
160157 ),
161158 );
162159 } else {
163- final result = await Navigator .of (
164- context,
165- ).pushNamed (AddCustomTokenView .routeName);
160+ final result = await Navigator .of (context)
161+ .pushNamed (AddCustomTokenView .routeName);
166162 contract = result as EthContract ? ;
167163 }
168164
@@ -177,7 +173,9 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
177173 tokenEntities.add (
178174 AddTokenListElementData (contract! )..selected = true ,
179175 );
180- tokenEntities.sort ((a, b) => a.token.name.compareTo (b.token.name));
176+ tokenEntities.sort (
177+ (a, b) => a.token.name.compareTo (b.token.name),
178+ );
181179 }
182180 });
183181 }
@@ -199,9 +197,7 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
199197 ),
200198 );
201199 } else {
202- final result = await Navigator .of (
203- context,
204- ).pushNamed (
200+ final result = await Navigator .of (context).pushNamed (
205201 AddCustomSolanaTokenView .routeName,
206202 arguments: widget.walletId,
207203 );
@@ -228,9 +224,7 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
228224 if (tokenEntities
229225 .where ((e) => e.token.address == token! .address)
230226 .isEmpty) {
231- tokenEntities.add (
232- AddTokenListElementData (token! )..selected = true ,
233- );
227+ tokenEntities.add (AddTokenListElementData (token! )..selected = true );
234228 tokenEntities.sort ((a, b) => a.token.name.compareTo (b.token.name));
235229 }
236230 });
@@ -268,7 +262,7 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
268262 .findAllSync ();
269263
270264 if (contracts.isEmpty) {
271- contracts.addAll (DefaultTokens .list );
265+ contracts.addAll (AppConfig .defaultEthTokens );
272266 MainDB .instance
273267 .putEthContracts (contracts)
274268 .then (
@@ -448,9 +442,8 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
448442 _searchTerm = value;
449443 });
450444 },
451- style: STextStyles .desktopTextMedium (
452- context,
453- ).copyWith (height: 2 ),
445+ style: STextStyles .desktopTextMedium (context)
446+ .copyWith (height: 2 ),
454447 decoration:
455448 standardInputDecoration (
456449 "Search" ,
@@ -516,9 +509,9 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
516509 } else {
517510 return Background (
518511 child: Scaffold (
519- backgroundColor: Theme .of (
520- context,
521- ). extension < StackColors > () ! .background,
512+ backgroundColor: Theme .of (context)
513+ . extension < StackColors > () !
514+ .background,
522515 appBar: AppBar (
523516 leading: AppBarBackButton (
524517 onPressed: () {
@@ -533,14 +526,14 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
533526 child: AppBarIconButton (
534527 size: 36 ,
535528 shadows: const [],
536- color: Theme .of (
537- context,
538- ). extension < StackColors > () ! .background,
529+ color: Theme .of (context)
530+ . extension < StackColors > () !
531+ .background,
539532 icon: SvgPicture .asset (
540533 Assets .svg.circlePlusFilled,
541- color: Theme .of (
542- context,
543- ). extension < StackColors > () ! .topNavIconPrimary,
534+ color: Theme .of (context)
535+ . extension < StackColors > () !
536+ .topNavIconPrimary,
544537 width: 20 ,
545538 height: 20 ,
546539 ),
0 commit comments