Skip to content

Commit

Permalink
fix(style): adjust responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
gabaldon committed Oct 22, 2024
1 parent 33aa4f8 commit f8aa541
Show file tree
Hide file tree
Showing 33 changed files with 281 additions and 264 deletions.
5 changes: 2 additions & 3 deletions integration_test/e2e_show_node_stats.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,13 @@ Future<void> e2eShowNodeStatsTest(WidgetTester tester) async {
final listFinder = find
.byType(Scrollable)
.first; // take first because it is the wallet list scroll
await tester.scrollUntilVisible(
find.text("wit174la8pevl74hczcpfepgmt036zkmjen4hu8zzs"), -100.0,
await tester.scrollUntilVisible(find.text("wit174l...4hu8zzs"), -100.0,
scrollable: listFinder);

await tester.pumpAndSettle();

/// Select HD wallet from the wallets list
await tapButton(tester, "wit174la8pevl74hczcpfepgmt036zkmjen4hu8zzs");
await tapButton(tester, "wit174l...4hu8zzs");

await tester.pumpAndSettle();

Expand Down
4 changes: 2 additions & 2 deletions integration_test/e2e_update_theme_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Future<void> e2eUpdateThemeColorTest(WidgetTester tester) async {
tester.widget<Text>(find.text(localization.darkMode)).style!.color;

// Avoid switch to password authentication if password is not typed by the user
expect(textColor, WitnetPallet.opacityWhite);
expect(textColor, WitnetPallet.lightGrey);

// Tap switch to change theme color
await tapButton(tester, Switch, index: 0);
Expand All @@ -51,6 +51,6 @@ Future<void> e2eUpdateThemeColorTest(WidgetTester tester) async {
final textColor2 =
tester.widget<Text>(find.text(localization.darkMode)).style!.color;
// Avoid switch to password authentication if password is not typed by the user
expect(textColor2, WitnetPallet.darkGrey);
expect(textColor2, WitnetPallet.mediumGrey);
await teardownTest();
}
14 changes: 3 additions & 11 deletions integration_test/e2e_update_wallet_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,10 @@ Future<void> e2eUpdateCurrentWalletTest(WidgetTester tester) async {
/// and brings up the wallet list.
await tapButton(tester, PaddedButton, index: 0);

/// Select another wallet from the wallet list
final listFinder = find
.byType(Scrollable)
.first; // take first because it is the wallet list scroll
await tester.scrollUntilVisible(
find.text("wit174la8pevl74hczcpfepgmt036zkmjen4hu8zzs"), -100.0,
scrollable: listFinder);

await tester.pumpAndSettle();

/// Select Node wallet from the wallets list
await tapButton(tester, "wit1vzm7xrguwf5uzjx72l65stgj3npfn292tya50u");
await tapButton(tester, "wit1vzm...2tya50u");

await tester.pumpAndSettle();

Expand All @@ -107,7 +99,7 @@ Future<void> e2eUpdateCurrentWalletTest(WidgetTester tester) async {
await tester.pumpAndSettle();

/// Verify the imported wallet and the current address
expectLater(currentWallet3!.masterAccount!.address,
"wit1vzm7xrguwf5uzjx72l65stgj3npfn292tya50u");
expectLater(currentWallet3!.masterAccount!.address.cropMiddle(18),
"wit1vzm...2tya50u");
await teardownTest();
}
12 changes: 6 additions & 6 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PODS:
- nanopb/encode (= 2.30910.0)
- nanopb/decode (2.30910.0)
- nanopb/encode (2.30910.0)
- open_file (0.0.1):
- open_file_ios (0.0.1):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
Expand All @@ -80,7 +80,7 @@ DEPENDENCIES:
- integration_test (from `.symlinks/plugins/integration_test/ios`)
- local_auth_darwin (from `.symlinks/plugins/local_auth_darwin/darwin`)
- mobile_scanner (from `.symlinks/plugins/mobile_scanner/ios`)
- open_file (from `.symlinks/plugins/open_file/ios`)
- open_file_ios (from `.symlinks/plugins/open_file_ios/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`)
Expand Down Expand Up @@ -112,8 +112,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/local_auth_darwin/darwin"
mobile_scanner:
:path: ".symlinks/plugins/mobile_scanner/ios"
open_file:
:path: ".symlinks/plugins/open_file/ios"
open_file_ios:
:path: ".symlinks/plugins/open_file_ios/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
Expand All @@ -133,7 +133,7 @@ SPEC CHECKSUMS:
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
GoogleUtilitiesComponents: 679b2c881db3b615a2777504623df6122dd20afe
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
integration_test: ce0a3ffa1de96d1a89ca0ac26fca7ea18a749ef4
integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573
local_auth_darwin: 66e40372f1c29f383a314c738c7446e2f7fdadc3
MLImage: 1824212150da33ef225fbd3dc49f184cf611046c
MLKitBarcodeScanning: 10ca0845a6d15f2f6e911f682a1998b68b973e8b
Expand All @@ -142,7 +142,7 @@ SPEC CHECKSUMS:
mobile_scanner: 8564358885a9253c43f822435b70f9345c87224f
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
nanopb: 438bc412db1928dac798aa6fd75726007be04262
open_file: 02eb5cb6b21264bd3a696876f5afbfb7ca4f4b7d
open_file_ios: 461db5853723763573e140de3193656f91990d9e
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
Expand Down
4 changes: 3 additions & 1 deletion lib/auto_updater_overlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:io';
import 'package:http/http.dart' as http;
import 'package:flutter/material.dart';
import 'package:my_wit_wallet/constants.dart';
import 'package:my_wit_wallet/theme/extended_theme.dart';
import 'package:my_wit_wallet/util/get_localization.dart';
import 'package:my_wit_wallet/widgets/PaddedButton.dart';
import 'package:updat/updat.dart';
Expand Down Expand Up @@ -138,14 +139,15 @@ void customDialog({
required void Function() dismissUpdate,
}) {
final theme = Theme.of(context);
final extendedTheme = Theme.of(context).extension<ExtendedTheme>()!;
showDialog(
context: context,
builder: (context) => AlertDialog(
backgroundColor: theme.dialogBackgroundColor,
surfaceTintColor: Colors.transparent,
scrollable: true,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(8))),
borderRadius: BorderRadius.all(extendedTheme.borderRadius!)),
title: Flex(
direction: Axis.vertical,
children: [
Expand Down
2 changes: 2 additions & 0 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ const String LATEST_RELEASE_URL =
const String DOWNLOAD_BASE_URL =
"https://github.com/witnet/my-wit-wallet/releases/download";

const double BORDER_RADIUS = 32;

const List<String> CUSTOM_ICON_NAMES = [
'create-or-import-wallet',
'general-error',
Expand Down
9 changes: 5 additions & 4 deletions lib/screens/create_wallet/build_wallet_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:my_wit_wallet/bloc/crypto/crypto_bloc.dart';
import 'package:my_wit_wallet/theme/extended_theme.dart';
import 'package:my_wit_wallet/util/extensions/string_extensions.dart';
import 'package:my_wit_wallet/util/get_localization.dart';
import 'package:my_wit_wallet/screens/create_wallet/bloc/api_create_wallet.dart';
import 'package:my_wit_wallet/screens/create_wallet/bloc/create_wallet_bloc.dart';
Expand Down Expand Up @@ -327,10 +328,10 @@ class BuildWalletCardState extends State<BuildWalletCard>
Expanded(
flex: 1,
child: Text(
state.message,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.bodyMedium,
)),
state.message.contains('wit1')
? state.message.cropMiddle(18)
: state.message,
style: extendedTheme.monoMediumText)),
],
),
],
Expand Down
1 change: 0 additions & 1 deletion lib/screens/create_wallet/confirm_mnemonic_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:my_wit_wallet/screens/create_wallet/bloc/api_create_wallet.dart'
import 'package:my_wit_wallet/screens/create_wallet/bloc/create_wallet_bloc.dart';
import 'package:my_wit_wallet/shared/locator.dart';
import 'package:my_wit_wallet/screens/create_wallet/nav_action.dart';
import 'package:my_wit_wallet/theme/extended_theme.dart';

typedef void VoidCallback(NavAction? value);

Expand Down
6 changes: 3 additions & 3 deletions lib/screens/create_wallet/generate_mnemonic_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ class GenerateMnemonicCardState extends State<GenerateMnemonicCard>
children: [
Text(
localization.generateMnemonic01(_radioWordCount),
style: theme.textTheme.bodyMedium,
style: theme.textTheme.bodyLarge,
),
SizedBox(
height: 8,
),
Text(
localization.generateMnemonic02,
style: theme.textTheme.bodyMedium,
style: theme.textTheme.bodyLarge,
),
SizedBox(
height: 8,
),
Text(
localization.generateMnemonic03,
style: theme.textTheme.bodyMedium,
style: theme.textTheme.bodyLarge,
),
],
);
Expand Down
1 change: 0 additions & 1 deletion lib/screens/create_wallet/import_mnemonic_card.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:my_wit_wallet/theme/extended_theme.dart';
import 'package:my_wit_wallet/util/get_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down
7 changes: 0 additions & 7 deletions lib/screens/dashboard/view/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class DashboardScreenState extends State<DashboardScreen>
String? currentAddress;
Wallet? currentWallet;
Account? currentAccount;
late AnimationController _loadingController;
late Timer syncTimer;
ApiDatabase database = Locator.instance.get<ApiDatabase>();
ScrollController scrollController = ScrollController(keepScrollOffset: true);
Expand All @@ -47,11 +46,6 @@ class DashboardScreenState extends State<DashboardScreen>
@override
void initState() {
super.initState();
_loadingController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 1200),
);
_loadingController.forward();
_setWallet();
_setAccount();
String walletId = database.walletStorage.currentWallet.id;
Expand All @@ -71,7 +65,6 @@ class DashboardScreenState extends State<DashboardScreen>

