Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fonts #604

Merged
merged 9 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
"messageSigning01": "Prove the ownership of your address by adding your signature to a message.",
"messageToBeSigned": "Message to be signed",
"mined": "Mined",
"minerFeeHint": "By default, `Absolute fee` is selected.\\nTo set a custom weighted fee, you need to select 'Weighted'. \\nThe Weighted fee is automatically calculated by the wallet considering the network congestion and transaction weight multiplied by the value selected as custom.",
"minerFeeHint": "By default, 'Absolute fee' is selected.\nTo set a custom weighted fee, you need to select 'Weighted'. \nThe Weighted fee is automatically calculated by the wallet considering the network congestion and transaction weight multiplied by the value selected as custom.",
"minerFeeInputHint": "Input the miner fee",
"mintTxn": "Mint",
"minutes": "Minutes",
Expand Down
33 changes: 17 additions & 16 deletions lib/screens/create_wallet/build_wallet_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:flutter/material.dart';
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 @@ -145,7 +147,7 @@ class BuildWalletCardState extends State<BuildWalletCard>
flex: 1,
child: Text(
localization.buildWallet01,
style: theme.textTheme.bodyMedium,
style: theme.textTheme.bodyLarge,
))
]),
SizedBox(
Expand Down Expand Up @@ -225,6 +227,7 @@ class BuildWalletCardState extends State<BuildWalletCard>

Widget _cryptoBlocBuilder() {
final theme = Theme.of(context);
final extendedTheme = theme.extension<ExtendedTheme>()!;
return BlocBuilder<CryptoBloc, CryptoState>(
builder: (context, state) {
if (state is CryptoInitializingWalletState) {
Expand Down Expand Up @@ -261,7 +264,7 @@ class BuildWalletCardState extends State<BuildWalletCard>
Row(
children: [
Text(localization.buildWalletBalance,
style: theme.textTheme.bodyMedium),
style: theme.textTheme.titleMedium),
SizedBox(
height: 8,
),
Expand All @@ -273,12 +276,10 @@ class BuildWalletCardState extends State<BuildWalletCard>
targetValue: nanoWitToWit(balance),
curve: Interval(0, .5, curve: Curves.easeOut),
controller: _balanceController,
style: theme.textTheme.headlineSmall!.copyWith(
fontWeight: FontWeight.bold,
),
style: theme.textTheme.bodyMedium!,
),
SizedBox(width: 4),
Text('WIT', style: theme.textTheme.headlineSmall!),
Text('WIT', style: theme.textTheme.bodyMedium!),
]),
],
))
Expand All @@ -290,29 +291,29 @@ class BuildWalletCardState extends State<BuildWalletCard>
Row(
children: [
Text(localization.transactionsFound,
style: theme.textTheme.bodyMedium!),
style: theme.textTheme.titleMedium!),
AutoSizeText(
'$currentTransactionCount',
maxLines: 2,
minFontSize: 16,
style: theme.textTheme.headlineSmall!,
style: theme.textTheme.bodyMedium!,
)
],
),
if (isHdWallet)
Row(
children: [
AutoSizeText(
Text(
localization.exploredAddresses,
style: theme.textTheme.bodyMedium,
style: theme.textTheme.titleMedium,
),
AnimatedIntegerText(
initialValue: currentAddressCount,
// TODO:targetValue: addressCount,
targetValue: currentAddressCount,
curve: Interval(0, .5, curve: Curves.easeOut),
controller: _balanceController,
style: theme.textTheme.headlineSmall!)
style: theme.textTheme.bodyMedium!)
],
),
SizedBox(
Expand All @@ -322,15 +323,15 @@ class BuildWalletCardState extends State<BuildWalletCard>
children: [
Text(
localization.exploringAddress,
style: theme.textTheme.bodyLarge!,
style: theme.textTheme.titleMedium!,
),
Expanded(
flex: 1,
child: Text(
state.message,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.headlineSmall,
)),
state.message.contains('wit1')
? state.message.cropMiddle(18)
: state.message,
gabaldon marked this conversation as resolved.
Show resolved Hide resolved
style: extendedTheme.monoMediumText)),
],
),
],
Expand Down
6 changes: 2 additions & 4 deletions 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 Expand Up @@ -72,7 +71,6 @@ class ConfirmMnemonicCardState extends State<ConfirmMnemonicCard>
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final extendedTheme = theme.extension<ExtendedTheme>()!;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expand All @@ -85,13 +83,13 @@ class ConfirmMnemonicCardState extends State<ConfirmMnemonicCard>
),
Text(
localization.confirmMnemonic01,
style: theme.textTheme.bodyMedium,
style: theme.textTheme.bodyLarge,
),
SizedBox(
height: 16,
),
TextField(
style: extendedTheme.monoBoldText,
style: theme.textTheme.titleLarge,
gabaldon marked this conversation as resolved.
Show resolved Hide resolved
keyboardType: TextInputType.text,
textInputAction: TextInputAction.go,
maxLines: 3,
Expand Down
8 changes: 4 additions & 4 deletions lib/screens/create_wallet/create_import_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CreateImportWalletState extends State<CreateImportWallet> {
children: [
Padding(
padding: EdgeInsets.only(top: 7, bottom: 7),
child: _buildInitialButtons(context, theme),
child: _buildContent(context, theme),
),
Padding(padding: EdgeInsets.all(7)),
],
Expand Down Expand Up @@ -107,7 +107,7 @@ class CreateImportWalletState extends State<CreateImportWallet> {
super.initState();
}

Widget _buildInitialButtons(BuildContext context, ThemeData theme) {
Widget _buildContent(BuildContext context, ThemeData theme) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
Expand All @@ -123,11 +123,11 @@ class CreateImportWalletState extends State<CreateImportWallet> {
SizedBox(height: 16),
Text(
localization.createImportWallet01,
style: theme.textTheme.bodyMedium,
style: theme.textTheme.bodyLarge,
),
SizedBox(height: 16),
Text(localization.createImportWallet02,
style: theme.textTheme.bodyMedium)
style: theme.textTheme.bodyLarge)
],
);
}
Expand Down
12 changes: 6 additions & 6 deletions lib/screens/create_wallet/disclaimer_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,27 @@ class DisclaimerCardState extends State<DisclaimerCard>
SizedBox(
height: 8,
),
Text(localization.walletSecurity01, style: theme.textTheme.bodyMedium),
Text(localization.walletSecurity01, style: theme.textTheme.bodyLarge),
SizedBox(
height: 8,
),
Text(localization.walletSecurity02, style: theme.textTheme.bodyMedium),
Text(localization.walletSecurity02, style: theme.textTheme.bodyLarge),
SizedBox(
height: 8,
),
Text(localization.walletSecurity03, style: theme.textTheme.bodyMedium),
Text(localization.walletSecurity03, style: theme.textTheme.bodyLarge),
SizedBox(
height: 8,
),
Text(localization.walletSecurity04, style: theme.textTheme.bodyMedium),
Text(localization.walletSecurity04, style: theme.textTheme.bodyLarge),
SizedBox(
height: 8,
),
Text(localization.walletSecurity05, style: theme.textTheme.bodyMedium),
Text(localization.walletSecurity05, style: theme.textTheme.bodyLarge),
SizedBox(
height: 4,
),
Text(localization.walletSecurity06, style: theme.textTheme.bodyMedium),
Text(localization.walletSecurity06, style: theme.textTheme.bodyLarge),
SizedBox(
height: 8,
),
Expand Down
Loading
Loading