prevent using same wallet name as existing (#391)

* Add wallet name validation
This commit is contained in:
Serhii
2022-06-29 18:21:21 +01:00
committed by GitHub
parent dc623f3293
commit 02533d68a0
25 changed files with 137 additions and 51 deletions
+6 -2
View File
@@ -1,3 +1,4 @@
import 'dart:convert';
import 'dart:math';
import 'package:flutter/services.dart';
@@ -14,8 +15,11 @@ Future<String> generateName() async {
await rootBundle.loadString('assets/text/Wallet_Adjectives.txt');
final nounStringRaw =
await rootBundle.loadString('assets/text/Wallet_Nouns.txt');
final adjectives = List<String>.from(adjectiveStringRaw.split('\n'));
final nouns = List<String>.from(nounStringRaw.split('\n'));
final ls = LineSplitter();
final adjectives = ls.convert(adjectiveStringRaw);
final nouns = ls.convert(nounStringRaw);
final chosenAdjective = adjectives[randomThing.nextInt(adjectives.length)];
final chosenNoun = nouns[randomThing.nextInt(nouns.length)];
final returnString =