Merged cake-105

This commit is contained in:
M
2020-10-22 18:20:26 +03:00
5 changed files with 3905 additions and 179 deletions
+20
View File
@@ -8,6 +8,8 @@ import 'package:cake_wallet/entities/pathForWallet.dart';
import 'package:cake_wallet/entities/wallet_info.dart';
import 'package:cake_wallet/entities/wallet_type.dart';
import 'package:cake_wallet/store/app_store.dart';
import 'package:flutter/services.dart';
import 'dart:math';
part 'wallet_creation_vm.g.dart';
@@ -31,6 +33,24 @@ abstract class WalletCreationVMBase with Store {
final Box<WalletInfo> _walletInfoSource;
final AppStore _appStore;
Future<String> generateName() async {
final adjectiveStringRaw =
await rootBundle.loadString('assets/text/Wallet_Adjectives.txt');
final nounStringRaw =
await rootBundle.loadString('assets/text/Wallet_Nouns.txt');
final randomThing = new Random();
final adjectives = new List<String>.from(adjectiveStringRaw.split("\n"));
final nouns = new List<String>.from(nounStringRaw.split("\n"));
final chosenAdjective = adjectives[randomThing.nextInt(adjectives.length)];
final chosenNoun = nouns[randomThing.nextInt(nouns.length)];
final returnString = chosenAdjective + " " + chosenNoun;
return returnString;
}
Future<void> create({dynamic options}) async {
try {
state = IsExecutingState();