@@ -54,18 +54,14 @@ class _AddTokenListElementState extends ConsumerState<AddTokenListElement> {
5454 super .initState ();
5555
5656 ExchangeDataLoadingService .instance.isar.then ((isar) async {
57- final currency =
58- await isar.currencies
59- .where ()
60- .exchangeNameEqualTo (ChangeNowExchange .exchangeName)
61- .filter ()
62- .tokenContractEqualTo (
63- widget.data.token.address,
64- caseSensitive: false ,
65- )
66- .and ()
67- .imageIsNotEmpty ()
68- .findFirst ();
57+ final currency = await isar.currencies
58+ .where ()
59+ .exchangeNameEqualTo (ChangeNowExchange .exchangeName)
60+ .filter ()
61+ .tokenContractEqualTo (widget.data.token.address, caseSensitive: false )
62+ .and ()
63+ .imageIsNotEmpty ()
64+ .findFirst ();
6965
7066 if (mounted) {
7167 WidgetsBinding .instance.addPostFrameCallback ((_) {
@@ -86,50 +82,45 @@ class _AddTokenListElementState extends ConsumerState<AddTokenListElement> {
8682
8783 return RoundedWhiteContainer (
8884 padding: EdgeInsets .all (isDesktop ? 16 : 12 ),
89- borderColor:
90- isDesktop
91- ? Theme .of (context).extension < StackColors > ()! .backgroundAppBar
92- : null ,
85+ borderColor: isDesktop
86+ ? Theme .of (context).extension < StackColors > ()! .backgroundAppBar
87+ : null ,
9388 child: Row (
9489 mainAxisAlignment: MainAxisAlignment .spaceBetween,
9590 children: [
9691 Row (
9792 children: [
9893 currency != null
9994 ? SvgPicture .network (
100- currency! .image,
101- width: iconSize,
102- height: iconSize,
103- placeholderBuilder:
104- (_) => AppIcon (width: iconSize, height: iconSize),
105- )
95+ currency! .image,
96+ width: iconSize,
97+ height: iconSize,
98+ placeholderBuilder: (_) =>
99+ AppIcon (width: iconSize, height: iconSize),
100+ )
106101 : AppIcon (width: iconSize, height: iconSize),
107102 const SizedBox (width: 12 ),
108103 ConditionalParent (
109104 condition: isDesktop,
110- builder:
111- (child) => Column (
112- crossAxisAlignment: CrossAxisAlignment .start,
113- children: [
114- child,
115- const SizedBox (height: 2 ),
116- Text (
117- widget.data.token.symbol,
118- style: STextStyles .desktopTextExtraExtraSmall (
119- context,
120- ),
121- overflow: TextOverflow .ellipsis,
122- ),
123- ],
105+ builder: (child) => Column (
106+ crossAxisAlignment: CrossAxisAlignment .start,
107+ children: [
108+ child,
109+ const SizedBox (height: 2 ),
110+ Text (
111+ widget.data.token.symbol,
112+ style: STextStyles .desktopTextExtraExtraSmall (context),
113+ overflow: TextOverflow .ellipsis,
124114 ),
115+ ],
116+ ),
125117 child: Text (
126118 isDesktop
127119 ? mainLabel
128120 : "$mainLabel (${widget .data .token .symbol })" ,
129- style:
130- isDesktop
131- ? STextStyles .desktopTextSmall (context)
132- : STextStyles .w600_14 (context),
121+ style: isDesktop
122+ ? STextStyles .desktopTextSmall (context)
123+ : STextStyles .w600_14 (context),
133124 overflow: TextOverflow .ellipsis,
134125 ),
135126 ),
@@ -138,21 +129,20 @@ class _AddTokenListElementState extends ConsumerState<AddTokenListElement> {
138129 const SizedBox (width: 4 ),
139130 isDesktop
140131 ? Checkbox (
141- value: widget.data.selected,
142- onChanged:
143- (newValue) =>
144- setState (() => widget.data.selected = newValue! ),
145- )
132+ value: widget.data.selected,
133+ onChanged: (newValue) =>
134+ setState (() => widget.data.selected = newValue! ),
135+ )
146136 : SizedBox (
147- height: 20 ,
148- width: 40 ,
149- child: DraggableSwitchButton (
150- isOn: widget.data.selected,
151- onValueChanged: (newValue) {
152- widget.data.selected = newValue;
153- },
137+ height: 20 ,
138+ width: 40 ,
139+ child: DraggableSwitchButton (
140+ isOn: widget.data.selected,
141+ onValueChanged: (newValue) {
142+ widget.data.selected = newValue;
143+ },
144+ ),
154145 ),
155- ),
156146 ],
157147 ),
158148 );
0 commit comments