Skip to content

Commit 9de4e7b

Browse files
authored
Merge pull request #1695 from wired-pasteque/fix-theme
Improve dark and light mode in few features
2 parents af98900 + bb3c70a commit 9de4e7b

10 files changed

Lines changed: 158 additions & 126 deletions

File tree

lib/core/widgets/bottom_sheet/x.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class BlurredBottomSheet extends StatelessWidget {
2727
isScrollControlled: isScrollControlled,
2828
isDismissible: isDismissible,
2929
useSafeArea: true,
30-
backgroundColor: context.appColors.surface,
31-
barrierColor: context.appColors.secondary.withAlpha(200),
30+
backgroundColor: context.appColors.background,
31+
barrierColor: context.appColors.background.withAlpha(200),
3232
builder: (_) => BlurredBottomSheet(child: child),
3333
);
3434
}

lib/core/widgets/price_input/price_input.dart

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:bb_mobile/core/themes/app_theme.dart';
22
import 'package:bb_mobile/core/utils/constants.dart';
3+
import 'package:bb_mobile/core/widgets/bottom_sheet/x.dart';
34
import 'package:bb_mobile/core/widgets/inputs/amount_input_formatter.dart';
45
import 'package:flutter/material.dart';
56
import 'package:gap/gap.dart';
@@ -160,18 +161,12 @@ class PriceInput extends StatelessWidget {
160161
}
161162

