mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
Merged cake-105
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user