Fix UTF-8 accent support
This commit is contained in:
parent
fbff8a6a91
commit
7eceac3f66
File diff suppressed because it is too large
Load Diff
|
@ -330,12 +330,19 @@ class GenerateWalletsProvider with ChangeNotifier {
|
||||||
|
|
||||||
bool isBipWord(String word) {
|
bool isBipWord(String word) {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|
||||||
|
// Needed for bad encoding of UTF-8
|
||||||
|
word = word.replaceAll('é', 'é');
|
||||||
|
word = word.replaceAll('è', 'è');
|
||||||
return bip39Words.contains(word);
|
return bip39Words.contains(word);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isBipWordsList(List words) {
|
bool isBipWordsList(List words) {
|
||||||
bool isValid = true;
|
bool isValid = true;
|
||||||
for (String word in words) {
|
for (String word in words) {
|
||||||
|
// Needed for bad encoding of UTF-8
|
||||||
|
word = word.replaceAll('é', 'é');
|
||||||
|
word = word.replaceAll('è', 'è');
|
||||||
if (!bip39Words.contains(word)) {
|
if (!bip39Words.contains(word)) {
|
||||||
isValid = false;
|
isValid = false;
|
||||||
}
|
}
|
||||||
|
@ -383,16 +390,14 @@ class GenerateWalletsProvider with ChangeNotifier {
|
||||||
Future<bool> isSentenceValid() async {
|
Future<bool> isSentenceValid() async {
|
||||||
String inputMnemonic =
|
String inputMnemonic =
|
||||||
'${cellController0.text} ${cellController1.text} ${cellController2.text} ${cellController3.text} ${cellController4.text} ${cellController5.text} ${cellController6.text} ${cellController7.text} ${cellController8.text} ${cellController9.text} ${cellController10.text} ${cellController11.text}';
|
'${cellController0.text} ${cellController1.text} ${cellController2.text} ${cellController3.text} ${cellController4.text} ${cellController5.text} ${cellController6.text} ${cellController7.text} ${cellController8.text} ${cellController9.text} ${cellController10.text} ${cellController11.text}';
|
||||||
//TODO: Fix bad accent management
|
|
||||||
|
|
||||||
// inputMnemonic = inputMnemonic.replaceAll('é', 'eM-LM-^A');
|
// Needed for bad encoding of UTF-8
|
||||||
// inputMnemonic = inputMnemonic.replaceAll('è', 'eM-LM-^@');
|
inputMnemonic = inputMnemonic.replaceAll('é', 'é');
|
||||||
|
inputMnemonic = inputMnemonic.replaceAll('è', 'è');
|
||||||
|
|
||||||
NewWallet generatedWallet =
|
NewWallet generatedWallet =
|
||||||
await generateWallet(inputMnemonic, isImport: true);
|
await generateWallet(inputMnemonic, isImport: true);
|
||||||
|
|
||||||
log.d(inputMnemonic);
|
|
||||||
|
|
||||||
if (generatedWallet == null) {
|
if (generatedWallet == null) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -18,6 +18,8 @@ class RestoreChest extends StatelessWidget {
|
||||||
GenerateWalletsProvider generateWalletProvider =
|
GenerateWalletsProvider generateWalletProvider =
|
||||||
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
||||||
|
|
||||||
|
generateWalletProvider.actualWallet = null;
|
||||||
|
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () {
|
onWillPop: () {
|
||||||
generateWalletProvider.resetImportView();
|
generateWalletProvider.resetImportView();
|
||||||
|
@ -124,7 +126,7 @@ class RestoreChest extends StatelessWidget {
|
||||||
key: const Key('importText'),
|
key: const Key('importText'),
|
||||||
textAlign: TextAlign.justify,
|
textAlign: TextAlign.justify,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: Colors.black, fontSize: 21, fontWeight: FontWeight.w400),
|
color: Colors.black, fontSize: 19, fontWeight: FontWeight.w400),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ description: Pay with G1.
|
||||||
# pub.dev using `pub publish`. This is preferred for private packages.
|
# pub.dev using `pub publish`. This is preferred for private packages.
|
||||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
version: 0.0.3+2
|
version: 0.0.3+3
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.7.0 <3.0.0"
|
sdk: ">=2.7.0 <3.0.0"
|
||||||
|
|
Loading…
Reference in New Issue