@override
void dispose() {
_loadingController.dispose();
if (explorerBlock != null &&
explorerBlock!.syncWalletSubscription != null) {
explorerBlock!.syncWalletSubscription!.cancel();
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/preferences/general_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class GeneralConfigState extends State<GeneralConfig> {
return Container(
alignment: Alignment.centerLeft,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(24)),
borderRadius: BorderRadius.all(extendedTheme.borderRadius!),
color: extendedTheme.backgroundBox,
),
child: child);
Expand Down
31 changes: 17 additions & 14 deletions lib/theme/dark_theme.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:my_wit_wallet/constants.dart';
import 'package:my_wit_wallet/screens/screen_transitions/no_transitions_builder.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
import 'colors.dart';
Expand Down Expand Up @@ -81,66 +82,67 @@ InputDecorationTheme inputDecorationTheme = InputDecorationTheme(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: WitnetPallet.darkGrey2, width: 1.0, style: BorderStyle.solid),
borderRadius: BorderRadius.circular(24),
borderRadius: BorderRadius.circular(BORDER_RADIUS),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: WitnetPallet.brightCyan, width: 2.0, style: BorderStyle.solid),
borderRadius: BorderRadius.circular(24),
borderRadius: BorderRadius.circular(BORDER_RADIUS),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: WitnetPallet.brightRed, width: 1.0, style: BorderStyle.solid),
borderRadius: BorderRadius.circular(24),
borderRadius: BorderRadius.circular(BORDER_RADIUS),
),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
color: WitnetPallet.brightRed, width: 1.0, style: BorderStyle.solid),
borderRadius: BorderRadius.circular(24),
borderRadius: BorderRadius.circular(BORDER_RADIUS),
),
border: OutlineInputBorder(
borderSide: BorderSide(
color: WitnetPallet.opacityWhite, width: 1.0, style: BorderStyle.solid),
borderRadius: BorderRadius.circular(24),
borderRadius: BorderRadius.circular(BORDER_RADIUS),
),
alignLabelWithHint: true,
);
TooltipThemeData tooltipTheme = TooltipThemeData(
margin: EdgeInsets.all(8),
padding: EdgeInsets.all(16),
padding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(24),
borderRadius: BorderRadius.circular(BORDER_RADIUS),
color: WitnetPallet.darkerGrey,
),
textStyle: bodyRegular.copyWith(color: WitnetPallet.white, fontSize: 12));
TextButtonThemeData textButtonTheme = TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: WitnetPallet.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(24))),
borderRadius: BorderRadius.all(Radius.circular(32))),
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
textStyle: bodyRegular.copyWith(fontSize: 16),
),
);
ElevatedButtonThemeData elevatedButtonTheme = ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 8),
foregroundColor: WitnetPallet.black,
backgroundColor: WitnetPallet.brightCyan,
disabledForegroundColor: WitnetPallet.mediumGrey,
disabledBackgroundColor: WitnetPallet.darkGrey2,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24)), // background color
borderRadius: BorderRadius.circular(BORDER_RADIUS)), // background color
textStyle: bodyRegular.copyWith(fontSize: 16),
),
);
OutlinedButtonThemeData outlinedButtonTheme = OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
foregroundColor: WitnetPallet.white,
disabledForegroundColor: Color.fromARGB(78, 240, 243, 245).withOpacity(0.38),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(BORDER_RADIUS)),
side: BorderSide(width: 1, color: WitnetPallet.white),
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 8),
textStyle: bodyRegular.copyWith(fontSize: 16),
));
CardTheme cardTheme = CardTheme(
Expand All @@ -153,7 +155,8 @@ IconThemeData iconTheme = IconThemeData(
size: 16,
);
ButtonThemeData buttonThemeData = ButtonThemeData(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)));
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(BORDER_RADIUS)));
IconThemeData primaryIconTheme = IconThemeData(
color: WitnetPallet.opacityWhite,
size: 24,
Expand All @@ -176,7 +179,7 @@ Color getColorPrimary(Set<WidgetState> states) {
if (states.any(activeStates.contains)) {
return WitnetPallet.brightCyan;
}
return WitnetPallet.lightGrey;
return WitnetPallet.mediumGrey;
}

Color getColorSecondary(Set<WidgetState> states) {
Expand Down
Loading

0 comments on commit f8aa541

Please sign in to comment.