Skip to content

Commit 85d2435

Browse files
committed
chore: dart format
1 parent c2eaff6 commit 85d2435

5 files changed

Lines changed: 91 additions & 116 deletions

File tree

lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/backup_frequency_type_select_sheet.dart

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ import '../../../../../utilities/enums/backup_frequency_type.dart';
1818
import '../../../../../utilities/text_styles.dart';
1919

2020
class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
21-
const BackupFrequencyTypeSelectSheet({
22-
super.key,
23-
});
21+
const BackupFrequencyTypeSelectSheet({super.key});
2422

2523
String prettyFrequencyType(BackupFrequencyType type) {
2624
switch (type) {
@@ -39,16 +37,15 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
3937
Widget build(BuildContext context, WidgetRef ref) {
4038
return WillPopScope(
4139
onWillPop: () async {
42-
Navigator.of(context)
43-
.pop(ref.read(prefsChangeNotifierProvider).backupFrequencyType);
40+
Navigator.of(
41+
context,
42+
).pop(ref.read(prefsChangeNotifierProvider).backupFrequencyType);
4443
return false;
4544
},
4645
child: Container(
4746
decoration: BoxDecoration(
4847
color: Theme.of(context).extension<StackColors>()!.popupBG,
49-
borderRadius: const BorderRadius.vertical(
50-
top: Radius.circular(20),
51-
),
48+
borderRadius: const BorderRadius.vertical(top: Radius.circular(20)),
5249
),
5350
child: Padding(
5451
padding: const EdgeInsets.only(
@@ -64,9 +61,9 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
6461
Center(
6562
child: Container(
6663
decoration: BoxDecoration(
67-
color: Theme.of(context)
68-
.extension<StackColors>()!
69-
.textFieldDefaultBG,
64+
color: Theme.of(
65+
context,
66+
).extension<StackColors>()!.textFieldDefaultBG,
7067
borderRadius: BorderRadius.circular(
7168
Constants.size.circularBorderRadius,
7269
),
@@ -75,9 +72,7 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
7572
height: 4,
7673
),
7774
),
78-
const SizedBox(
79-
height: 36,
80-
),
75+
const SizedBox(height: 36),
8176
Column(
8277
crossAxisAlignment: CrossAxisAlignment.start,
8378
children: [
@@ -86,9 +81,7 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
8681
style: STextStyles.pageTitleH2(context),
8782
textAlign: TextAlign.left,
8883
),
89-
const SizedBox(
90-
height: 24,
91-
),
84+
const SizedBox(height: 24),
9285
for (int i = 0; i < BackupFrequencyType.values.length; i++)
9386
Column(
9487
children: [
@@ -133,9 +126,7 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
133126
},
134127
),
135128
),
136-
const SizedBox(
137-
width: 12,
138-
),
129+
const SizedBox(width: 12),
139130
Flexible(
140131
child: Column(
141132
children: [
@@ -153,14 +144,10 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget {
153144
),
154145
),
155146
),
156-
const SizedBox(
157-
height: 20,
158-
),
147+
const SizedBox(height: 20),
159148
],
160149
),
161-
const SizedBox(
162-
height: 24,
163-
),
150+
const SizedBox(height: 24),
164151
],
165152
),
166153
],

lib/pages/wallet_view/transaction_views/edit_note_view.dart

Lines changed: 66 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -72,34 +72,33 @@ class _EditNoteViewState extends ConsumerState<EditNoteView> {
7272
condition: !isDesktop,
7373
builder: (child) => Background(child: child),
7474
child: Scaffold(
75-
backgroundColor:
76-
isDesktop
77-
? Colors.transparent
78-
: Theme.of(context).extension<StackColors>()!.background,
79-
appBar:
80-
isDesktop
81-
? null
82-
: AppBar(
83-
backgroundColor:
84-
Theme.of(context).extension<StackColors>()!.background,
85-
leading: AppBarBackButton(
86-
onPressed: () async {
87-
if (FocusScope.of(context).hasFocus) {
88-
FocusScope.of(context).unfocus();
89-
await Future<void>.delayed(
90-
const Duration(milliseconds: 75),
91-
);
92-
}
93-
if (mounted) {
94-
Navigator.of(context).pop();
95-
}
96-
},
97-
),
98-
title: Text(
99-
"Edit note",
100-
style: STextStyles.navBarTitle(context),
101-
),
75+
backgroundColor: isDesktop
76+
? Colors.transparent
77+
: Theme.of(context).extension<StackColors>()!.background,
78+
appBar: isDesktop
79+
? null
80+
: AppBar(
81+
backgroundColor: Theme.of(
82+
context,
83+
).extension<StackColors>()!.background,
84+
leading: AppBarBackButton(
85+
onPressed: () async {
86+
if (FocusScope.of(context).hasFocus) {
87+
FocusScope.of(context).unfocus();
88+
await Future<void>.delayed(
89+
const Duration(milliseconds: 75),
90+
);
91+
}
92+
if (mounted) {
93+
Navigator.of(context).pop();
94+
}
95+
},
96+
),
97+
title: Text(
98+
"Edit note",
99+
style: STextStyles.navBarTitle(context),
102100
),
101+
),
103102
body: MobileEditNoteScaffold(
104103
child: Column(
105104
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -116,10 +115,9 @@ class _EditNoteViewState extends ConsumerState<EditNoteView> {
116115
),
117116
),
118117
Padding(
119-
padding:
120-
isDesktop
121-
? const EdgeInsets.symmetric(horizontal: 32)
122-
: const EdgeInsets.all(0),
118+
padding: isDesktop
119+
? const EdgeInsets.symmetric(horizontal: 32)
120+
: const EdgeInsets.all(0),
123121
child: ClipRRect(
124122
borderRadius: BorderRadius.circular(
125123
Constants.size.circularBorderRadius,
@@ -128,55 +126,50 @@ class _EditNoteViewState extends ConsumerState<EditNoteView> {
128126
autocorrect: Util.isDesktop ? false : true,
129127
enableSuggestions: Util.isDesktop ? false : true,
130128
controller: _noteController,
131-
style:
132-
isDesktop
133-
? STextStyles.desktopTextExtraSmall(
129+
style: isDesktop
130+
? STextStyles.desktopTextExtraSmall(context).copyWith(
131+
color: Theme.of(
134132
context,
135-
).copyWith(
136-
color:
137-
Theme.of(context)
138-
.extension<StackColors>()!
139-
.textFieldActiveText,
140-
height: 1.8,
141-
)
142-
: STextStyles.field(context),
133+
).extension<StackColors>()!.textFieldActiveText,
134+
height: 1.8,
135+
)
136+
: STextStyles.field(context),
143137
focusNode: noteFieldFocusNode,
144-
decoration: standardInputDecoration(
145-
"Note",
146-
noteFieldFocusNode,
147-
context,
148-
desktopMed: isDesktop,
149-
).copyWith(
150-
contentPadding:
151-
isDesktop
138+
decoration:
139+
standardInputDecoration(
140+
"Note",
141+
noteFieldFocusNode,
142+
context,
143+
desktopMed: isDesktop,
144+
).copyWith(
145+
contentPadding: isDesktop
152146
? const EdgeInsets.only(
153-
left: 16,
154-
top: 11,
155-
bottom: 12,
156-
right: 5,
157-
)
147+
left: 16,
148+
top: 11,
149+
bottom: 12,
150+
right: 5,
151+
)
158152
: null,
159-
suffixIcon:
160-
_noteController.text.isNotEmpty
153+
suffixIcon: _noteController.text.isNotEmpty
161154
? Padding(
162-
padding: const EdgeInsets.only(right: 0),
163-
child: UnconstrainedBox(
164-
child: Row(
165-
children: [
166-
TextFieldIconButton(
167-
child: const XIcon(),
168-
onTap: () async {
169-
setState(() {
170-
_noteController.text = "";
171-
});
172-
},
173-
),
174-
],
155+
padding: const EdgeInsets.only(right: 0),
156+
child: UnconstrainedBox(
157+
child: Row(
158+
children: [
159+
TextFieldIconButton(
160+
child: const XIcon(),
161+
onTap: () async {
162+
setState(() {
163+
_noteController.text = "";
164+
});
165+
},
166+
),
167+
],
168+
),
175169
),
176-
),
177-
)
170+
)
178171
: null,
179-
),
172+
),
180173
),
181174
),
182175
),

lib/providers/global/auto_swb_service_provider.dart

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
1212
import 'secure_store_provider.dart';
1313
import '../../services/auto_swb_service.dart';
1414

15-
final autoSWBServiceProvider = ChangeNotifierProvider<AutoSWBService>(
16-
(ref) {
17-
final service = AutoSWBService(
18-
secureStorageInterface: ref.read(secureStoreProvider),
19-
);
20-
AutoSWBService.instance = service;
21-
return service;
22-
},
23-
);
15+
final autoSWBServiceProvider = ChangeNotifierProvider<AutoSWBService>((ref) {
16+
final service = AutoSWBService(
17+
secureStorageInterface: ref.read(secureStoreProvider),
18+
);
19+
AutoSWBService.instance = service;
20+
return service;
21+
});

lib/services/auto_swb_service.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,14 @@ class AutoSWBService extends ChangeNotifier {
5151
if (!prefs.isAutoBackupEnabled) return;
5252
if (prefs.backupFrequencyType != BackupFrequencyType.afterChanges) return;
5353

54-
Logging.instance.d(
55-
"AutoSWBService.requestBackupAfterChange() triggered",
56-
);
54+
Logging.instance.d("AutoSWBService.requestBackupAfterChange() triggered");
5755
instance!.requestBackup();
5856
}
5957

6058
/// Request a debounced backup. Multiple calls within [debounceDuration]
6159
/// will be collapsed into a single backup. This prevents backup storms
6260
/// during wallet sync or rapid changes.
63-
void requestBackup({
64-
Duration debounceDuration = const Duration(seconds: 5),
65-
}) {
61+
void requestBackup({Duration debounceDuration = const Duration(seconds: 5)}) {
6662
_debounceTimer?.cancel();
6763
_debounceTimer = Timer(debounceDuration, () {
6864
Logging.instance.d(

lib/utilities/format.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ abstract class Format {
6868
return dayAndYear;
6969
}
7070

71-
final minutes =
72-
date.minute < 10 ? "0${date.minute}" : date.minute.toString();
71+
final minutes = date.minute < 10
72+
? "0${date.minute}"
73+
: date.minute.toString();
7374
return "$dayAndYear, ${date.hour}:$minutes";
7475
}
7576

0 commit comments

Comments
 (0)