so much UI changes/refacto
|
@ -19,6 +19,8 @@
|
||||||
<activity
|
<activity
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
android:resource="@style/NormalTheme"
|
||||||
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:theme="@style/LaunchTheme"
|
android:theme="@style/LaunchTheme"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
|
@ -29,16 +31,12 @@
|
||||||
the Android process has started. This theme is visible to the user
|
the Android process has started. This theme is visible to the user
|
||||||
while the Flutter UI initializes. After that, this theme continues
|
while the Flutter UI initializes. After that, this theme continues
|
||||||
to determine the Window background behind the Flutter UI. -->
|
to determine the Window background behind the Flutter UI. -->
|
||||||
<meta-data
|
<!-- <meta-data
|
||||||
android:name="io.flutter.embedding.android.NormalTheme"
|
android:name="io.flutter.embedding.android.NormalTheme"
|
||||||
android:resource="@style/NormalTheme"
|
android:resource="@style/NormalTheme"
|
||||||
/>
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
/> -->
|
||||||
|
|
||||||
<!-- Theme to apply as soon as Flutter begins rendering frames -->
|
|
||||||
<meta-data
|
|
||||||
android:name="io.flutter.embedding.android.NormalTheme"
|
|
||||||
android:resource="@style/NormalTheme"
|
|
||||||
/>
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
|
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 104 KiB |
After Width: | Height: | Size: 112 KiB |
After Width: | Height: | Size: 166 KiB |
Before Width: | Height: | Size: 104 KiB |
Before Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 211 KiB |
|
@ -492,4 +492,4 @@
|
||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
};
|
};
|
||||||
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 148 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
|
@ -155,25 +155,6 @@ class GenerateWalletsProvider with ChangeNotifier {
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<durt.NewWallet?> generateWallet(String generatedMnemonic,
|
|
||||||
{required bool isImport}) async {
|
|
||||||
try {
|
|
||||||
actualWallet = await durt.Dewif().generateDewif(
|
|
||||||
generatedMnemonic, durt.randomSecretCode(pinLength),
|
|
||||||
lang: appLang);
|
|
||||||
} catch (e) {
|
|
||||||
log.e(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isImport) {
|
|
||||||
mnemonicController.text = generatedMnemonic;
|
|
||||||
pin.text = actualWallet!.password;
|
|
||||||
}
|
|
||||||
// notifyListeners();
|
|
||||||
|
|
||||||
return actualWallet;
|
|
||||||
}
|
|
||||||
|
|
||||||
String changePinCode({required bool reload}) {
|
String changePinCode({required bool reload}) {
|
||||||
pin.text = durt.randomSecretCode(pinLength);
|
pin.text = durt.randomSecretCode(pinLength);
|
||||||
if (reload) {
|
if (reload) {
|
||||||
|
@ -229,56 +210,6 @@ class GenerateWalletsProvider with ChangeNotifier {
|
||||||
log.d(_walletPubkey);
|
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);
|
|
||||||
|
|
||||||
// cesiumID.text = '';
|
|
||||||
// cesiumPWD.text = '';
|
|
||||||
// cesiumPubkey.text = '';
|
|
||||||
// canImport = false;
|
|
||||||
// isCesiumIDVisible = false;
|
|
||||||
// isCesiumPWDVisible = false;
|
|
||||||
|
|
||||||
// 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}';
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 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);
|
|
||||||
|
|
||||||
// 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;
|
|
||||||
// }
|
|
||||||
|
|
||||||
void cesiumIDisVisible() {
|
void cesiumIDisVisible() {
|
||||||
isCesiumIDVisible = !isCesiumIDVisible;
|
isCesiumIDVisible = !isCesiumIDVisible;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
@ -371,25 +302,6 @@ class GenerateWalletsProvider with ChangeNotifier {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> isSentenceValid() async {
|
|
||||||
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}';
|
|
||||||
|
|
||||||
// Needed for bad encoding of UTF-8
|
|
||||||
inputMnemonic = inputMnemonic.replaceAll('é', 'é');
|
|
||||||
inputMnemonic = inputMnemonic.replaceAll('è', 'è');
|
|
||||||
|
|
||||||
durt.NewWallet? generatedWallet =
|
|
||||||
await generateWallet(inputMnemonic, isImport: true);
|
|
||||||
|
|
||||||
if (generatedWallet == null) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
generatedMnemonic = inputMnemonic;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future pasteMnemonic(BuildContext context) async {
|
Future pasteMnemonic(BuildContext context) async {
|
||||||
final sentence = await Clipboard.getData('text/plain');
|
final sentence = await Clipboard.getData('text/plain');
|
||||||
int nbr = 0;
|
int nbr = 0;
|
||||||
|
|
|
@ -26,7 +26,7 @@ class MyWalletsProvider with ChangeNotifier {
|
||||||
// configBox.delete('endpoint');
|
// configBox.delete('endpoint');
|
||||||
if (!configBox.containsKey('endpoint') || configBox.get('endpoint') == '') {
|
if (!configBox.containsKey('endpoint') || configBox.get('endpoint') == '') {
|
||||||
log.d('No endpoint, configure...');
|
log.d('No endpoint, configure...');
|
||||||
configBox.put('endpoint', 'ws://192.168.1.72:9944');
|
configBox.put('endpoint', 'ws://127.0.0.1:9944');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chestBox.isEmpty) {
|
if (chestBox.isEmpty) {
|
||||||
|
|
|
@ -315,6 +315,14 @@ class SubstrateSdk with ChangeNotifier {
|
||||||
|
|
||||||
return await importAccount(fromMnemonic: true, derivePath: '//$number');
|
return await importAccount(fromMnemonic: true, derivePath: '//$number');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<bool> isMnemonicValid(String mnemonic) async {
|
||||||
|
// Needed for bad encoding of UTF-8
|
||||||
|
mnemonic = mnemonic.replaceAll('é', 'é');
|
||||||
|
mnemonic = mnemonic.replaceAll('è', 'è');
|
||||||
|
|
||||||
|
return await sdk.api.keyring.checkMnemonicValid(mnemonic);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void snack(BuildContext context, String message, {int duration = 2}) {
|
void snack(BuildContext context, String message, {int duration = 2}) {
|
||||||
|
@ -339,8 +347,10 @@ void snackNode(BuildContext context, bool isConnected) {
|
||||||
_message =
|
_message =
|
||||||
"Vous êtes connecté au noeud\n${configBox.get('endpoint').split('//')[1]}";
|
"Vous êtes connecté au noeud\n${configBox.get('endpoint').split('//')[1]}";
|
||||||
}
|
}
|
||||||
final snackBar =
|
final snackBar = SnackBar(
|
||||||
SnackBar(content: Text(_message), duration: const Duration(seconds: 2));
|
padding: const EdgeInsets.all(20),
|
||||||
|
content: Text(_message, style: const TextStyle(fontSize: 16)),
|
||||||
|
duration: const Duration(seconds: 2));
|
||||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,11 @@ import 'package:fast_base58/fast_base58.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:gecko/globals.dart';
|
import 'package:gecko/globals.dart';
|
||||||
import 'package:gecko/models/chest_data.dart';
|
|
||||||
import 'package:gecko/providers/my_wallets.dart';
|
import 'package:gecko/providers/my_wallets.dart';
|
||||||
import 'package:gecko/models/wallet_data.dart';
|
import 'package:gecko/models/wallet_data.dart';
|
||||||
|
import 'package:gecko/providers/substrate_sdk.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
import 'package:truncate/truncate.dart';
|
import 'package:truncate/truncate.dart';
|
||||||
|
|
||||||
class WalletOptionsProvider with ChangeNotifier {
|
class WalletOptionsProvider with ChangeNotifier {
|
||||||
|
@ -25,33 +26,16 @@ class WalletOptionsProvider with ChangeNotifier {
|
||||||
Future<NewWallet>? get badWallet => null;
|
Future<NewWallet>? get badWallet => null;
|
||||||
|
|
||||||
int getPinLenght(_walletNbr) {
|
int getPinLenght(_walletNbr) {
|
||||||
// TODOo: Get real Dewif lenght
|
|
||||||
// String _localDewif;
|
|
||||||
// if (_walletNbr is int || _walletNbr == null) {
|
|
||||||
// _localDewif = chestBox.get(configBox.get('currentChest')).dewif;
|
|
||||||
// } else {
|
|
||||||
// _localDewif = _walletNbr;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// final int _pinLenght = DubpRust.getDewifSecretCodeLen(
|
|
||||||
// dewif: _localDewif, secretCodeType: SecretCodeType.letters);
|
|
||||||
|
|
||||||
return pinLength;
|
return pinLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _renameWallet(List<int?> _walletID, _newName,
|
void _renameWallet(List<int?> _walletID, String _newName,
|
||||||
{required bool isCesium}) async {
|
{required bool isCesium}) async {
|
||||||
if (isCesium) {
|
MyWalletsProvider myWalletClass = MyWalletsProvider();
|
||||||
ChestData _chestTarget = chestBox.get(_walletID[0])!;
|
|
||||||
_chestTarget.name = _newName;
|
|
||||||
await chestBox.put(_chestTarget.key, _chestTarget);
|
|
||||||
} else {
|
|
||||||
MyWalletsProvider myWalletClass = MyWalletsProvider();
|
|
||||||
|
|
||||||
WalletData _walletTarget = myWalletClass.getWalletData(_walletID)!;
|
WalletData _walletTarget = myWalletClass.getWalletData(_walletID)!;
|
||||||
_walletTarget.name = _newName;
|
_walletTarget.name = _newName;
|
||||||
await walletBox.put(_walletTarget.key, _walletTarget);
|
await walletBox.put(_walletTarget.key, _walletTarget);
|
||||||
}
|
|
||||||
|
|
||||||
_newWalletName.text = '';
|
_newWalletName.text = '';
|
||||||
}
|
}
|
||||||
|
@ -124,14 +108,6 @@ class WalletOptionsProvider with ChangeNotifier {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
snackCopyKey(context) {
|
|
||||||
const snackBar = SnackBar(
|
|
||||||
content:
|
|
||||||
Text("Cette clé publique a été copié dans votre presse-papier."),
|
|
||||||
duration: Duration(seconds: 2));
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
|
||||||
}
|
|
||||||
|
|
||||||
String getShortPubkey(String pubkey) {
|
String getShortPubkey(String pubkey) {
|
||||||
List<int> pubkeyByte = Base58Decode(pubkey);
|
List<int> pubkeyByte = Base58Decode(pubkey);
|
||||||
Digest pubkeyS256 = sha256.convert(sha256.convert(pubkeyByte).bytes);
|
Digest pubkeyS256 = sha256.convert(sha256.convert(pubkeyByte).bytes);
|
||||||
|
@ -161,10 +137,14 @@ class WalletOptionsProvider with ChangeNotifier {
|
||||||
|
|
||||||
if (pickedFile != null) {
|
if (pickedFile != null) {
|
||||||
_image = File(pickedFile.path);
|
_image = File(pickedFile.path);
|
||||||
|
|
||||||
|
////TODO: Store image on disk, store path in walletBox.imagePath
|
||||||
|
|
||||||
log.i(pickedFile.path);
|
log.i(pickedFile.path);
|
||||||
return _image;
|
return _image;
|
||||||
} else {
|
} else {
|
||||||
log.w('No image selected.');
|
log.w('No image selected.');
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,3 +166,30 @@ class WalletOptionsProvider with ChangeNotifier {
|
||||||
return _address;
|
return _address;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget balance(BuildContext context, String address, double size) {
|
||||||
|
String balanceCache = '';
|
||||||
|
|
||||||
|
return Column(children: <Widget>[
|
||||||
|
Consumer<SubstrateSdk>(builder: (context, _sdk, _) {
|
||||||
|
return FutureBuilder(
|
||||||
|
future: _sdk.getBalance(address),
|
||||||
|
builder: (BuildContext context, AsyncSnapshot<num?> _balance) {
|
||||||
|
if (_balance.connectionState != ConnectionState.done ||
|
||||||
|
_balance.hasError) {
|
||||||
|
return Text(balanceCache,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: isTall ? size : size * 0.9,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
balanceCache = "${_balance.data.toString()} $currencyName";
|
||||||
|
return Text(
|
||||||
|
balanceCache,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: isTall ? size : 18,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
|
@ -239,25 +239,6 @@ class WalletsProfilesProvider with ChangeNotifier {
|
||||||
return num.parse(result);
|
return num.parse(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
snackCopyKey(context) {
|
|
||||||
const snackBar = SnackBar(
|
|
||||||
padding: EdgeInsets.all(20),
|
|
||||||
content:
|
|
||||||
Text("Cette clé publique a été copié dans votre presse-papier."),
|
|
||||||
duration: Duration(seconds: 2));
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
|
||||||
}
|
|
||||||
|
|
||||||
void switchProfileView() {
|
|
||||||
isHistoryScreen = !isHistoryScreen;
|
|
||||||
if (isHistoryScreen) {
|
|
||||||
historySwitchButtun = "Payer";
|
|
||||||
} else {
|
|
||||||
historySwitchButtun = "Voir l'historique";
|
|
||||||
}
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
String generateIdenticon(String _pubkey) {
|
String generateIdenticon(String _pubkey) {
|
||||||
return Jdenticon.toSvg(_pubkey);
|
return Jdenticon.toSvg(_pubkey);
|
||||||
}
|
}
|
||||||
|
@ -285,3 +266,12 @@ class WalletsProfilesProvider with ChangeNotifier {
|
||||||
return balance;
|
return balance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snackCopyKey(context) {
|
||||||
|
const snackBar = SnackBar(
|
||||||
|
padding: EdgeInsets.all(20),
|
||||||
|
content: Text("Cette clé publique a été copié dans votre presse-papier.",
|
||||||
|
style: TextStyle(fontSize: 16)),
|
||||||
|
duration: Duration(seconds: 2));
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
|
}
|
||||||
|
|
|
@ -403,7 +403,7 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
|
||||||
key: const Key('copyPubkey'),
|
key: const Key('copyPubkey'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(text: pubkey));
|
Clipboard.setData(ClipboardData(text: pubkey));
|
||||||
_historyProvider.snackCopyKey(context);
|
snackCopyKey(context);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
_historyProvider.getShortPubkey(pubkey!),
|
_historyProvider.getShortPubkey(pubkey!),
|
||||||
|
|
|
@ -1,410 +0,0 @@
|
||||||
import 'dart:async';
|
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:ui';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:gecko/globals.dart';
|
|
||||||
import 'package:gecko/models/chest_data.dart';
|
|
||||||
import 'package:gecko/providers/chest_provider.dart';
|
|
||||||
import 'package:gecko/providers/wallets_profiles.dart';
|
|
||||||
import 'package:gecko/providers/my_wallets.dart';
|
|
||||||
import 'package:gecko/models/queries.dart';
|
|
||||||
import 'package:gecko/providers/wallet_options.dart';
|
|
||||||
import 'package:gecko/screens/history.dart';
|
|
||||||
import 'package:gecko/screens/myWallets/change_pin.dart';
|
|
||||||
import 'package:graphql_flutter/graphql_flutter.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:qr_flutter/qr_flutter.dart';
|
|
||||||
|
|
||||||
bool _isNewNameValid = false;
|
|
||||||
|
|
||||||
class CesiumWalletOptions extends StatelessWidget {
|
|
||||||
const CesiumWalletOptions(
|
|
||||||
{Key? key, Key? keyMyWallets, required this.cesiumWallet})
|
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
final ChestData cesiumWallet;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
|
||||||
WalletOptionsProvider _walletOptions =
|
|
||||||
Provider.of<WalletOptionsProvider>(context, listen: false);
|
|
||||||
ChestProvider _chestProvider =
|
|
||||||
Provider.of<ChestProvider>(context, listen: false);
|
|
||||||
WalletsProfilesProvider _historyProvider =
|
|
||||||
Provider.of<WalletsProfilesProvider>(context, listen: false);
|
|
||||||
MyWalletsProvider _myWalletProvider =
|
|
||||||
Provider.of<MyWalletsProvider>(context, listen: false);
|
|
||||||
|
|
||||||
final String shortPubkey =
|
|
||||||
_walletOptions.getShortPubkey(_walletOptions.address.text);
|
|
||||||
|
|
||||||
if (_isNewNameValid == false) {
|
|
||||||
_walletOptions.nameController.text = cesiumWallet.name!;
|
|
||||||
} else {
|
|
||||||
cesiumWallet.name = _walletOptions.nameController.text;
|
|
||||||
}
|
|
||||||
|
|
||||||
return WillPopScope(
|
|
||||||
onWillPop: () {
|
|
||||||
_walletOptions.isEditing = false;
|
|
||||||
_walletOptions.isBalanceBlur = true;
|
|
||||||
Navigator.popUntil(
|
|
||||||
context,
|
|
||||||
ModalRoute.withName('/'),
|
|
||||||
);
|
|
||||||
return Future<bool>.value(true);
|
|
||||||
},
|
|
||||||
child: Scaffold(
|
|
||||||
resizeToAvoidBottomInset: false,
|
|
||||||
appBar: AppBar(
|
|
||||||
toolbarHeight: 60 * ratio,
|
|
||||||
elevation: 0,
|
|
||||||
leading: IconButton(
|
|
||||||
icon: const Icon(Icons.arrow_back, color: Colors.black),
|
|
||||||
onPressed: () {
|
|
||||||
_walletOptions.isEditing = false;
|
|
||||||
_walletOptions.isBalanceBlur = true;
|
|
||||||
Navigator.popUntil(
|
|
||||||
context,
|
|
||||||
ModalRoute.withName('/'),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
title: SizedBox(
|
|
||||||
height: 22,
|
|
||||||
child: Consumer<WalletOptionsProvider>(
|
|
||||||
builder: (context, walletProvider, _) {
|
|
||||||
return Text(_walletOptions.nameController.text);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
body: Builder(
|
|
||||||
builder: (ctx) => SafeArea(
|
|
||||||
child: Column(children: <Widget>[
|
|
||||||
Consumer<WalletOptionsProvider>(
|
|
||||||
builder: (context, walletProvider, _) {
|
|
||||||
return Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
gradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [
|
|
||||||
yellowC,
|
|
||||||
const Color(0xfffafafa),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
||||||
children: <Widget>[
|
|
||||||
const Spacer(flex: 1),
|
|
||||||
InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
File newAvatar =
|
|
||||||
await (_walletOptions.changeAvatar());
|
|
||||||
cesiumWallet.imageFile = newAvatar;
|
|
||||||
_walletOptions.reloadBuild();
|
|
||||||
},
|
|
||||||
child: cesiumWallet.imageFile == null
|
|
||||||
? Image.asset(
|
|
||||||
'assets/chests/${cesiumWallet.imageName}',
|
|
||||||
width: 110,
|
|
||||||
)
|
|
||||||
: Image.file(cesiumWallet.imageFile!, width: 110),
|
|
||||||
),
|
|
||||||
InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
File newAvatar =
|
|
||||||
await (_walletOptions.changeAvatar());
|
|
||||||
cesiumWallet.imageFile = newAvatar;
|
|
||||||
_walletOptions.reloadBuild();
|
|
||||||
},
|
|
||||||
child: Column(children: <Widget>[
|
|
||||||
Image.asset(
|
|
||||||
'assets/walletOptions/camera.png',
|
|
||||||
height: 40,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 80)
|
|
||||||
])),
|
|
||||||
const Spacer(flex: 1),
|
|
||||||
Column(children: <Widget>[
|
|
||||||
SizedBox(
|
|
||||||
width: 260,
|
|
||||||
child: TextField(
|
|
||||||
key: const Key('walletName'),
|
|
||||||
autofocus: false,
|
|
||||||
focusNode: _walletOptions.walletNameFocus,
|
|
||||||
enabled: _walletOptions.isEditing,
|
|
||||||
controller: _walletOptions.nameController,
|
|
||||||
minLines: 1,
|
|
||||||
maxLines: 3,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
border: InputBorder.none,
|
|
||||||
focusedBorder: InputBorder.none,
|
|
||||||
enabledBorder: InputBorder.none,
|
|
||||||
disabledBorder: InputBorder.none,
|
|
||||||
contentPadding: EdgeInsets.all(15.0),
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: isTall ? 27 : 23,
|
|
||||||
color: Colors.black,
|
|
||||||
fontWeight: FontWeight.w400,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
SizedBox(height: isTall ? 5 : 0),
|
|
||||||
Query(
|
|
||||||
options: QueryOptions(
|
|
||||||
document: gql(getBalance),
|
|
||||||
variables: {
|
|
||||||
'pubkey': _walletOptions.address.text,
|
|
||||||
},
|
|
||||||
// pollInterval: Duration(seconds: 1),
|
|
||||||
),
|
|
||||||
builder: (QueryResult result,
|
|
||||||
{VoidCallback? refetch, FetchMore? fetchMore}) {
|
|
||||||
if (result.hasException) {
|
|
||||||
return Text(result.exception.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result.isLoading) {
|
|
||||||
return const Text('Loading');
|
|
||||||
}
|
|
||||||
|
|
||||||
// List repositories = result.data['viewer']['repositories']['nodes'];
|
|
||||||
String wBalanceUD;
|
|
||||||
if (result.data!['balance'] == null) {
|
|
||||||
wBalanceUD = '0.0';
|
|
||||||
} else {
|
|
||||||
int wBalanceG1 =
|
|
||||||
result.data!['balance']['amount'];
|
|
||||||
int currentUD =
|
|
||||||
result.data!['currentUd']['amount'];
|
|
||||||
double wBalanceUDBrut =
|
|
||||||
wBalanceG1 / currentUD; // .toString();
|
|
||||||
wBalanceUD = double.parse(
|
|
||||||
(wBalanceUDBrut).toStringAsFixed(2))
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
return Row(children: <Widget>[
|
|
||||||
ImageFiltered(
|
|
||||||
imageFilter: ImageFilter.blur(
|
|
||||||
sigmaX: _walletOptions.isBalanceBlur
|
|
||||||
? 6
|
|
||||||
: 0.001,
|
|
||||||
sigmaY: _walletOptions.isBalanceBlur
|
|
||||||
? 5
|
|
||||||
: 0.001),
|
|
||||||
child: Text(wBalanceUD,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: isTall ? 20 : 18,
|
|
||||||
color: Colors.black)),
|
|
||||||
),
|
|
||||||
Text(' DU',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: isTall ? 20 : 18,
|
|
||||||
color: Colors.black))
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Text(
|
|
||||||
// '$wBalanceUD DU',
|
|
||||||
// style: TextStyle(
|
|
||||||
// fontSize: 20, color: Colors.black),
|
|
||||||
// );
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
InkWell(
|
|
||||||
key: const Key('displayBalance'),
|
|
||||||
onTap: () {
|
|
||||||
_walletOptions.bluringBalance();
|
|
||||||
},
|
|
||||||
child: Image.asset(
|
|
||||||
_walletOptions.isBalanceBlur
|
|
||||||
? 'assets/walletOptions/icon_oeuil.png'
|
|
||||||
: 'assets/walletOptions/icon_oeuil_close.png',
|
|
||||||
height: 35,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
Column(children: <Widget>[
|
|
||||||
InkWell(
|
|
||||||
key: const Key('renameWallet'),
|
|
||||||
onTap: () async {
|
|
||||||
_isNewNameValid = _walletOptions.editWalletName(
|
|
||||||
[cesiumWallet.key, 0],
|
|
||||||
isCesium: cesiumWallet.isCesium);
|
|
||||||
await Future.delayed(
|
|
||||||
const Duration(milliseconds: 30));
|
|
||||||
_walletOptions.walletNameFocus.requestFocus();
|
|
||||||
},
|
|
||||||
child: ClipRRect(
|
|
||||||
child: Image.asset(
|
|
||||||
_walletOptions.isEditing
|
|
||||||
? 'assets/walletOptions/android-checkmark.png'
|
|
||||||
: 'assets/walletOptions/edit.png',
|
|
||||||
width: 20,
|
|
||||||
height: 20),
|
|
||||||
)),
|
|
||||||
const SizedBox(
|
|
||||||
height: 60,
|
|
||||||
)
|
|
||||||
]),
|
|
||||||
const Spacer(flex: 3),
|
|
||||||
]),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
SizedBox(height: 4 * ratio),
|
|
||||||
QrImageWidget(
|
|
||||||
data: _walletOptions.address.text,
|
|
||||||
version: QrVersions.auto,
|
|
||||||
size: isTall ? 300 : 270,
|
|
||||||
),
|
|
||||||
SizedBox(height: 15 * ratio),
|
|
||||||
GestureDetector(
|
|
||||||
key: const Key('copyPubkey'),
|
|
||||||
onTap: () {
|
|
||||||
Clipboard.setData(
|
|
||||||
ClipboardData(text: _walletOptions.address.text));
|
|
||||||
_walletOptions.snackCopyKey(ctx);
|
|
||||||
},
|
|
||||||
child: SizedBox(
|
|
||||||
height: 50,
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
const SizedBox(width: 30),
|
|
||||||
Image.asset(
|
|
||||||
'assets/walletOptions/key.png',
|
|
||||||
height: 45,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 20),
|
|
||||||
Text("${shortPubkey.split(':')[0]}:",
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 22,
|
|
||||||
fontWeight: FontWeight.w800,
|
|
||||||
fontFamily: 'Monospace',
|
|
||||||
color: Colors.black)),
|
|
||||||
Text(shortPubkey.split(':')[1],
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 22,
|
|
||||||
fontWeight: FontWeight.w800,
|
|
||||||
fontFamily: 'Monospace')),
|
|
||||||
const SizedBox(width: 15),
|
|
||||||
SizedBox(
|
|
||||||
height: 40,
|
|
||||||
child: ElevatedButton(
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
elevation: 1,
|
|
||||||
primary: orangeC, // background
|
|
||||||
onPrimary: Colors.black, // foreground
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
Clipboard.setData(ClipboardData(
|
|
||||||
text: _walletOptions.address.text));
|
|
||||||
_walletOptions.snackCopyKey(ctx);
|
|
||||||
},
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
Image.asset(
|
|
||||||
'assets/walletOptions/copy-white.png',
|
|
||||||
height: 25,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 7),
|
|
||||||
Text('Copier',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 15, color: Colors.grey[50]))
|
|
||||||
]))),
|
|
||||||
]))),
|
|
||||||
SizedBox(height: 10 * ratio),
|
|
||||||
InkWell(
|
|
||||||
key: const Key('displayHistory'),
|
|
||||||
onTap: () {
|
|
||||||
_historyProvider.nPage = 1;
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) {
|
|
||||||
return HistoryScreen(
|
|
||||||
pubkey: _walletOptions.address.text);
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: SizedBox(
|
|
||||||
height: 50,
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
const SizedBox(width: 30),
|
|
||||||
Image.asset(
|
|
||||||
'assets/walletOptions/clock.png',
|
|
||||||
height: 45,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 22),
|
|
||||||
const Text('Historique des transactions',
|
|
||||||
style:
|
|
||||||
TextStyle(fontSize: 20, color: Colors.black)),
|
|
||||||
]))),
|
|
||||||
SizedBox(height: 7 * ratio),
|
|
||||||
InkWell(
|
|
||||||
key: const Key('changePin'),
|
|
||||||
onTap: () async {
|
|
||||||
// await _chestProvider.changePin(context, cesiumWallet);
|
|
||||||
String? newPin = await Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (context) {
|
|
||||||
return ChangePinScreen(
|
|
||||||
walletName: cesiumWallet.name,
|
|
||||||
walletProvider: _myWalletProvider,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if (newPin != null) _myWalletProvider.pinCode = newPin;
|
|
||||||
},
|
|
||||||
child: SizedBox(
|
|
||||||
height: 50,
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
const SizedBox(width: 31),
|
|
||||||
Image.asset(
|
|
||||||
'assets/chests/secret_code.png',
|
|
||||||
height: 24,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 20),
|
|
||||||
const Text('Changer mon code secret',
|
|
||||||
style: TextStyle(fontSize: 20, color: Colors.black)),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 7 * ratio),
|
|
||||||
InkWell(
|
|
||||||
key: const Key('deleteWallet'),
|
|
||||||
onTap: () async {
|
|
||||||
await _chestProvider.deleteChest(context, cesiumWallet);
|
|
||||||
},
|
|
||||||
child: SizedBox(
|
|
||||||
height: 50,
|
|
||||||
child: Row(children: <Widget>[
|
|
||||||
const SizedBox(width: 33),
|
|
||||||
Image.asset(
|
|
||||||
'assets/walletOptions/trash.png',
|
|
||||||
height: 45,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 21),
|
|
||||||
const Text(
|
|
||||||
'Supprimer ce coffre',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20,
|
|
||||||
color: Color(0xffD80000),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:durt/durt.dart';
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:gecko/globals.dart';
|
import 'package:gecko/globals.dart';
|
||||||
|
@ -127,11 +126,6 @@ class GenerateFastChestScreen extends StatelessWidget {
|
||||||
? () async {
|
? () async {
|
||||||
_generateWalletProvider.nbrWord =
|
_generateWalletProvider.nbrWord =
|
||||||
_generateWalletProvider.getRandomInt();
|
_generateWalletProvider.getRandomInt();
|
||||||
_generateWalletProvider.actualWallet = await Dewif()
|
|
||||||
.generateDewif(
|
|
||||||
_generateWalletProvider.generatedMnemonic!,
|
|
||||||
_generateWalletProvider.pin.text,
|
|
||||||
lang: appLang);
|
|
||||||
await Navigator.push(
|
await Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) {
|
MaterialPageRoute(builder: (context) {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
|
||||||
import 'package:gecko/globals.dart';
|
import 'package:gecko/globals.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gecko/providers/generate_wallets.dart';
|
import 'package:gecko/providers/generate_wallets.dart';
|
||||||
|
import 'package:gecko/providers/substrate_sdk.dart';
|
||||||
import 'package:gecko/screens/common_elements.dart';
|
import 'package:gecko/screens/common_elements.dart';
|
||||||
import 'package:gecko/screens/onBoarding/11.dart';
|
import 'package:gecko/screens/onBoarding/11.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
@ -15,14 +16,19 @@ class RestoreChest extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
GenerateWalletsProvider generateWalletProvider =
|
GenerateWalletsProvider genW =
|
||||||
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
||||||
|
SubstrateSdk _sub = Provider.of<SubstrateSdk>(context, listen: false);
|
||||||
|
|
||||||
generateWalletProvider.actualWallet = null;
|
genW.actualWallet = null;
|
||||||
|
if (genW.isSentenceComplete(context)) {
|
||||||
|
genW.generatedMnemonic =
|
||||||
|
'${genW.cellController0.text} ${genW.cellController1.text} ${genW.cellController2.text} ${genW.cellController3.text} ${genW.cellController4.text} ${genW.cellController5.text} ${genW.cellController6.text} ${genW.cellController7.text} ${genW.cellController8.text} ${genW.cellController9.text} ${genW.cellController10.text} ${genW.cellController11.text}';
|
||||||
|
}
|
||||||
|
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () {
|
onWillPop: () {
|
||||||
generateWalletProvider.resetImportView();
|
genW.resetImportView();
|
||||||
return Future<bool>.value(true);
|
return Future<bool>.value(true);
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
|
@ -31,7 +37,7 @@ class RestoreChest extends StatelessWidget {
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: const Icon(Icons.arrow_back, color: Colors.black),
|
icon: const Icon(Icons.arrow_back, color: Colors.black),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
generateWalletProvider.resetImportView();
|
genW.resetImportView();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}),
|
}),
|
||||||
title: const SizedBox(
|
title: const SizedBox(
|
||||||
|
@ -48,32 +54,32 @@ class RestoreChest extends StatelessWidget {
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
arrayCell(context, generateWalletProvider.cellController0),
|
arrayCell(context, genW.cellController0),
|
||||||
arrayCell(context, generateWalletProvider.cellController1),
|
arrayCell(context, genW.cellController1),
|
||||||
arrayCell(context, generateWalletProvider.cellController2),
|
arrayCell(context, genW.cellController2),
|
||||||
arrayCell(context, generateWalletProvider.cellController3),
|
arrayCell(context, genW.cellController3),
|
||||||
]),
|
]),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
arrayCell(context, generateWalletProvider.cellController4),
|
arrayCell(context, genW.cellController4),
|
||||||
arrayCell(context, generateWalletProvider.cellController5),
|
arrayCell(context, genW.cellController5),
|
||||||
arrayCell(context, generateWalletProvider.cellController6),
|
arrayCell(context, genW.cellController6),
|
||||||
arrayCell(context, generateWalletProvider.cellController7),
|
arrayCell(context, genW.cellController7),
|
||||||
]),
|
]),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
arrayCell(context, generateWalletProvider.cellController8),
|
arrayCell(context, genW.cellController8),
|
||||||
arrayCell(context, generateWalletProvider.cellController9),
|
arrayCell(context, genW.cellController9),
|
||||||
arrayCell(context, generateWalletProvider.cellController10),
|
arrayCell(context, genW.cellController10),
|
||||||
arrayCell(context, generateWalletProvider.cellController11),
|
arrayCell(context, genW.cellController11),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
// const Spacer(),
|
// const Spacer(),
|
||||||
if (generateWalletProvider.isSentenceComplete(context))
|
if (genW.isSentenceComplete(context))
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
|
@ -87,8 +93,8 @@ class RestoreChest extends StatelessWidget {
|
||||||
onPrimary: Colors.white, // foreground
|
onPrimary: Colors.white, // foreground
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (await generateWalletProvider.isSentenceValid()) {
|
if (await _sub.isMnemonicValid(genW.generatedMnemonic!)) {
|
||||||
generateWalletProvider.resetImportView();
|
genW.resetImportView();
|
||||||
await Navigator.push(
|
await Navigator.push(
|
||||||
context,
|
context,
|
||||||
FaderTransition(
|
FaderTransition(
|
||||||
|
@ -121,7 +127,7 @@ class RestoreChest extends StatelessWidget {
|
||||||
onPrimary: Colors.black, // foreground
|
onPrimary: Colors.black, // foreground
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
generateWalletProvider.pasteMnemonic(context);
|
genW.pasteMnemonic(context);
|
||||||
},
|
},
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Coller depuis le\npresse-papier',
|
'Coller depuis le\npresse-papier',
|
||||||
|
@ -193,7 +199,7 @@ class RestoreChest extends StatelessWidget {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('Phrase incorrecte'),
|
title: const Text('Phrase incorrecte'),
|
||||||
content: const Text(
|
content: const Text(
|
||||||
'Votre phrase de restauration semble incorrecte, veuillez la corriger.'),
|
'Votre phrase de restauration semble incorrecte, les mots ne sont pas dans le bon ordre.\nVeuillez la corriger.'),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: const Text("OK"),
|
child: const Text("OK"),
|
||||||
|
|
|
@ -8,7 +8,6 @@ import 'package:gecko/providers/my_wallets.dart';
|
||||||
import 'package:gecko/models/wallet_data.dart';
|
import 'package:gecko/models/wallet_data.dart';
|
||||||
import 'package:gecko/providers/wallet_options.dart';
|
import 'package:gecko/providers/wallet_options.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gecko/screens/myWallets/cesium_wallet_options.dart';
|
|
||||||
import 'package:gecko/screens/myWallets/choose_chest.dart';
|
import 'package:gecko/screens/myWallets/choose_chest.dart';
|
||||||
import 'package:gecko/screens/myWallets/choose_wallet.dart';
|
import 'package:gecko/screens/myWallets/choose_wallet.dart';
|
||||||
import 'package:gecko/screens/myWallets/wallets_home.dart';
|
import 'package:gecko/screens/myWallets/wallets_home.dart';
|
||||||
|
@ -214,20 +213,12 @@ class UnlockingWallet extends StatelessWidget {
|
||||||
} else {
|
} else {
|
||||||
pinColor = Colors.green[400];
|
pinColor = Colors.green[400];
|
||||||
if (action == "mywallets") {
|
if (action == "mywallets") {
|
||||||
currentChest.isCesium!
|
Navigator.push(
|
||||||
? Navigator.push(
|
context,
|
||||||
context,
|
MaterialPageRoute(builder: (context) {
|
||||||
MaterialPageRoute(builder: (context) {
|
return const WalletsHome();
|
||||||
return CesiumWalletOptions(
|
}),
|
||||||
cesiumWallet: currentChest);
|
);
|
||||||
}),
|
|
||||||
).then((value) => _myWalletProvider.mnemonic = '')
|
|
||||||
: Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: (context) {
|
|
||||||
return const WalletsHome();
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
} else if (action == "pay") {
|
} else if (action == "pay") {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:ui';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gecko/globals.dart';
|
import 'package:gecko/globals.dart';
|
||||||
import 'package:gecko/providers/my_wallets.dart';
|
import 'package:gecko/providers/my_wallets.dart';
|
||||||
import 'package:gecko/models/wallet_data.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/wallet_options.dart';
|
||||||
import 'package:gecko/providers/wallets_profiles.dart';
|
import 'package:gecko/providers/wallets_profiles.dart';
|
||||||
import 'package:gecko/screens/history.dart';
|
import 'package:gecko/screens/history.dart';
|
||||||
|
@ -92,13 +89,13 @@ class WalletOptions extends StatelessWidget {
|
||||||
Column(children: <Widget>[
|
Column(children: <Widget>[
|
||||||
walletName(walletProvider, _walletOptions),
|
walletName(walletProvider, _walletOptions),
|
||||||
SizedBox(height: isTall ? 5 : 0),
|
SizedBox(height: isTall ? 5 : 0),
|
||||||
balance(context, walletProvider),
|
balance(context, walletProvider.address.text, 20),
|
||||||
]),
|
]),
|
||||||
const Spacer(flex: 3),
|
const Spacer(flex: 3),
|
||||||
]),
|
]),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
SizedBox(height: 4 * ratio),
|
SizedBox(height: 10 * ratio),
|
||||||
QrImageWidget(
|
QrImageWidget(
|
||||||
data: _walletOptions.address.text,
|
data: _walletOptions.address.text,
|
||||||
version: QrVersions.auto,
|
version: QrVersions.auto,
|
||||||
|
@ -132,8 +129,10 @@ class WalletOptions extends StatelessWidget {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
File newAvatar = await (walletProvider.changeAvatar());
|
wallet.imageFile = await (walletProvider.changeAvatar());
|
||||||
wallet.imageFile = newAvatar;
|
if (wallet.imageFile != null) {
|
||||||
|
walletBox.put(wallet.key, wallet);
|
||||||
|
}
|
||||||
walletProvider.reloadBuild();
|
walletProvider.reloadBuild();
|
||||||
},
|
},
|
||||||
child: wallet.imageFile == null
|
child: wallet.imageFile == null
|
||||||
|
@ -151,8 +150,7 @@ class WalletOptions extends StatelessWidget {
|
||||||
top: 0,
|
top: 0,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
File newAvatar = await (walletProvider.changeAvatar());
|
wallet.imageFile = await (walletProvider.changeAvatar());
|
||||||
wallet.imageFile = newAvatar;
|
|
||||||
walletProvider.reloadBuild();
|
walletProvider.reloadBuild();
|
||||||
},
|
},
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
|
@ -223,52 +221,6 @@ class WalletOptions extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget balance(BuildContext context, WalletOptionsProvider walletProvider) {
|
|
||||||
String balanceCache = '';
|
|
||||||
|
|
||||||
return Column(children: <Widget>[
|
|
||||||
Consumer<SubstrateSdk>(builder: (context, _sdk, _) {
|
|
||||||
return FutureBuilder(
|
|
||||||
future: _sdk.getBalance(walletProvider.address.text),
|
|
||||||
builder: (BuildContext context, AsyncSnapshot<num?> _balance) {
|
|
||||||
if (_balance.connectionState != ConnectionState.done ||
|
|
||||||
_balance.hasError) {
|
|
||||||
return Text(balanceCache,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: isTall ? 20 : 18,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
balanceCache = "${_balance.data.toString()} $currencyName";
|
|
||||||
return ImageFiltered(
|
|
||||||
imageFilter: ImageFilter.blur(
|
|
||||||
sigmaX: walletProvider.isBalanceBlur ? 6 : 0,
|
|
||||||
sigmaY: walletProvider.isBalanceBlur ? 5 : 0),
|
|
||||||
child: Text(
|
|
||||||
balanceCache,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: isTall ? 20 : 18,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
|
|
||||||
const SizedBox(height: 15),
|
|
||||||
// InkWell(
|
|
||||||
// key: const Key('displayBalance'),
|
|
||||||
// onTap: () {
|
|
||||||
// walletProvider.bluringBalance();
|
|
||||||
// },
|
|
||||||
// child: Image.asset(
|
|
||||||
// walletProvider.isBalanceBlur
|
|
||||||
// ? 'assets/walletOptions/icon_oeuil.png'
|
|
||||||
// : 'assets/walletOptions/icon_oeuil_close.png',
|
|
||||||
// height: 35,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget pubkeyWidget(WalletOptionsProvider walletProvider, BuildContext ctx) {
|
Widget pubkeyWidget(WalletOptionsProvider walletProvider, BuildContext ctx) {
|
||||||
final String shortPubkey =
|
final String shortPubkey =
|
||||||
walletProvider.getShortPubkey(walletProvider.address.text);
|
walletProvider.getShortPubkey(walletProvider.address.text);
|
||||||
|
@ -276,7 +228,7 @@ class WalletOptions extends StatelessWidget {
|
||||||
key: const Key('copyPubkey'),
|
key: const Key('copyPubkey'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(text: walletProvider.address.text));
|
Clipboard.setData(ClipboardData(text: walletProvider.address.text));
|
||||||
walletProvider.snackCopyKey(ctx);
|
snackCopyKey(ctx);
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 50,
|
height: 50,
|
||||||
|
@ -313,7 +265,7 @@ class WalletOptions extends StatelessWidget {
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Clipboard.setData(
|
Clipboard.setData(
|
||||||
ClipboardData(text: walletProvider.address.text));
|
ClipboardData(text: walletProvider.address.text));
|
||||||
walletProvider.snackCopyKey(ctx);
|
snackCopyKey(ctx);
|
||||||
},
|
},
|
||||||
child: Row(children: <Widget>[
|
child: Row(children: <Widget>[
|
||||||
Image.asset(
|
Image.asset(
|
||||||
|
|
|
@ -18,20 +18,30 @@ class OnboardingStepOne extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||||
CommonElements common = CommonElements();
|
////TODO: Continue onbarding refactoring
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
toolbarHeight: 60 * ratio,
|
||||||
|
title: const SizedBox(
|
||||||
|
height: 22,
|
||||||
|
child: Text(
|
||||||
|
'Nouveau portefeuille',
|
||||||
|
style: TextStyle(fontWeight: FontWeight.w600),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Column(children: <Widget>[
|
child: Column(children: <Widget>[
|
||||||
common.onboardingProgressBar(
|
// common.onboardingProgressBar(
|
||||||
context, 'Nouveau portefeuilles', progress),
|
// context, 'Nouveau portefeuilles', progress),
|
||||||
common.bubbleSpeak(
|
// common.bubbleSpeak(
|
||||||
"Il semblerait que vous n’ayez pas encore de coffre.\n\nUn coffre vous permet de gérer un ou plusieurs portefeuilles.",
|
// "Il semblerait que vous n’ayez pas encore de coffre.\n\nUn coffre vous permet de gérer un ou plusieurs portefeuilles.",
|
||||||
textKey: const Key('step1')),
|
// textKey: const Key('step1')),
|
||||||
const SizedBox(height: 90),
|
const SizedBox(height: 90),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'assets/onBoarding/keys-and-wallets-horizontal.png',
|
'assets/onBoarding/fabrication-de-portefeuille.png',
|
||||||
height: 200,
|
height: 200,
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
|
@ -3,6 +3,7 @@ import 'package:gecko/globals.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gecko/providers/cesium_plus.dart';
|
import 'package:gecko/providers/cesium_plus.dart';
|
||||||
import 'package:gecko/models/g1_wallets_list.dart';
|
import 'package:gecko/models/g1_wallets_list.dart';
|
||||||
|
import 'package:gecko/providers/wallet_options.dart';
|
||||||
import 'package:gecko/providers/wallets_profiles.dart';
|
import 'package:gecko/providers/wallets_profiles.dart';
|
||||||
import 'package:gecko/providers/search.dart';
|
import 'package:gecko/providers/search.dart';
|
||||||
import 'package:gecko/screens/wallet_view.dart';
|
import 'package:gecko/screens/wallet_view.dart';
|
||||||
|
@ -133,6 +134,11 @@ class SearchResultScreen extends StatelessWidget {
|
||||||
fontWeight: FontWeight.w500),
|
fontWeight: FontWeight.w500),
|
||||||
textAlign: TextAlign.center),
|
textAlign: TextAlign.center),
|
||||||
]),
|
]),
|
||||||
|
trailing: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
balance(context, g1Wallet.pubkey!, 16)
|
||||||
|
]),
|
||||||
subtitle: Row(children: <Widget>[
|
subtitle: Row(children: <Widget>[
|
||||||
Text(g1Wallet.id?.username ?? '',
|
Text(g1Wallet.id?.username ?? '',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
|
|
|
@ -2,15 +2,12 @@ import 'package:flutter/services.dart';
|
||||||
import 'package:gecko/globals.dart';
|
import 'package:gecko/globals.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gecko/providers/cesium_plus.dart';
|
import 'package:gecko/providers/cesium_plus.dart';
|
||||||
|
import 'package:gecko/providers/wallet_options.dart';
|
||||||
import 'package:gecko/providers/my_wallets.dart';
|
import 'package:gecko/providers/my_wallets.dart';
|
||||||
import 'package:gecko/models/wallet_data.dart';
|
import 'package:gecko/models/wallet_data.dart';
|
||||||
import 'package:gecko/providers/wallets_profiles.dart';
|
import 'package:gecko/providers/wallets_profiles.dart';
|
||||||
import 'package:gecko/models/queries.dart';
|
|
||||||
import 'package:gecko/screens/avatar_fullscreen.dart';
|
import 'package:gecko/screens/avatar_fullscreen.dart';
|
||||||
import 'package:gecko/screens/common_elements.dart';
|
|
||||||
import 'package:gecko/screens/history.dart';
|
|
||||||
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
||||||
import 'package:graphql_flutter/graphql_flutter.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class WalletViewScreen extends StatelessWidget {
|
class WalletViewScreen extends StatelessWidget {
|
||||||
|
@ -53,7 +50,8 @@ class WalletViewScreen extends StatelessWidget {
|
||||||
height: buttonSize,
|
height: buttonSize,
|
||||||
child: ClipOval(
|
child: ClipOval(
|
||||||
child: Material(
|
child: Material(
|
||||||
color: const Color(0xffFFD58D), // button color
|
color: Colors
|
||||||
|
.grey[300], //const Color(0xffFFD58D), // button color
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
key: const Key('viewHistory'),
|
key: const Key('viewHistory'),
|
||||||
splashColor: orangeC, // inkwell color
|
splashColor: orangeC, // inkwell color
|
||||||
|
@ -64,19 +62,20 @@ class WalletViewScreen extends StatelessWidget {
|
||||||
'assets/walletOptions/clock.png'),
|
'assets/walletOptions/clock.png'),
|
||||||
height: 90)),
|
height: 90)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_historyProvider.nPage = 1;
|
////TODO: wait for subsquid indexer
|
||||||
Navigator.push(
|
// _historyProvider.nPage = 1;
|
||||||
context,
|
// Navigator.push(
|
||||||
FaderTransition(
|
// context,
|
||||||
page: HistoryScreen(
|
// FaderTransition(
|
||||||
pubkey: pubkey,
|
// page: HistoryScreen(
|
||||||
username: username ??
|
// pubkey: pubkey,
|
||||||
g1WalletsBox.get(pubkey)?.username,
|
// username: username ??
|
||||||
avatar: avatar ??
|
// g1WalletsBox.get(pubkey)?.username,
|
||||||
g1WalletsBox.get(pubkey)?.avatar,
|
// avatar: avatar ??
|
||||||
),
|
// g1WalletsBox.get(pubkey)?.avatar,
|
||||||
isFast: false),
|
// ),
|
||||||
);
|
// isFast: false),
|
||||||
|
// );
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -105,7 +104,7 @@ class WalletViewScreen extends StatelessWidget {
|
||||||
height: 90)),
|
height: 90)),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(text: pubkey));
|
Clipboard.setData(ClipboardData(text: pubkey));
|
||||||
_historyProvider.snackCopyKey(context);
|
snackCopyKey(context);
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -286,21 +285,21 @@ class WalletViewScreen extends StatelessWidget {
|
||||||
primary: orangeC, // background
|
primary: orangeC, // background
|
||||||
onPrimary: Colors.white, // foreground
|
onPrimary: Colors.white, // foreground
|
||||||
),
|
),
|
||||||
onPressed:
|
onPressed: _walletViewProvider.payAmount.text !=
|
||||||
_walletViewProvider.payAmount.text != ''
|
''
|
||||||
? () {
|
? () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return UnlockingWallet(
|
return UnlockingWallet(
|
||||||
wallet: defaultWallet,
|
wallet: defaultWallet,
|
||||||
action: "pay");
|
action: "pay");
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
child: const Text(
|
child: const Text(
|
||||||
'Effectuer le virement',
|
'Effectuer le virement',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
@ -352,7 +351,7 @@ class WalletViewScreen extends StatelessWidget {
|
||||||
key: const Key('copyPubkey'),
|
key: const Key('copyPubkey'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(text: pubkey));
|
Clipboard.setData(ClipboardData(text: pubkey));
|
||||||
_historyProvider.snackCopyKey(context);
|
snackCopyKey(context);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
_historyProvider.getShortPubkey(pubkey!),
|
_historyProvider.getShortPubkey(pubkey!),
|
||||||
|
@ -363,40 +362,45 @@ class WalletViewScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 25),
|
||||||
if (username == null &&
|
Consumer<WalletOptionsProvider>(
|
||||||
g1WalletsBox.get(pubkey)?.username == null)
|
builder: (context, walletProvider, _) {
|
||||||
Query(
|
return balance(context, pubkey!, 20);
|
||||||
options: QueryOptions(
|
}),
|
||||||
document: gql(getId),
|
////
|
||||||
variables: {
|
// if (username == null &&
|
||||||
'pubkey': pubkey,
|
// g1WalletsBox.get(pubkey)?.username == null)
|
||||||
},
|
// Query(
|
||||||
),
|
// options: QueryOptions(
|
||||||
builder: (QueryResult result,
|
// document: gql(getId),
|
||||||
{VoidCallback? refetch, FetchMore? fetchMore}) {
|
// variables: {
|
||||||
if (result.isLoading || result.hasException) {
|
// 'pubkey': pubkey,
|
||||||
return const Text('...');
|
// },
|
||||||
} else if (result.data!['idty'] == null ||
|
// ),
|
||||||
result.data!['idty']['username'] == null) {
|
// builder: (QueryResult result,
|
||||||
g1WalletsBox.get(pubkey)?.username = '';
|
// {VoidCallback? refetch, FetchMore? fetchMore}) {
|
||||||
return const Text('');
|
// if (result.isLoading || result.hasException) {
|
||||||
} else {
|
// return const Text('...');
|
||||||
g1WalletsBox.get(pubkey)?.username =
|
// } else if (result.data!['idty'] == null ||
|
||||||
result.data!['idty']['username'] ?? '';
|
// result.data!['idty']['username'] == null) {
|
||||||
return SizedBox(
|
// g1WalletsBox.get(pubkey)?.username = '';
|
||||||
width: 230,
|
// return const Text('');
|
||||||
child: Text(
|
// } else {
|
||||||
result.data!['idty']['username'] ?? '',
|
// g1WalletsBox.get(pubkey)?.username =
|
||||||
style: const TextStyle(
|
// result.data!['idty']['username'] ?? '';
|
||||||
fontSize: 27,
|
// return SizedBox(
|
||||||
color: Color(0xff814C00),
|
// width: 230,
|
||||||
),
|
// child: Text(
|
||||||
),
|
// result.data!['idty']['username'] ?? '',
|
||||||
);
|
// style: const TextStyle(
|
||||||
}
|
// fontSize: 27,
|
||||||
},
|
// color: Color(0xff814C00),
|
||||||
),
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
if (username == null &&
|
if (username == null &&
|
||||||
g1WalletsBox.get(pubkey)?.username != null)
|
g1WalletsBox.get(pubkey)?.username != null)
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
@ -421,19 +425,20 @@ class WalletViewScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 25),
|
const SizedBox(height: 25),
|
||||||
FutureBuilder(
|
//// To get Cs+ name
|
||||||
future: _cesiumPlusProvider.getName(pubkey),
|
// FutureBuilder(
|
||||||
initialData: '...',
|
// future: _cesiumPlusProvider.getName(pubkey),
|
||||||
builder: (context, snapshot) {
|
// initialData: '...',
|
||||||
return SizedBox(
|
// builder: (context, snapshot) {
|
||||||
width: 230,
|
// return SizedBox(
|
||||||
child: Text(
|
// width: 230,
|
||||||
snapshot.data.toString(),
|
// child: Text(
|
||||||
style: const TextStyle(
|
// snapshot.data.toString(),
|
||||||
fontSize: 18, color: Colors.black),
|
// style: const TextStyle(
|
||||||
),
|
// fontSize: 18, color: Colors.black),
|
||||||
);
|
// ),
|
||||||
}),
|
// );
|
||||||
|
// }),
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
]),
|
]),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
|
|
49
pubspec.lock
|
@ -8,13 +8,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "40.0.0"
|
version: "40.0.0"
|
||||||
aes_ecb_pkcs5_flutter:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: aes_ecb_pkcs5_flutter
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.1.2"
|
|
||||||
analyzer:
|
analyzer:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -349,6 +342,13 @@ packages:
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_aes_ecb_pkcs5:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: flutter_aes_ecb_pkcs5
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.2"
|
||||||
flutter_driver:
|
flutter_driver:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -368,13 +368,6 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.4.3+7"
|
version: "5.4.3+7"
|
||||||
flutter_launcher_icons_maker:
|
|
||||||
dependency: "direct dev"
|
|
||||||
description:
|
|
||||||
name: flutter_launcher_icons_maker
|
|
||||||
url: "https://pub.dartlang.org"
|
|
||||||
source: hosted
|
|
||||||
version: "0.10.2"
|
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -566,7 +559,7 @@ packages:
|
||||||
name: http_parser
|
name: http_parser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
version: "4.0.1"
|
||||||
http_server:
|
http_server:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -574,6 +567,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
|
icons_launcher:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
name: icons_launcher
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.8"
|
||||||
image:
|
image:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -615,7 +615,7 @@ packages:
|
||||||
name: image_picker_ios
|
name: image_picker_ios
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.8.5+4"
|
version: "0.8.5+5"
|
||||||
image_picker_platform_interface:
|
image_picker_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -914,7 +914,7 @@ packages:
|
||||||
name: pdf
|
name: pdf
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.8.0"
|
version: "3.8.1"
|
||||||
permission_handler:
|
permission_handler:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -976,7 +976,7 @@ packages:
|
||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: fixAndroidActivityVersion
|
ref: fixAndroidActivityVersion
|
||||||
resolved-ref: db17df1a7e421066dd88a16ed46c5cc945b77f82
|
resolved-ref: e33351cde5ea9b55d191772fe3b36f9dbb8277e6
|
||||||
url: "https://github.com/poka-IT/sdk.git"
|
url: "https://github.com/poka-IT/sdk.git"
|
||||||
source: git
|
source: git
|
||||||
version: "0.4.5"
|
version: "0.4.5"
|
||||||
|
@ -992,7 +992,7 @@ packages:
|
||||||
description:
|
description:
|
||||||
path: printing
|
path: printing
|
||||||
ref: HEAD
|
ref: HEAD
|
||||||
resolved-ref: "726aab13746a4f515601febfb0824ba71dbe4f80"
|
resolved-ref: "95bbc1f33b7cb45f7a4b98088b96bc541fefc495"
|
||||||
url: "https://github.com/DavBfr/dart_pdf.git"
|
url: "https://github.com/DavBfr/dart_pdf.git"
|
||||||
source: git
|
source: git
|
||||||
version: "5.9.1"
|
version: "5.9.1"
|
||||||
|
@ -1069,7 +1069,7 @@ packages:
|
||||||
name: responsive_framework
|
name: responsive_framework
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.8"
|
version: "0.1.9"
|
||||||
rxdart:
|
rxdart:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -1306,6 +1306,13 @@ packages:
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
|
universal_io:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: universal_io
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.4"
|
||||||
unorm_dart:
|
unorm_dart:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
@ -1361,7 +1368,7 @@ packages:
|
||||||
name: webkit_inspection_protocol
|
name: webkit_inspection_protocol
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.1"
|
version: "1.1.0"
|
||||||
webview_flutter:
|
webview_flutter:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -81,7 +81,9 @@ dependencies:
|
||||||
ref: fixAndroidActivityVersion
|
ref: fixAndroidActivityVersion
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_launcher_icons_maker: ^0.10.2
|
# flutter_launcher_icons: ^0.9.2
|
||||||
|
# flutter_launcher_icons_maker: ^^0.10.2
|
||||||
|
icons_launcher: ^1.1.8
|
||||||
build_runner: ^2.1.2
|
build_runner: ^2.1.2
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
@ -95,6 +97,8 @@ flutter_icons:
|
||||||
image_path: "assets/icon/gecko_flat.png"
|
image_path: "assets/icon/gecko_flat.png"
|
||||||
remove_alpha_ios: true
|
remove_alpha_ios: true
|
||||||
|
|
||||||
|
uses-material-design: true
|
||||||
|
|
||||||
# The following section is specific to Flutter.
|
# The following section is specific to Flutter.
|
||||||
flutter:
|
flutter:
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
|
|
|
@ -19,7 +19,7 @@ cargo make
|
||||||
|
|
||||||
# Build APK
|
# Build APK
|
||||||
echo "Build APK..."
|
echo "Build APK..."
|
||||||
flutter clean
|
#flutter clean
|
||||||
flutter build apk --release --build-name $VERSION --build-number $BUILD
|
flutter build apk --release --build-name $VERSION --build-number $BUILD
|
||||||
|
|
||||||
# Create artifacts folder
|
# Create artifacts folder
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
flutter pub run flutter_launcher_icons_maker:main
|
flutter pub run icons_launcher:main
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|