mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 17:40:43 +00:00
e21cf7113d
* 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>
25 lines
713 B
Dart
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;
|
|
}
|