cake_wallet/lib/view_model/wallet_seed_view_model.dart
David Adegoke e21cf7113d
CW-703: Better Seed UI/UX - Fix for Japanese PolySeeds (#1875)
* feat: Switch UI for seeds display

* feat: Add localization for disclaimer text

* fix: Modify color for warning on seeds screen

* Fix: Adjust UI styling for seed page

* chore: Revert podfile.lock

* Fix column colors

* Fix more colors

* Fix more colors and update strings

* fix: Error extracting seed words in Japanese because of spacing type used

---------

Co-authored-by: tuxpizza <tuxsudo@tux.pizza>
2024-12-13 21:44:39 +02:00

25 lines
713 B
Dart

import 'package:mobx/mobx.dart';
import 'package:cw_core/wallet_base.dart';
part 'wallet_seed_view_model.g.dart';
class WalletSeedViewModel = WalletSeedViewModelBase with _$WalletSeedViewModel;
abstract class WalletSeedViewModelBase with Store {
WalletSeedViewModelBase(WalletBase wallet)
: name = wallet.name,
seed = wallet.seed!;
@observable
String name;
@observable
String seed;
/// 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;
}