WIP: Continue digging global substratization
This commit is contained in:
parent
b1b27743a0
commit
a72390f428
|
@ -1,5 +1,3 @@
|
|||
[
|
||||
"https://g1.librelois.fr/gva",
|
||||
"https://duniter-gva.axiom-team.fr/gva",
|
||||
"https://duniter-g1.p2p.legal/gva"
|
||||
"https://g1.librelois.fr/gva"
|
||||
]
|
||||
|
|
|
@ -22,7 +22,8 @@ late Box configBox;
|
|||
late Box<G1WalletsList> g1WalletsBox;
|
||||
// late Box keystoreBox;
|
||||
|
||||
String cesiumPod = "https://g1.data.le-sou.org";
|
||||
// String cesiumPod = "https://g1.data.le-sou.org";
|
||||
String cesiumPod = "https://g1.data.presles.fr";
|
||||
// String cesiumPod = "https://g1.data.e-is.pro";
|
||||
|
||||
// Responsive ratios
|
||||
|
|
|
@ -20,7 +20,6 @@ import 'dart:io';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/providers/cesium_plus.dart';
|
||||
import 'package:gecko/providers/change_pin.dart';
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:gecko/providers/chest_provider.dart';
|
||||
import 'package:gecko/models/g1_wallets_list.dart';
|
||||
|
@ -71,17 +70,18 @@ Future<void> main() async {
|
|||
walletBox = await Hive.openBox<WalletData>("walletBox");
|
||||
chestBox = await Hive.openBox<ChestData>("chestBox");
|
||||
configBox = await Hive.openBox("configBox");
|
||||
await Hive.deleteBoxFromDisk('g1WalletsBox');
|
||||
g1WalletsBox = await Hive.openBox<G1WalletsList>("g1WalletsBox");
|
||||
// keystoreBox = await Hive.openBox("keystoreBox");
|
||||
|
||||
g1WalletsBox.clear();
|
||||
// g1WalletsBox.clear();
|
||||
|
||||
// final HiveStore _store =
|
||||
// await HiveStore.open(path: '${appPath.path}/gqlCache');
|
||||
|
||||
// Get a valid GVA endpoint
|
||||
// endPointGVA = 'https://g1.librelois.fr/gva';
|
||||
endPointGVA = 'https://duniter-g1.p2p.legal/gva';
|
||||
endPointGVA = 'https://g1.librelois.fr/gva';
|
||||
// endPointGVA = 'https://duniter-g1.p2p.legal/gva';
|
||||
// await _homeProvider.getValidEndpoint();
|
||||
|
||||
// if (endPointGVA == 'HS') {
|
||||
|
@ -156,7 +156,6 @@ class Gecko extends StatelessWidget {
|
|||
ChangeNotifierProvider(create: (_) => ChestProvider()),
|
||||
ChangeNotifierProvider(create: (_) => GenerateWalletsProvider()),
|
||||
ChangeNotifierProvider(create: (_) => WalletOptionsProvider()),
|
||||
ChangeNotifierProvider(create: (_) => ChangePinProvider()),
|
||||
ChangeNotifierProvider(create: (_) => SearchProvider()),
|
||||
ChangeNotifierProvider(create: (_) => CesiumPlusProvider()),
|
||||
ChangeNotifierProvider(create: (_) => SubstrateSdk())
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -7,7 +7,7 @@ part 'chest_data.g.dart';
|
|||
@HiveType(typeId: 1)
|
||||
class ChestData extends HiveObject {
|
||||
@HiveField(0)
|
||||
String? dewif;
|
||||
String? address;
|
||||
|
||||
@HiveField(1)
|
||||
String? rootAddress;
|
||||
|
@ -28,7 +28,7 @@ class ChestData extends HiveObject {
|
|||
bool? isCesium;
|
||||
|
||||
ChestData({
|
||||
this.dewif,
|
||||
this.address,
|
||||
this.rootAddress,
|
||||
this.name,
|
||||
this.defaultWallet,
|
||||
|
|
|
@ -17,7 +17,7 @@ class ChestDataAdapter extends TypeAdapter<ChestData> {
|
|||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return ChestData(
|
||||
dewif: fields[0] as String?,
|
||||
address: fields[0] as String?,
|
||||
rootAddress: fields[1] as String?,
|
||||
name: fields[2] as String?,
|
||||
defaultWallet: fields[3] as int?,
|
||||
|
@ -32,7 +32,7 @@ class ChestDataAdapter extends TypeAdapter<ChestData> {
|
|||
writer
|
||||
..writeByte(7)
|
||||
..writeByte(0)
|
||||
..write(obj.dewif)
|
||||
..write(obj.address)
|
||||
..writeByte(1)
|
||||
..write(obj.rootAddress)
|
||||
..writeByte(2)
|
||||
|
|
|
@ -11,19 +11,19 @@ class G1WalletsList {
|
|||
@HiveField(1)
|
||||
double? balance;
|
||||
|
||||
@HiveField(3)
|
||||
@HiveField(2)
|
||||
Id? id;
|
||||
|
||||
@HiveField(4)
|
||||
@HiveField(3)
|
||||
Image? avatar;
|
||||
|
||||
@HiveField(5)
|
||||
@HiveField(4)
|
||||
String? username;
|
||||
|
||||
@HiveField(6)
|
||||
@HiveField(5)
|
||||
String? csName;
|
||||
|
||||
@HiveField(7)
|
||||
@HiveField(6)
|
||||
bool? isMembre;
|
||||
|
||||
G1WalletsList({
|
||||
|
|
|
@ -19,11 +19,11 @@ class G1WalletsListAdapter extends TypeAdapter<G1WalletsList> {
|
|||
return G1WalletsList(
|
||||
pubkey: fields[0] as String?,
|
||||
balance: fields[1] as double?,
|
||||
id: fields[3] as Id?,
|
||||
avatar: fields[4] as Image?,
|
||||
username: fields[5] as String?,
|
||||
csName: fields[6] as String?,
|
||||
isMembre: fields[7] as bool?,
|
||||
id: fields[2] as Id?,
|
||||
avatar: fields[3] as Image?,
|
||||
username: fields[4] as String?,
|
||||
csName: fields[5] as String?,
|
||||
isMembre: fields[6] as bool?,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -35,15 +35,15 @@ class G1WalletsListAdapter extends TypeAdapter<G1WalletsList> {
|
|||
..write(obj.pubkey)
|
||||
..writeByte(1)
|
||||
..write(obj.balance)
|
||||
..writeByte(3)
|
||||
..writeByte(2)
|
||||
..write(obj.id)
|
||||
..writeByte(4)
|
||||
..writeByte(3)
|
||||
..write(obj.avatar)
|
||||
..writeByte(5)
|
||||
..writeByte(4)
|
||||
..write(obj.username)
|
||||
..writeByte(6)
|
||||
..writeByte(5)
|
||||
..write(obj.csName)
|
||||
..writeByte(7)
|
||||
..writeByte(6)
|
||||
..write(obj.isMembre);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,22 +8,26 @@ class WalletData extends HiveObject {
|
|||
int? chest;
|
||||
|
||||
@HiveField(1)
|
||||
int? number;
|
||||
String? address;
|
||||
|
||||
@HiveField(2)
|
||||
String? name;
|
||||
int? number;
|
||||
|
||||
@HiveField(3)
|
||||
int? derivation;
|
||||
String? name;
|
||||
|
||||
@HiveField(4)
|
||||
String? imageName;
|
||||
int? derivation;
|
||||
|
||||
@HiveField(5)
|
||||
String? imageName;
|
||||
|
||||
@HiveField(6)
|
||||
File? imageFile;
|
||||
|
||||
WalletData(
|
||||
{this.chest,
|
||||
this.address,
|
||||
this.number,
|
||||
this.name,
|
||||
this.derivation,
|
||||
|
@ -46,3 +50,10 @@ class WalletData extends HiveObject {
|
|||
return [chest, number];
|
||||
}
|
||||
}
|
||||
|
||||
class NewWallet {
|
||||
final String address;
|
||||
final String password;
|
||||
|
||||
NewWallet._(this.address, this.password);
|
||||
}
|
||||
|
|
|
@ -18,29 +18,32 @@ class WalletDataAdapter extends TypeAdapter<WalletData> {
|
|||
};
|
||||
return WalletData(
|
||||
chest: fields[0] as int?,
|
||||
number: fields[1] as int?,
|
||||
name: fields[2] as String?,
|
||||
derivation: fields[3] as int?,
|
||||
imageName: fields[4] as String?,
|
||||
imageFile: fields[5] as File?,
|
||||
address: fields[1] as String?,
|
||||
number: fields[2] as int?,
|
||||
name: fields[3] as String?,
|
||||
derivation: fields[4] as int?,
|
||||
imageName: fields[5] as String?,
|
||||
imageFile: fields[6] as File?,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, WalletData obj) {
|
||||
writer
|
||||
..writeByte(6)
|
||||
..writeByte(7)
|
||||
..writeByte(0)
|
||||
..write(obj.chest)
|
||||
..writeByte(1)
|
||||
..write(obj.number)
|
||||
..write(obj.address)
|
||||
..writeByte(2)
|
||||
..write(obj.name)
|
||||
..write(obj.number)
|
||||
..writeByte(3)
|
||||
..write(obj.derivation)
|
||||
..write(obj.name)
|
||||
..writeByte(4)
|
||||
..write(obj.imageName)
|
||||
..write(obj.derivation)
|
||||
..writeByte(5)
|
||||
..write(obj.imageName)
|
||||
..writeByte(6)
|
||||
..write(obj.imageFile);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
import 'package:durt/durt.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
|
||||
class ChangePinProvider with ChangeNotifier {
|
||||
bool ischangedPin = false;
|
||||
TextEditingController newPin = TextEditingController();
|
||||
String? pinToGive;
|
||||
|
||||
NewWallet? get badWallet => null;
|
||||
|
||||
Future<NewWallet?> changePin(String _oldPin, {String? newCustomPin}) async {
|
||||
final NewWallet newWalletFile;
|
||||
try {
|
||||
final _chest = chestBox.get(configBox.get('currentChest'))!;
|
||||
|
||||
if (_chest.isCesium!) {
|
||||
newWalletFile = await Dewif().changeCesiumPassword(
|
||||
dewif: _chest.dewif!,
|
||||
oldPassword: _oldPin.toUpperCase(),
|
||||
newPassword: newCustomPin);
|
||||
} else {
|
||||
newWalletFile = await Dewif().changePassword(
|
||||
dewif: _chest.dewif!,
|
||||
oldPassword: _oldPin.toUpperCase(),
|
||||
newPassword: newCustomPin);
|
||||
}
|
||||
newPin.text = pinToGive = newWalletFile.password;
|
||||
ischangedPin = true;
|
||||
// notifyListeners();
|
||||
return newWalletFile;
|
||||
} catch (e) {
|
||||
log.e('Impossible de changer le code PIN: $e');
|
||||
return badWallet;
|
||||
}
|
||||
}
|
||||
|
||||
void storeNewPinChest(context, NewWallet _newWalletFile) {
|
||||
// ChestData currentChest = chestBox.getAt(configBox.get('currentChest'));
|
||||
// currentChest.dewif = _newWalletFile.dewif;
|
||||
// await chestBox.add(currentChest);
|
||||
|
||||
chestBox.get(configBox.get('currentChest'))!.dewif = _newWalletFile.dewif;
|
||||
|
||||
Navigator.pop(context, pinToGive);
|
||||
pinToGive = '';
|
||||
}
|
||||
}
|
|
@ -72,7 +72,7 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
chestName = 'Coffre à Ğecko ${chestNumber + 1}';
|
||||
}
|
||||
ChestData thisChest = ChestData(
|
||||
dewif: address,
|
||||
address: address,
|
||||
name: chestName,
|
||||
defaultWallet: 0,
|
||||
imageName: '${chestNumber % 8}.png',
|
||||
|
@ -83,6 +83,7 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
|
||||
WalletData myWallet = WalletData(
|
||||
chest: chestKey,
|
||||
address: address,
|
||||
number: 0,
|
||||
name: _name,
|
||||
derivation: 3,
|
||||
|
@ -228,55 +229,55 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
log.d(_walletPubkey);
|
||||
}
|
||||
|
||||
Future<int?> importCesiumWallet() async {
|
||||
// String _walletPubkey = await DubpRust.getLegacyPublicKey(
|
||||
// salt: _cesiumID, password: _cesiumPWD);
|
||||
// String shortPubkey = truncate(_walletPubkey, 9,
|
||||
// omission: "...", position: TruncatePosition.end);
|
||||
// await storeWallet(
|
||||
// actualWallet, 'Portefeuille Cesium - $shortPubkey', context);
|
||||
// NewWallet myCesiumWallet = await DubpRust.genWalletFromDeprecatedSaltPassword(salt: _cesiumID, password: _cesiumPWD);
|
||||
// Future<int?> importCesiumWallet() async {
|
||||
// // String _walletPubkey = await DubpRust.getLegacyPublicKey(
|
||||
// // salt: _cesiumID, password: _cesiumPWD);
|
||||
// // String shortPubkey = truncate(_walletPubkey, 9,
|
||||
// // omission: "...", position: TruncatePosition.end);
|
||||
// // await storeWallet(
|
||||
// // actualWallet, 'Portefeuille Cesium - $shortPubkey', context);
|
||||
// // NewWallet myCesiumWallet = await DubpRust.genWalletFromDeprecatedSaltPassword(salt: _cesiumID, password: _cesiumPWD);
|
||||
|
||||
cesiumID.text = '';
|
||||
cesiumPWD.text = '';
|
||||
cesiumPubkey.text = '';
|
||||
canImport = false;
|
||||
isCesiumIDVisible = false;
|
||||
isCesiumPWDVisible = false;
|
||||
// cesiumID.text = '';
|
||||
// cesiumPWD.text = '';
|
||||
// cesiumPubkey.text = '';
|
||||
// canImport = false;
|
||||
// isCesiumIDVisible = false;
|
||||
// isCesiumPWDVisible = false;
|
||||
|
||||
int chestNumber = 0;
|
||||
chestBox.toMap().forEach((key, value) {
|
||||
if (value.isCesium!) {
|
||||
chestNumber++;
|
||||
}
|
||||
});
|
||||
// int chestNumber = 0;
|
||||
// chestBox.toMap().forEach((key, value) {
|
||||
// if (value.isCesium!) {
|
||||
// chestNumber++;
|
||||
// }
|
||||
// });
|
||||
|
||||
String chestName;
|
||||
if (chestNumber == 0) {
|
||||
chestName = 'Coffre à Césium';
|
||||
} else {
|
||||
chestName = 'Coffre à Césium ${chestNumber + 1}';
|
||||
}
|
||||
// String chestName;
|
||||
// if (chestNumber == 0) {
|
||||
// chestName = 'Coffre à Césium';
|
||||
// } else {
|
||||
// chestName = 'Coffre à Césium ${chestNumber + 1}';
|
||||
// }
|
||||
|
||||
log.d(pin.text);
|
||||
durt.NewWallet cesiumDewif =
|
||||
await durt.Dewif().generateCesiumDewif(cesiumWallet.seed, pin.text);
|
||||
// log.d(pin.text);
|
||||
// durt.NewWallet cesiumDewif =
|
||||
// await durt.Dewif().generateCesiumDewif(cesiumWallet.seed, pin.text);
|
||||
|
||||
ChestData cesiumChest = ChestData(
|
||||
dewif: cesiumDewif.dewif,
|
||||
name: chestName,
|
||||
imageName: 'cesium.png',
|
||||
defaultWallet: 0,
|
||||
isCesium: true);
|
||||
// ChestData cesiumChest = ChestData(
|
||||
// dewif: cesiumDewif.dewif,
|
||||
// name: chestName,
|
||||
// imageName: 'cesium.png',
|
||||
// defaultWallet: 0,
|
||||
// isCesium: true);
|
||||
|
||||
await chestBox.add(cesiumChest).then((value) => null);
|
||||
int? chestKey = await chestBox.toMap().keys.last;
|
||||
// chestBox.toMap().
|
||||
await configBox.put('currentChest', chestKey);
|
||||
// await chestBox.add(cesiumChest).then((value) => null);
|
||||
// int? chestKey = await chestBox.toMap().keys.last;
|
||||
// // chestBox.toMap().
|
||||
// await configBox.put('currentChest', chestKey);
|
||||
|
||||
pin.text = '';
|
||||
return chestKey;
|
||||
}
|
||||
// pin.text = '';
|
||||
// return chestKey;
|
||||
// }
|
||||
|
||||
void cesiumIDisVisible() {
|
||||
isCesiumIDVisible = !isCesiumIDVisible;
|
||||
|
@ -296,8 +297,7 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
}
|
||||
|
||||
Future<List<String>> generateWordList(BuildContext context) async {
|
||||
SubstrateSdk _sdk =
|
||||
Provider.of<SubstrateSdk>(context, listen: false);
|
||||
SubstrateSdk _sdk = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
|
||||
generatedMnemonic = await _sdk.generateMnemonic(lang: appLang);
|
||||
List<String> _wordsList = [];
|
||||
|
@ -318,7 +318,7 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
// Needed for bad encoding of UTF-8
|
||||
word = word.replaceAll('é', 'é');
|
||||
word = word.replaceAll('è', 'è');
|
||||
return bip39Words.contains(word);
|
||||
return bip39Words(appLang).contains(word);
|
||||
}
|
||||
|
||||
bool isBipWordsList(List<String> words) {
|
||||
|
@ -327,7 +327,7 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
// Needed for bad encoding of UTF-8
|
||||
word = word.replaceAll('é', 'é');
|
||||
word = word.replaceAll('è', 'è');
|
||||
if (!bip39Words.contains(word)) {
|
||||
if (!bip39Words(appLang).contains(word)) {
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import 'dart:typed_data';
|
||||
|
||||
import 'package:durt/durt.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:async';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class MyWalletsProvider with ChangeNotifier {
|
||||
List<WalletData> listWallets = [];
|
||||
|
@ -21,24 +22,6 @@ class MyWalletsProvider with ChangeNotifier {
|
|||
return configBox.get('currentChest');
|
||||
}
|
||||
|
||||
String dewifToMnemonic(context, WalletData _wallet, String _pin) {
|
||||
String _mnemonic;
|
||||
|
||||
try {
|
||||
String _localDewif = chestBox.get(_wallet.chest)!.dewif!;
|
||||
_mnemonic = Dewif()
|
||||
.mnemonicFromDewif(_localDewif, _pin.toUpperCase(), lang: appLang);
|
||||
} on ChecksumException catch (e) {
|
||||
log.e(e.cause);
|
||||
return 'bad';
|
||||
} catch (e) {
|
||||
// _homeProvider.playSound('non', 0.6);
|
||||
log.e('ERROR READING FILE: $e');
|
||||
return 'bad';
|
||||
}
|
||||
return _mnemonic;
|
||||
}
|
||||
|
||||
bool checkIfWalletExist() {
|
||||
if (chestBox.isEmpty) {
|
||||
log.i('No wallets detected');
|
||||
|
@ -150,8 +133,19 @@ class MyWalletsProvider with ChangeNotifier {
|
|||
_newWalletNbr = _walletConfig.last.number! + 1;
|
||||
}
|
||||
|
||||
MyWalletsProvider myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
|
||||
SubstrateSdk _sdk = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
|
||||
final int? _currentChestNumber = myWalletProvider.getCurrentChest();
|
||||
final ChestData _currentChest = chestBox.get(_currentChestNumber)!;
|
||||
|
||||
final address = await _sdk.derive(context, _currentChest.address!, _newDerivationNbr, pinCode);
|
||||
|
||||
WalletData newWallet = WalletData(
|
||||
chest: _chest,
|
||||
address: address,
|
||||
number: _newWalletNbr,
|
||||
name: _name,
|
||||
derivation: _newDerivationNbr,
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:crypto/crypto.dart';
|
|||
import 'package:fast_base58/fast_base58.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:polkawallet_sdk/api/apiKeyring.dart';
|
||||
import 'package:polkawallet_sdk/api/types/networkParams.dart';
|
||||
import 'package:polkawallet_sdk/api/types/txInfoData.dart';
|
||||
|
@ -69,7 +70,8 @@ class SubstrateSdk with ChangeNotifier {
|
|||
Future<String> importAccount(
|
||||
{String mnemonic = '',
|
||||
bool fromMnemonic = false,
|
||||
String derivePath = ''}) async {
|
||||
String derivePath = '',
|
||||
String password = ''}) async {
|
||||
// toy exercise immense month enter answer table prefer speed cycle gold phone
|
||||
final clipboardData = await Clipboard.getData(Clipboard.kTextPlain);
|
||||
if (mnemonic != '') {
|
||||
|
@ -80,6 +82,10 @@ class SubstrateSdk with ChangeNotifier {
|
|||
generatedMnemonic = clipboardData.text!;
|
||||
}
|
||||
|
||||
if (password == '') {
|
||||
password = keystorePassword.text;
|
||||
}
|
||||
|
||||
final KeyType keytype;
|
||||
final String keyToImport;
|
||||
if (fromMnemonic) {
|
||||
|
@ -97,8 +103,8 @@ class SubstrateSdk with ChangeNotifier {
|
|||
.importAccount(keyring,
|
||||
keyType: keytype,
|
||||
key: keyToImport,
|
||||
name: 'testKey',
|
||||
password: keystorePassword.text,
|
||||
name: derivePath,
|
||||
password: password,
|
||||
derivePath: derivePath,
|
||||
cryptoType: CryptoType.sr25519)
|
||||
.catchError((e) {
|
||||
|
@ -107,16 +113,16 @@ class SubstrateSdk with ChangeNotifier {
|
|||
});
|
||||
if (json == null) return '';
|
||||
print(json);
|
||||
late KeyPairData? keyPairData;
|
||||
try {
|
||||
keyPairData = await sdk.api.keyring.addAccount(
|
||||
await sdk.api.keyring.addAccount(
|
||||
keyring,
|
||||
keyType: keytype,
|
||||
acc: json,
|
||||
password: keystorePassword.text,
|
||||
password: password,
|
||||
);
|
||||
// Clipboard.setData(ClipboardData(text: jsonEncode(acc.toJson())));
|
||||
} catch (e) {
|
||||
print(e);
|
||||
importIsLoading = false;
|
||||
notifyListeners();
|
||||
}
|
||||
|
@ -124,7 +130,8 @@ class SubstrateSdk with ChangeNotifier {
|
|||
importIsLoading = false;
|
||||
await Future.delayed(const Duration(milliseconds: 20));
|
||||
notifyListeners();
|
||||
return keyPairData!.address!;
|
||||
final bakedAddress = keyring.allAccounts.last.address;
|
||||
return bakedAddress!;
|
||||
}
|
||||
|
||||
void reload() {
|
||||
|
@ -142,23 +149,56 @@ class SubstrateSdk with ChangeNotifier {
|
|||
// account.balance = int.parse(p0.freeBalance) / 100;
|
||||
// });
|
||||
// sdk.api.setting.unsubscribeBestNumber();
|
||||
if (nodeConnected) {
|
||||
final brutBalance = await sdk.api.account.queryBalance(element.address);
|
||||
account.balance = int.parse(brutBalance!.freeBalance) / 100;
|
||||
}
|
||||
account.balance = await getBalance(element.address!);
|
||||
result.add(account);
|
||||
print('waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
|
||||
print(element.indexInfo);
|
||||
print(element.memo);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Future<double> getBalance(String address, {bool isUd = false}) async {
|
||||
double balance = 0.0;
|
||||
if (nodeConnected) {
|
||||
final brutBalance = await sdk.api.account.queryBalance(address);
|
||||
balance = int.parse(brutBalance!.freeBalance) / 100;
|
||||
}
|
||||
return balance;
|
||||
}
|
||||
|
||||
KeyPairData getKeypair(String address) {
|
||||
return keyring.keyPairs.firstWhere((kp) => kp.address == address,
|
||||
orElse: (() => KeyPairData()));
|
||||
}
|
||||
|
||||
Future<bool> checkPassword(String address, String pass) async {
|
||||
final account = getKeypair(address);
|
||||
return await sdk.api.keyring.checkPassword(account, pass);
|
||||
}
|
||||
|
||||
int getDerivationNumber(String address) {
|
||||
final account = getKeypair(address);
|
||||
final deriveNbr = account.name!.split('/')[1];
|
||||
return int.parse(deriveNbr);
|
||||
}
|
||||
|
||||
Future<KeyPairData?> changePassword(
|
||||
String address, String passOld, String? passNew) async {
|
||||
final account = getKeypair(address);
|
||||
keyring.setCurrent(account);
|
||||
|
||||
return await sdk.api.keyring.changePassword(keyring, passOld, passNew);
|
||||
}
|
||||
|
||||
Future<void> deleteAllAccounts() async {
|
||||
for (var account in keyring.allAccounts) {
|
||||
await sdk.api.keyring.deleteAccount(keyring, account);
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> generateMnemonic({String lang = 'english'}) async {
|
||||
Future<String> generateMnemonic({String lang = appLang}) async {
|
||||
final gen = await sdk.api.keyring.generateMnemonic(ss58);
|
||||
generatedMnemonic = gen.mnemonic!;
|
||||
|
||||
|
@ -192,16 +232,16 @@ class SubstrateSdk with ChangeNotifier {
|
|||
}
|
||||
}
|
||||
|
||||
derive(
|
||||
Future<String> derive(
|
||||
BuildContext context, String address, int number, String password) async {
|
||||
final keypair =
|
||||
keyring.keyPairs.firstWhere((element) => element.address == address);
|
||||
final keypair = getKeypair(address);
|
||||
|
||||
final seedMap =
|
||||
await keyring.store.getDecryptedSeed(keypair.pubKey, password);
|
||||
print(seedMap);
|
||||
if (seedMap!['type'] != 'mnemonic') return;
|
||||
final List seedList = seedMap['seed'].split('/');
|
||||
|
||||
if (seedMap?['type'] != 'mnemonic') return '';
|
||||
final List seedList = seedMap!['seed'].split('/');
|
||||
generatedMnemonic = seedList[0];
|
||||
int sourceDerivation = -1; // To get derivation number of this account
|
||||
if (seedList.length > 1) {
|
||||
|
@ -210,7 +250,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
print(generatedMnemonic);
|
||||
print(sourceDerivation);
|
||||
|
||||
importAccount(fromMnemonic: true, derivePath: '/$number');
|
||||
return await importAccount(fromMnemonic: true, derivePath: '/$number');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'dart:io';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:durt/durt.dart';
|
||||
import 'package:fast_base58/fast_base58.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:async';
|
||||
|
@ -12,7 +11,7 @@ import 'package:image_picker/image_picker.dart';
|
|||
import 'package:truncate/truncate.dart';
|
||||
|
||||
class WalletOptionsProvider with ChangeNotifier {
|
||||
TextEditingController pubkey = TextEditingController();
|
||||
TextEditingController address = TextEditingController();
|
||||
final TextEditingController _newWalletName = TextEditingController();
|
||||
bool isWalletUnlock = false;
|
||||
bool ischangedPin = false;
|
||||
|
@ -25,82 +24,6 @@ class WalletOptionsProvider with ChangeNotifier {
|
|||
|
||||
Future<NewWallet>? get badWallet => null;
|
||||
|
||||
String _getPubkeyFromDewif(
|
||||
String? _dewif, _pin, int _pinLenght, int? derivation) {
|
||||
RegExp regExp = RegExp(
|
||||
r'^[A-Z0-9]+$',
|
||||
caseSensitive: false,
|
||||
multiLine: false,
|
||||
);
|
||||
|
||||
if (regExp.hasMatch(_pin) == true && _pin.length == _pinLenght) {
|
||||
} else {
|
||||
return 'false';
|
||||
}
|
||||
if (derivation != -1) {
|
||||
try {
|
||||
final _wallet = HdWallet.fromDewif(_dewif!, _pin, lang: appLang);
|
||||
pubkey.text = _wallet.getPubkey(derivation!);
|
||||
log.d(pubkey.text);
|
||||
notifyListeners();
|
||||
|
||||
return pubkey.text;
|
||||
} catch (e) {
|
||||
log.w('Bad PIN code !\n' + e.toString());
|
||||
notifyListeners();
|
||||
|
||||
return 'false';
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
pubkey.text = CesiumWallet.fromDewif(_dewif!, _pin).pubkey;
|
||||
notifyListeners();
|
||||
return pubkey.text;
|
||||
} catch (e) {
|
||||
log.w('Bad PIN code !\n' + e.toString());
|
||||
notifyListeners();
|
||||
|
||||
return 'false';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String? readLocalWallet(
|
||||
context, WalletData _wallet, String _pin, int _pinLenght,
|
||||
{String? mnemonic}) {
|
||||
isWalletUnlock = false;
|
||||
final String _localPubkey;
|
||||
|
||||
try {
|
||||
String? _localDewif = chestBox.get(_wallet.chest)!.dewif;
|
||||
|
||||
if (mnemonic == null) {
|
||||
_localPubkey = _getPubkeyFromDewif(
|
||||
_localDewif, _pin.toUpperCase(), _pinLenght, _wallet.derivation);
|
||||
} else {
|
||||
final _hdwallet = HdWallet.fromMnemonic(mnemonic);
|
||||
_localPubkey = _hdwallet.getPubkey(_wallet.derivation!);
|
||||
}
|
||||
|
||||
if (_localPubkey != 'false') {
|
||||
pubkey.text = _localPubkey;
|
||||
isWalletUnlock = true;
|
||||
log.d(pubkey.text);
|
||||
return _localDewif;
|
||||
} else {
|
||||
throw 'Bad pubkey';
|
||||
}
|
||||
} on ChecksumException catch (e) {
|
||||
log.e(e.cause);
|
||||
return 'bad';
|
||||
} catch (e) {
|
||||
// _homeProvider.playSound('non', 0.6);
|
||||
log.e('ERROR READING FILE: $e');
|
||||
pubkey.clear();
|
||||
return 'bad';
|
||||
}
|
||||
}
|
||||
|
||||
int getPinLenght(_walletNbr) {
|
||||
// TODOo: Get real Dewif lenght
|
||||
// String _localDewif;
|
||||
|
@ -116,11 +39,6 @@ class WalletOptionsProvider with ChangeNotifier {
|
|||
return pinLength;
|
||||
}
|
||||
|
||||
Future<double> getBalance(String pubkey, {bool isUd = false}) async {
|
||||
final node = Gva(node: endPointGVA);
|
||||
return await node.balance(pubkey, ud: isUd);
|
||||
}
|
||||
|
||||
void _renameWallet(List<int?> _walletID, _newName,
|
||||
{required bool isCesium}) async {
|
||||
if (isCesium) {
|
||||
|
@ -252,4 +170,18 @@ class WalletOptionsProvider with ChangeNotifier {
|
|||
void reloadBuild() {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
String? getAddress(int chest, int derivation) {
|
||||
String? _address;
|
||||
walletBox.toMap().forEach((key, value) {
|
||||
if (value.chest == chest) {
|
||||
_address = value.address!;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
address.text = _address ?? '';
|
||||
|
||||
return _address;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ class HomeScreen extends StatelessWidget {
|
|||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
if (!_sub.sdkReady && !_sub.sdkLoading) await _sub.initApi();
|
||||
if (_sub.sdkReady && !_sub.nodeConnected) {
|
||||
await _sub.connectNode();
|
||||
await _sub.connectNode(); //kopa
|
||||
}
|
||||
if (isWalletsExists) homeClass.snackNode(ctx);
|
||||
});
|
||||
|
|
|
@ -38,7 +38,7 @@ class CesiumWalletOptions extends StatelessWidget {
|
|||
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
|
||||
final String shortPubkey =
|
||||
_walletOptions.getShortPubkey(_walletOptions.pubkey.text);
|
||||
_walletOptions.getShortPubkey(_walletOptions.address.text);
|
||||
|
||||
if (_isNewNameValid == false) {
|
||||
_walletOptions.nameController.text = cesiumWallet.name!;
|
||||
|
@ -158,7 +158,7 @@ class CesiumWalletOptions extends StatelessWidget {
|
|||
options: QueryOptions(
|
||||
document: gql(getBalance),
|
||||
variables: {
|
||||
'pubkey': _walletOptions.pubkey.text,
|
||||
'pubkey': _walletOptions.address.text,
|
||||
},
|
||||
// pollInterval: Duration(seconds: 1),
|
||||
),
|
||||
|
@ -257,7 +257,7 @@ class CesiumWalletOptions extends StatelessWidget {
|
|||
}),
|
||||
SizedBox(height: 4 * ratio),
|
||||
QrImageWidget(
|
||||
data: _walletOptions.pubkey.text,
|
||||
data: _walletOptions.address.text,
|
||||
version: QrVersions.auto,
|
||||
size: isTall ? 300 : 270,
|
||||
),
|
||||
|
@ -266,7 +266,7 @@ class CesiumWalletOptions extends StatelessWidget {
|
|||
key: const Key('copyPubkey'),
|
||||
onTap: () {
|
||||
Clipboard.setData(
|
||||
ClipboardData(text: _walletOptions.pubkey.text));
|
||||
ClipboardData(text: _walletOptions.address.text));
|
||||
_walletOptions.snackCopyKey(ctx);
|
||||
},
|
||||
child: SizedBox(
|
||||
|
@ -303,7 +303,7 @@ class CesiumWalletOptions extends StatelessWidget {
|
|||
),
|
||||
onPressed: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: _walletOptions.pubkey.text));
|
||||
text: _walletOptions.address.text));
|
||||
_walletOptions.snackCopyKey(ctx);
|
||||
},
|
||||
child: Row(children: <Widget>[
|
||||
|
@ -326,7 +326,7 @@ class CesiumWalletOptions extends StatelessWidget {
|
|||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return HistoryScreen(
|
||||
pubkey: _walletOptions.pubkey.text);
|
||||
pubkey: _walletOptions.address.text);
|
||||
}),
|
||||
);
|
||||
},
|
||||
|
|
|
@ -3,9 +3,10 @@ import 'package:durt/durt.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/stateful_wrapper.dart';
|
||||
import 'package:gecko/providers/change_pin.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
|
@ -19,15 +20,16 @@ class ChangePinScreen extends StatelessWidget with ChangeNotifier {
|
|||
final MyWalletsProvider walletProvider;
|
||||
Directory? appPath;
|
||||
|
||||
TextEditingController newPin = TextEditingController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
ChangePinProvider _changePin = Provider.of<ChangePinProvider>(context);
|
||||
// _walletOptions.changePin(walletName, oldPin);
|
||||
// _walletOptions.newPin.text = _tmpPin;
|
||||
SubstrateSdk _sdk = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
|
||||
return WillPopScope(
|
||||
onWillPop: () {
|
||||
_changePin.newPin.text = '';
|
||||
newPin.text = '';
|
||||
return Future<bool>.value(true);
|
||||
},
|
||||
child: Scaffold(
|
||||
|
@ -37,7 +39,7 @@ class ChangePinScreen extends StatelessWidget with ChangeNotifier {
|
|||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back, color: Colors.black),
|
||||
onPressed: () {
|
||||
_changePin.newPin.text = '';
|
||||
newPin.text = '';
|
||||
Navigator.of(context).pop();
|
||||
}),
|
||||
title: SizedBox(
|
||||
|
@ -50,7 +52,7 @@ class ChangePinScreen extends StatelessWidget with ChangeNotifier {
|
|||
child: Column(children: <Widget>[
|
||||
StatefulWrapper(
|
||||
onInit: () {
|
||||
_changePin.newPin.text = randomSecretCode(pinLength);
|
||||
newPin.text = randomSecretCode(pinLength);
|
||||
},
|
||||
child: Container(),
|
||||
),
|
||||
|
@ -69,7 +71,7 @@ class ChangePinScreen extends StatelessWidget with ChangeNotifier {
|
|||
children: <Widget>[
|
||||
TextField(
|
||||
enabled: false,
|
||||
controller: _changePin.newPin,
|
||||
controller: newPin,
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: const InputDecoration(),
|
||||
|
@ -81,7 +83,7 @@ class ChangePinScreen extends StatelessWidget with ChangeNotifier {
|
|||
icon: const Icon(Icons.replay),
|
||||
color: orangeC,
|
||||
onPressed: () async {
|
||||
_changePin.newPin.text = randomSecretCode(pinLength);
|
||||
newPin.text = randomSecretCode(pinLength);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
@ -97,12 +99,10 @@ class ChangePinScreen extends StatelessWidget with ChangeNotifier {
|
|||
onPrimary: Colors.black, // foreground
|
||||
),
|
||||
onPressed: () async {
|
||||
NewWallet? _newWalletFile = await _changePin.changePin(
|
||||
walletProvider.pinCode,
|
||||
newCustomPin: _changePin.newPin.text);
|
||||
_changePin.newPin.text = '';
|
||||
_changePin.storeNewPinChest(context, _newWalletFile!);
|
||||
walletProvider.pinCode = _changePin.newPin.text;
|
||||
final _chest = chestBox.get(configBox.get('currentChest'));
|
||||
_sdk.changePassword(_chest!.address!, walletProvider.pinCode, newPin.text);
|
||||
newPin.text = '';
|
||||
walletProvider.pinCode = newPin.text;
|
||||
},
|
||||
child: const Text(
|
||||
'Confirmer',
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
|
|||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/providers/generate_wallets.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
@ -32,6 +33,7 @@ class ConfirmStoreWallet extends StatelessWidget with ChangeNotifier {
|
|||
MyWalletsProvider _myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context);
|
||||
final int? _currentChest = _myWalletProvider.getCurrentChest();
|
||||
SubstrateSdk _sdk = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
|
||||
_mnemonicController.text = generatedMnemonic!;
|
||||
return WillPopScope(
|
||||
|
@ -134,9 +136,16 @@ class ConfirmStoreWallet extends StatelessWidget with ChangeNotifier {
|
|||
.isAskedWordValid &&
|
||||
walletName.text != '')
|
||||
? () async {
|
||||
_generateWalletProvider.storeHDWChest(
|
||||
generatedWallet!.dewif,
|
||||
walletName.text,
|
||||
final address = await _sdk.importAccount(
|
||||
fromMnemonic: true,
|
||||
mnemonic: _generateWalletProvider
|
||||
.generatedMnemonic!,
|
||||
password:
|
||||
_generateWalletProvider.pin.text,
|
||||
derivePath: '/3');
|
||||
await _generateWalletProvider.storeHDWChest(
|
||||
address,
|
||||
'Mon portefeuille courant',
|
||||
context);
|
||||
_generateWalletProvider.isAskedWordValid =
|
||||
false;
|
||||
|
|
|
@ -23,14 +23,9 @@ class GenerateFastChestScreen extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
GenerateWalletsProvider _generateWalletProvider =
|
||||
Provider.of<GenerateWalletsProvider>(context);
|
||||
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
||||
|
||||
if (_generateWalletProvider.mnemonicController.text == '') {
|
||||
_generateWalletProvider.generateWordList(context);
|
||||
_generateWalletProvider.mnemonicController.text =
|
||||
_generateWalletProvider.generatedMnemonic!;
|
||||
_generateWalletProvider.pin.text = randomSecretCode(pinLength);
|
||||
}
|
||||
_generateWalletProvider.changePinCode(reload: false);
|
||||
|
||||
return WillPopScope(
|
||||
onWillPop: () {
|
||||
|
@ -59,9 +54,7 @@ class GenerateFastChestScreen extends StatelessWidget {
|
|||
child: FloatingActionButton(
|
||||
heroTag: "buttonGenerateWallet",
|
||||
onPressed: () {
|
||||
_generateWalletProvider.generateWordList(context);
|
||||
_generateWalletProvider.mnemonicController.text =
|
||||
_generateWalletProvider.generatedMnemonic!;
|
||||
_generateWalletProvider.reloadBuild();
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 40.0,
|
||||
|
@ -77,18 +70,23 @@ class GenerateFastChestScreen extends StatelessWidget {
|
|||
const SizedBox(height: 20),
|
||||
toolTips(_toolTipSentence, 'Phrase de restauration:',
|
||||
"Notez et gardez cette phrase précieusement sur un papier, elle vous servira à restaurer votre portefeuille sur un autre appareil"),
|
||||
TextField(
|
||||
enabled: false,
|
||||
controller: _generateWalletProvider.mnemonicController,
|
||||
maxLines: 3,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: const InputDecoration(
|
||||
contentPadding: EdgeInsets.all(15.0),
|
||||
),
|
||||
style: const TextStyle(
|
||||
fontSize: 22.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400)),
|
||||
Consumer<GenerateWalletsProvider>(builder: (context, _gWP, _) {
|
||||
return FutureBuilder(
|
||||
future: _gWP.generateWordList(context),
|
||||
builder: (BuildContext context, AsyncSnapshot<List> _data) {
|
||||
if (!_data.hasData) {
|
||||
return const Text('');
|
||||
} else {
|
||||
return Text(_gWP.generatedMnemonic!,
|
||||
maxLines: 3,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 22.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400));
|
||||
}
|
||||
});
|
||||
}),
|
||||
const SizedBox(height: 8),
|
||||
toolTips(_toolTipSecret, 'Code secret:',
|
||||
"Retenez bien votre code secret, il vous sera demandé à chaque paiement, ainsi que pour configurer votre portefeuille"),
|
||||
|
@ -110,7 +108,7 @@ class GenerateFastChestScreen extends StatelessWidget {
|
|||
icon: const Icon(Icons.replay),
|
||||
color: orangeC,
|
||||
onPressed: () {
|
||||
_generateWalletProvider.changePinCode(reload: true);
|
||||
_generateWalletProvider.changePinCode(reload: false);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
|
|
@ -1,244 +0,0 @@
|
|||
import 'dart:async';
|
||||
import 'package:durt/durt.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/providers/generate_wallets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/providers/wallet_options.dart';
|
||||
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class ImportWalletScreen extends StatelessWidget {
|
||||
const ImportWalletScreen({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
GlobalKey _toolTipSecret = GlobalKey();
|
||||
Timer? _debounce;
|
||||
GenerateWalletsProvider _generateWalletProvider =
|
||||
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
||||
WalletOptionsProvider _walletOptions =
|
||||
Provider.of<WalletOptionsProvider>(context, listen: false);
|
||||
MyWalletsProvider _myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
|
||||
_generateWalletProvider.pin.text = randomSecretCode(pinLength);
|
||||
return WillPopScope(
|
||||
onWillPop: () {
|
||||
_generateWalletProvider.resetCesiumImportView();
|
||||
return Future<bool>.value(true);
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back, color: Colors.black),
|
||||
onPressed: () {
|
||||
_generateWalletProvider.resetCesiumImportView();
|
||||
Navigator.of(context).pop();
|
||||
}),
|
||||
title: const SizedBox(
|
||||
height: 22,
|
||||
child: Text('Importer un portefeuille'),
|
||||
)),
|
||||
body: Builder(
|
||||
builder: (ctx) => SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
const SizedBox(height: 20),
|
||||
Consumer<GenerateWalletsProvider>(
|
||||
builder: (context, walletProvider, _) {
|
||||
return TextFormField(
|
||||
autofocus: true,
|
||||
onChanged: (text) {
|
||||
if (_debounce?.isActive ?? false) {
|
||||
_debounce!.cancel();
|
||||
}
|
||||
_debounce = Timer(const Duration(milliseconds: 600), () {
|
||||
walletProvider
|
||||
.generateCesiumWalletPubkey(
|
||||
text, walletProvider.cesiumPWD.text)
|
||||
.then((value) {
|
||||
walletProvider.canImport = true;
|
||||
walletProvider.reloadBuild();
|
||||
});
|
||||
});
|
||||
},
|
||||
keyboardType: TextInputType.text,
|
||||
controller: walletProvider.cesiumID,
|
||||
obscureText: !walletProvider
|
||||
.isCesiumIDVisible, //This will obscure text dynamically
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Entrez votre identifiant Cesium',
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
walletProvider.isCesiumIDVisible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
color: Colors.black,
|
||||
),
|
||||
onPressed: () {
|
||||
walletProvider.cesiumIDisVisible();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 15),
|
||||
Consumer<GenerateWalletsProvider>(
|
||||
builder: (context, walletProvider, _) {
|
||||
return TextFormField(
|
||||
onChanged: (text) {
|
||||
if (_debounce?.isActive ?? false) {
|
||||
_debounce!.cancel();
|
||||
}
|
||||
_debounce = Timer(const Duration(milliseconds: 600), () {
|
||||
walletProvider
|
||||
.generateCesiumWalletPubkey(
|
||||
walletProvider.cesiumID.text, text)
|
||||
.then((value) {
|
||||
walletProvider.canImport = true;
|
||||
walletProvider.reloadBuild();
|
||||
});
|
||||
});
|
||||
},
|
||||
keyboardType: TextInputType.text,
|
||||
controller: walletProvider.cesiumPWD,
|
||||
obscureText: !walletProvider
|
||||
.isCesiumPWDVisible, //This will obscure text dynamically
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Entrez votre mot de passe Cesium',
|
||||
suffixIcon: IconButton(
|
||||
icon: Icon(
|
||||
walletProvider.isCesiumPWDVisible
|
||||
? Icons.visibility
|
||||
: Icons.visibility_off,
|
||||
color: Colors.black,
|
||||
),
|
||||
onPressed: () {
|
||||
walletProvider.cesiumPWDisVisible();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 15),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: _generateWalletProvider.cesiumPubkey.text));
|
||||
_walletOptions.snackCopyKey(ctx);
|
||||
},
|
||||
child: Consumer<GenerateWalletsProvider>(
|
||||
builder: (context, walletProvider, _) {
|
||||
return Text(
|
||||
_generateWalletProvider.cesiumPubkey.text,
|
||||
style: const TextStyle(
|
||||
fontSize: 14.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: 'Monospace'),
|
||||
);
|
||||
}),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
toolTips(_toolTipSecret, 'Code secret:',
|
||||
"Retenez bien votre code secret, il vous sera demandé à chaque paiement, ainsi que pour configurer votre portefeuille"),
|
||||
Stack(
|
||||
alignment: Alignment.centerRight,
|
||||
children: <Widget>[
|
||||
TextField(
|
||||
enabled: false,
|
||||
controller: _generateWalletProvider.pin,
|
||||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: const InputDecoration(),
|
||||
style: const TextStyle(
|
||||
fontSize: 30.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold)),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.replay),
|
||||
color: orangeC,
|
||||
onPressed: () {
|
||||
_generateWalletProvider.changePinCode(reload: true);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Consumer<GenerateWalletsProvider>(
|
||||
builder: (context, walletProvider, _) {
|
||||
return ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: yellowC, // background
|
||||
onPrimary: Colors.black, // foreground
|
||||
),
|
||||
onPressed: walletProvider.canImport
|
||||
? () async {
|
||||
final chestKey =
|
||||
await walletProvider.importCesiumWallet();
|
||||
_myWalletProvider.rebuildWidget();
|
||||
|
||||
await Navigator.pushAndRemoveUntil(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return UnlockingWallet(
|
||||
wallet: WalletData(chest: chestKey),
|
||||
action: "mywallets",
|
||||
);
|
||||
}),
|
||||
ModalRoute.withName('/'),
|
||||
);
|
||||
_generateWalletProvider.resetCesiumImportView();
|
||||
}
|
||||
: null,
|
||||
child: const Text(
|
||||
'Importer ce portefeuille Cesium',
|
||||
style: TextStyle(fontSize: 20),
|
||||
),
|
||||
);
|
||||
}),
|
||||
]),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget toolTips(_key, _text, _message) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
final dynamic _toolTip = _key.currentState;
|
||||
_toolTip.ensureTooltipVisible();
|
||||
},
|
||||
child: Tooltip(
|
||||
padding: const EdgeInsets.all(10),
|
||||
key: _key,
|
||||
showDuration: const Duration(seconds: 5),
|
||||
message: _message,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
const SizedBox(width: 20),
|
||||
Column(children: <Widget>[
|
||||
SizedBox(
|
||||
width: 30,
|
||||
height: 25,
|
||||
child:
|
||||
Icon(Icons.info_outline, size: 22, color: orangeC)),
|
||||
const SizedBox(height: 1)
|
||||
]),
|
||||
Text(
|
||||
_text,
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: Colors.grey[600],
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
const SizedBox(width: 45)
|
||||
])));
|
||||
}
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
// ignore_for_file: avoid_print
|
||||
|
||||
import 'dart:async';
|
||||
import 'package:durt/durt.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:gecko/providers/wallets_profiles.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
|
@ -34,17 +36,12 @@ class UnlockingWallet extends StatelessWidget {
|
|||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
WalletOptionsProvider _walletOptions =
|
||||
Provider.of<WalletOptionsProvider>(context);
|
||||
final double statusBarHeight = MediaQuery.of(context).padding.top;
|
||||
// final double statusBarHeight = MediaQuery.of(context).padding.top;
|
||||
|
||||
int _pinLenght;
|
||||
ChestData currentChest = chestBox.get(configBox.get('currentChest'))!;
|
||||
|
||||
if (currentChest.isCesium!) {
|
||||
_pinLenght = _walletOptions.getPinLenght(currentChest.dewif);
|
||||
wallet = WalletData(derivation: -1, chest: currentChest.key);
|
||||
} else {
|
||||
_pinLenght = _walletOptions.getPinLenght(wallet!.number);
|
||||
}
|
||||
_pinLenght = _walletOptions.getPinLenght(wallet!.number);
|
||||
errorController = StreamController<ErrorAnimationType>();
|
||||
|
||||
return Scaffold(
|
||||
|
@ -55,7 +52,7 @@ class UnlockingWallet extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Stack(children: <Widget>[
|
||||
Positioned(
|
||||
top: statusBarHeight + 10,
|
||||
top: 10, //statusBarHeight + 10,
|
||||
left: 15,
|
||||
child: Builder(
|
||||
builder: (context) => IconButton(
|
||||
|
@ -63,7 +60,7 @@ class UnlockingWallet extends StatelessWidget {
|
|||
icon: const Icon(
|
||||
Icons.arrow_back,
|
||||
color: Colors.black,
|
||||
size: 25,
|
||||
size: 30,
|
||||
),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
|
@ -150,6 +147,8 @@ class UnlockingWallet extends StatelessWidget {
|
|||
WalletsProfilesProvider _historyProvider =
|
||||
Provider.of<WalletsProfilesProvider>(context);
|
||||
|
||||
SubstrateSdk _sdk = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
|
||||
FocusNode pinFocus = FocusNode();
|
||||
|
||||
return Form(
|
||||
|
@ -201,30 +200,12 @@ class UnlockingWallet extends StatelessWidget {
|
|||
],
|
||||
onCompleted: (_pin) async {
|
||||
log.d("Completed");
|
||||
_myWalletProvider.pinCode = _pin;
|
||||
_myWalletProvider.pinCode = _pin.toUpperCase();
|
||||
|
||||
if (currentChest.isCesium!) {
|
||||
try {
|
||||
String _localDewif = chestBox.get(wallet!.chest)!.dewif!;
|
||||
final cesiumWallet =
|
||||
CesiumWallet.fromDewif(_localDewif, _pin.toUpperCase());
|
||||
_walletOptions.pubkey.text = cesiumWallet.pubkey;
|
||||
_myWalletProvider.cesiumSeed = cesiumWallet.seed;
|
||||
_myWalletProvider.mnemonic = 'cesium';
|
||||
} catch (e) {
|
||||
log.e(e);
|
||||
_myWalletProvider.mnemonic = 'bad';
|
||||
}
|
||||
} else {
|
||||
_myWalletProvider.mnemonic = _myWalletProvider.dewifToMnemonic(
|
||||
context, wallet!, _pin.toUpperCase());
|
||||
}
|
||||
// final String? resultWallet = _walletOptions.readLocalWallet(
|
||||
// context, wallet!, _pin.toUpperCase(), _pinLenght);
|
||||
// _myWalletProvider.pinCode = _pin.toUpperCase();
|
||||
_myWalletProvider.pinLenght = _pinLenght;
|
||||
final isValid = await _sdk.checkPassword(
|
||||
currentChest.address!, _pin.toUpperCase());
|
||||
|
||||
if (_myWalletProvider.mnemonic == 'bad') {
|
||||
if (!isValid) {
|
||||
await Future.delayed(const Duration(milliseconds: 50));
|
||||
errorController.add(ErrorAnimationType
|
||||
.shake); // Triggering error shake animation
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:gecko/providers/wallet_options.dart';
|
||||
import 'package:gecko/providers/wallets_profiles.dart';
|
||||
import 'package:gecko/screens/history.dart';
|
||||
|
@ -27,7 +28,7 @@ class WalletOptions extends StatelessWidget {
|
|||
MyWalletsProvider _myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context);
|
||||
|
||||
log.d(_walletOptions.pubkey.text);
|
||||
log.d(_walletOptions.address.text);
|
||||
|
||||
final int _currentChest = _myWalletProvider.getCurrentChest()!;
|
||||
|
||||
|
@ -97,7 +98,7 @@ class WalletOptions extends StatelessWidget {
|
|||
}),
|
||||
SizedBox(height: 4 * ratio),
|
||||
QrImageWidget(
|
||||
data: _walletOptions.pubkey.text,
|
||||
data: _walletOptions.address.text,
|
||||
version: QrVersions.auto,
|
||||
size: isTall ? 300 : 270,
|
||||
),
|
||||
|
@ -221,9 +222,10 @@ class WalletOptions extends StatelessWidget {
|
|||
}
|
||||
|
||||
Widget balance(WalletOptionsProvider walletProvider) {
|
||||
SubstrateSdk _sdk = SubstrateSdk();
|
||||
return Column(children: <Widget>[
|
||||
FutureBuilder(
|
||||
future: walletProvider.getBalance(walletProvider.pubkey.text),
|
||||
future: _sdk.getBalance(walletProvider.address.text),
|
||||
builder: (BuildContext context, AsyncSnapshot<num?> _balance) {
|
||||
if (_balance.connectionState != ConnectionState.done ||
|
||||
_balance.hasError) {
|
||||
|
@ -262,11 +264,11 @@ class WalletOptions extends StatelessWidget {
|
|||
|
||||
Widget pubkeyWidget(WalletOptionsProvider walletProvider, BuildContext ctx) {
|
||||
final String shortPubkey =
|
||||
walletProvider.getShortPubkey(walletProvider.pubkey.text);
|
||||
walletProvider.getShortPubkey(walletProvider.address.text);
|
||||
return GestureDetector(
|
||||
key: const Key('copyPubkey'),
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: walletProvider.pubkey.text));
|
||||
Clipboard.setData(ClipboardData(text: walletProvider.address.text));
|
||||
walletProvider.snackCopyKey(ctx);
|
||||
},
|
||||
child: SizedBox(
|
||||
|
@ -303,7 +305,7 @@ class WalletOptions extends StatelessWidget {
|
|||
),
|
||||
onPressed: () {
|
||||
Clipboard.setData(
|
||||
ClipboardData(text: walletProvider.pubkey.text));
|
||||
ClipboardData(text: walletProvider.address.text));
|
||||
walletProvider.snackCopyKey(ctx);
|
||||
},
|
||||
child: Row(children: <Widget>[
|
||||
|
@ -336,7 +338,7 @@ class WalletOptions extends StatelessWidget {
|
|||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return HistoryScreen(
|
||||
pubkey: walletProvider.pubkey.text,
|
||||
pubkey: walletProvider.address.text,
|
||||
avatar: wallet.imageFile == null
|
||||
? Image.asset(
|
||||
'assets/avatars/${wallet.imageName}',
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import 'package:durt/durt.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
|
@ -55,7 +54,7 @@ class WalletsHome extends StatelessWidget {
|
|||
backgroundColor: const Color(0xffFFD58D),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: myWalletsTiles(context),
|
||||
child: myWalletsTiles(context, _currentChestNumber!),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -132,7 +131,7 @@ class WalletsHome extends StatelessWidget {
|
|||
]);
|
||||
}
|
||||
|
||||
Widget myWalletsTiles(BuildContext context) {
|
||||
Widget myWalletsTiles(BuildContext context, int _currentChestNumber) {
|
||||
MyWalletsProvider _myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context);
|
||||
WalletOptionsProvider _walletOptions =
|
||||
|
@ -182,9 +181,8 @@ class WalletsHome extends StatelessWidget {
|
|||
onTap: () {
|
||||
// _walletOptions.readLocalWallet(context, _repository,
|
||||
// _myWalletProvider.pinCode, pinLength);
|
||||
_walletOptions.pubkey.text =
|
||||
HdWallet.fromMnemonic(_myWalletProvider.mnemonic)
|
||||
.getPubkey(_repository.derivation!);
|
||||
_walletOptions.getAddress(
|
||||
_currentChestNumber, _repository.derivation!);
|
||||
Navigator.push(
|
||||
context,
|
||||
SmoothTransition(
|
||||
|
@ -275,10 +273,8 @@ class WalletsHome extends StatelessWidget {
|
|||
// _repository,
|
||||
// _myWalletProvider.pinCode,
|
||||
// pinLength);
|
||||
_walletOptions.pubkey.text =
|
||||
HdWallet.fromMnemonic(
|
||||
_myWalletProvider.mnemonic)
|
||||
.getPubkey(_repository.derivation!);
|
||||
_walletOptions.getAddress(
|
||||
_currentChestNumber, _repository.derivation!);
|
||||
Navigator.push(
|
||||
context,
|
||||
SmoothTransition(
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
// ignore_for_file: file_names
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/screens/common_elements.dart';
|
||||
import 'package:gecko/screens/myWallets/import_cesium_wallet.dart';
|
||||
import 'package:gecko/screens/onBoarding/1.dart';
|
||||
|
||||
class NoKeyChainScreen extends StatelessWidget {
|
||||
|
@ -66,46 +64,6 @@ class NoKeyChainScreen extends StatelessWidget {
|
|||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(height: 70),
|
||||
Container(
|
||||
child: ClipOval(
|
||||
child: Material(
|
||||
color: const Color(0xffFFD58D), // button color
|
||||
child: InkWell(
|
||||
splashColor: orangeC, // inkwell color
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child:
|
||||
// Image(
|
||||
// image: AssetImage('assets/cesium_bw3.png'),
|
||||
// height: 60),
|
||||
SvgPicture.asset('assets/cesium_small.svg',
|
||||
semanticsLabel: 'Cesium Logo', height: 48),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(context,
|
||||
SlideLeftRoute(page: const ImportWalletScreen()));
|
||||
}),
|
||||
),
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.white,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey,
|
||||
blurRadius: 4.0,
|
||||
offset: Offset(2.0, 2.5),
|
||||
spreadRadius: 0.5)
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
"Importer un\nportefeuille Cesium",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Colors.black, fontSize: 13),
|
||||
)
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import 'package:flutter/services.dart';
|
|||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/screens/myWallets/generate_wallets.dart';
|
||||
import 'dart:io';
|
||||
import 'package:gecko/screens/myWallets/import_cesium_wallet.dart';
|
||||
// import 'package:gecko/screens/myWallets/import_cesium_wallet.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/screens/myWallets/restore_chest.dart';
|
||||
|
||||
|
@ -48,14 +48,15 @@ class SettingsScreen extends StatelessWidget {
|
|||
primary: yellowC, // background
|
||||
onPrimary: Colors.black, // foreground
|
||||
),
|
||||
onPressed: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const ImportWalletScreen();
|
||||
}),
|
||||
).then((value) => {
|
||||
if (value == true) {Navigator.pop(context)}
|
||||
}),
|
||||
onPressed: null,
|
||||
// () => Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(builder: (context) {
|
||||
// return const ImportWalletScreen();
|
||||
// }),
|
||||
// ).then((value) => {
|
||||
// if (value == true) {Navigator.pop(context)}
|
||||
// }),
|
||||
child: const Text(
|
||||
"Importer un portefeuille Cesium",
|
||||
style: TextStyle(fontSize: 16),
|
||||
|
|
|
@ -94,7 +94,7 @@ class SubstrateSandBox extends StatelessWidget {
|
|||
child: const Text("Dériver"),
|
||||
)
|
||||
])
|
||||
]);
|
||||
]);
|
||||
}),
|
||||
const SizedBox(height: 20),
|
||||
const Text('Mot de passe du trousseau:'),
|
||||
|
|
24
pubspec.lock
24
pubspec.lock
|
@ -7,7 +7,7 @@ packages:
|
|||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "38.0.0"
|
||||
version: "40.0.0"
|
||||
aes_ecb_pkcs5_flutter:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -21,7 +21,7 @@ packages:
|
|||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.4.1"
|
||||
version: "4.1.0"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -126,7 +126,7 @@ packages:
|
|||
name: build_runner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.10"
|
||||
version: "2.1.11"
|
||||
build_runner_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -381,7 +381,7 @@ packages:
|
|||
name: flutter_logs
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.5"
|
||||
version: "2.1.6"
|
||||
flutter_plugin_android_lifecycle:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -412,7 +412,7 @@ packages:
|
|||
name: frontend_server_client
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "2.1.3"
|
||||
fuchsia_remote_debug_protocol:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
|
@ -494,7 +494,7 @@ packages:
|
|||
name: graphql
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.1.2-beta.1"
|
||||
version: "5.1.1"
|
||||
graphql_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -524,7 +524,7 @@ packages:
|
|||
name: hive
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.2.1"
|
||||
hive_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -538,7 +538,7 @@ packages:
|
|||
name: hive_generator
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
version: "1.1.3"
|
||||
http:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -573,7 +573,7 @@ packages:
|
|||
name: icons_launcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.7"
|
||||
version: "1.1.8"
|
||||
image:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -615,7 +615,7 @@ packages:
|
|||
name: image_picker_ios
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.8.5+2"
|
||||
version: "0.8.5+4"
|
||||
image_picker_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1387,7 +1387,7 @@ packages:
|
|||
name: webview_flutter_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.9.0"
|
||||
webview_flutter_wkwebview:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1401,7 +1401,7 @@ packages:
|
|||
name: win32
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.6.0"
|
||||
version: "2.6.1"
|
||||
window_size:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
14
pubspec.yaml
14
pubspec.yaml
|
@ -51,23 +51,20 @@ dependencies:
|
|||
url: https://github.com/DavBfr/dart_pdf.git
|
||||
path: printing
|
||||
provider: ^6.0.1
|
||||
# qrscan: ^0.3.2
|
||||
qrscan:
|
||||
qrscan: #^0.3.2
|
||||
git:
|
||||
url: https://github.com/leyan95/qrcode_scanner.git
|
||||
ref: master # branch name
|
||||
# qr_code_scanner: ^0.6.1
|
||||
# qr_flutter: ^4.0.0
|
||||
qr_flutter:
|
||||
qr_flutter: #^4.0.0
|
||||
git:
|
||||
url: https://github.com/insinfo/qr.flutter.git
|
||||
ref: master # branch name
|
||||
responsive_builder: ^0.4.1
|
||||
responsive_framework: ^0.1.4
|
||||
sentry: 6.5.1
|
||||
sentry: ^6.5.1
|
||||
sentry_flutter: ^6.5.1
|
||||
shared_preferences: ^2.0.7
|
||||
# super_tooltip: ^1.0.1
|
||||
sync_http: ^0.3.0
|
||||
test: ^1.17.10
|
||||
truncate: ^3.0.1
|
||||
|
@ -78,10 +75,7 @@ dependencies:
|
|||
desktop_window: ^0.4.0
|
||||
durt: ^0.1.6
|
||||
package_info_plus: ^1.4.2
|
||||
polkawallet_sdk: ^0.4.5 ## Wait for merging PR: https://github.com/polkawallet-io/sdk/pull/19
|
||||
# git:
|
||||
# url: git://github.com/poka-IT/sdk.git
|
||||
# ref: fixAndroidActivityVersion
|
||||
polkawallet_sdk: ^0.4.5
|
||||
|
||||
flutter_icons:
|
||||
android: true
|
||||
|
|
Loading…
Reference in New Issue