Skip to content

Commit 320e241

Browse files
committed
chore: dart format staging vs main
1 parent aaed0b9 commit 320e241

33 files changed

Lines changed: 641 additions & 743 deletions

lib/models/add_wallet_list_entity/sub_classes/sol_token_entity.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class SolTokenEntity extends AddWalletListEntity {
2626
String get ticker => token.symbol;
2727

2828
@override
29-
List<Object?> get props =>
30-
[cryptoCurrency.identifier, name, ticker, token.address];
29+
List<Object?> get props => [
30+
cryptoCurrency.identifier,
31+
name,
32+
ticker,
33+
token.address,
34+
];
3135
}

lib/models/isar/models/blockchain_data/transaction.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,12 @@ class Transaction {
218218
slateId: json["slateId"] as String?,
219219
otherData: json["otherData"] as String?,
220220
nonce: json["nonce"] as int?,
221-
inputs:
222-
List<String>.from(
223-
json["inputs"] as List,
224-
).map((e) => Input.fromJsonString(e)).toList(),
225-
outputs:
226-
List<String>.from(
227-
json["outputs"] as List,
228-
).map((e) => Output.fromJsonString(e)).toList(),
221+
inputs: List<String>.from(
222+
json["inputs"] as List,
223+
).map((e) => Input.fromJsonString(e)).toList(),
224+
outputs: List<String>.from(
225+
json["outputs"] as List,
226+
).map((e) => Output.fromJsonString(e)).toList(),
229227
numberOfMessages: json["numberOfMessages"] as int,
230228
);
231229
if (json["address"] == null) {

lib/models/keys/view_only_wallet_data.dart

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,15 @@ import '../../wallets/wallet/wallet_mixin_interfaces/extended_keys_interface.dar
44
import 'key_data_interface.dart';
55

66
// do not remove or change the order of these enum values
7-
enum ViewOnlyWalletType {
8-
cryptonote,
9-
addressOnly,
10-
xPub,
11-
spark;
12-
}
7+
enum ViewOnlyWalletType { cryptonote, addressOnly, xPub, spark }
138

149
sealed class ViewOnlyWalletData with KeyDataInterface {
1510
@override
1611
final String walletId;
1712

1813
ViewOnlyWalletType get type;
1914

20-
ViewOnlyWalletData({
21-
required this.walletId,
22-
});
15+
ViewOnlyWalletData({required this.walletId});
2316

2417
static ViewOnlyWalletData fromJsonEncodedString(
2518
String jsonEncodedString, {
@@ -88,10 +81,10 @@ class CryptonoteViewOnlyWalletData extends ViewOnlyWalletData {
8881

8982
@override
9083
String toJsonEncodedString() => jsonEncode({
91-
"type": type.index,
92-
"address": address,
93-
"privateViewKey": privateViewKey,
94-
});
84+
"type": type.index,
85+
"address": address,
86+
"privateViewKey": privateViewKey,
87+
});
9588
}
9689

9790
class AddressViewOnlyWalletData extends ViewOnlyWalletData {
@@ -100,10 +93,7 @@ class AddressViewOnlyWalletData extends ViewOnlyWalletData {
10093

10194
final String address;
10295

103-
AddressViewOnlyWalletData({
104-
required super.walletId,
105-
required this.address,
106-
});
96+
AddressViewOnlyWalletData({required super.walletId, required this.address});
10797

10898
static AddressViewOnlyWalletData fromJsonEncodedString(
10999
String jsonEncodedString, {
@@ -119,10 +109,8 @@ class AddressViewOnlyWalletData extends ViewOnlyWalletData {
119109
}
120110

121111
@override
122-
String toJsonEncodedString() => jsonEncode({
123-
"type": type.index,
124-
"address": address,
125-
});
112+
String toJsonEncodedString() =>
113+
jsonEncode({"type": type.index, "address": address});
126114
}
127115

128116
class ExtendedKeysViewOnlyWalletData extends ViewOnlyWalletData {
@@ -158,16 +146,11 @@ class ExtendedKeysViewOnlyWalletData extends ViewOnlyWalletData {
158146

159147
@override
160148
String toJsonEncodedString() => jsonEncode({
161-
"type": type.index,
162-
"xPubs": [
163-
...xPubs.map(
164-
(e) => {
165-
"path": e.path,
166-
"encoded": e.encoded,
167-
},
168-
),
169-
],
170-
});
149+
"type": type.index,
150+
"xPubs": [
151+
...xPubs.map((e) => {"path": e.path, "encoded": e.encoded}),
152+
],
153+
});
171154
}
172155

173156
class SparkViewOnlyWalletData extends ViewOnlyWalletData {
@@ -176,10 +159,7 @@ class SparkViewOnlyWalletData extends ViewOnlyWalletData {
176159

177160
final String viewKey;
178161

179-
SparkViewOnlyWalletData({
180-
required super.walletId,
181-
required this.viewKey,
182-
});
162+
SparkViewOnlyWalletData({required super.walletId, required this.viewKey});
183163

184164
static SparkViewOnlyWalletData fromJsonEncodedString(
185165
String jsonEncodedString, {
@@ -195,8 +175,6 @@ class SparkViewOnlyWalletData extends ViewOnlyWalletData {
195175
}
196176

197177
@override
198-
String toJsonEncodedString() => jsonEncode({
199-
"type": type.index,
200-
"viewKey": viewKey,
201-
});
178+
String toJsonEncodedString() =>
179+
jsonEncode({"type": type.index, "viewKey": viewKey});
202180
}

lib/pages/add_wallet_views/add_token_view/edit_wallet_tokens_view.dart

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -177,7 +176,9 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
177176
tokenEntities.add(
178177
AddTokenListElementData(contract!)..selected = true,
179178
);
180-
tokenEntities.sort((a, b) => a.token.name.compareTo(b.token.name));
179+
tokenEntities.sort(
180+
(a, b) => a.token.name.compareTo(b.token.name),
181+
);
181182
}
182183
});
183184
}
@@ -199,9 +200,7 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
199200
),
200201
);
201202
} else {
202-
final result = await Navigator.of(
203-
context,
204-
).pushNamed(
203+
final result = await Navigator.of(context).pushNamed(
205204
AddCustomSolanaTokenView.routeName,
206205
arguments: widget.walletId,
207206
);
@@ -228,9 +227,7 @@ class _EditWalletTokensViewState extends ConsumerState<EditWalletTokensView> {
228227
if (tokenEntities
229228
.where((e) => e.token.address == token!.address)
230229
.isEmpty) {
231-
tokenEntities.add(
232-
AddTokenListElementData(token!)..selected = true,
233-
);
230+
tokenEntities.add(AddTokenListElementData(token!)..selected = true);
234231
tokenEntities.sort((a, b) => a.token.name.compareTo(b.token.name));
235232
}
236233
});

lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ class AddTokenList extends StatelessWidget {
3838
mainAxisSize: MainAxisSize.min,
3939
children: [
4040
child,
41-
AddCustomTokenSelector(
42-
addFunction: addFunction!,
43-
),
41+
AddCustomTokenSelector(addFunction: addFunction!),
4442
],
4543
),
4644
child: Padding(

lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list_element.dart

Lines changed: 43 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)