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

CW-703: Better Seed UI/UX - Fix for Japanese PolySeeds #1875

Merged
merged 12 commits into from
Dec 13, 2024
30 changes: 17 additions & 13 deletions lib/src/screens/seed/wallet_seed_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/utils/clipboard_util.dart';
Expand Down Expand Up @@ -139,8 +138,8 @@ class WalletSeedPage extends BasePage {
fontSize: 12,
fontWeight: FontWeight.w800,
color: currentTheme.type == ThemeType.dark
? Colors.white.withOpacity(0.75)
: Colors.white.withOpacity(0.85),
? Colors.white.withOpacity(0.75)
: Colors.white.withOpacity(0.85),
),
),
),
Expand Down Expand Up @@ -188,19 +187,24 @@ class WalletSeedPage extends BasePage {
numberCount.toString(),
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w700,
color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor.withOpacity(0.5)
),
fontSize: 14,
fontWeight: FontWeight.w700,
color: Theme.of(context)
.extension<CakeTextTheme>()!
.buttonTextColor
.withOpacity(0.5)),
),
),
const SizedBox(width: 8),
Text(
'${item[0].toUpperCase()}${item.substring(1)}',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w700,
color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor
Expanded(
child: Text(
'${item[0].toUpperCase()}${item.substring(1)}',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w700,
color: Theme.of(context)
.extension<CakeTextTheme>()!
.buttonTextColor),
),
),
],
Expand Down
5 changes: 4 additions & 1 deletion lib/view_model/wallet_seed_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ abstract class WalletSeedViewModelBase with Store {
@observable
String seed;

List<String> get seedSplit => seed.split(' ');
/// The Regex split the words based on any whitespace character.
///
/// Either standard ASCII space (U+0020) or the full-width space character (U+3000) used by the Japanese.
List<String> get seedSplit => seed.split(RegExp(r'\s+'));

int get columnCount => seedSplit.length <= 16 ? 2 : 3;
}