162163
Future<String?> _openPopup(BuildContext context, String selected) async {
163-
final c = await showModalBottomSheet<String?>(
164-
useRootNavigator: true,
164+
final c = await BlurredBottomSheet.show<String?>(
165165
context: context,
166-
isScrollControlled: true,
167-
backgroundColor: context.appColors.secondaryFixedDim,
168-
constraints: const BoxConstraints(maxWidth: double.infinity),
169-
builder: (context) {
170-
return CurrencyBottomSheet(
171-
availableCurrencies: availableCurrencies,
172-
selectedValue: selected,
173-
);
174-
},
166+
child: CurrencyBottomSheet(
167+
availableCurrencies: availableCurrencies,
168+
selectedValue: selected,
169+
),
175170
);
176171

177172
return c;
@@ -190,6 +185,10 @@ class CurrencyBottomSheet extends StatelessWidget {
190185
@override
191186
Widget build(BuildContext context) {
192187
return Container(
188+
decoration: BoxDecoration(
189+
color: context.appColors.surface,
190+
borderRadius: const BorderRadius.vertical(top: Radius.circular(32)),
191+
),
193192
constraints: BoxConstraints(
194193
maxHeight: MediaQuery.of(context).size.height * 0.8,
195194
),
@@ -204,14 +203,14 @@ class CurrencyBottomSheet extends StatelessWidget {
204203
Text(
205204
'Currency',
206205
style: context.font.headlineMedium?.copyWith(
207-
color: context.appColors.secondary,
206+
color: context.appColors.onSurface,
208207
),
209208
),
210209
const Spacer(),
211210
IconButton(
212211
iconSize: 20,
213212
onPressed: () => Navigator.pop(context),
214-
color: context.appColors.secondary,
213+
color: context.appColors.onSurface,
215214
icon: const Icon(Icons.close),
216215
),
217216
const Gap(16),
@@ -250,7 +249,7 @@ class CurrencyBottomSheet extends StatelessWidget {
250249
style: context.font.headlineSmall?.copyWith(
251250
color: selectedValue == curr
252251
? context.appColors.primary
253-
: context.appColors.secondary,
252+
: context.appColors.onSurface,
254253
),
255254
),
256255
const Gap(2),

lib/features/all_seed_view/ui/all_seed_view_screen.dart

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,18 @@ class AllSeedViewScreen extends StatelessWidget with PrivacyScreen {
3636
appBar: AppBar(
3737
title: BBText(
3838
context.loc.allSeedViewTitle,
39-
style: const TextStyle(
40-
fontWeight: .bold,
41-
fontSize: 20,
42-
),
39+
style: const TextStyle(fontWeight: .bold, fontSize: 20),
4340
),
4441
bottom: PreferredSize(
4542
preferredSize: const Size.fromHeight(3),
46-
child:
47-
state.loading
48-
? FadingLinearProgress(
49-
height: 3,
50-
trigger: state.loading,
51-
backgroundColor: context.appColors.surface,
52-
foregroundColor: context.appColors.primary,
53-
)
54-
: const SizedBox(height: 3),
43+
child: state.loading
44+
? FadingLinearProgress(
45+
height: 3,
46+
trigger: state.loading,
47+
backgroundColor: context.appColors.surface,
48+
foregroundColor: context.appColors.primary,
49+
)
50+
: const SizedBox(height: 3),
5551
),
5652
),
5753
body: Builder(
@@ -63,22 +59,29 @@ class AllSeedViewScreen extends StatelessWidget with PrivacyScreen {
6359
child: BBText(
6460
context.loc.allSeedViewLoadingMessage,
6561
style: context.font.bodyMedium,
66-
color: context.appColors.onSurface.withValues(alpha: 0.7),
62+
color: context.appColors.onSurface.withValues(
63+
alpha: 0.7,
64+
),
6765
textAlign: .center,
6866
),
6967
),
7068
);
7169
}
7270
if (state.error != null) {
7371
return Center(
74-
child: BBText(state.error!, style: context.font.bodyLarge),
72+
child: BBText(
73+
state.error!,
74+
style: context.font.bodyLarge,
75+
color: context.appColors.error,
76+
),
7577
);
7678
}
7779
if (state.allSeeds.isEmpty) {
7880
return Center(
7981
child: BBText(
8082
context.loc.allSeedViewNoSeedsFound,
8183
style: context.font.bodyLarge,
84+
color: context.appColors.onSurface,
8285
),
8386
);
8487
}
@@ -162,7 +165,7 @@ class AllSeedViewScreen extends StatelessWidget with PrivacyScreen {
162165
barrierDismissible: false,
163166
builder: (BuildContext dialogContext) {
164167
return AlertDialog(
165-
backgroundColor: context.appColors.onPrimary,
168+
backgroundColor: context.appColors.surface,
166169
title: Text(
167170
context.loc.allSeedViewSecurityWarningTitle,
168171
style: context.font.headlineSmall?.copyWith(
@@ -172,13 +175,20 @@ class AllSeedViewScreen extends StatelessWidget with PrivacyScreen {
172175
content: SingleChildScrollView(
173176
child: Text(
174177
context.loc.allSeedViewSecurityWarningMessage,
175-
style: context.font.bodyMedium,
178+
style: context.font.bodyMedium?.copyWith(
179+
color: context.appColors.onSurface,
180+
),
176181
),
177182
),
178183
actions: [
179184
TextButton(
180185
onPressed: () => Navigator.of(dialogContext).pop(),
181-
child: Text(context.loc.cancel, style: context.font.bodyMedium),
186+
child: Text(
187+
context.loc.cancel,
188+
style: context.font.bodyMedium?.copyWith(
189+
color: context.appColors.onSurface,
190+
),
191+
),
182192
),
183193
TextButton(
184194
onPressed: () {
@@ -208,7 +218,7 @@ class AllSeedViewScreen extends StatelessWidget with PrivacyScreen {
208218
barrierDismissible: false,
209219
builder: (BuildContext dialogContext) {
210220
return AlertDialog(
211-
backgroundColor: context.appColors.onPrimary,
221+
backgroundColor: context.appColors.surface,
212222
title: Text(
213223
context.loc.allSeedViewDeleteWarningTitle,
214224
style: context.font.headlineSmall?.copyWith(
@@ -219,13 +229,20 @@ class AllSeedViewScreen extends StatelessWidget with PrivacyScreen {
219229
content: SingleChildScrollView(
220230
child: Text(
221231
context.loc.allSeedViewDeleteWarningMessage,
222-
style: context.font.bodyMedium,
232+
style: context.font.bodyMedium?.copyWith(
233+
color: context.appColors.onSurface,
234+
),
223235
),
224236
),
225237
actions: [
226238
TextButton(
227239
onPressed: () => Navigator.of(dialogContext).pop(),
228-
child: Text(context.loc.cancel, style: context.font.bodyMedium),
240+
child: Text(
241+
context.loc.cancel,
242+
style: context.font.bodyMedium?.copyWith(
243+
color: context.appColors.onSurface,
244+
),
245+
),
229246
),
230247
TextButton(
231248
onPressed: () {
@@ -261,9 +278,9 @@ class AllSeedViewScreen extends StatelessWidget with PrivacyScreen {
261278
Container(
262279
padding: const EdgeInsets.all(16),
263280
decoration: BoxDecoration(
264-
color: context.appColors.onPrimary,
281+
color: context.appColors.surface,
265282
borderRadius: BorderRadius.circular(8),
266-
border: Border.all(color: context.appColors.primary, width: 2),
283+
border: Border.all(color: context.appColors.outline, width: 1),
267284
),
268285
child: Row(
269286
crossAxisAlignment: .start,
@@ -272,7 +289,7 @@ class AllSeedViewScreen extends StatelessWidget with PrivacyScreen {
272289
child: BBText(
273290
seed.mnemonicWords.join(' '),
274291
style: context.font.bodyMedium,
275-
color: context.appColors.secondary,
292+
color: context.appColors.onSurface,
276293
maxLines: 5,
277294
),
278295
),
@@ -299,7 +316,9 @@ class AllSeedViewScreen extends StatelessWidget with PrivacyScreen {
299316
children: [
300317
BBText(
301318
context.loc.allSeedViewPassphraseLabel,
302-
style: context.font.bodyLarge,
319+
style: context.font.bodyLarge?.copyWith(
320+
color: context.appColors.onSurface,
321+
),
303322
),
304323
BBText(
305324
seed.passphrase!,

lib/features/exchange/ui/screens/exchange_landing_screen.dart

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ class ExchangeLandingScreen extends StatelessWidget {
2525
context.goNamed(WalletRoute.walletHome.name);
2626
},
2727
child: Scaffold(
28-
backgroundColor: context.appColors.secondary,
28+
backgroundColor: context.appColors.background,
2929
appBar: AppBar(
3030
leading: BackButton(
31-
color: context.appColors.onSecondary,
31+
color: context.appColors.onSurface,
3232
onPressed: () => context.goNamed(WalletRoute.walletHome.name),
3333
),
3434
),
@@ -42,23 +42,23 @@ class ExchangeLandingScreen extends StatelessWidget {
4242
child: Column(
4343
children: [
4444
Image.asset(
45-
Assets.logos.bbLogoWhite.path,
45+
Assets.logos.bbLogoSmall.path,
4646
width: 120,
4747
height: 120,
4848
),
4949
const Gap(16),
5050
BBText(
5151
context.loc.exchangeBrandName,
5252
style: AppFonts.textTitleTheme.textStyle.copyWith(
53-
color: context.appColors.onSecondary,
53+
color: context.appColors.primary,
5454
fontSize: 64,
5555
),
5656
),
5757
const Gap(12),
5858
BBText(
5959
context.loc.exchangeLandingConnectAccount,
6060
style: context.font.headlineSmall?.copyWith(
61-
color: context.appColors.onSecondary,
61+
color: context.appColors.onSurface,
6262
),
6363
),
6464
],
@@ -68,8 +68,9 @@ class ExchangeLandingScreen extends StatelessWidget {
6868
Container(
6969
padding: const EdgeInsets.all(32),
7070
decoration: BoxDecoration(
71+
color: context.appColors.surfaceContainer,
7172
border: Border.all(
72-
color: context.appColors.primary,
73+
color: context.appColors.outline,
7374
width: 0,
7475
),
7576
borderRadius: BorderRadius.circular(12),
@@ -80,42 +81,42 @@ class ExchangeLandingScreen extends StatelessWidget {
8081
BBText(
8182
context.loc.exchangeFeatureSelfCustody,
8283
style: context.font.bodyLarge?.copyWith(
83-
color: context.appColors.onSecondary,
84+
color: context.appColors.onSurface,
8485
),
8586
),
8687
const Gap(12),
8788
BBText(
8889
context.loc.exchangeFeatureDcaOrders,
8990
style: context.font.bodyLarge?.copyWith(
90-
color: context.appColors.onSecondary,
91+
color: context.appColors.onSurface,
9192
),
9293
),
9394
const Gap(12),
9495
BBText(
9596
context.loc.exchangeFeatureSellBitcoin,
9697
style: context.font.bodyLarge?.copyWith(
97-
color: context.appColors.onSecondary,
98+
color: context.appColors.onSurface,
9899
),
99100
),
100101
const Gap(12),
101102
BBText(
102103
context.loc.exchangeFeatureBankTransfers,
103104
style: context.font.bodyLarge?.copyWith(
104-
color: context.appColors.onSecondary,
105+
color: context.appColors.onSurface,
105106
),
106107
),
107108
const Gap(12),
108109
BBText(
109110
context.loc.exchangeFeatureCustomerSupport,
110111
style: context.font.bodyLarge?.copyWith(
111-
color: context.appColors.onSecondary,
112+
color: context.appColors.onSurface,
112113
),
113114
),
114115
const Gap(12),
115116
BBText(
116117
context.loc.exchangeFeatureUnifiedHistory,
117118
style: context.font.bodyLarge?.copyWith(
118-
color: context.appColors.onSecondary,
119+
color: context.appColors.onSurface,
119120
),
120121
),
121122
],
@@ -125,13 +126,13 @@ class ExchangeLandingScreen extends StatelessWidget {
125126
Container(
126127
padding: const EdgeInsets.all(16),
127128
decoration: BoxDecoration(
128-
color: context.appColors.primary.withValues(alpha: 0.1),
129+
color: context.appColors.warningContainer,
129130
borderRadius: BorderRadius.circular(8),
130131
),
131132
child: BBText(
132133
context.loc.exchangeLandingDisclaimerLegal,
133134
style: context.font.bodySmall?.copyWith(
134-
color: context.appColors.onSecondary,
135+
color: context.appColors.onSurface,
135136
),
136137
),
137138
),
@@ -146,7 +147,7 @@ class ExchangeLandingScreen extends StatelessWidget {
146147
context.goNamed(ExchangeRoute.exchangeAuth.name);
147148
},
148149
bgColor: context.appColors.primary,
149-
textColor: context.appColors.onSecondary,
150+
textColor: context.appColors.onPrimary,
150151
),
151152
),
152153
],

0 commit comments

Comments
 (0)