mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
prevent using same wallet name as existing (#391)
* Add wallet name validation
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user