Compare commits

...

10 Commits

93 changed files with 1871 additions and 1599 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -159,8 +159,8 @@
"days": "{} days", "days": "{} days",
"months": "{} months", "months": "{} months",
"certify": "Certify this\nidentity", "certify": "Certify this\nidentity",
"from": "From:", "from": "From:{}",
"to": "To:", "to": "To:{}",
"amount": "Amount:", "amount": "Amount:",
"choiceOfSourceWallet": "Choose a source wallet", "choiceOfSourceWallet": "Choose a source wallet",
"extrinsicInProgress": "{} in progress", "extrinsicInProgress": "{} in progress",
@ -171,16 +171,18 @@
"cancel": "Cancel", "cancel": "Cancel",
"inBlockchainResult": "In {} blockchain", "inBlockchainResult": "In {} blockchain",
"search": "Search an identity\nor an address", "search": "Search an identity\nor an address",
"currencyNode": "{} node :", "currencyNode": "node",
"contactsManagementWithNbr": "My contacts ({})", "contactsManagementWithNbr": "My contacts ({})",
"contactsManagement": "My contacts", "contactsManagement": "My contacts",
"noContacts": "You don't have any contact", "noContacts": "You don't have any contact",
"addContact": "Add\nto contacts", "addContact": "Add\nto contacts",
"removeContact": "Remove\nthis contact", "removeContact": "Remove\nthis contact",
"derivationsScanProgress": "Scan address {}/{}", "scanRootDerivationInProgress": "Scan root address",
"derivationsScanProgress": "Scan {} firsts addresses",
"importDerivationsInProgress": "Import address {}/{}",
"youAreOffline": "You are offline...", "youAreOffline": "You are offline...",
"importG1v1": "Import old G1v1 account", "importG1v1": "Import old G1v1 account",
"selectDestWallet": "Select a target wallet:", "migrateToThisWallet": "Migrate to this wallet:",
"youMustWaitBeforeCashoutThisAccount": "You have to wait a few moment before migrate this account", "youMustWaitBeforeCashoutThisAccount": "You have to wait a few moment before migrate this account",
"thisAccountIsEmpty": "This account is empty", "thisAccountIsEmpty": "This account is empty",
"youCannotMigrateIdentityToExistingIdentity": "You cannot migrate an identity\nto an account that already has an identity", "youCannotMigrateIdentityToExistingIdentity": "You cannot migrate an identity\nto an account that already has an identity",

View File

@ -160,8 +160,8 @@
"days": "{} dias", "days": "{} dias",
"months": "{} meses", "months": "{} meses",
"certify": "Certificar esta\nidentidad", "certify": "Certificar esta\nidentidad",
"from": "De:", "from": "De:{}",
"to": "A:", "to": "A:{}",
"amount": "Importe:", "amount": "Importe:",
"choiceOfSourceWallet": "Elige un monedero de origen", "choiceOfSourceWallet": "Elige un monedero de origen",
"extrinsicInProgress": "{} en progreso", "extrinsicInProgress": "{} en progreso",
@ -172,16 +172,18 @@
"cancel": "Cancelar", "cancel": "Cancelar",
"inBlockchainResult": "En la blockchain {}", "inBlockchainResult": "En la blockchain {}",
"search": "Buscar una identidad\no una dirección", "search": "Buscar una identidad\no una dirección",
"currencyNode": "Nodo {} :", "currencyNode": "Nodo",
"contactsManagementWithNbr": "Mis contactos ({})", "contactsManagementWithNbr": "Mis contactos ({})",
"contactsManagement": "Mis contactos", "contactsManagement": "Mis contactos",
"noContacts": "No tienes ningún contacto", "noContacts": "No tienes ningún contacto",
"addContact": "Añadir\na contactos", "addContact": "Añadir\na contactos",
"removeContact": "Eliminar\neste contacto", "removeContact": "Eliminar\neste contacto",
"derivationsScanProgress": "Escaneado de la dirección {}/{}", "scanRootDerivationInProgress": "Scan root address",
"derivationsScanProgress": "Scan {} firsts addresses",
"importDerivationsInProgress": "Import address {}/{}",
"youAreOffline": "Estás desconectado...", "youAreOffline": "Estás desconectado...",
"importG1v1": "Importar la cuenta antigua de G1v1", "importG1v1": "Importar la cuenta antigua de G1v1",
"selectDestWallet": "Selecciona un monedero destino:", "migrateToThisWallet": "Migrate to this wallet:",
"youMustWaitBeforeCashoutThisAccount": "Tienes que esperar unos minutos antes de migrar esta cuenta", "youMustWaitBeforeCashoutThisAccount": "Tienes que esperar unos minutos antes de migrar esta cuenta",
"thisAccountIsEmpty": "Esta cuenta está vacía", "thisAccountIsEmpty": "Esta cuenta está vacía",
"youCannotMigrateIdentityToExistingIdentity": "No se puede migrar una identidad\na una cuenta que ya tiene una identidad", "youCannotMigrateIdentityToExistingIdentity": "No se puede migrar una identidad\na una cuenta que ya tiene una identidad",

View File

@ -159,8 +159,8 @@
"days": "{} jours", "days": "{} jours",
"months": "{} mois", "months": "{} mois",
"certify": "Certifier cette\nidentité", "certify": "Certifier cette\nidentité",
"from": "Depuis:", "from": "Depuis:{}",
"to": "Vers:", "to": "Vers:{}",
"amount": "Montant:", "amount": "Montant:",
"choiceOfSourceWallet": "Choix du portefeuille source", "choiceOfSourceWallet": "Choix du portefeuille source",
"extrinsicInProgress": "{} en cours", "extrinsicInProgress": "{} en cours",
@ -171,16 +171,18 @@
"cancel": "Annuler", "cancel": "Annuler",
"inBlockchainResult": "Dans la blockchain {}", "inBlockchainResult": "Dans la blockchain {}",
"search": "Rechercher une identité\nou une adresse", "search": "Rechercher une identité\nou une adresse",
"currencyNode": "Noeud {} :", "currencyNode": "Noeud",
"contactsManagementWithNbr": "Mes contacts ({})", "contactsManagementWithNbr": "Mes contacts ({})",
"contactsManagement": "Mes contacts", "contactsManagement": "Mes contacts",
"noContacts": "Vous n'avez aucun contact", "noContacts": "Vous n'avez aucun contact",
"addContact": "Ajouter\naux contacts", "addContact": "Ajouter\naux contacts",
"removeContact": "Supprimer\nce contact", "removeContact": "Supprimer\nce contact",
"derivationsScanProgress": "Scan de l'adresse {}/{}", "scanRootDerivationInProgress": "Scan de l'adresse racine",
"derivationsScanProgress": "Scan des {} premières adresses",
"importDerivationsInProgress": "Importation de l'adresse {}/{}",
"youAreOffline": "Vous êtes hors ligne...", "youAreOffline": "Vous êtes hors ligne...",
"importG1v1": "Importer un ancien compte G1v1", "importG1v1": "Importer un ancien compte G1v1",
"selectDestWallet": "Sélectionnez un portefeuille cible:", "migrateToThisWallet": "Migrer vers ce portefeuille:",
"youMustWaitBeforeCashoutThisAccount": "Vous devez attendre quelques minutes\navant de pouvoir migrer ce compte", "youMustWaitBeforeCashoutThisAccount": "Vous devez attendre quelques minutes\navant de pouvoir migrer ce compte",
"thisAccountIsEmpty": "Ce compte est vide", "thisAccountIsEmpty": "Ce compte est vide",
"youCannotMigrateIdentityToExistingIdentity": "Vous ne pouvez pas migrer une identité\nvers un compte disposant déjà d'une identité", "youCannotMigrateIdentityToExistingIdentity": "Vous ne pouvez pas migrer une identité\nvers un compte disposant déjà d'une identité",

View File

@ -172,7 +172,7 @@
"cancel": "Annulla", "cancel": "Annulla",
"inBlockchainResult": "Nella blockchain {}", "inBlockchainResult": "Nella blockchain {}",
"search": "Cerca una identitá\no un indirizzo", "search": "Cerca una identitá\no un indirizzo",
"currencyNode": "Nodo {} :", "currencyNode": "Nodo",
"contactsManagementWithNbr": "I miei contatti ({})", "contactsManagementWithNbr": "I miei contatti ({})",
"contactsManagement": "I miei contatti", "contactsManagement": "I miei contatti",
"noContacts": "Non ci sono contatti salvati", "noContacts": "Non ci sono contatti salvati",
@ -181,7 +181,7 @@
"derivationsScanProgress": "Scannerizzando l'indirizzo {}/{}", "derivationsScanProgress": "Scannerizzando l'indirizzo {}/{}",
"youAreOffline": "Disconnesso...", "youAreOffline": "Disconnesso...",
"importG1v1": "Importa il conto antico da G1v1, versione precedente", "importG1v1": "Importa il conto antico da G1v1, versione precedente",
"selectDestWallet": "Seleziona un portafoglio di destinazione:", "migrateToThisWallet": "Seleziona un portafoglio di destinazione:",
"youMustWaitBeforeCashoutThisAccount": "Devi aspettare qualche minuto prima di migrare questo conto", "youMustWaitBeforeCashoutThisAccount": "Devi aspettare qualche minuto prima di migrare questo conto",
"thisAccountIsEmpty": "Questo conto é vuoto", "thisAccountIsEmpty": "Questo conto é vuoto",
"youCannotMigrateIdentityToExistingIdentity": "Non si puó migrare un'identitá\na un conto che ne ha giá una", "youCannotMigrateIdentityToExistingIdentity": "Non si puó migrare un'identitá\na un conto che ne ha giá una",

1
devtools_options.yaml Normal file
View File

@ -0,0 +1 @@
extensions:

View File

@ -100,7 +100,7 @@ Future certifyTest5() async {
await waitFor('thisWalletIsDefault'.tr()); await waitFor('thisWalletIsDefault'.tr());
// Search Wallet 5 again // Search Wallet 5 again
await tapKey(keyAppBarSearch); await tapKey(keyAppBarHome);
final addressToSearch = await clipPaste(); final addressToSearch = await clipPaste();
final endAddress = addressToSearch.substring(addressToSearch.length - 6); final endAddress = addressToSearch.substring(addressToSearch.length - 6);
expect(addressToSearch, test5.address); expect(addressToSearch, test5.address);

View File

@ -23,14 +23,10 @@ late Box<G1WalletsList> contactsBox;
// late Box keystoreBox; // late Box keystoreBox;
late Directory imageDirectory; late Directory imageDirectory;
// 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.presles.fr";
// String cesiumPod = "https://g1.data.e-is.pro"; // String cesiumPod = "https://g1.data.e-is.pro";
// Responsive ratios
late bool isTall;
late double ratio;
// Contexts // Contexts
late BuildContext homeContext; late BuildContext homeContext;

View File

@ -26,6 +26,7 @@ import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/generate_wallets.dart'; import 'package:gecko/providers/generate_wallets.dart';
import 'package:gecko/providers/settings_provider.dart'; import 'package:gecko/providers/settings_provider.dart';
import 'package:gecko/providers/substrate_sdk.dart'; import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/v2s_datapod.dart';
import 'package:gecko/providers/wallets_profiles.dart'; import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/providers/home.dart'; import 'package:gecko/providers/home.dart';
import 'package:gecko/providers/my_wallets.dart'; import 'package:gecko/providers/my_wallets.dart';
@ -133,23 +134,21 @@ class Gecko extends StatelessWidget {
ChangeNotifierProvider(create: (_) => CesiumPlusProvider()), ChangeNotifierProvider(create: (_) => CesiumPlusProvider()),
ChangeNotifierProvider(create: (_) => SubstrateSdk()), ChangeNotifierProvider(create: (_) => SubstrateSdk()),
ChangeNotifierProvider(create: (_) => DuniterIndexer()), ChangeNotifierProvider(create: (_) => DuniterIndexer()),
ChangeNotifierProvider(create: (_) => SettingsProvider()) ChangeNotifierProvider(create: (_) => SettingsProvider()),
ChangeNotifierProvider(create: (_) => V2sDatapodProvider())
], ],
child: MaterialApp( child: MaterialApp(
localizationsDelegates: context.localizationDelegates, localizationsDelegates: context.localizationDelegates,
supportedLocales: context.supportedLocales, supportedLocales: context.supportedLocales,
locale: context.locale, locale: context.locale,
builder: (context, widget) => ResponsiveWrapper.builder( builder: (context, child) => ResponsiveBreakpoints.builder(
BouncingScrollWrapper.builder(context, widget!), child: child!,
maxWidth: 1200, breakpoints: [
minWidth: 480, const Breakpoint(start: 0, end: 450, name: MOBILE),
defaultScale: true, const Breakpoint(start: 451, end: 800, name: TABLET),
breakpoints: [ const Breakpoint(start: 801, end: double.infinity, name: DESKTOP),
const ResponsiveBreakpoint.resize(480, name: MOBILE), ],
const ResponsiveBreakpoint.autoScale(800, name: TABLET), ),
const ResponsiveBreakpoint.resize(1000, name: DESKTOP),
],
background: Container(color: backgroundColor)),
title: 'Ğecko', title: 'Ğecko',
theme: ThemeData( theme: ThemeData(
appBarTheme: const AppBarTheme( appBarTheme: const AppBarTheme(
@ -159,6 +158,7 @@ class Gecko extends StatelessWidget {
primaryColor: const Color(0xffFFD58D), primaryColor: const Color(0xffFFD58D),
scaffoldBackgroundColor: backgroundColor, scaffoldBackgroundColor: backgroundColor,
canvasColor: backgroundColor, canvasColor: backgroundColor,
dialogBackgroundColor: backgroundColor,
textTheme: const TextTheme( textTheme: const TextTheme(
bodyLarge: TextStyle(fontSize: 16), bodyLarge: TextStyle(fontSize: 16),
bodyMedium: TextStyle(fontSize: 18), bodyMedium: TextStyle(fontSize: 18),

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:hive_flutter/hive_flutter.dart'; import 'package:hive_flutter/hive_flutter.dart';
part 'g1_wallets_list.g.dart'; part 'g1_wallets_list.g.dart';
@ -15,22 +14,18 @@ class G1WalletsList {
Id? id; Id? id;
@HiveField(3) @HiveField(3)
Image? avatar;
@HiveField(4)
String? username; String? username;
@HiveField(5) @HiveField(4)
String? csName; String? csName;
@HiveField(6) @HiveField(5)
bool? isMembre; bool? isMembre;
G1WalletsList({ G1WalletsList({
required this.address, required this.address,
this.balance, this.balance,
this.id, this.id,
this.avatar,
this.username, this.username,
this.csName, this.csName,
this.isMembre, this.isMembre,

View File

@ -20,17 +20,16 @@ class G1WalletsListAdapter extends TypeAdapter<G1WalletsList> {
address: fields[0] as String, address: fields[0] as String,
balance: fields[1] as double?, balance: fields[1] as double?,
id: fields[2] as Id?, id: fields[2] as Id?,
avatar: fields[3] as Image?, username: fields[3] as String?,
username: fields[4] as String?, csName: fields[4] as String?,
csName: fields[5] as String?, isMembre: fields[5] as bool?,
isMembre: fields[6] as bool?,
); );
} }
@override @override
void write(BinaryWriter writer, G1WalletsList obj) { void write(BinaryWriter writer, G1WalletsList obj) {
writer writer
..writeByte(7) ..writeByte(6)
..writeByte(0) ..writeByte(0)
..write(obj.address) ..write(obj.address)
..writeByte(1) ..writeByte(1)
@ -38,12 +37,10 @@ class G1WalletsListAdapter extends TypeAdapter<G1WalletsList> {
..writeByte(2) ..writeByte(2)
..write(obj.id) ..write(obj.id)
..writeByte(3) ..writeByte(3)
..write(obj.avatar)
..writeByte(4)
..write(obj.username) ..write(obj.username)
..writeByte(5) ..writeByte(4)
..write(obj.csName) ..write(obj.csName)
..writeByte(6) ..writeByte(5)
..write(obj.isMembre); ..write(obj.isMembre);
} }

View File

@ -0,0 +1,26 @@
const String updateProfileQ = r'''
mutation ($address: String!, $hash: String!, $signature: String!, $title: String, $description: String, $avatar: String, $geoloc: GeolocInput, $city: String, $socials: [SocialInput!]) {
updateProfile(address: $address, hash: $hash, signature: $signature, title: $title, description: $description, avatarBase64: $avatar, geoloc: $geoloc, city: $city, socials: $socials) {
message
success
}
}
''';
const String deleteProfileQ = r'''
mutation ($address: String!, $hash: String!, $signature: String!) {
deleteProfile(address: $address, hash: $hash, signature: $signature) {
message
success
}
}
''';
const String migrateProfileQ = r'''
mutation ($addressOld: String!, $addressNew: String!, $hash: String!, $signature: String!) {
migrateProfile(addressOld: $addressOld, addressNew: $addressNew, hash: $hash, signature: $signature) {
message
success
}
}
''';

View File

@ -5,7 +5,7 @@ const keyInfoPopup = Key('keyInfoPopup');
const keyGoNext = Key('keyGoNext'); const keyGoNext = Key('keyGoNext');
const keyCancel = Key('keyCancel'); const keyCancel = Key('keyCancel');
const keyConfirm = Key('keyConfirm'); const keyConfirm = Key('keyConfirm');
const keyAppBarSearch = Key('keyAppBarSearch'); const keyAppBarHome = Key('keyAppBarSearch');
const keyAppBarQrcode = Key('keyAppBarQrcode'); const keyAppBarQrcode = Key('keyAppBarQrcode');
const keyAppBarChest = Key('keyAppBarChest'); const keyAppBarChest = Key('keyAppBarChest');
@ -28,6 +28,7 @@ final keyDragAndDrop = GlobalKey(debugLabel: 'keyDragAndDrop');
// Wallet options // Wallet options
const keyCopyAddress = Key('keyCopyAddress'); const keyCopyAddress = Key('keyCopyAddress');
const keyCopyPubkey = Key('keyCopyPubkey');
const keyOpenActivity = Key('keyOpenActivity'); const keyOpenActivity = Key('keyOpenActivity');
const keyManageMembership = Key('keyManageMembership'); const keyManageMembership = Key('keyManageMembership');
const keySetDefaultWallet = Key('keySetDefaultWallet'); const keySetDefaultWallet = Key('keySetDefaultWallet');

View File

@ -2,8 +2,13 @@ import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:gecko/globals.dart'; import 'package:gecko/globals.dart';
import 'package:gecko/providers/substrate_sdk.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart';
import 'package:crypto/crypto.dart';
// import 'package:http/http.dart' as http; // import 'package:http/http.dart' as http;
class CesiumPlusProvider with ChangeNotifier { class CesiumPlusProvider with ChangeNotifier {
@ -11,105 +16,186 @@ class CesiumPlusProvider with ChangeNotifier {
CancelToken avatarCancelToken = CancelToken(); CancelToken avatarCancelToken = CancelToken();
Future<List> _buildQuery(pubkey) async { final Map<String, String> _headers = {
var queryGetAvatar = json.encode({ 'Content-type': 'application/json',
"query": { 'Accept': 'application/json',
"bool": { };
"should": [
{ // List _buildQueryGetAvatar(String pubkeyV1) {
"match": { // final queryGetAvatar = json.encode({
'_id': {"query": pubkey, "boost": 2} // "query": {
} // "bool": {
}, // "should": [
{ // {
"prefix": {'_id': pubkey} // "match": {
} // '_id': {"query": pubkeyV1, "boost": 1}
] // }
} // },
}, // {
"highlight": { // "prefix": {'_id': pubkeyV1}
"fields": {"title": {}, "tags": {}} // }
}, // ]
"from": 0, // }
"size": 100, // },
"_source": [ // "_source": [
"title", // "avatar",
"avatar", // "avatar._content_type",
"avatar._content_type", // ],
"description", // "indices_boost": {"user": 1, "page": 1, "group": 0.01}
"city", // });
"address",
"socials.url", // const requestUrl = "/user,page,group/profile,record/_search";
"creationTime", // final podRequest = cesiumPod + requestUrl;
"membersCount",
"type" // return [podRequest, queryGetAvatar];
], // }
"indices_boost": {"user": 100, "page": 1, "group": 0.01}
Future<List> _buildQuerySetAvatar(
String pubkeyV1, String address, String avatar) async {
int timeSent = DateTime.now().millisecondsSinceEpoch ~/ 1000;
final queryGetAvatar = json.encode({
"avatar": {"_content": avatar, "_content_type": "image/png"},
"time": timeSent,
"issuer": pubkeyV1,
"version": 2,
"tags": []
}); });
String requestUrl = "/user,page,group/profile,record/_search"; final requestUrl =
String podRequest = cesiumPod + requestUrl; "/user/profile?pubkey=$pubkeyV1/_update?pubkey=$pubkeyV1";
final podRequest = cesiumPod + requestUrl;
Map<String, String> headers = { final signedDocument = await signDoc(queryGetAvatar, address);
'Content-type': 'application/json',
'Accept': 'application/json', return [podRequest, signedDocument];
}
Future<String> signDoc(String document, String address) async {
final sub = Provider.of<SubstrateSdk>(homeContext, listen: false);
final hashDocBytes = utf8.encode(document);
final hashDoc = sha256.convert(hashDocBytes);
final hashDocHex = hashDoc.toString().toUpperCase();
// Generate signature of document
final signature = await sub.signDatapod(hashDocHex, address);
// Build final document
final Map<String, dynamic> data = {
'hash': hashDocHex,
'signature': signature
};
final signJSON = jsonEncode(data);
final Map<String, dynamic> finalJSON = {
...jsonDecode(signJSON),
...jsonDecode(document)
}; };
return [podRequest, queryGetAvatar, headers]; return jsonEncode(finalJSON);
}
// Future<String> getName(String address) async {
// String? name;
// if (g1WalletsBox.get(address)?.csName != null) {
// return g1WalletsBox.get(address)!.csName!;
// }
// List queryOptions = await _buildQueryName(address);
// var dio = Dio();
// late Response response;
// try {
// response = await dio.post(
// queryOptions[0],
// data: queryOptions[1],
// options: Options(
// headers: queryOptions[2],
// sendTimeout: const Duration(seconds: 3),
// receiveTimeout: const Duration(seconds: 5),
// ),
// );
// // response = await http.post((Uri.parse(queryOptions[0])),
// // body: queryOptions[1], headers: queryOptions[2]);
// } catch (e) {
// log.e(e);
// }
// if (response.data['hits']['hits'].toString() == '[]') {
// return '';
// }
// final bool nameExist =
// response.data['hits']['hits'][0]['_source'].containsKey("title");
// if (!nameExist) {
// return '';
// }
// name = response.data['hits']['hits'][0]['_source']['title'];
// name ??= '';
// g1WalletsBox.get(address)!.csName = name;
// return name;
// }
Future<Image> getAvatar(String address, double size) async {
return defaultAvatar(size);
// final sub = Provider.of<SubstrateSdk>(homeContext, listen: false);
// if (await isAvatarExist(address)) {
// return await getAvatarLocal(address, size);
// }
// final pubkeyV1 = await sub.addressToPubkeyB58(address);
// var dio = Dio();
// List queryOptions = _buildQueryGetAvatar(pubkeyV1);
// late Response response;
// try {
// response = await dio
// .post(queryOptions[0],
// data: queryOptions[1],
// options: Options(
// headers: _headers,
// sendTimeout: const Duration(seconds: 4),
// receiveTimeout: const Duration(seconds: 15),
// ),
// cancelToken: avatarCancelToken)
// .timeout(
// const Duration(seconds: 15),
// );
// } catch (e) {
// log.e(e);
// }
// if (response.data['hits']['hits'].toString() == '[]' ||
// !response.data['hits']['hits'][0]['_source'].containsKey("avatar")) {
// return defaultAvatar(size);
// }
// final avatar =
// response.data['hits']['hits'][0]['_source']['avatar']['_content'];
// final avatarFile = await saveAvatar(address, avatar);
// final finalAvatar = Image.file(
// avatarFile,
// height: size,
// fit: BoxFit.fitWidth,
// );
// return finalAvatar;
} }
Future<String> getName(String? pubkey) async { Future<bool> setAvatar(String address, String avatarPath) async {
String? name; final sub = Provider.of<SubstrateSdk>(homeContext, listen: false);
if (g1WalletsBox.get(pubkey)?.csName != null) {
return g1WalletsBox.get(pubkey)!.csName!;
}
List queryOptions = await _buildQuery(pubkey);
final pubkeyV1 = await sub.addressToPubkeyB58(address);
var dio = Dio(); var dio = Dio();
late Response response; final Uint8List avatarBytes = await File(avatarPath).readAsBytes();
try { final avatarString = base64Encode(avatarBytes);
response = await dio.post(
queryOptions[0],
data: queryOptions[1],
options: Options(
headers: queryOptions[2],
sendTimeout: const Duration(seconds: 3),
receiveTimeout: const Duration(seconds: 5),
),
);
// response = await http.post((Uri.parse(queryOptions[0])),
// body: queryOptions[1], headers: queryOptions[2]);
} catch (e) {
log.e(e);
}
if (response.data['hits']['hits'].toString() == '[]') { List queryOptions =
return ''; await _buildQuerySetAvatar(pubkeyV1, address, avatarString);
} log.d(queryOptions[0]);
final bool nameExist = log.d(jsonDecode(queryOptions[1]));
response.data['hits']['hits'][0]['_source'].containsKey("title");
if (!nameExist) {
return '';
}
name = response.data['hits']['hits'][0]['_source']['title'];
name ??= '';
g1WalletsBox.get(pubkey)!.csName = name;
return name;
}
Future<Image?> getAvatar(String? pubkey, double size) async {
if (g1WalletsBox.get(pubkey)?.avatar != null) {
return g1WalletsBox.get(pubkey)!.avatar;
}
var dio = Dio();
// log.d(_pubkey);
List queryOptions = await _buildQuery(pubkey);
late Response response; late Response response;
try { try {
@ -117,7 +203,7 @@ class CesiumPlusProvider with ChangeNotifier {
.post(queryOptions[0], .post(queryOptions[0],
data: queryOptions[1], data: queryOptions[1],
options: Options( options: Options(
headers: queryOptions[2], headers: _headers,
sendTimeout: const Duration(seconds: 4), sendTimeout: const Duration(seconds: 4),
receiveTimeout: const Duration(seconds: 15), receiveTimeout: const Duration(seconds: 15),
), ),
@ -125,33 +211,51 @@ class CesiumPlusProvider with ChangeNotifier {
.timeout( .timeout(
const Duration(seconds: 15), const Duration(seconds: 15),
); );
// response = await http.post((Uri.parse(queryOptions[0])), log.d(response.data);
// body: queryOptions[1], headers: queryOptions[2]); return response.statusCode == 200;
} catch (e) { } catch (e) {
log.e(e); log.e(e);
return false;
} }
}
if (response.data['hits']['hits'].toString() == '[]' || Future<String> getLocalPath() async {
!response.data['hits']['hits'][0]['_source'].containsKey("avatar")) { final directory = await getApplicationDocumentsDirectory();
return defaultAvatar(size); return directory.path;
}
Future<File> saveAvatar(String address, String data) async {
final path = await getLocalPath();
final avatarFolder = Directory('$path/avatars/');
if (!await avatarFolder.exists()) {
await avatarFolder.create();
} }
final file = File('$path/avatars/$address');
return await file.writeAsBytes(base64.decode(data));
}
final avatar = Future<Image> getAvatarLocal(String address, double size) async {
response.data['hits']['hits'][0]['_source']['avatar']['_content']; final path = await getLocalPath();
final avatarFile = File('$path/avatars/$address');
var avatarFile = return Image.file(
File('${(await getTemporaryDirectory()).path}/avatar_$pubkey.png');
await avatarFile.writeAsBytes(base64.decode(avatar));
final finalAvatar = Image.file(
avatarFile, avatarFile,
height: size, height: size,
fit: BoxFit.fitWidth, fit: BoxFit.fitWidth,
); );
}
g1WalletsBox.get(pubkey)!.avatar = finalAvatar; Future<bool> isAvatarExist(String address) async {
final path = await getLocalPath();
final avatarFile = File('$path/avatars/$address');
return avatarFile.exists();
}
return finalAvatar; Future deleteAvatarFolder() async {
final path = await getLocalPath();
final avatarFolder = Directory('$path/avatars/');
if (await avatarFolder.exists()) {
await avatarFolder.delete(recursive: true);
}
} }
} }

View File

@ -9,6 +9,7 @@ import 'package:gecko/models/bip39_words.dart';
import 'package:gecko/models/chest_data.dart'; import 'package:gecko/models/chest_data.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/substrate_sdk.dart';
import 'package:gecko/widgets/scan_derivations_info.dart';
import 'package:polkawallet_sdk/api/apiKeyring.dart'; import 'package:polkawallet_sdk/api/apiKeyring.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import "package:unorm_dart/unorm_dart.dart" as unorm; import "package:unorm_dart/unorm_dart.dart" as unorm;
@ -19,6 +20,7 @@ class GenerateWalletsProvider with ChangeNotifier {
final walletNameFocus = FocusNode(); final walletNameFocus = FocusNode();
Color? askedWordColor = Colors.black; Color? askedWordColor = Colors.black;
bool isAskedWordValid = false; bool isAskedWordValid = false;
var scanStatus = ScanDerivationsStatus.none;
int scanedValidWalletNumber = -1; int scanedValidWalletNumber = -1;
int scanedWalletNumber = -1; int scanedWalletNumber = -1;
int numberScan = 60; int numberScan = 60;
@ -296,7 +298,6 @@ class GenerateWalletsProvider with ChangeNotifier {
final sub = Provider.of<SubstrateSdk>(context, listen: false); final sub = Provider.of<SubstrateSdk>(context, listen: false);
final currentChestNumber = configBox.get('currentChest'); final currentChestNumber = configBox.get('currentChest');
bool isAlive = false; bool isAlive = false;
scanedValidWalletNumber = 0;
scanedWalletNumber = 0; scanedWalletNumber = 0;
Map<String, int> addressToScan = {}; Map<String, int> addressToScan = {};
notifyListeners(); notifyListeners();
@ -305,14 +306,14 @@ class GenerateWalletsProvider with ChangeNotifier {
return false; return false;
} }
scanStatus = ScanDerivationsStatus.rootScanning;
final hasRoot = await scanRootBalance(sub, currentChestNumber); final hasRoot = await scanRootBalance(sub, currentChestNumber);
scanedWalletNumber = 1;
notifyListeners(); notifyListeners();
if (hasRoot) { if (hasRoot) {
scanedValidWalletNumber = 1;
isAlive = true; isAlive = true;
} }
scanStatus = ScanDerivationsStatus.scanning;
for (int derivationNbr in [for (var i = 0; i < numberScan; i += 1) i]) { for (int derivationNbr in [for (var i = 0; i < numberScan; i += 1) i]) {
final addressData = await sub.sdk.api.keyring.addressFromMnemonic( final addressData = await sub.sdk.api.keyring.addressFromMnemonic(
sub.currencyParameters['ss58']!, sub.currencyParameters['ss58']!,
@ -328,35 +329,37 @@ class GenerateWalletsProvider with ChangeNotifier {
onTimeout: () => {}, onTimeout: () => {},
); );
for (String scannedWallet in balanceList.keys) { // Remove unused wallets
if (balanceList[scannedWallet]!['transferableBalance'] != 0) { balanceList.removeWhere((key, value) => value['transferableBalance'] == 0);
isAlive = true; scanedValidWalletNumber = balanceList.length + scanedWalletNumber;
String walletName = scanedValidWalletNumber == 0
? 'currentWallet'.tr()
: '${'wallet'.tr()} ${scanedValidWalletNumber + 1}';
await sub.importAccount(
mnemonic: generatedMnemonic!,
derivePath: "//${addressToScan[scannedWallet]}",
password: pin.text);
WalletData myWallet = WalletData( scanStatus = ScanDerivationsStatus.import;
chest: currentChestNumber, for (String scannedWallet in balanceList.keys) {
address: scannedWallet, isAlive = true;
number: scanedValidWalletNumber, String walletName = scanedWalletNumber == 0
name: walletName, ? 'currentWallet'.tr()
derivation: addressToScan[scannedWallet], : '${'wallet'.tr()} ${scanedWalletNumber + 1}';
imageDefaultPath: '${scanedValidWalletNumber % 4}.png', await sub.importAccount(
isOwned: true); mnemonic: generatedMnemonic!,
await walletBox.put(myWallet.address, myWallet); derivePath: "//${addressToScan[scannedWallet]}",
scanedValidWalletNumber = scanedValidWalletNumber + 1; password: pin.text);
}
scanedWalletNumber = scanedWalletNumber + 1; WalletData myWallet = WalletData(
chest: currentChestNumber,
address: scannedWallet,
number: scanedWalletNumber,
name: walletName,
derivation: addressToScan[scannedWallet],
imageDefaultPath: '${scanedWalletNumber % 4}.png',
isOwned: true);
await walletBox.put(myWallet.address, myWallet);
scanedWalletNumber++;
notifyListeners(); notifyListeners();
} }
log.d(scanedWalletNumber); log.d(scanedWalletNumber);
scanedWalletNumber = -1; scanStatus = ScanDerivationsStatus.none;
scanedValidWalletNumber = -1; scanedWalletNumber = scanedValidWalletNumber = -1;
notifyListeners(); notifyListeners();
return isAlive; return isAlive;
} }
@ -387,6 +390,7 @@ class GenerateWalletsProvider with ChangeNotifier {
imageDefaultPath: '0.png', imageDefaultPath: '0.png',
isOwned: true); isOwned: true);
await walletBox.put(myWallet.address, myWallet); await walletBox.put(myWallet.address, myWallet);
scanedWalletNumber++;
return true; return true;
} else { } else {
return false; return false;

View File

@ -43,6 +43,7 @@ class MyWalletsProvider with ChangeNotifier {
Map<String, WalletData> walletsToScan = {}; Map<String, WalletData> walletsToScan = {};
for (var walletFromBox in wallets) { for (var walletFromBox in wallets) {
if (walletFromBox.chest == chest) { if (walletFromBox.chest == chest) {
// log.d('${walletFromBox.number} - ${walletFromBox.name}');
if (walletFromBox.identityStatus == IdtyStatus.unknown) { if (walletFromBox.identityStatus == IdtyStatus.unknown) {
walletsToScan.putIfAbsent( walletsToScan.putIfAbsent(
walletFromBox.address, (() => walletFromBox)); walletFromBox.address, (() => walletFromBox));
@ -61,7 +62,6 @@ class MyWalletsProvider with ChangeNotifier {
listWallets.add(wallet); listWallets.add(wallet);
n++; n++;
} }
return listWallets; return listWallets;
} }
@ -201,6 +201,7 @@ class MyWalletsProvider with ChangeNotifier {
isOwned: true); isOwned: true);
await walletBox.put(newWallet.address, newWallet); await walletBox.put(newWallet.address, newWallet);
await readAllWallets();
isNewDerivationLoading = false; isNewDerivationLoading = false;
notifyListeners(); notifyListeners();

View File

@ -37,7 +37,7 @@ class SubstrateSdk with ChangeNotifier {
bool importIsLoading = false; bool importIsLoading = false;
int blocNumber = 0; int blocNumber = 0;
bool isLoadingEndpoint = false; bool isLoadingEndpoint = false;
String transactionStatus = ''; String? transactionStatus;
final int initSs58 = 42; final int initSs58 = 42;
Map<String, int> currencyParameters = {}; Map<String, int> currencyParameters = {};
TextEditingController csSalt = TextEditingController(); TextEditingController csSalt = TextEditingController();
@ -136,6 +136,42 @@ class SubstrateSdk with ChangeNotifier {
return res?.signature ?? ''; return res?.signature ?? '';
} }
Future<String> signDatapod(String document, String address) async {
final myWallets =
Provider.of<MyWalletsProvider>(homeContext, listen: false);
final messageToSign = Uint8List.fromList(document.codeUnits);
// final pubkeyV1 = json.decode(document)['issuer'];
// final address = await pubkeyV1ToAddress(pubkeyV1);
// final walletData = myWallets.getWalletDataByAddress(address);
// final derivationPath =
// walletData!.derivation == null ? '' : "//${walletData.derivation}";
// final seed = await getSeed(address, myWallets.pinCode);
// final addressEd25519 = await importAccount(
// mnemonic: seed,
// password: 'AAAAA',
// cryptoType: CryptoType.ed25519,
// derivePath: derivationPath);
// final pubkeyEd25519 = await addressToPubkeyB58(addressEd25519);
final signatureString =
await _signMessage(messageToSign, address, myWallets.pinCode);
final signatureInt = HEX.decode(signatureString.substring(2));
final signature64 = base64Encode(signatureInt);
// await deleteAccounts([addressEd25519]);
// log.d("""
// $addressEd25519
// $pubkeyEd25519
// $derivationPath
// $signature64
// """);
return signature64;
}
//////////////////////////////////////////// ////////////////////////////////////////////
////////// 2: GET ONCHAIN STORAGE ////////// ////////// 2: GET ONCHAIN STORAGE //////////
//////////////////////////////////////////// ////////////////////////////////////////////
@ -435,7 +471,6 @@ class SubstrateSdk with ChangeNotifier {
wrapPromise: false, wrapPromise: false,
) ?? ) ??
[]; [];
// log.d('genesisHash: $genesisHash');
// log.d('genesisHash: ${HEX.decode(genesisHash.substring(2))}'); // log.d('genesisHash: ${HEX.decode(genesisHash.substring(2))}');
return genesisHash; return genesisHash;
} }
@ -449,9 +484,16 @@ class SubstrateSdk with ChangeNotifier {
return pubkeyByte; return pubkeyByte;
} }
// Future pubkeyToAddress(String pubkey) async { Future<String> addressToPubkeyB58(String address) async {
// await sdk.api.account.encodeAddress([pubkey]); return Base58Encode(await addressToPubkey(address));
// } }
Future<String> pubkeyV1ToAddress(String pubkey) async {
final pubkeyByte = Base58Decode(pubkey);
final String pubkeyHex = '0x${HEX.encode(pubkeyByte)}';
final address = await sdk.api.account.encodeAddress([pubkeyHex]);
return address!.keys.first;
}
Future initCurrencyParameters() async { Future initCurrencyParameters() async {
try { try {
@ -677,7 +719,8 @@ class SubstrateSdk with ChangeNotifier {
Future<String> importAccount( Future<String> importAccount(
{String mnemonic = '', {String mnemonic = '',
String derivePath = '', String derivePath = '',
required String password}) async { required String password,
CryptoType cryptoType = CryptoType.sr25519}) async {
const keytype = KeyType.mnemonic; const keytype = KeyType.mnemonic;
if (mnemonic != '') generatedMnemonic = mnemonic; if (mnemonic != '') generatedMnemonic = mnemonic;
@ -691,7 +734,7 @@ class SubstrateSdk with ChangeNotifier {
name: derivePath, name: derivePath,
password: password, password: password,
derivePath: derivePath, derivePath: derivePath,
cryptoType: CryptoType.sr25519) cryptoType: cryptoType)
.catchError((e) { .catchError((e) {
importIsLoading = false; importIsLoading = false;
notifyListeners(); notifyListeners();
@ -748,12 +791,6 @@ class SubstrateSdk with ChangeNotifier {
return seedText; return seedText;
} }
int getDerivationNumber(String address) {
final account = getKeypair(address);
final deriveNbr = account.name!.split('//')[1];
return int.parse(deriveNbr);
}
Future<KeyPairData?> changePassword(BuildContext context, String address, Future<KeyPairData?> changePassword(BuildContext context, String address,
String passOld, String passNew) async { String passOld, String passNew) async {
final account = getKeypair(address); final account = getKeypair(address);
@ -908,7 +945,7 @@ class SubstrateSdk with ChangeNotifier {
required String destAddress, required String destAddress,
required double amount, required double amount,
required String password}) async { required String password}) async {
transactionStatus = ''; transactionStatus = 'sending';
final sender = await _setSender(fromAddress); final sender = await _setSender(fromAddress);
@ -960,7 +997,7 @@ class SubstrateSdk with ChangeNotifier {
Future<String> certify( Future<String> certify(
String fromAddress, String destAddress, String password) async { String fromAddress, String destAddress, String password) async {
transactionStatus = ''; transactionStatus = 'sending';
final statusList = await idtyStatus([fromAddress, destAddress]); final statusList = await idtyStatus([fromAddress, destAddress]);
final myIdtyStatus = statusList[0]; final myIdtyStatus = statusList[0];
@ -1005,9 +1042,13 @@ class SubstrateSdk with ChangeNotifier {
sender, sender,
); );
final tx1 = 'api.tx.cert.addCert($fromIndex, $toIndex)'; final tx1 = 'api.tx.cert.addCert($fromIndex, $toIndex)';
final tx2 = 'api.tx.identity.validateIdentity($toIndex)';
rawParams = '[[$tx1, $tx2]]'; //TODO: add requestDistanceEvaluation tx when available
// final tx2 = 'api.tx.distance.requestDistanceEvaluation($toIndex)';
// final tx2 = 'api.tx.identity.validateIdentity($toIndex)';
rawParams = '[[$tx1]]';
} else { } else {
txInfo = TxInfoData( txInfo = TxInfoData(
'cert', 'cert',
@ -1028,6 +1069,7 @@ class SubstrateSdk with ChangeNotifier {
Future<String> confirmIdentity( Future<String> confirmIdentity(
String fromAddress, String name, String password) async { String fromAddress, String name, String password) async {
transactionStatus = 'sending';
final sender = await _setSender(fromAddress); final sender = await _setSender(fromAddress);
final txInfo = TxInfoData( final txInfo = TxInfoData(
@ -1047,7 +1089,7 @@ class SubstrateSdk with ChangeNotifier {
required String destPassword, required String destPassword,
required Map fromBalance, required Map fromBalance,
bool withBalance = false}) async { bool withBalance = false}) async {
transactionStatus = ''; transactionStatus = 'sending';
final sender = await _setSender(fromAddress); final sender = await _setSender(fromAddress);
TxInfoData txInfo; TxInfoData txInfo;

View File

@ -0,0 +1,125 @@
import 'dart:convert';
import 'dart:io';
import 'package:crypto/crypto.dart';
import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/models/queries_datapod.dart';
import 'package:gecko/providers/substrate_sdk.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:provider/provider.dart';
class V2sDatapodProvider with ChangeNotifier {
Future<QueryResult> _execQuery(
String query, Map<String, dynamic> variables) async {
final httpLink = HttpLink(
// 'http://10.0.2.2:8080/v1/graphql',
'https://gdev-datapod.p2p.legal/v1/graphql',
);
final GraphQLClient client = GraphQLClient(
cache: GraphQLCache(),
link: httpLink,
);
final QueryOptions options =
QueryOptions(document: gql(query), variables: variables);
return await client.query(options);
}
Future<bool> updateProfile(
{required String address,
String? title,
String? description,
String? avatar,
String? city,
List<Map<String, String>>? socials,
Map<String, double>? geoloc}) async {
final sub = Provider.of<SubstrateSdk>(homeContext, listen: false);
final messageToSign = jsonEncode({
'address': address,
'description': description,
'avatarBase64': avatar,
'geoloc': geoloc,
'title': title,
'city': city,
'socials': socials
});
final hashDocBytes = utf8.encode(messageToSign);
final hashDoc = sha256.convert(hashDocBytes).toString().toUpperCase();
final signature = await sub.signDatapod(hashDoc, address);
final variables = <String, dynamic>{
'address': address,
'hash': hashDoc,
'signature': signature,
'title': title,
'description': description,
'avatar': avatar,
'city': city,
'socials': socials,
'geoloc': geoloc,
};
final result = await _execQuery(updateProfileQ, variables);
if (result.hasException) {
log.e(result.exception.toString());
return false;
}
log.d(result.data!['updateProfile']['message']);
return true;
}
Future<bool> deleteProfile({required String address}) async {
final sub = Provider.of<SubstrateSdk>(homeContext, listen: false);
final messageToSign = jsonEncode({'address': address});
final hashDocBytes = utf8.encode(messageToSign);
final hashDoc = sha256.convert(hashDocBytes).toString().toUpperCase();
final signature = await sub.signDatapod(hashDoc, address);
final variables = <String, dynamic>{
'address': address,
'hash': hashDoc,
'signature': signature
};
final result = await _execQuery(deleteProfileQ, variables);
if (result.hasException) {
log.e(result.exception.toString());
return false;
}
log.d(result.data!['deleteProfile']['message']);
return true;
}
Future<bool> migrateProfile(
{required String addressOld, required String addressNew}) async {
final sub = Provider.of<SubstrateSdk>(homeContext, listen: false);
final messageToSign =
jsonEncode({'addressOld': addressOld, 'addressNew': addressNew});
final hashDocBytes = utf8.encode(messageToSign);
final hashDoc = sha256.convert(hashDocBytes).toString().toUpperCase();
final signature = await sub.signDatapod(hashDoc, addressOld);
final variables = <String, dynamic>{
'addressOld': addressOld,
'addressNew': addressNew,
'hash': hashDoc,
'signature': signature
};
final result = await _execQuery(migrateProfileQ, variables);
if (result.hasException) {
log.e(result.exception.toString());
return false;
}
log.d(result.data!['migrateProfile']['message']);
return true;
}
Future<bool> setAvatar(String address, String avatarPath) async {
final avatarBytes = await File(avatarPath).readAsBytes();
final avatarString = base64Encode(avatarBytes);
return await updateProfile(address: address, avatar: avatarString);
}
}

View File

@ -11,6 +11,7 @@ import 'package:gecko/providers/duniter_indexer.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/substrate_sdk.dart';
import 'package:gecko/providers/v2s_datapod.dart';
import 'package:gecko/widgets/commons/common_elements.dart'; import 'package:gecko/widgets/commons/common_elements.dart';
import 'package:gecko/screens/myWallets/unlocking_wallet.dart'; import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
import 'package:gecko/screens/transaction_in_progress.dart'; import 'package:gecko/screens/transaction_in_progress.dart';
@ -110,6 +111,9 @@ class WalletOptionsProvider with ChangeNotifier {
], ],
); );
final datapod =
Provider.of<V2sDatapodProvider>(homeContext, listen: false);
final newPath = "${imageDirectory.path}/${pickedFile.name}"; final newPath = "${imageDirectory.path}/${pickedFile.name}";
if (croppedFile != null) { if (croppedFile != null) {
@ -119,6 +123,7 @@ class WalletOptionsProvider with ChangeNotifier {
return ''; return '';
} }
// await imageFile.copy(newPath); // await imageFile.copy(newPath);
datapod.setAvatar(address.text, newPath);
log.i(newPath); log.i(newPath);
return newPath; return newPath;

View File

@ -12,12 +12,10 @@ import 'package:gecko/widgets/history_query.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class ActivityScreen extends StatefulWidget { class ActivityScreen extends StatefulWidget {
const ActivityScreen( const ActivityScreen({required this.address, this.username})
{required this.address, required this.avatar, this.username})
: super(key: keyActivityScreen); : super(key: keyActivityScreen);
final String address; final String address;
final String? username; final String? username;
final Image avatar;
@override @override
State<ActivityScreen> createState() => _ActivityScreenState(); State<ActivityScreen> createState() => _ActivityScreenState();
@ -43,11 +41,8 @@ class _ActivityScreenState extends State<ActivityScreen> {
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text('accountActivity'.tr()),
height: 22,
child: Text('accountActivity'.tr()),
),
), ),
bottomNavigationBar: const GeckoBottomAppBar(), bottomNavigationBar: const GeckoBottomAppBar(),
body: Column(children: <Widget>[ body: Column(children: <Widget>[

View File

@ -2,9 +2,8 @@ import 'package:accordion/controllers.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:gecko/globals.dart'; import 'package:gecko/globals.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gecko/widgets/certs_received.dart'; import 'package:gecko/widgets/certs_list.dart';
import 'package:gecko/widgets/certs_counter.dart'; import 'package:gecko/widgets/certs_counter.dart';
import 'package:gecko/widgets/certs_sent.dart';
import 'package:accordion/accordion.dart'; import 'package:accordion/accordion.dart';
class CertificationsScreen extends StatelessWidget { class CertificationsScreen extends StatelessWidget {
@ -20,11 +19,8 @@ class CertificationsScreen extends StatelessWidget {
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text('certificationsOf'.tr(args: [username]))),
height: 22,
child: Text('certificationsOf'.tr(args: [username])),
)),
body: SafeArea( body: SafeArea(
child: Accordion( child: Accordion(
paddingListTop: 10, paddingListTop: 10,
@ -52,7 +48,8 @@ class CertificationsScreen extends StatelessWidget {
const SizedBox(width: 5), const SizedBox(width: 5),
CertsCounter(address: address) CertsCounter(address: address)
]), ]),
content: CertsReceived(address: address), content: CertsList(
address: address, direction: CertDirection.sent),
contentHorizontalPadding: 0, contentHorizontalPadding: 0,
contentBorderWidth: 1, contentBorderWidth: 1,
), ),
@ -70,8 +67,11 @@ class CertificationsScreen extends StatelessWidget {
const SizedBox(width: 5), const SizedBox(width: 5),
CertsCounter(address: address, isSent: true) CertsCounter(address: address, isSent: true)
]), ]),
content: CertsSent(address: address), content: CertsList(
contentHorizontalPadding: 20, address: address,
direction: CertDirection.sent,
),
contentHorizontalPadding: 0,
contentBorderWidth: 1, contentBorderWidth: 1,
// onOpenSection: () => print('onOpenSection ...'), // onOpenSection: () => print('onOpenSection ...'),
// onCloseSection: () => print('onCloseSection ...'), // onCloseSection: () => print('onCloseSection ...'),

View File

@ -13,12 +13,7 @@ class DebugScreen extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(toolbarHeight: 60, title: const Text('Debug screen')),
toolbarHeight: 60 * ratio,
title: const SizedBox(
height: 22,
child: Text('Debug screen'),
)),
body: SafeArea( body: SafeArea(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
const SizedBox(height: 40), const SizedBox(height: 40),

View File

@ -6,6 +6,7 @@ import 'package:gecko/globals.dart';
import 'package:gecko/models/chest_data.dart'; import 'package:gecko/models/chest_data.dart';
import 'package:gecko/models/g1_wallets_list.dart'; import 'package:gecko/models/g1_wallets_list.dart';
import 'package:gecko/models/widgets_keys.dart'; import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/providers/chest_provider.dart'; import 'package:gecko/providers/chest_provider.dart';
import 'package:gecko/providers/duniter_indexer.dart'; import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/home.dart'; import 'package:gecko/providers/home.dart';
@ -41,6 +42,8 @@ class _HomeScreenState extends State<HomeScreen> {
Provider.of<DuniterIndexer>(context, listen: false); Provider.of<DuniterIndexer>(context, listen: false);
final myWalletProvider = final myWalletProvider =
Provider.of<MyWalletsProvider>(context, listen: false); Provider.of<MyWalletsProvider>(context, listen: false);
final csProvider =
Provider.of<CesiumPlusProvider>(context, listen: false);
final bool isWalletsExists = myWalletProvider.checkIfWalletExist(); final bool isWalletsExists = myWalletProvider.checkIfWalletExist();
@ -66,6 +69,7 @@ class _HomeScreenState extends State<HomeScreen> {
if (sub.sdkReady && !sub.nodeConnected) { if (sub.sdkReady && !sub.nodeConnected) {
walletBox = await Hive.openBox<WalletData>("walletBox"); walletBox = await Hive.openBox<WalletData>("walletBox");
await Hive.deleteBoxFromDisk('g1WalletsBox'); await Hive.deleteBoxFromDisk('g1WalletsBox');
await csProvider.deleteAvatarFolder();
g1WalletsBox = await Hive.openBox<G1WalletsList>("g1WalletsBox"); g1WalletsBox = await Hive.openBox<G1WalletsList>("g1WalletsBox");
contactsBox = await Hive.openBox<G1WalletsList>("contactsBox"); contactsBox = await Hive.openBox<G1WalletsList>("contactsBox");
@ -112,17 +116,10 @@ class _HomeScreenState extends State<HomeScreen> {
Provider.of<ChestProvider>(context); Provider.of<ChestProvider>(context);
final bool isWalletsExists = myWalletProvider.checkIfWalletExist(); final bool isWalletsExists = myWalletProvider.checkIfWalletExist();
isTall = false;
ratio = 1;
if (MediaQuery.of(context).size.height >= 930) {
isTall = true;
ratio = 1.125;
}
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
drawer: MainDrawer(isWalletsExists: isWalletsExists), drawer: MainDrawer(isWalletsExists: isWalletsExists),
backgroundColor: const Color(0xffF9F9F1), backgroundColor: yellowC,
body: isWalletsExists ? geckHome(context) : welcomeHome(context)); body: isWalletsExists ? geckHome(context) : welcomeHome(context));
} }
} }
@ -149,7 +146,7 @@ Widget geckHome(context) {
key: keyDrawerMenu, key: keyDrawerMenu,
icon: const Icon( icon: const Icon(
Icons.menu, Icons.menu,
color: Colors.white, color: Colors.black,
size: 35, size: 35,
), ),
onPressed: () => Scaffold.of(context).openDrawer(), onPressed: () => Scaffold.of(context).openDrawer(),
@ -158,18 +155,18 @@ Widget geckHome(context) {
), ),
const Align( const Align(
child: child:
Image(image: AssetImage('assets/home/header.png'), height: 210), Image(image: AssetImage('assets/home/header.png'), height: 170),
), ),
]), ]),
Padding( Padding(
padding: EdgeInsets.only(top: 15 * ratio), padding: const EdgeInsets.only(top: 15),
child: child:
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
DefaultTextStyle( DefaultTextStyle(
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 24, fontSize: 20,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
shadows: <Shadow>[ shadows: <Shadow>[
Shadow( Shadow(
@ -245,11 +242,11 @@ Widget welcomeHome(context) {
), ),
const Align( const Align(
child: child:
Image(image: AssetImage('assets/home/header.png'), height: 210), Image(image: AssetImage('assets/home/header.png'), height: 170),
), ),
]), ]),
Padding( Padding(
padding: EdgeInsets.only(top: 1 * ratio), padding: const EdgeInsets.only(top: 1),
child: child:
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
Text( Text(
@ -257,7 +254,7 @@ Widget welcomeHome(context) {
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 24, fontSize: 20,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
shadows: <Shadow>[ shadows: <Shadow>[
Shadow( Shadow(
@ -292,7 +289,7 @@ Widget welcomeHome(context) {
child: ConstrainedBox( child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 480), constraints: const BoxConstraints(maxWidth: 480),
child: Column(children: <Widget>[ child: Column(children: <Widget>[
const Spacer(), const Spacer(flex: 4),
Row(children: <Widget>[ Row(children: <Widget>[
Expanded( Expanded(
child: Stack(children: <Widget>[ child: Stack(children: <Widget>[
@ -300,16 +297,17 @@ Widget welcomeHome(context) {
padding: EdgeInsets.only(top: 55), padding: EdgeInsets.only(top: 55),
child: Image( child: Image(
image: AssetImage('assets/home/gecko-bienvenue.png'), image: AssetImage('assets/home/gecko-bienvenue.png'),
height: 220, height: 180,
), ),
), ),
Positioned( Positioned(
left: 180, left: 160,
top: 10,
child: BubbleSpeak(text: "noLizard".tr()), child: BubbleSpeak(text: "noLizard".tr()),
), ),
const Positioned( const Positioned(
left: 200, left: 180,
top: 60, top: 70,
child: Image( child: Image(
image: AssetImage('assets/home/bout_de_bulle.png'), image: AssetImage('assets/home/bout_de_bulle.png'),
), ),
@ -318,8 +316,8 @@ Widget welcomeHome(context) {
), ),
]), ]),
SizedBox( SizedBox(
width: 410, width: 335,
height: 70, height: 60,
child: ElevatedButton( child: ElevatedButton(
key: keyOnboardingNewChest, key: keyOnboardingNewChest,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -339,14 +337,14 @@ Widget welcomeHome(context) {
child: Text( child: Text(
'createWallet'.tr(), 'createWallet'.tr(),
style: const TextStyle( style: const TextStyle(
fontSize: 24, fontWeight: FontWeight.w600), fontSize: 21, fontWeight: FontWeight.w600),
), ),
), ),
), ),
SizedBox(height: 25 * ratio), const SizedBox(height: 25),
SizedBox( SizedBox(
width: 410, width: 335,
height: 70, height: 60,
child: OutlinedButton( child: OutlinedButton(
key: keyRestoreChest, key: keyRestoreChest,
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
@ -364,13 +362,14 @@ Widget welcomeHome(context) {
child: Text( child: Text(
"restoreWallet".tr(), "restoreWallet".tr(),
style: const TextStyle( style: const TextStyle(
fontSize: 24, fontSize: 21,
color: orangeC, color: orangeC,
fontWeight: FontWeight.w600), fontWeight: FontWeight.w600),
), ),
), ),
), ),
SizedBox(height: isTall ? 100 : 50) // const SizedBox(height: 80)
const Spacer(flex: 3),
]), ]),
), ),
), ),

View File

@ -48,11 +48,8 @@ class _ChangePinScreenState extends State<ChangePinScreen> {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
elevation: 1, elevation: 1,
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(widget.walletName!),
height: 22,
child: Text(widget.walletName!),
),
), ),
body: Center( body: Center(
child: SafeArea( child: SafeArea(

View File

@ -33,7 +33,7 @@ class ChestOptions extends StatelessWidget {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
elevation: 1, elevation: 1,
toolbarHeight: 60 * ratio, toolbarHeight: 60,
// leading: IconButton( // leading: IconButton(
// icon: const Icon(Icons.arrow_back, color: Colors.black), // icon: const Icon(Icons.arrow_back, color: Colors.black),
// onPressed: () { // onPressed: () {
@ -43,16 +43,13 @@ class ChestOptions extends StatelessWidget {
// // ); // // );
// Navigator.pop(context); // Navigator.pop(context);
// }), // }),
title: SizedBox( title: Text(currentChest.name!)),
height: 22,
child: Text(currentChest.name!),
)),
bottomNavigationBar: const GeckoBottomAppBar(), bottomNavigationBar: const GeckoBottomAppBar(),
body: Stack(children: [ body: Stack(children: [
Builder( Builder(
builder: (ctx) => SafeArea( builder: (ctx) => SafeArea(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
SizedBox(height: 30 * ratio), const SizedBox(height: 30),
InkWell( InkWell(
key: keyShowSeed, key: keyShowSeed,
onTap: () async { onTap: () async {
@ -83,7 +80,7 @@ class ChestOptions extends StatelessWidget {
} }
}, },
child: SizedBox( child: SizedBox(
height: 50, height: 70,
child: Row(children: <Widget>[ child: Row(children: <Widget>[
const SizedBox(width: 20), const SizedBox(width: 20),
Image.asset( Image.asset(
@ -91,17 +88,20 @@ class ChestOptions extends StatelessWidget {
width: 60, width: 60,
), ),
const SizedBox(width: 15), const SizedBox(width: 15),
Text( SizedBox(
'displayMnemonic'.tr(), width: 270,
style: const TextStyle( child: Text(
fontSize: 20, 'displayMnemonic'.tr(),
color: orangeC, style: const TextStyle(
fontSize: 20,
color: orangeC,
),
), ),
), ),
]), ]),
), ),
), ),
SizedBox(height: 10 * ratio), const SizedBox(height: 10),
Consumer<SubstrateSdk>(builder: (context, sub, _) { Consumer<SubstrateSdk>(builder: (context, sub, _) {
return InkWell( return InkWell(
key: keyChangePin, key: keyChangePin,
@ -127,7 +127,7 @@ class ChestOptions extends StatelessWidget {
// } // }
// : null, // : null,
child: SizedBox( child: SizedBox(
height: 50, height: 70,
child: Row(children: <Widget>[ child: Row(children: <Widget>[
const SizedBox(width: 26), const SizedBox(width: 26),
Image.asset( Image.asset(
@ -146,7 +146,7 @@ class ChestOptions extends StatelessWidget {
])), ])),
); );
}), }),
SizedBox(height: 10 * ratio), const SizedBox(height: 10),
Consumer<SubstrateSdk>(builder: (context, sub, _) { Consumer<SubstrateSdk>(builder: (context, sub, _) {
return InkWell( return InkWell(
key: keycreateRootDerivation, key: keycreateRootDerivation,
@ -163,7 +163,7 @@ class ChestOptions extends StatelessWidget {
} }
: null, : null,
child: SizedBox( child: SizedBox(
height: 50, height: 70,
child: Row(children: <Widget>[ child: Row(children: <Widget>[
const SizedBox(width: 35), const SizedBox(width: 35),
const Icon( const Icon(
@ -183,14 +183,14 @@ class ChestOptions extends StatelessWidget {
), ),
); );
}), }),
SizedBox(height: 10 * ratio), const SizedBox(height: 10),
InkWell( InkWell(
key: keyDeleteChest, key: keyDeleteChest,
onTap: () async { onTap: () async {
await chestProvider.deleteChest(context, currentChest); await chestProvider.deleteChest(context, currentChest);
}, },
child: SizedBox( child: SizedBox(
height: 50, height: 70,
child: Row(children: <Widget>[ child: Row(children: <Widget>[
const SizedBox(width: 28), const SizedBox(width: 28),
Image.asset( Image.asset(

View File

@ -33,15 +33,10 @@ class _ChooseChestState extends State<ChooseChest> {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(toolbarHeight: 60, title: Text('selectMyChest'.tr())),
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('selectMyChest'.tr()),
)),
body: SafeArea( body: SafeArea(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
SizedBox(height: 160 * ratio), const SizedBox(height: 160),
CarouselSlider( CarouselSlider(
carouselController: buttonCarouselController, carouselController: buttonCarouselController,
options: CarouselOptions( options: CarouselOptions(
@ -102,7 +97,7 @@ class _ChooseChestState extends State<ChooseChest> {
); );
}).toList(), }).toList(),
), ),
SizedBox(height: 80 * ratio), const SizedBox(height: 80),
SizedBox( SizedBox(
width: 400, width: 400,
height: 70, height: 70,

View File

@ -48,12 +48,8 @@ class _CustomDerivationState extends State<CustomDerivation> {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar:
toolbarHeight: 60 * ratio, AppBar(toolbarHeight: 60, title: Text('createCustomDerivation'.tr())),
title: SizedBox(
height: 22,
child: Text('createCustomDerivation'.tr()),
)),
body: Center( body: Center(
child: SafeArea( child: SafeArea(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
@ -100,8 +96,8 @@ class _CustomDerivationState extends State<CustomDerivation> {
), ),
const Spacer(flex: 1), const Spacer(flex: 1),
SizedBox( SizedBox(
width: 410, width: 300,
height: 70, height: 60,
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
foregroundColor: Colors.white, elevation: 4, foregroundColor: Colors.white, elevation: 4,
@ -135,14 +131,14 @@ class _CustomDerivationState extends State<CustomDerivation> {
int.parse(dropdownValue!), int.parse(dropdownValue!),
); );
} }
Navigator.pop(context); Navigator.popUntil(
Navigator.pop(context); context, ModalRoute.withName('/mywallets'));
} }
}, },
child: Text( child: Text(
'validate'.tr(), 'validate'.tr(),
style: const TextStyle( style: const TextStyle(
fontSize: 24, fontWeight: FontWeight.w600), fontSize: 22, fontWeight: FontWeight.w600),
), ),
), ),
), ),

View File

@ -40,12 +40,7 @@ class ImportG1v1 extends StatelessWidget {
}, },
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(toolbarHeight: 60, title: Text('importOldAccount'.tr())),
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('importOldAccount'.tr()),
)),
body: SafeArea( body: SafeArea(
child: Consumer<SubstrateSdk>(builder: (context, sub, _) { child: Consumer<SubstrateSdk>(builder: (context, sub, _) {
return FutureBuilder( return FutureBuilder(
@ -106,7 +101,7 @@ class ImportG1v1 extends StatelessWidget {
final unit = isUdUnit ? 'ud'.tr(args: ['']) : currencyName; final unit = isUdUnit ? 'ud'.tr(args: ['']) : currencyName;
return Column(children: <Widget>[ return Column(children: <Widget>[
const SizedBox(height: 20), const SizedBox(height: 10),
TextFormField( TextFormField(
key: keyCesiumId, key: keyCesiumId,
autofocus: true, autofocus: true,
@ -117,9 +112,12 @@ class ImportG1v1 extends StatelessWidget {
} }
debounce = Timer( debounce = Timer(
const Duration(milliseconds: debouneTime), () { const Duration(milliseconds: debouneTime), () {
sub.reload(); if (sub.csSalt.text != '' &&
sub.csToV2Address( sub.csPassword.text != '') {
sub.csSalt.text, sub.csPassword.text); sub.reload();
sub.csToV2Address(
sub.csSalt.text, sub.csPassword.text);
}
}); });
}, },
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
@ -154,9 +152,12 @@ class ImportG1v1 extends StatelessWidget {
debounce = Timer( debounce = Timer(
const Duration(milliseconds: debouneTime), () { const Duration(milliseconds: debouneTime), () {
sub.g1V1NewAddress = ''; sub.g1V1NewAddress = '';
sub.reload(); if (sub.csSalt.text != '' &&
sub.csToV2Address( sub.csPassword.text != '') {
sub.csSalt.text, sub.csPassword.text); sub.reload();
sub.csToV2Address(
sub.csSalt.text, sub.csPassword.text);
}
}); });
}, },
keyboardType: TextInputType.text, keyboardType: TextInputType.text,
@ -179,39 +180,67 @@ class ImportG1v1 extends StatelessWidget {
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
GestureDetector( Visibility(
key: keyCopyAddress, visible: sub.g1V1OldPubkey != '',
onTap: () { child: Row(
Clipboard.setData( mainAxisAlignment: MainAxisAlignment.center,
ClipboardData(text: sub.g1V1OldPubkey)); children: [
snackCopyKey(context); Column(
}, children: [
child: Text( GestureDetector(
sub.g1V1OldPubkey, key: keyCopyPubkey,
style: const TextStyle( onTap: () {
fontSize: 16, Clipboard.setData(
fontWeight: FontWeight.w600, ClipboardData(text: sub.g1V1OldPubkey));
), snackCopyKey(context);
},
child: Text(
'v1: ${getShortPubkey(sub.g1V1OldPubkey)}',
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
fontFamily: 'Monospace'),
),
),
const SizedBox(height: 5),
GestureDetector(
key: keyCopyAddress,
onTap: () {
Clipboard.setData(
ClipboardData(text: sub.g1V1OldPubkey));
snackCopyKey(context);
},
child: Text(
'v2: ${getShortPubkey(sub.g1V1NewAddress)}',
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
fontFamily: 'Monospace'),
),
),
],
),
const SizedBox(width: 30),
Column(
children: [
Text(
'${balance['transferableBalance']} $unit',
style: const TextStyle(fontSize: 17),
),
IdentityStatus(
address: sub.g1V1NewAddress,
isOwner: false,
color: Colors.black),
const SizedBox(width: 10),
Certifications(
address: sub.g1V1NewAddress, size: 14)
],
),
],
), ),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
Text( Text('migrateToThisWallet'.tr()),
'${balance['transferableBalance']} $unit',
style: const TextStyle(fontSize: 17),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
IdentityStatus(
address: sub.g1V1NewAddress,
isOwner: false,
color: Colors.black),
const SizedBox(width: 10),
Certifications(address: sub.g1V1NewAddress, size: 14)
],
),
const SizedBox(height: 30),
Text('selectDestWallet'.tr()),
const SizedBox(height: 5), const SizedBox(height: 5),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
key: keySelectWallet, key: keySelectWallet,
@ -235,10 +264,10 @@ class ImportG1v1 extends StatelessWidget {
}, },
), ),
), ),
const SizedBox(height: 30), const SizedBox(height: 10),
SizedBox( SizedBox(
width: 380 * ratio, width: 350,
height: 60 * ratio, height: 50,
child: ElevatedButton( child: ElevatedButton(
key: keyConfirm, key: keyConfirm,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -270,7 +299,7 @@ class ImportG1v1 extends StatelessWidget {
balance: balance, balance: balance,
idtyStatus: idtyStatus); idtyStatus: idtyStatus);
Navigator.pop(context); Navigator.pop(context);
Navigator.push( await Navigator.push(
context, context,
MaterialPageRoute(builder: (context) { MaterialPageRoute(builder: (context) {
return TransactionInProgress( return TransactionInProgress(
@ -286,9 +315,8 @@ class ImportG1v1 extends StatelessWidget {
: null, : null,
child: Text( child: Text(
'migrateAccount'.tr(), 'migrateAccount'.tr(),
style: TextStyle( style: const TextStyle(
fontSize: 23 * ratio, fontSize: 23, fontWeight: FontWeight.w600),
fontWeight: FontWeight.w600),
), ),
), ),
), ),
@ -312,5 +340,6 @@ class ImportG1v1 extends StatelessWidget {
sub.csSalt.text = ''; sub.csSalt.text = '';
sub.csPassword.text = ''; sub.csPassword.text = '';
sub.g1V1NewAddress = ''; sub.g1V1NewAddress = '';
sub.g1V1OldPubkey = '';
} }
} }

View File

@ -32,11 +32,7 @@ class ManageMembership extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60, title: const Text('manageMembership').tr()),
title: SizedBox(
height: 22,
child: const Text('manageMembership').tr(),
)),
body: SafeArea( body: SafeArea(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
const SizedBox(height: 20), const SizedBox(height: 20),

View File

@ -65,12 +65,7 @@ class MigrateIdentityScreen extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(toolbarHeight: 60, title: Text('importOldAccount'.tr())),
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('importOldAccount'.tr()),
)),
body: SafeArea( body: SafeArea(
child: Consumer<SubstrateSdk>(builder: (context, sub, _) { child: Consumer<SubstrateSdk>(builder: (context, sub, _) {
return FutureBuilder( return FutureBuilder(
@ -166,7 +161,7 @@ class MigrateIdentityScreen extends StatelessWidget {
fontFamily: 'Monospace'), fontFamily: 'Monospace'),
), ),
const SizedBox(height: 30), const SizedBox(height: 30),
Text('selectDestWallet'.tr()), Text('migrateToThisWallet'.tr()),
const SizedBox(height: 5), const SizedBox(height: 5),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
key: keySelectWallet, key: keySelectWallet,
@ -192,8 +187,8 @@ class MigrateIdentityScreen extends StatelessWidget {
), ),
const SizedBox(height: 30), const SizedBox(height: 30),
SizedBox( SizedBox(
width: 380 * ratio, width: 370,
height: 60 * ratio, height: 60,
child: ElevatedButton( child: ElevatedButton(
key: keyConfirm, key: keyConfirm,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -240,8 +235,8 @@ class MigrateIdentityScreen extends StatelessWidget {
: null, : null,
child: Text( child: Text(
'migrateIdentity'.tr(), 'migrateIdentity'.tr(),
style: TextStyle( style: const TextStyle(
fontSize: 23 * ratio, fontWeight: FontWeight.w600), fontSize: 23, fontWeight: FontWeight.w600),
), ),
), ),
), ),

View File

@ -36,18 +36,13 @@ class RestoreChest extends StatelessWidget {
}, },
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(toolbarHeight: 60, title: Text('restoreAChest'.tr())),
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('restoreAChest'.tr()),
)),
body: SafeArea( body: SafeArea(
child: Stack(children: [ child: Stack(children: [
Column(children: <Widget>[ Column(children: <Widget>[
SizedBox(height: isTall ? 30 : 15), const SizedBox(height: 25),
bubbleSpeak('toRestoreEnterMnemonic'.tr()), bubbleSpeak('toRestoreEnterMnemonic'.tr()),
SizedBox(height: isTall ? 30 : 15), const SizedBox(height: 25),
Column(children: <Widget>[ Column(children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -82,7 +77,7 @@ class RestoreChest extends StatelessWidget {
child: Align( child: Align(
alignment: Alignment.center, alignment: Alignment.center,
child: SizedBox( child: SizedBox(
width: 410, width: 370,
height: 70, height: 70,
child: ElevatedButton( child: ElevatedButton(
key: keyGoNext, key: keyGoNext,
@ -121,7 +116,7 @@ class RestoreChest extends StatelessWidget {
Column(children: [ Column(children: [
const SizedBox(height: 20), const SizedBox(height: 20),
SizedBox( SizedBox(
width: 190, width: 220,
height: 60, height: 60,
child: ElevatedButton( child: ElevatedButton(
key: keyPastMnemonic, key: keyPastMnemonic,
@ -137,14 +132,14 @@ class RestoreChest extends StatelessWidget {
children: [ children: [
const Icon( const Icon(
Icons.content_paste_go, Icons.content_paste_go,
size: 27, size: 30,
), ),
// const SizedBox(width: 10), // const SizedBox(width: 10),
Text( Text(
'pasteFromClipboard'.tr(), 'pasteFromClipboard'.tr(),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: const TextStyle(
fontSize: 17, fontWeight: FontWeight.w400), fontSize: 18, fontWeight: FontWeight.w400),
), ),
], ],
)), )),
@ -161,7 +156,7 @@ class RestoreChest extends StatelessWidget {
Widget bubbleSpeak(String text) { Widget bubbleSpeak(String text) {
return Bubble( return Bubble(
margin: const BubbleEdges.symmetric(horizontal: 20), margin: const BubbleEdges.symmetric(horizontal: 20),
padding: BubbleEdges.all(isTall ? 25 : 15), padding: const BubbleEdges.all(20),
borderWidth: 1, borderWidth: 1,
borderColor: Colors.black, borderColor: Colors.black,
radius: Radius.zero, radius: Radius.zero,
@ -171,7 +166,7 @@ class RestoreChest extends StatelessWidget {
key: keyBubbleSpeak, key: keyBubbleSpeak,
textAlign: TextAlign.justify, textAlign: TextAlign.justify,
style: const TextStyle( style: const TextStyle(
color: Colors.black, fontSize: 19, fontWeight: FontWeight.w400), color: Colors.black, fontSize: 18, fontWeight: FontWeight.w400),
), ),
); );
} }
@ -181,8 +176,8 @@ class RestoreChest extends StatelessWidget {
Provider.of<GenerateWalletsProvider>(context); Provider.of<GenerateWalletsProvider>(context);
return Container( return Container(
width: 102, width: 90,
height: 40 * ratio, height: 40,
// ), // ),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey), border: Border.all(color: Colors.grey),
@ -213,7 +208,7 @@ class RestoreChest extends StatelessWidget {
} }
}, },
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle(fontSize: 20), style: const TextStyle(fontSize: 18),
), ),
); );
} }

View File

@ -33,12 +33,7 @@ class ShowSeed extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(toolbarHeight: 60, title: Text('myMnemonic'.tr())),
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('myMnemonic'.tr()),
)),
body: SafeArea( body: SafeArea(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
const Spacer(flex: 1), const Spacer(flex: 1),
@ -64,62 +59,67 @@ class ShowSeed extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Column(children: [ Column(children: [
BuildText(text: 'keepYourMnemonicSecret'.tr()), BuildText(
SizedBox(height: 35 * ratio), text: 'keepYourMnemonicSecret'.tr(), size: 17),
const SizedBox(height: 35),
sentanceArray(context, seed.data!.split(' ')), sentanceArray(context, seed.data!.split(' ')),
const SizedBox(height: 20), const SizedBox(height: 20),
SizedBox( Row(
height: 40, children: [
child: ElevatedButton( SizedBox(
style: ElevatedButton.styleFrom( height: 40,
foregroundColor: Colors.black, child: ElevatedButton(
shape: RoundedRectangleBorder( style: ElevatedButton.styleFrom(
borderRadius: BorderRadius.circular(8), foregroundColor: Colors.black,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
backgroundColor: orangeC,
elevation: 1, // foreground
),
onPressed: () {
Clipboard.setData(
ClipboardData(text: seed.data!));
snackCopySeed(context);
},
child: Row(children: <Widget>[
Image.asset(
'assets/walletOptions/copy-white.png',
height: 25,
),
const SizedBox(width: 7),
Text(
'copy'.tr(),
style: TextStyle(
fontSize: 15, color: Colors.grey[50]),
)
]),
), ),
backgroundColor: orangeC,
elevation: 1, // foreground
), ),
onPressed: () { const SizedBox(width: 50),
Clipboard.setData( GestureDetector(
ClipboardData(text: seed.data!)); onTap: () {
snackCopySeed(context); Navigator.push(
}, context,
child: Row(children: <Widget>[ MaterialPageRoute(builder: (context) {
Image.asset( return PrintWallet(seed.data);
'assets/walletOptions/copy-white.png', }),
height: 25, );
},
child: Image.asset(
'assets/printer.png',
height: 42,
), ),
const SizedBox(width: 7), ),
Text( ],
'copy'.tr(),
style: TextStyle(
fontSize: 15, color: Colors.grey[50]),
)
]),
),
),
const SizedBox(height: 30),
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return PrintWallet(seed.data);
}),
);
},
child: Image.asset(
'assets/printer.png',
height: 42 * ratio,
),
), ),
]), ]),
]); ]);
}), }),
const Spacer(flex: 2), const Spacer(flex: 3),
SizedBox( SizedBox(
width: 380 * ratio, width: 370,
height: 60 * ratio, height: 60,
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
foregroundColor: Colors.white, elevation: 4, foregroundColor: Colors.white, elevation: 4,
@ -130,8 +130,8 @@ class ShowSeed extends StatelessWidget {
}, },
child: Text( child: Text(
'close'.tr(), 'close'.tr(),
style: TextStyle( style: const TextStyle(
fontSize: 23 * ratio, fontWeight: FontWeight.w600), fontSize: 23, fontWeight: FontWeight.w600),
), ),
), ),
), ),
@ -141,61 +141,57 @@ class ShowSeed extends StatelessWidget {
} }
Widget sentanceArray(BuildContext context, List mnemonic) { Widget sentanceArray(BuildContext context, List mnemonic) {
return Padding( return Container(
padding: const EdgeInsets.symmetric(horizontal: 3), constraints: const BoxConstraints(maxWidth: 375),
child: Container( decoration: BoxDecoration(
constraints: const BoxConstraints(maxWidth: 450), border: Border.all(color: Colors.black),
decoration: BoxDecoration( color: const Color(0xffeeeedd),
border: Border.all(color: Colors.black), borderRadius: const BorderRadius.all(
color: const Color(0xffeeeedd), Radius.circular(10),
borderRadius: const BorderRadius.all( )),
Radius.circular(10), padding: const EdgeInsets.all(15),
)), child: Column(
padding: const EdgeInsets.all(20), mainAxisAlignment: MainAxisAlignment.center,
child: Column( mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.center, Row(children: <Widget>[
children: <Widget>[ arrayCell(mnemonic[0], 1),
Row(children: <Widget>[ arrayCell(mnemonic[1], 2),
arrayCell(mnemonic[0], 1), arrayCell(mnemonic[2], 3),
arrayCell(mnemonic[1], 2), arrayCell(mnemonic[3], 4),
arrayCell(mnemonic[2], 3), ]),
arrayCell(mnemonic[3], 4), const SizedBox(height: 15),
]), Row(children: <Widget>[
const SizedBox(height: 15), arrayCell(mnemonic[4], 5),
Row(children: <Widget>[ arrayCell(mnemonic[5], 6),
arrayCell(mnemonic[4], 5), arrayCell(mnemonic[6], 7),
arrayCell(mnemonic[5], 6), arrayCell(mnemonic[7], 8),
arrayCell(mnemonic[6], 7), ]),
arrayCell(mnemonic[7], 8), const SizedBox(height: 15),
]), Row(children: <Widget>[
const SizedBox(height: 15), arrayCell(mnemonic[8], 9),
Row(children: <Widget>[ arrayCell(mnemonic[9], 10),
arrayCell(mnemonic[8], 9), arrayCell(mnemonic[10], 11),
arrayCell(mnemonic[9], 10), arrayCell(mnemonic[11], 12),
arrayCell(mnemonic[10], 11), ]),
arrayCell(mnemonic[11], 12), ]));
]),
])),
);
} }
Widget arrayCell(dataWord, int nbr) { Widget arrayCell(dataWord, int nbr) {
log.d(nbr); log.d(nbr);
return SizedBox( return SizedBox(
width: 100, width: 85,
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Text( Text(
nbr.toString(), nbr.toString(),
style: style: const TextStyle(fontSize: 13, color: Color(0xff6b6b52)),
TextStyle(fontSize: 13 * ratio, color: const Color(0xff6b6b52)),
), ),
Text( Text(
dataWord, dataWord,
key: keyMnemonicWord(dataWord), key: keyMnemonicWord(dataWord),
style: TextStyle(fontSize: 17 * ratio, color: Colors.black), style: const TextStyle(fontSize: 17, color: Colors.black),
), ),
]), ]),
); );
@ -219,13 +215,10 @@ class PrintWallet extends StatelessWidget {
}), }),
backgroundColor: yellowC, backgroundColor: yellowC,
foregroundColor: Colors.black, foregroundColor: Colors.black,
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'printMyMnemonic'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'printMyMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
body: PdfPreview( body: PdfPreview(

View File

@ -77,18 +77,18 @@ class UnlockingWallet extends StatelessWidget {
), ),
), ),
Column(children: <Widget>[ Column(children: <Widget>[
SizedBox(height: isTall ? 100 : 20), const SizedBox(height: 80),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
currentChest.imageFile == null currentChest.imageFile == null
? Image.asset( ? Image.asset(
'assets/chests/${currentChest.imageName}', 'assets/chests/${currentChest.imageName}',
width: isTall ? 130 : 100, width: 100,
) )
: Image.file( : Image.file(
currentChest.imageFile!, currentChest.imageFile!,
width: isTall ? 130 : 100, width: 130,
), ),
const SizedBox(width: 5), const SizedBox(width: 5),
SizedBox( SizedBox(
@ -102,17 +102,18 @@ class UnlockingWallet extends StatelessWidget {
fontWeight: FontWeight.w700), fontWeight: FontWeight.w700),
)), )),
]), ]),
SizedBox(height: 30 * ratio), const SizedBox(height: 30),
SizedBox( SizedBox(
width: 400, width: 350,
child: Text( child: Text(
'toUnlockEnterPassword'.tr(), 'toUnlockEnterPassword'.tr(),
textAlign: TextAlign.center,
style: const TextStyle( style: const TextStyle(
fontSize: 19, fontSize: 19,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w400), fontWeight: FontWeight.w400),
)), )),
SizedBox(height: 30 * ratio), const SizedBox(height: 30),
if (!myWalletProvider.isPinValid && if (!myWalletProvider.isPinValid &&
!myWalletProvider.isPinLoading) !myWalletProvider.isPinLoading)
Text( Text(
@ -120,9 +121,9 @@ class UnlockingWallet extends StatelessWidget {
style: const TextStyle( style: const TextStyle(
color: Colors.red, fontWeight: FontWeight.w500), color: Colors.red, fontWeight: FontWeight.w500),
), ),
SizedBox(height: 10 * ratio), const SizedBox(height: 10),
pinForm(context, pinLenght), pinForm(context, pinLenght),
SizedBox(height: 3 * ratio), const SizedBox(height: 10),
if (canUnlock) if (canUnlock)
Consumer<WalletOptionsProvider>( Consumer<WalletOptionsProvider>(
builder: (context, sub, _) { builder: (context, sub, _) {
@ -150,31 +151,31 @@ class UnlockingWallet extends StatelessWidget {
]), ]),
); );
}), }),
const SizedBox(height: 10), // const SizedBox(height: 10),
// if (canUnlock) // if (canUnlock)
InkWell( // InkWell(
key: keyChangeChest, // key: keyChangeChest,
onTap: () { // onTap: () {
// Navigator.push( // // Navigator.push(
// context, // // context,
// MaterialPageRoute(builder: (context) { // // MaterialPageRoute(builder: (context) {
// return const ChooseChest(); // // return const ChooseChest();
// }), // // }),
// ); // // );
}, // },
child: SizedBox( // child: SizedBox(
width: 400, // width: 400,
height: 50, // height: 50,
child: Center( // child: Center(
child: Text( // child: Text(
'changeChest'.tr(), // 'changeChest'.tr(),
style: const TextStyle( // style: const TextStyle(
fontSize: 22, // fontSize: 22,
color: Colors.grey, // orangeC // color: Colors.grey, // orangeC
fontWeight: FontWeight.w600), // fontWeight: FontWeight.w600),
), // ),
), // ),
)), // )),
]), ]),
]), ]),
]), ]),
@ -200,7 +201,7 @@ class UnlockingWallet extends StatelessWidget {
return Form( return Form(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(vertical: 5 * ratio, horizontal: 30), padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 30),
child: PinCodeTextField( child: PinCodeTextField(
key: keyPinForm, key: keyPinForm,
textCapitalization: TextCapitalization.characters, textCapitalization: TextCapitalization.characters,
@ -228,7 +229,7 @@ class UnlockingWallet extends StatelessWidget {
borderWidth: 4, borderWidth: 4,
shape: PinCodeFieldShape.box, shape: PinCodeFieldShape.box,
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
fieldHeight: 50 * ratio, fieldHeight: 50,
fieldWidth: 50, fieldWidth: 50,
activeFillColor: Colors.black, activeFillColor: Colors.black,
), ),

View File

@ -61,18 +61,14 @@ class WalletOptions extends StatelessWidget {
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
elevation: 0, elevation: 0,
title: SizedBox( title: Consumer<WalletOptionsProvider>(
height: 22, builder: (context, walletProvider, _) {
child: Consumer<WalletOptionsProvider>( return Text(isWalletNameIndexed
builder: (context, walletProvider, _) { ? duniterIndexer.walletNameIndexer[walletOptions.address.text]!
return Text(isWalletNameIndexed : wallet.name!);
? duniterIndexer }),
.walletNameIndexer[walletOptions.address.text]!
: wallet.name!);
}),
),
actions: [ actions: [
InkWell( InkWell(
onTap: () { onTap: () {
@ -88,7 +84,7 @@ class WalletOptions extends StatelessWidget {
child: QrImageWidget( child: QrImageWidget(
data: walletOptions.address.text, data: walletOptions.address.text,
version: QrVersions.auto, version: QrVersions.auto,
size: 80, size: 70,
), ),
), ),
], ],
@ -99,7 +95,7 @@ class WalletOptions extends StatelessWidget {
builder: (ctx) => SafeArea( builder: (ctx) => SafeArea(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Container( Container(
height: isTall ? 5 : 0, height: 5,
color: yellowC, color: yellowC,
), ),
Consumer<WalletOptionsProvider>( Consumer<WalletOptionsProvider>(
@ -116,6 +112,7 @@ class WalletOptions extends StatelessWidget {
)), )),
child: Row(children: <Widget>[ child: Row(children: <Widget>[
const Spacer(flex: 1), const Spacer(flex: 1),
const SizedBox(width: 15),
avatar(walletProvider), avatar(walletProvider),
const Spacer(flex: 1), const Spacer(flex: 1),
Column( Column(
@ -123,7 +120,7 @@ class WalletOptions extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Stack(children: [ Stack(children: [
SizedBox( SizedBox(
width: 250, width: 230,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -167,7 +164,7 @@ class WalletOptions extends StatelessWidget {
), ),
), ),
]), ]),
SizedBox(height: isTall ? 5 : 0), const SizedBox(height: 5),
Balance( Balance(
address: walletProvider.address.text, size: 24), address: walletProvider.address.text, size: 24),
const SizedBox(width: 30), const SizedBox(width: 30),
@ -203,7 +200,7 @@ class WalletOptions extends StatelessWidget {
size: 20) size: 20)
]), ]),
), ),
SizedBox(height: 10 * ratio), const SizedBox(height: 10),
]), ]),
const Spacer(flex: 2), const Spacer(flex: 2),
]), ]),
@ -231,7 +228,7 @@ class WalletOptions extends StatelessWidget {
// size: isTall ? 150 : 80, // size: isTall ? 150 : 80,
// ), // ),
// ), // ),
SizedBox(height: 30 * ratio), const SizedBox(height: 30),
Consumer<WalletOptionsProvider>( Consumer<WalletOptionsProvider>(
builder: (context, walletProvider, _) { builder: (context, walletProvider, _) {
final defaultWallet = final defaultWallet =
@ -242,17 +239,17 @@ class WalletOptions extends StatelessWidget {
return Column(children: [ return Column(children: [
confirmIdentityButton(walletProvider), confirmIdentityButton(walletProvider),
pubkeyWidget(walletProvider, ctx), pubkeyWidget(walletProvider, ctx),
SizedBox(height: 10 * ratio), const SizedBox(height: 12),
activityWidget( activityWidget(
context, historyProvider, walletProvider), context, historyProvider, walletProvider),
SizedBox(height: 12 * ratio), const SizedBox(height: 13),
setDefaultWalletWidget( setDefaultWalletWidget(
context, context,
walletProvider, walletProvider,
myWalletProvider, myWalletProvider,
walletOptions, walletOptions,
currentChest), currentChest),
SizedBox(height: 17 * ratio), const SizedBox(height: 18),
Column(children: [ Column(children: [
if (!walletProvider.isDefaultWallet && if (!walletProvider.isDefaultWallet &&
!wallet.isMembre()) !wallet.isMembre())
@ -286,17 +283,19 @@ class WalletOptions extends StatelessWidget {
if (newPath != '') { if (newPath != '') {
wallet.imageCustomPath = newPath; wallet.imageCustomPath = newPath;
walletBox.put(wallet.key, wallet); walletBox.put(wallet.key, wallet);
// Uncomment to enable Cs+ avatar storage
// CesiumPlusProvider().setAvatar(wallet.address, newPath);
} }
walletProvider.reload(); walletProvider.reload();
}, },
child: wallet.imageCustomPath == null || wallet.imageCustomPath == '' child: wallet.imageCustomPath == null || wallet.imageCustomPath == ''
? Image.asset( ? Image.asset(
'assets/avatars/${wallet.imageDefaultPath}', 'assets/avatars/${wallet.imageDefaultPath}',
width: 110, width: 130,
) )
: Container( : Container(
width: 150, width: 130,
height: 150, height: 130,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: Colors.transparent, color: Colors.transparent,
@ -402,7 +401,7 @@ class WalletOptions extends StatelessWidget {
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontFamily: 'Monospace', fontFamily: 'Monospace',
color: Colors.black)), color: Colors.black)),
const SizedBox(width: 15), const Spacer(),
SizedBox( SizedBox(
height: 40, height: 40,
child: ElevatedButton( child: ElevatedButton(
@ -424,14 +423,15 @@ class WalletOptions extends StatelessWidget {
'assets/walletOptions/copy-white.png', 'assets/walletOptions/copy-white.png',
height: 25, height: 25,
), ),
const SizedBox(width: 7), // const SizedBox(width: 7),
Text( // Text(
'copy'.tr(), // 'copy'.tr(),
style: TextStyle(fontSize: 15, color: Colors.grey[50]), // style: TextStyle(fontSize: 15, color: Colors.grey[50]),
) // )
]), ]),
), ),
), ),
const Spacer(),
]), ]),
), ),
); );
@ -448,17 +448,7 @@ class WalletOptions extends StatelessWidget {
Navigator.push( Navigator.push(
context, context,
PageNoTransit(builder: (context) { PageNoTransit(builder: (context) {
return ActivityScreen( return ActivityScreen(address: walletProvider.address.text);
address: walletProvider.address.text,
avatar: wallet.imageCustomPath == null
? Image.asset(
'assets/avatars/${wallet.imageDefaultPath}',
width: 110,
)
: Image.asset(
wallet.imageCustomPath!,
width: 110,
));
}), }),
); );
}, },
@ -496,7 +486,7 @@ class WalletOptions extends StatelessWidget {
} }
: null, : null,
child: SizedBox( child: SizedBox(
height: 50, height: 60,
child: Row(children: <Widget>[ child: Row(children: <Widget>[
const SizedBox(width: 31), const SizedBox(width: 31),
CircleAvatar( CircleAvatar(
@ -508,15 +498,18 @@ class WalletOptions extends StatelessWidget {
), ),
), ),
const SizedBox(width: 22), const SizedBox(width: 22),
Text( SizedBox(
walletProvider.isDefaultWallet width: 270,
? 'thisWalletIsDefault'.tr() child: Text(
: 'defineWalletAsDefault'.tr(), walletProvider.isDefaultWallet
style: TextStyle( ? 'thisWalletIsDefault'.tr()
fontSize: 20, : 'defineWalletAsDefault'.tr(),
color: walletProvider.isDefaultWallet style: TextStyle(
? Colors.grey[500] fontSize: 20,
: Colors.black)), color: walletProvider.isDefaultWallet
? Colors.grey[500]
: Colors.black)),
),
]), ]),
), ),
); );
@ -560,7 +553,8 @@ class WalletOptions extends StatelessWidget {
walletOptions.balanceCache[walletOptions.address.text] ?? -1; walletOptions.balanceCache[walletOptions.address.text] ?? -1;
final bool canDelete = !isDefaultWallet && final bool canDelete = !isDefaultWallet &&
!hasConsumers.data! && !hasConsumers.data! &&
(balance > 2 || balance == 0); (balance > 2 || balance == 0) &&
!wallet.hasIdentity();
return InkWell( return InkWell(
key: keyDeleteWallet, key: keyDeleteWallet,
onTap: canDelete onTap: canDelete

View File

@ -44,7 +44,7 @@ class _WalletsHomeState extends State<WalletsHome> {
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
elevation: 1, elevation: 1,
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: Row( title: Row(
children: [ children: [
Image.asset( Image.asset(
@ -131,9 +131,9 @@ class _WalletsHomeState extends State<WalletsHome> {
final screenWidth = MediaQuery.of(context).size.width; final screenWidth = MediaQuery.of(context).size.width;
int nTule; int nTule;
if (screenWidth >= 900) { if (screenWidth >= 700) {
nTule = 4; nTule = 4;
} else if (screenWidth >= 650) { } else if (screenWidth >= 450) {
nTule = 3; nTule = 3;
} else { } else {
nTule = 2; nTule = 2;
@ -148,7 +148,7 @@ class _WalletsHomeState extends State<WalletsHome> {
TargetContent( TargetContent(
child: Column( child: Column(
children: [ children: [
Image.asset('assets/drag-and-drop.png', height: 140), Image.asset('assets/drag-and-drop.png', height: 120),
const SizedBox(height: 15), const SizedBox(height: 15),
Text( Text(
'explainDraggableWallet'.tr(), 'explainDraggableWallet'.tr(),
@ -179,7 +179,7 @@ class _WalletsHomeState extends State<WalletsHome> {
} }
return CustomScrollView(slivers: <Widget>[ return CustomScrollView(slivers: <Widget>[
const SliverToBoxAdapter(child: SizedBox(height: 20)), const SliverToBoxAdapter(child: SizedBox(height: 15)),
if (idtyWallet.address != '') if (idtyWallet.address != '')
SliverToBoxAdapter( SliverToBoxAdapter(
child: DragTuleAction( child: DragTuleAction(

View File

@ -14,7 +14,6 @@ class ContactsScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Provider.of<WalletsProfilesProvider>(context, listen: true); Provider.of<WalletsProfilesProvider>(context, listen: true);
double avatarSize = 55;
final myContacts = contactsBox.toMap().values.toList(); final myContacts = contactsBox.toMap().values.toList();
// Order contacts by username // Order contacts by username
@ -27,17 +26,14 @@ class ContactsScreen extends StatelessWidget {
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
elevation: 1, elevation: 1,
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'contactsManagementWithNbr'.tr(args: ['${myContacts.length}'])),
child: Text(
'contactsManagementWithNbr'.tr(args: ['${myContacts.length}'])),
),
), ),
bottomNavigationBar: const GeckoBottomAppBar(), bottomNavigationBar: const GeckoBottomAppBar(),
body: SafeArea( body: SafeArea(
child: Stack(children: [ child: Stack(children: [
ContactsList(myContacts: myContacts, avatarSize: avatarSize), ContactsList(myContacts: myContacts),
const OfflineInfo(), const OfflineInfo(),
]), ]),
), ),

View File

@ -15,13 +15,10 @@ class OnboardingStepOne extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'newWallet'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'newWallet'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,

View File

@ -16,6 +16,7 @@ import 'package:gecko/widgets/commons/build_text.dart';
import 'package:gecko/screens/onBoarding/11_congratulations.dart'; import 'package:gecko/screens/onBoarding/11_congratulations.dart';
import 'package:gecko/widgets/commons/fader_transition.dart'; import 'package:gecko/widgets/commons/fader_transition.dart';
import 'package:gecko/widgets/commons/offline_info.dart'; import 'package:gecko/widgets/commons/offline_info.dart';
import 'package:gecko/widgets/scan_derivations_info.dart';
import 'package:pin_code_fields/pin_code_fields.dart'; import 'package:pin_code_fields/pin_code_fields.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -48,48 +49,22 @@ class OnboardingStepTen extends StatelessWidget {
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'myPassword'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'myPassword'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
body: SafeArea( body: SafeArea(
child: Stack(children: [ child: Stack(children: [
Column(children: <Widget>[ Column(children: <Widget>[
SizedBox(height: isTall ? 40 : 20), const SizedBox(height: 25),
const BuildProgressBar(pagePosition: 9), const BuildProgressBar(pagePosition: 9),
SizedBox(height: isTall ? 40 : 20), const SizedBox(height: 25),
BuildText(text: "geckoWillCheckPassword".tr()), BuildText(text: "geckoWillCheckPassword".tr()),
SizedBox(height: isTall ? 60 : 10), const SizedBox(height: 25),
Visibility( const ScanDerivationsInfo(),
visible: generateWalletProvider.scanedValidWalletNumber != -1,
child: Padding(
padding: const EdgeInsets.only(bottom: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("derivationsScanProgress".tr(args: [
'${generateWalletProvider.scanedWalletNumber}',
'${generateWalletProvider.numberScan + 1}'
])),
const SizedBox(width: 10),
const SizedBox(
height: 22,
width: 22,
child: CircularProgressIndicator(
color: orangeC,
strokeWidth: 3,
),
),
],
),
),
),
Consumer<MyWalletsProvider>(builder: (context, mw, _) { Consumer<MyWalletsProvider>(builder: (context, mw, _) {
return Visibility( return Visibility(
visible: !myWalletProvider.isPinValid && visible: !myWalletProvider.isPinValid &&
@ -101,7 +76,7 @@ class OnboardingStepTen extends StatelessWidget {
), ),
); );
}), }),
SizedBox(height: isTall ? 20 : 10), const SizedBox(height: 20),
Consumer<SubstrateSdk>(builder: (context, sub, _) { Consumer<SubstrateSdk>(builder: (context, sub, _) {
return sub.nodeConnected return sub.nodeConnected
? pinForm(context, walletOptions, pinLenght, 1, 2) ? pinForm(context, walletOptions, pinLenght, 1, 2)
@ -195,7 +170,7 @@ class OnboardingStepTen extends StatelessWidget {
borderWidth: 4, borderWidth: 4,
shape: PinCodeFieldShape.box, shape: PinCodeFieldShape.box,
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
fieldHeight: 50 * ratio, fieldHeight: 50,
fieldWidth: 50, fieldWidth: 50,
activeFillColor: Colors.black, activeFillColor: Colors.black,
), ),

View File

@ -21,27 +21,24 @@ class OnboardingStepEleven extends StatelessWidget {
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
leading: const Icon(Icons.check), leading: const Icon(Icons.check),
title: SizedBox( title: Text(
height: 22, 'allGood'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'allGood'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
body: SafeArea( body: SafeArea(
child: Stack(children: [ child: Stack(children: [
Column(children: <Widget>[ Column(children: <Widget>[
const SizedBox(height: 40), const SizedBox(height: 30),
BuildText( BuildText(
text: "yourChestAndWalletWereCreatedSuccessfully".tr()), text: "yourChestAndWalletWereCreatedSuccessfully".tr()),
SizedBox(height: isTall ? 20 : 10), const SizedBox(height: 15),
Image.asset( Image.asset(
'assets/onBoarding/gecko-clin.gif', 'assets/onBoarding/gecko-clin.gif',
height: isTall ? 400 : 300, height: 350,
), ),
Expanded( Expanded(
child: Align( child: Align(
@ -84,8 +81,8 @@ class OnboardingStepEleven extends StatelessWidget {
Widget finishButton(BuildContext context) { Widget finishButton(BuildContext context) {
return SizedBox( return SizedBox(
width: 380 * ratio, width: 370,
height: 60 * ratio, height: 60,
child: ElevatedButton( child: ElevatedButton(
key: keyGoWalletsHome, key: keyGoWalletsHome,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -99,7 +96,7 @@ Widget finishButton(BuildContext context) {
}, },
child: Text( child: Text(
"accessMyChest".tr(), "accessMyChest".tr(),
style: TextStyle(fontSize: 22 * ratio, fontWeight: FontWeight.w600), style: const TextStyle(fontSize: 22, fontWeight: FontWeight.w600),
), ),
), ),
); );

View File

@ -16,13 +16,10 @@ class OnboardingStepTwo extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'yourMnemonic'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'yourMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,

View File

@ -16,13 +16,10 @@ class OnboardingStepThree extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'yourMnemonic'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'yourMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,

View File

@ -16,13 +16,10 @@ class OnboardingStepFor extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'yourMnemonic'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'yourMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,

View File

@ -40,47 +40,30 @@ class _ChooseChestState extends State<OnboardingStepFive> {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'yourMnemonic'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'yourMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
body: SafeArea( body: SafeArea(
child: Stack(children: [ child: Stack(children: [
Column(children: [ Column(children: [
SizedBox(height: isTall ? 40 : 20), const SizedBox(height: 25),
const BuildProgressBar(pagePosition: 4), const BuildProgressBar(pagePosition: 4),
SizedBox(height: isTall ? 40 : 20), const SizedBox(height: 25),
BuildText(text: 'geckoGeneratedYourMnemonicKeepItSecret'.tr()), BuildText(
SizedBox(height: 35 * ratio), text: 'geckoGeneratedYourMnemonicKeepItSecret'.tr(), size: 18),
const SizedBox(height: 15),
sentanceArray(context), sentanceArray(context),
SizedBox(height: 17 * ratio), const SizedBox(height: 17),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return PrintWallet(
generateWalletProvider.generatedMnemonic!);
}),
);
},
child: Image.asset(
'assets/printer.png',
height: 42 * ratio,
),
),
SizedBox( SizedBox(
height: 40, height: 40,
width: 120, width: 130,
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
foregroundColor: Colors.black, foregroundColor: Colors.black,
@ -108,15 +91,31 @@ class _ChooseChestState extends State<OnboardingStepFive> {
]), ]),
), ),
), ),
const SizedBox(width: 70),
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return PrintWallet(
generateWalletProvider.generatedMnemonic!);
}),
);
},
child: Image.asset(
'assets/printer.png',
height: 42,
),
),
], ],
), ),
const SizedBox(height: 40), const SizedBox(height: 17),
Expanded( Expanded(
child: Align( child: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: SizedBox( child: SizedBox(
width: 380 * ratio, width: 370,
height: 60 * ratio, height: 60,
child: ElevatedButton( child: ElevatedButton(
key: keyGenerateMnemonic, key: keyGenerateMnemonic,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -129,17 +128,16 @@ class _ChooseChestState extends State<OnboardingStepFive> {
}, },
child: Text("chooseAnotherMnemonic".tr(), child: Text("chooseAnotherMnemonic".tr(),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: const TextStyle(
fontSize: 22 * ratio, fontSize: 22, fontWeight: FontWeight.w600))),
fontWeight: FontWeight.w600))),
), ),
), ),
), ),
SizedBox(height: 22 * ratio), const SizedBox(height: 22),
nextButton( nextButton(
context, "iNotedMyMnemonic".tr(), false, widget.skipIntro), context, "iNotedMyMnemonic".tr(), false, widget.skipIntro),
const Spacer(), const Spacer(),
// SizedBox(height: 35 * ratio), // SizedBox(height: 35),
]), ]),
const OfflineInfo(), const OfflineInfo(),
]), ]),
@ -152,68 +150,65 @@ Widget sentanceArray(BuildContext context) {
final generateWalletProvider = final generateWalletProvider =
Provider.of<GenerateWalletsProvider>(context, listen: false); Provider.of<GenerateWalletsProvider>(context, listen: false);
return Padding( return Container(
padding: const EdgeInsets.symmetric(horizontal: 3), constraints: const BoxConstraints(maxWidth: 375),
child: Container( decoration: BoxDecoration(
constraints: const BoxConstraints(maxWidth: 450), border: Border.all(color: Colors.black),
decoration: BoxDecoration( color: const Color(0xffeeeedd),
border: Border.all(color: Colors.black), borderRadius: const BorderRadius.all(
color: const Color(0xffeeeedd), Radius.circular(10),
borderRadius: const BorderRadius.all( )),
Radius.circular(10), padding: const EdgeInsets.all(15),
)), child: FutureBuilder(
padding: const EdgeInsets.all(20), future: generateWalletProvider.generateWordList(context),
child: FutureBuilder( builder: (BuildContext context, AsyncSnapshot<List> data) {
future: generateWalletProvider.generateWordList(context), if (!data.hasData) {
builder: (BuildContext context, AsyncSnapshot<List> data) { return const Text('');
if (!data.hasData) { } else {
return const Text(''); mnemoList = data;
} else { return Column(
mnemoList = data; mainAxisAlignment: MainAxisAlignment.center,
return Column( mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.center, Row(children: <Widget>[
children: <Widget>[ arrayCell(data.data![0]),
Row(children: <Widget>[ arrayCell(data.data![1]),
arrayCell(data.data![0]), arrayCell(data.data![2]),
arrayCell(data.data![1]), arrayCell(data.data![3]),
arrayCell(data.data![2]), ]),
arrayCell(data.data![3]), const SizedBox(height: 12),
]), Row(children: <Widget>[
const SizedBox(height: 15), arrayCell(data.data![4]),
Row(children: <Widget>[ arrayCell(data.data![5]),
arrayCell(data.data![4]), arrayCell(data.data![6]),
arrayCell(data.data![5]), arrayCell(data.data![7]),
arrayCell(data.data![6]), ]),
arrayCell(data.data![7]), const SizedBox(height: 12),
]), Row(children: <Widget>[
const SizedBox(height: 15), arrayCell(data.data![8]),
Row(children: <Widget>[ arrayCell(data.data![9]),
arrayCell(data.data![8]), arrayCell(data.data![10]),
arrayCell(data.data![9]), arrayCell(data.data![11]),
arrayCell(data.data![10]), ]),
arrayCell(data.data![11]), ]);
]), }
]); }),
}
}),
),
); );
} }
Widget arrayCell(dataWord) { Widget arrayCell(dataWord) {
return SizedBox( return SizedBox(
width: 100, width: 85,
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Text( Text(
dataWord.split(':')[0], dataWord.split(':')[0],
style: TextStyle(fontSize: 13 * ratio, color: const Color(0xff6b6b52)), style: const TextStyle(fontSize: 13, color: Color(0xff6b6b52)),
), ),
Text( Text(
dataWord.split(':')[1], dataWord.split(':')[1],
key: keyMnemonicWord(dataWord.split(':')[0]), key: keyMnemonicWord(dataWord.split(':')[0]),
style: TextStyle(fontSize: 17 * ratio, color: Colors.black), style: const TextStyle(fontSize: 17, color: Colors.black),
), ),
]), ]),
); );
@ -226,8 +221,8 @@ Widget nextButton(
final myWalletProvider = final myWalletProvider =
Provider.of<MyWalletsProvider>(context, listen: false); Provider.of<MyWalletsProvider>(context, listen: false);
return SizedBox( return SizedBox(
width: 380 * ratio, width: 370,
height: 60 * ratio, height: 60,
child: ElevatedButton( child: ElevatedButton(
key: keyGoNext, key: keyGoNext,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -251,7 +246,7 @@ Widget nextButton(
}, },
child: Text( child: Text(
text, text,
style: TextStyle(fontSize: 22 * ratio, fontWeight: FontWeight.w600), style: const TextStyle(fontSize: 22, fontWeight: FontWeight.w600),
), ),
), ),
); );

View File

@ -42,13 +42,10 @@ class OnboardingStepSix extends StatelessWidget {
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'yourMnemonic'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'yourMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
body: SafeArea( body: SafeArea(
@ -56,23 +53,23 @@ class OnboardingStepSix extends StatelessWidget {
Align( Align(
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
child: Column(children: [ child: Column(children: [
SizedBox(height: isTall ? 40 : 20), const SizedBox(height: 25),
const BuildProgressBar(pagePosition: 5), const BuildProgressBar(pagePosition: 5),
SizedBox(height: isTall ? 40 : 20), const SizedBox(height: 25),
BuildText( BuildText(
text: "didYouNoteMnemonicToBeSureTypeWord".tr(args: [ text: "didYouNoteMnemonicToBeSureTypeWord".tr(args: [
(generateWalletProvider.nbrWord + 1).toString() (generateWalletProvider.nbrWord + 1).toString()
]), ]),
size: 20, size: 18,
isMd: true), isMd: true),
SizedBox(height: isTall ? 70 : 20), const SizedBox(height: 40),
Text('${generateWalletProvider.nbrWord + 1}', Text('${generateWalletProvider.nbrWord + 1}',
key: keyAskedWord, key: keyAskedWord,
style: TextStyle( style: const TextStyle(
fontSize: isTall ? 17 : 15, fontSize: 20,
color: orangeC, color: orangeC,
fontWeight: FontWeight.w400)), fontWeight: FontWeight.w500)),
const SizedBox(height: 10), const SizedBox(height: 5),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
@ -80,7 +77,7 @@ class OnboardingStepSix extends StatelessWidget {
color: Colors.grey[600]!, color: Colors.grey[600]!,
width: 3, width: 3,
)), )),
width: 430, width: 350,
child: TextFormField( child: TextFormField(
key: keyInputWord, key: keyInputWord,
autofocus: true, autofocus: true,
@ -95,7 +92,7 @@ class OnboardingStepSix extends StatelessWidget {
textAlign: TextAlign.center, textAlign: TextAlign.center,
decoration: InputDecoration( decoration: InputDecoration(
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 22.0, fontSize: 19,
color: Colors.grey[500], color: Colors.grey[500],
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
labelText: generateWalletProvider.isAskedWordValid labelText: generateWalletProvider.isAskedWordValid
@ -103,10 +100,10 @@ class OnboardingStepSix extends StatelessWidget {
: "${generateWalletProvider.nbrWordAlpha} ${"nthMnemonicWord".tr()}", : "${generateWalletProvider.nbrWordAlpha} ${"nthMnemonicWord".tr()}",
fillColor: const Color(0xffeeeedd), fillColor: const Color(0xffeeeedd),
filled: true, filled: true,
contentPadding: const EdgeInsets.all(12), contentPadding: const EdgeInsets.all(10),
), ),
style: TextStyle( style: TextStyle(
fontSize: 40.0, fontSize: 32,
color: generateWalletProvider.askedWordColor, color: generateWalletProvider.askedWordColor,
fontWeight: FontWeight.w500))), fontWeight: FontWeight.w500))),
Visibility( Visibility(
@ -133,7 +130,7 @@ class OnboardingStepSix extends StatelessWidget {
// ), // ),
// ), // ),
// ), // ),
SizedBox(height: 35 * ratio), const SizedBox(height: 40),
]), ]),
), ),
const OfflineInfo(), const OfflineInfo(),
@ -152,8 +149,8 @@ Widget nextButton(BuildContext context, String text, nextScreen, bool isFast) {
generateWalletProvider.askedWordColor = Colors.black; generateWalletProvider.askedWordColor = Colors.black;
return SizedBox( return SizedBox(
width: 380 * ratio, width: 370,
height: 60 * ratio, height: 60,
child: ElevatedButton( child: ElevatedButton(
key: keyGoNext, key: keyGoNext,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(

View File

@ -17,13 +17,10 @@ class OnboardingStepSeven extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'myPassword'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'myPassword'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
@ -35,7 +32,7 @@ class OnboardingStepSeven extends StatelessWidget {
buttonText: '>', buttonText: '>',
nextScreen: OnboardingStepEight(scanDerivation: scanDerivation), nextScreen: OnboardingStepEight(scanDerivation: scanDerivation),
pagePosition: 6, pagePosition: 6,
boxHeight: 400), boxHeight: 320),
const OfflineInfo(), const OfflineInfo(),
]), ]),
), ),

View File

@ -17,13 +17,10 @@ class OnboardingStepEight extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'myPassword'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'myPassword'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
@ -35,7 +32,8 @@ class OnboardingStepEight extends StatelessWidget {
buttonText: '>', buttonText: '>',
nextScreen: OnboardingStepNine(scanDerivation: scanDerivation), nextScreen: OnboardingStepNine(scanDerivation: scanDerivation),
pagePosition: 7, pagePosition: 7,
isMd: true), isMd: true,
boxHeight: 320),
const OfflineInfo(), const OfflineInfo(),
]), ]),
), ),

View File

@ -31,24 +31,21 @@ class OnboardingStepNine extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text(
height: 22, 'myPassword'.tr(),
child: Text( style: const TextStyle(fontWeight: FontWeight.w600),
'myPassword'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
), ),
), ),
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
body: SafeArea( body: SafeArea(
child: Stack(children: [ child: Stack(children: [
Column(children: <Widget>[ Column(children: <Widget>[
SizedBox(height: isTall ? 40 : 20), const SizedBox(height: 25),
const BuildProgressBar(pagePosition: 8), const BuildProgressBar(pagePosition: 8),
SizedBox(height: isTall ? 40 : 20), const SizedBox(height: 25),
BuildText(text: "hereIsThePasswordKeepIt".tr()), BuildText(text: "hereIsThePasswordKeepIt".tr()),
const SizedBox(height: 100), const SizedBox(height: 60),
Stack( Stack(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
children: <Widget>[ children: <Widget>[
@ -62,7 +59,7 @@ class OnboardingStepNine extends StatelessWidget {
decoration: const InputDecoration(), decoration: const InputDecoration(),
style: const TextStyle( style: const TextStyle(
letterSpacing: 5, letterSpacing: 5,
fontSize: 35.0, fontSize: 35,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold)), fontWeight: FontWeight.bold)),
IconButton( IconButton(
@ -84,8 +81,8 @@ class OnboardingStepNine extends StatelessWidget {
child: Align( child: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: SizedBox( child: SizedBox(
width: 380 * ratio, width: 370,
height: 60 * ratio, height: 60,
child: ElevatedButton( child: ElevatedButton(
key: keyChangePin, key: keyChangePin,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -99,16 +96,16 @@ class OnboardingStepNine extends StatelessWidget {
reload: true); reload: true);
}, },
child: Text("chooseAnotherPassword".tr(), child: Text("chooseAnotherPassword".tr(),
style: TextStyle( style: const TextStyle(
fontSize: 22 * ratio, fontSize: 22,
fontWeight: FontWeight.w600))), fontWeight: FontWeight.w600))),
))), ))),
SizedBox(height: 22 * ratio), const SizedBox(height: 22),
NextButton( NextButton(
text: "iNotedMyPassword".tr(), text: "iNotedMyPassword".tr(),
nextScreen: OnboardingStepTen(scanDerivation: scanDerivation), nextScreen: OnboardingStepTen(scanDerivation: scanDerivation),
isFast: false), isFast: false),
SizedBox(height: 35 * ratio), const SizedBox(height: 40),
]), ]),
const OfflineInfo(), const OfflineInfo(),
]), ]),

View File

@ -20,18 +20,15 @@ class QrCodeFullscreen extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
backgroundColor: color ?? Colors.black, backgroundColor: color ?? Colors.black,
toolbarHeight: 60 * ratio, toolbarHeight: 60,
leading: IconButton( leading: IconButton(
icon: const Icon(Icons.arrow_back, color: orangeC), icon: const Icon(Icons.arrow_back, color: orangeC),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}), }),
title: SizedBox( title: Text(
height: 22, 'QR Code de ${getShortPubkey(address)}',
child: Text( style: const TextStyle(color: orangeC),
'QR Code de ${getShortPubkey(address)}',
style: const TextStyle(color: orangeC),
),
)), )),
body: SafeArea( body: SafeArea(
child: SizedBox.expand( child: SizedBox.expand(

View File

@ -8,6 +8,7 @@ import 'package:gecko/globals.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gecko/models/widgets_keys.dart'; import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/search.dart'; import 'package:gecko/providers/search.dart';
import 'package:gecko/providers/v2s_datapod.dart';
import 'package:gecko/widgets/commons/common_elements.dart'; import 'package:gecko/widgets/commons/common_elements.dart';
import 'package:gecko/screens/search_result.dart'; import 'package:gecko/screens/search_result.dart';
import 'package:gecko/screens/wallet_view.dart'; import 'package:gecko/screens/wallet_view.dart';
@ -28,15 +29,36 @@ class _SearchScreenState extends State<SearchScreen> {
final int debouneTime = 50; final int debouneTime = 50;
Future getClipBoard() async { Future getClipBoard() async {
final searchProvider = Provider.of<SearchProvider>(context, listen: false);
final clipboard = await Clipboard.getData('text/plain'); final clipboard = await Clipboard.getData('text/plain');
pastedAddress = clipboard?.text ?? ''; pastedAddress = clipboard?.text ?? '';
canPasteAddress = isAddress(pastedAddress); canPasteAddress = isAddress(pastedAddress);
searchProvider.reload();
} }
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
await getClipBoard(); await getClipBoard();
// final datapod = Provider.of<V2sDatapodProvider>(context, listen: false);
// datapod.updateProfile(
// address: '5CQ8T4qpbYJq7uVsxGPQ5q2df7x3Wa4aRY6HUWMBYjfLZhnn',
// // address: '5CJKhFCpdSpumgWjSZ3TQmejJuHV6iELJrtdrfs38SXuiQeB',
// geoloc: {"latitude": 48.536883, "longitude": 2.661986},
// title: 'Ta mère en string',
// socials: [
// {'type': "website", 'url': "https://tamere.com"}
// ],
// city: "Melun 77000",
// description: 'new prof !');
// // datapod.deleteProfile(
// // address: '5CJKhFCpdSpumgWjSZ3TQmejJuHV6iELJrtdrfs38SXuiQeB');
// // datapod.migrateProfile(
// // addressOld: '5CJKhFCpdSpumgWjSZ3TQmejJuHV6iELJrtdrfs38SXuiQeB',
// // addressNew: '5CQ8T4qpbYJq7uVsxGPQ5q2df7x3Wa4aRY6HUWMBYjfLZhnn');
}); });
super.initState(); super.initState();
} }
@ -44,10 +66,7 @@ class _SearchScreenState extends State<SearchScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final searchProvider = Provider.of<SearchProvider>(context); final searchProvider = Provider.of<SearchProvider>(context);
final screenHeight = MediaQuery.of(context).size.height;
final canValidate = searchProvider.searchController.text.length >= 2; final canValidate = searchProvider.searchController.text.length >= 2;
// final canPasteAddress = false;
return PopScope( return PopScope(
onPopInvoked: (_) { onPopInvoked: (_) {
@ -57,16 +76,13 @@ class _SearchScreenState extends State<SearchScreen> {
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
elevation: 1, elevation: 1,
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text('search'.tr()),
height: 22,
child: Text('search'.tr()),
),
), ),
body: SafeArea( body: SafeArea(
child: Stack(children: [ child: Stack(children: [
Column(children: <Widget>[ Column(children: <Widget>[
SizedBox(height: isTall ? 200 : 100), const SizedBox(height: 165),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 17), padding: const EdgeInsets.symmetric(horizontal: 17),
child: TextField( child: TextField(
@ -102,7 +118,7 @@ class _SearchScreenState extends State<SearchScreen> {
suffixIcon: searchProvider.searchController.text == '' suffixIcon: searchProvider.searchController.text == ''
? null ? null
: Padding( : Padding(
padding: const EdgeInsets.symmetric(horizontal: 17), padding: const EdgeInsets.symmetric(horizontal: 10),
child: IconButton( child: IconButton(
onPressed: (() async => { onPressed: (() async => {
searchProvider.searchController.text = '', searchProvider.searchController.text = '',
@ -117,10 +133,10 @@ class _SearchScreenState extends State<SearchScreen> {
), ),
), ),
prefixIcon: const Padding( prefixIcon: const Padding(
padding: EdgeInsets.symmetric(horizontal: 17), padding: EdgeInsets.symmetric(horizontal: 13),
child: Image( child: Image(
image: AssetImage('assets/loupe-noire.png'), image: AssetImage('assets/loupe-noire.png'),
height: 35), height: 30),
), ),
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: borderSide:
@ -131,19 +147,19 @@ class _SearchScreenState extends State<SearchScreen> {
BorderSide(color: Colors.grey[500]!, width: 2.5), BorderSide(color: Colors.grey[500]!, width: 2.5),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
contentPadding: const EdgeInsets.all(20), contentPadding: const EdgeInsets.all(13),
), ),
style: const TextStyle( style: const TextStyle(
fontSize: 20, fontSize: 18,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
), ),
), ),
const Spacer(flex: 1), const Spacer(),
SizedBox( SizedBox(
width: 320, width: 280,
height: 90, height: 80,
child: ElevatedButton( child: ElevatedButton(
key: keyConfirmSearch, key: keyConfirmSearch,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -178,11 +194,11 @@ class _SearchScreenState extends State<SearchScreen> {
: 'search'.tr(), : 'search'.tr(),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: const TextStyle(
fontSize: 21, fontWeight: FontWeight.w600), fontSize: 19, fontWeight: FontWeight.w600),
), ),
), ),
), ),
Spacer(flex: screenHeight <= 800 ? 1 : 2), const Spacer(),
]), ]),
const OfflineInfo(), const OfflineInfo(),
]), ]),

View File

@ -20,7 +20,7 @@ class SearchResultScreen extends StatelessWidget {
Provider.of<WalletsProfilesProvider>(context, listen: false); Provider.of<WalletsProfilesProvider>(context, listen: false);
final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false); final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false);
double avatarSize = 55; double avatarSize = 45;
// List<G1WalletsList> myContacts = contactsBox.toMap().values.toList(); // List<G1WalletsList> myContacts = contactsBox.toMap().values.toList();
// myContacts = myContacts // myContacts = myContacts
// .where((map) => // .where((map) =>
@ -33,11 +33,8 @@ class SearchResultScreen extends StatelessWidget {
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
elevation: 1, elevation: 1,
toolbarHeight: 60 * ratio, toolbarHeight: 60,
title: SizedBox( title: Text('researchResults'.tr()),
height: 22,
child: Text('researchResults'.tr()),
),
), ),
bottomNavigationBar: const GeckoBottomAppBar(), bottomNavigationBar: const GeckoBottomAppBar(),
body: SafeArea( body: SafeArea(
@ -47,7 +44,7 @@ class SearchResultScreen extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
const SizedBox(height: 30), const SizedBox(height: 20),
Center( Center(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -73,12 +70,12 @@ class SearchResultScreen extends StatelessWidget {
// avatarSize: avatarSize, // avatarSize: avatarSize,
// walletsProfilesClass: walletsProfilesClass, // walletsProfilesClass: walletsProfilesClass,
// duniterIndexer: duniterIndexer), // duniterIndexer: duniterIndexer),
const SizedBox(height: 40), const SizedBox(height: 22),
Text( Text(
'inBlockchainResult'.tr(args: [currencyName]), 'inBlockchainResult'.tr(args: [currencyName]),
style: const TextStyle(fontSize: 20), style: const TextStyle(fontSize: 18),
), ),
const SizedBox(height: 20), const SizedBox(height: 15),
SearchResult( SearchResult(
searchProvider: searchProvider, searchProvider: searchProvider,
duniterIndexer: duniterIndexer, duniterIndexer: duniterIndexer,

View File

@ -8,6 +8,7 @@ import 'package:gecko/providers/my_wallets.dart';
import 'package:gecko/providers/settings_provider.dart'; import 'package:gecko/providers/settings_provider.dart';
import 'package:gecko/providers/substrate_sdk.dart'; import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/globals.dart'; import 'package:gecko/globals.dart';
import 'package:gecko/widgets/commons/loading.dart';
import 'package:polkawallet_sdk/api/types/networkParams.dart'; import 'package:polkawallet_sdk/api/types/networkParams.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -18,61 +19,54 @@ class SettingsScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
const double buttonHigh = 50;
const double buttonWidth = 240;
const double fontSize = 16;
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(toolbarHeight: 60, title: Text('parameters'.tr())),
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('parameters'.tr()),
)),
body: Column(children: <Widget>[ body: Column(children: <Widget>[
const SizedBox(height: 30), const SizedBox(height: 30),
Text( Text(
'networkSettings'.tr(), 'networkSettings'.tr(),
style: TextStyle(color: Colors.grey[500], fontSize: 22), style: TextStyle(color: Colors.grey[500], fontSize: 20),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
duniterEndpointSelection(context), duniterEndpointSelection(context),
const SizedBox(height: 30), const SizedBox(height: 30),
indexerEndpointSelection(context), indexerEndpointSelection(context),
const SizedBox(height: 40), const SizedBox(height: 35),
Text( Text(
'displaySettings'.tr(), 'displaySettings'.tr(),
style: TextStyle(color: Colors.grey[500], fontSize: 22), style: TextStyle(color: Colors.grey[500], fontSize: 20),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
chooseCurrencyUnit(context), chooseCurrencyUnit(context),
// SizedBox(height: isTall ? 80 : 120), // SizedBox(height: isTall ? 80 : 120),
const Spacer(), const Spacer(),
SizedBox( Center(
height: buttonHigh, child: InkWell(
width: buttonWidth, key: keyDeleteAllWallets,
child: Center( onTap: () async {
child: InkWell( log.i('Oublier tous mes coffres');
key: keyDeleteAllWallets, await _myWallets.deleteAllWallet(context);
onTap: () async { },
log.i('Oublier tous mes coffres'); child: SizedBox(
await _myWallets.deleteAllWallet(context); height: 40,
}, width: 220,
child: Text( child: Center(
'forgetAllMyChests'.tr(), child: Text(
style: const TextStyle( 'forgetAllMyChests'.tr(),
fontSize: fontSize + 4, style: const TextStyle(
color: Color(0xffD80000), fontSize: 18,
fontWeight: FontWeight.w600, color: Color(0xffD80000),
fontWeight: FontWeight.w600,
),
), ),
), ),
), ),
), ),
), ),
// const Spacer(), // const Spacer(),
SizedBox(height: isTall ? 90 : 60), const SizedBox(height: 70),
]), ]),
); );
} }
@ -144,22 +138,26 @@ class SettingsScreen extends StatelessWidget {
log.d(sub.sdk.api.connectedNode?.endpoint); log.d(sub.sdk.api.connectedNode?.endpoint);
return Expanded( return Expanded(
child: Row(children: [ child: Row(children: [
const SizedBox(width: 10), const SizedBox(width: 2),
SizedBox( SizedBox(
width: 80, width: 60,
child: Text( child: Text(
'currencyNode'.tr(args: ['']), 'currencyNode'.tr(),
), ),
), ),
const Spacer(), const Spacer(),
Icon(sub.nodeConnected && !sub.isLoadingEndpoint SizedBox(
? Icons.check width: 30,
: Icons.close), child: Icon(sub.nodeConnected && !sub.isLoadingEndpoint
? Icons.check
: Icons.close),
),
if (sub.nodeConnected && !sub.isLoadingEndpoint) if (sub.nodeConnected && !sub.isLoadingEndpoint)
const Icon(Icons.add_card_sharp, size: 0.01), const Icon(Icons.add_card_sharp, size: 0.01),
const Spacer(), const Spacer(),
SizedBox( SizedBox(
width: 280, height: 52,
width: 240,
child: Consumer<SettingsProvider>(builder: (context, set, _) { child: Consumer<SettingsProvider>(builder: (context, set, _) {
return DropdownButtonHideUnderline( return DropdownButtonHideUnderline(
key: keySelectDuniterNodeDropDown, key: keySelectDuniterNodeDropDown,
@ -184,9 +182,9 @@ class SettingsScreen extends StatelessWidget {
); );
}), }),
), ),
const Spacer(flex: 5), const Spacer(flex: 3),
sub.isLoadingEndpoint sub.isLoadingEndpoint
? const CircularProgressIndicator(color: orangeC) ? const Loading(size: 33, stroke: 2.5)
: Consumer<SettingsProvider>(builder: (context, set, _) { : Consumer<SettingsProvider>(builder: (context, set, _) {
return IconButton( return IconButton(
key: keyConnectToEndpoint, key: keyConnectToEndpoint,
@ -196,7 +194,7 @@ class SettingsScreen extends StatelessWidget {
sub.getConnectedEndpoint() sub.getConnectedEndpoint()
? orangeC ? orangeC
: Colors.grey[500], : Colors.grey[500],
size: 40, size: 36,
), ),
onPressed: selectedDuniterEndpoint != onPressed: selectedDuniterEndpoint !=
sub.getConnectedEndpoint() sub.getConnectedEndpoint()
@ -297,9 +295,9 @@ class SettingsScreen extends StatelessWidget {
log.d(indexer.listIndexerEndpoints); log.d(indexer.listIndexerEndpoints);
return Expanded( return Expanded(
child: Row(children: [ child: Row(children: [
const SizedBox(width: 10), const SizedBox(width: 5),
const SizedBox( const SizedBox(
width: 80, width: 65,
// child: Text('indexer'.tr()), // why translation does not work?? // child: Text('indexer'.tr()), // why translation does not work??
child: Text('Indexer'), child: Text('Indexer'),
), ),
@ -307,7 +305,7 @@ class SettingsScreen extends StatelessWidget {
Icon(indexerEndpoint != '' ? Icons.check : Icons.close), Icon(indexerEndpoint != '' ? Icons.check : Icons.close),
const Spacer(), const Spacer(),
SizedBox( SizedBox(
width: 280, width: 240,
child: Consumer<SettingsProvider>(builder: (context, set, _) { child: Consumer<SettingsProvider>(builder: (context, set, _) {
return DropdownButtonHideUnderline( return DropdownButtonHideUnderline(
child: DropdownButton( child: DropdownButton(
@ -332,7 +330,7 @@ class SettingsScreen extends StatelessWidget {
), ),
const Spacer(flex: 5), const Spacer(flex: 5),
indexer.isLoadingIndexer indexer.isLoadingIndexer
? const CircularProgressIndicator(color: orangeC) ? const Loading(size: 33, stroke: 2.5)
: Consumer<SettingsProvider>(builder: (context, set, _) { : Consumer<SettingsProvider>(builder: (context, set, _) {
return IconButton( return IconButton(
icon: Icon( icon: Icon(
@ -340,7 +338,7 @@ class SettingsScreen extends StatelessWidget {
color: selectedIndexerEndpoint != indexerEndpoint color: selectedIndexerEndpoint != indexerEndpoint
? orangeC ? orangeC
: Colors.grey[500], : Colors.grey[500],
size: 40, size: 36,
), ),
onPressed: selectedIndexerEndpoint != indexerEndpoint onPressed: selectedIndexerEndpoint != indexerEndpoint
? () async { ? () async {

View File

@ -10,12 +10,7 @@ class TemplateScreen extends StatelessWidget {
return Scaffold( return Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(toolbarHeight: 60, title: const Text('Template screen')),
toolbarHeight: 60 * ratio,
title: const SizedBox(
height: 22,
child: Text('Template screen'),
)),
body: const SafeArea( body: const SafeArea(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
SizedBox(height: 20), SizedBox(height: 20),

View File

@ -27,8 +27,7 @@ class TransactionInProgress extends StatelessWidget {
Provider.of<WalletsProfilesProvider>(context, listen: false); Provider.of<WalletsProfilesProvider>(context, listen: false);
final myWalletProvider = final myWalletProvider =
Provider.of<MyWalletsProvider>(context, listen: false); Provider.of<MyWalletsProvider>(context, listen: false);
bool isValid = false; var txStatus = TransactionStatus.none;
bool isLoading = false;
final result = sub.transactionStatus; final result = sub.transactionStatus;
final from = fromAddress ?? final from = fromAddress ??
@ -54,7 +53,7 @@ class TransactionInProgress extends StatelessWidget {
String resultText = ''; String resultText = '';
final Map<String, String> resultMap = { final Map<String, String> resultMap = {
'': 'sending'.tr(), 'sending': 'sending'.tr(),
'Ready': 'propagating'.tr(), 'Ready': 'propagating'.tr(),
'Broadcast': 'validating'.tr(), 'Broadcast': 'validating'.tr(),
'cert.NotRespectCertPeriod': '24hbetweenCerts'.tr(), 'cert.NotRespectCertPeriod': '24hbetweenCerts'.tr(),
@ -68,18 +67,21 @@ class TransactionInProgress extends StatelessWidget {
'Exception: timeout': 'execTimeoutOver'.tr(), 'Exception: timeout': 'execTimeoutOver'.tr(),
}; };
if (result.contains('blockHash: ')) { if (result == null) {
isValid = true; txStatus = TransactionStatus.none;
} else if (result.contains('blockHash: ')) {
txStatus = TransactionStatus.success;
resultText = 'extrinsicValidated' resultText = 'extrinsicValidated'
.tr(args: [actionMap[transType] ?? 'strangeTransaction'.tr()]); .tr(args: [actionMap[transType] ?? 'strangeTransaction'.tr()]);
log.i('Bloc of last transaction: ${sub.blocNumber} --- $result'); log.i('Bloc of last transaction: ${sub.blocNumber} --- $result');
} else if (result.contains('Exception: ')) { } else if (result.contains('Exception: ')) {
txStatus = TransactionStatus.failed;
resultText = "${"anErrorOccurred".tr()}:\n"; resultText = "${"anErrorOccurred".tr()}:\n";
final String exception = result.split('Exception: ')[1]; final String exception = result.split('Exception: ')[1];
resultText = resultMap[exception] ?? "$resultText\n$exception"; resultText = resultMap[exception] ?? "$resultText\n$exception";
log.d('Error: $exception'); log.d('Error: $exception');
} else { } else {
isLoading = true; txStatus = TransactionStatus.loading;
resultText = resultMap[result] ?? 'unknown status...'; resultText = resultMap[result] ?? 'unknown status...';
} }
@ -87,24 +89,21 @@ class TransactionInProgress extends StatelessWidget {
return PopScope( return PopScope(
onPopInvoked: (_) { onPopInvoked: (_) {
sub.transactionStatus = ''; sub.transactionStatus = null;
}, },
child: Scaffold( child: Scaffold(
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 60 * ratio, toolbarHeight: 60,
elevation: 0, elevation: 0,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
title: SizedBox( title: Row(
height: 22, mainAxisAlignment: MainAxisAlignment.center,
child: Row( children: <Widget>[
mainAxisAlignment: MainAxisAlignment.center, Text('extrinsicInProgress'.tr(args: [
children: <Widget>[ actionMap[transType] ?? 'strangeTransaction'.tr()
Text('extrinsicInProgress'.tr(args: [ ]))
actionMap[transType] ?? 'strangeTransaction'.tr() ])),
]))
]),
)),
body: SafeArea( body: SafeArea(
child: Align( child: Align(
alignment: FractionalOffset.bottomCenter, alignment: FractionalOffset.bottomCenter,
@ -143,17 +142,24 @@ class TransactionInProgress extends StatelessWidget {
style: const TextStyle( style: const TextStyle(
fontSize: 18, fontWeight: FontWeight.w600), fontSize: 18, fontWeight: FontWeight.w600),
), ),
const SizedBox(height: 10), Visibility(
Text( visible: from != to,
'toMinus'.tr(), child: Column(
textAlign: TextAlign.center, children: [
style: const TextStyle(fontSize: 18), const SizedBox(height: 10),
), Text(
Text( 'toMinus'.tr(),
toUsername ?? to, textAlign: TextAlign.center,
textAlign: TextAlign.center, style: const TextStyle(fontSize: 18),
style: const TextStyle( ),
fontSize: 18, fontWeight: FontWeight.w600), Text(
toUsername ?? to,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 18, fontWeight: FontWeight.w600),
),
],
),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
]), ]),
@ -162,7 +168,7 @@ class TransactionInProgress extends StatelessWidget {
const Spacer(), const Spacer(),
Column(children: [ Column(children: [
Visibility( Visibility(
visible: isLoading, visible: txStatus == TransactionStatus.loading,
child: const SizedBox( child: const SizedBox(
height: 18, height: 18,
width: 18, width: 18,
@ -173,18 +179,29 @@ class TransactionInProgress extends StatelessWidget {
), ),
), ),
Visibility( Visibility(
visible: !isLoading, visible: txStatus == TransactionStatus.success,
child: Icon( child: const Icon(
isValid ? Icons.done_all : Icons.close, Icons.done_all,
size: 35, size: 35,
color: isValid ? Colors.greenAccent : Colors.redAccent, color: Colors.greenAccent,
),
),
Visibility(
visible: txStatus == TransactionStatus.failed,
child: const Icon(
Icons.close,
size: 35,
color: Colors.redAccent,
), ),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Text( Visibility(
resultText, visible: txStatus != TransactionStatus.none,
textAlign: TextAlign.center, child: Text(
style: TextStyle(fontSize: 19 * ratio), resultText,
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 19),
),
), ),
]), ]),
const Spacer(), const Spacer(),
@ -192,8 +209,8 @@ class TransactionInProgress extends StatelessWidget {
child: Align( child: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: SizedBox( child: SizedBox(
width: 380 * ratio, width: 300,
height: 60 * ratio, height: 55,
child: ElevatedButton( child: ElevatedButton(
key: keyCloseTransactionScreen, key: keyCloseTransactionScreen,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -201,23 +218,24 @@ class TransactionInProgress extends StatelessWidget {
backgroundColor: orangeC, // foreground backgroundColor: orangeC, // foreground
), ),
onPressed: () { onPressed: () {
sub.transactionStatus = ''; sub.transactionStatus = null;
Navigator.pop(context); Navigator.pop(context);
}, },
child: Text( child: Text(
'close'.tr(), 'close'.tr(),
style: TextStyle( style: const TextStyle(
fontSize: 23 * ratio, fontSize: 23, fontWeight: FontWeight.w600),
fontWeight: FontWeight.w600),
), ),
), ),
), ),
), ),
), ),
SizedBox(height: isTall ? 80 : 20) const SizedBox(height: 80)
])), ])),
), ),
), ),
); );
} }
} }
enum TransactionStatus { loading, failed, success, none }

View File

@ -1,5 +1,4 @@
//FIXME: flutter upgrades should fix this... one day. // ignore_for_file: use_build_context_synchronously
// ignore_for_file: use_build_context_synchronously, prefer_const_constructors
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -7,7 +6,6 @@ import 'package:gecko/globals.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gecko/models/g1_wallets_list.dart'; import 'package:gecko/models/g1_wallets_list.dart';
import 'package:gecko/models/widgets_keys.dart'; import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/providers/duniter_indexer.dart'; import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/substrate_sdk.dart'; import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/my_wallets.dart'; import 'package:gecko/providers/my_wallets.dart';
@ -25,15 +23,15 @@ import 'package:gecko/widgets/payment_popup.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:qr_flutter/qr_flutter.dart'; import 'package:qr_flutter/qr_flutter.dart';
const double buttonSize = 85;
const double buttonFontSize = 16;
class WalletViewScreen extends StatelessWidget { class WalletViewScreen extends StatelessWidget {
const WalletViewScreen( const WalletViewScreen(
{required this.address, required this.username, this.avatar, Key? key}) {required this.address, required this.username, Key? key})
: super(key: key); : super(key: key);
final String address; final String address;
final String? username; final String? username;
final Image? avatar;
final double buttonSize = 100;
final double buttonFontSize = 18;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -55,7 +53,7 @@ class WalletViewScreen extends StatelessWidget {
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
toolbarHeight: 60 * ratio, toolbarHeight: 60,
actions: [ actions: [
Row( Row(
children: [ children: [
@ -100,22 +98,18 @@ class WalletViewScreen extends StatelessWidget {
], ],
) )
], ],
title: SizedBox( title: Text(duniterIndexer.walletNameIndexer[walletProfile.address] ==
height: 22, null
child: Text(duniterIndexer ? 'seeAWallet'.tr()
.walletNameIndexer[walletProfile.address] == : 'memberAccountOf'.tr(args: [
null duniterIndexer.walletNameIndexer[walletProfile.address] ?? '?'
? 'seeAWallet'.tr() ])),
: 'memberAccountOf'.tr(args: [
duniterIndexer.walletNameIndexer[walletProfile.address] ??
'?'
]))),
), ),
bottomNavigationBar: const GeckoBottomAppBar(), bottomNavigationBar: const GeckoBottomAppBar(),
body: SafeArea( body: SafeArea(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
HeaderProfile(address: address, username: username), HeaderProfile(address: address, username: username),
SizedBox(height: isTall ? 30 : 15), const SizedBox(height: 25),
Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
Column(children: <Widget>[ Column(children: <Widget>[
SizedBox( SizedBox(
@ -127,18 +121,17 @@ class WalletViewScreen extends StatelessWidget {
key: keyViewActivity, key: keyViewActivity,
splashColor: orangeC, // inkwell color splashColor: orangeC, // inkwell color
child: const Padding( child: const Padding(
padding: EdgeInsets.all(13), padding: EdgeInsets.all(11),
child: Image( child: Image(
image: AssetImage( image:
'assets/walletOptions/clock.png'), AssetImage('assets/walletOptions/clock.png'),
height: 90)), ),
),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
PageNoTransit(builder: (context) { PageNoTransit(builder: (context) {
return ActivityScreen( return ActivityScreen(address: address);
address: address,
avatar: defaultAvatar(50));
}), }),
); );
}), }),
@ -149,7 +142,7 @@ class WalletViewScreen extends StatelessWidget {
Text( Text(
"displayNActivity".tr(), "displayNActivity".tr(),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: const TextStyle(
fontSize: buttonFontSize, fontWeight: FontWeight.w500), fontSize: buttonFontSize, fontWeight: FontWeight.w500),
), ),
]), ]),
@ -277,7 +270,7 @@ class WalletViewScreen extends StatelessWidget {
? "certify".tr() ? "certify".tr()
: "createIdentity".tr(), : "createIdentity".tr(),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: const TextStyle(
fontSize: buttonFontSize, fontSize: buttonFontSize,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
@ -304,10 +297,11 @@ class WalletViewScreen extends StatelessWidget {
key: keyCopyAddress, key: keyCopyAddress,
splashColor: orangeC, splashColor: orangeC,
child: const Padding( child: const Padding(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(17),
child: Image( child: Image(
image: AssetImage('assets/copy_key.png'), image: AssetImage('assets/copy_key.png'),
height: 90)), ),
),
onTap: () { onTap: () {
Clipboard.setData(ClipboardData(text: address)); Clipboard.setData(ClipboardData(text: address));
snackCopyKey(context); snackCopyKey(context);
@ -319,7 +313,7 @@ class WalletViewScreen extends StatelessWidget {
Text( Text(
"copyAddress".tr(), "copyAddress".tr(),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: const TextStyle(
fontSize: buttonFontSize, fontWeight: FontWeight.w500), fontSize: buttonFontSize, fontWeight: FontWeight.w500),
), ),
]), ]),
@ -365,7 +359,7 @@ class WalletViewScreen extends StatelessWidget {
} }
: null, : null,
child: const Padding( child: const Padding(
padding: EdgeInsets.all(14), padding: EdgeInsets.all(10),
child: Image( child: Image(
image: AssetImage('assets/vector_white.png')), image: AssetImage('assets/vector_white.png')),
)), )),
@ -385,7 +379,7 @@ class WalletViewScreen extends StatelessWidget {
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
); );
}), }),
SizedBox(height: isTall ? 50 : 20) const SizedBox(height: 50)
]), ]),
)); ));
} }
@ -394,17 +388,14 @@ class WalletViewScreen extends StatelessWidget {
return Column(children: <Widget>[ return Column(children: <Widget>[
SizedBox( SizedBox(
height: buttonSize, height: buttonSize,
child: Padding( child: Container(
padding: const EdgeInsets.only(bottom: 0), foregroundDecoration: const BoxDecoration(
child: Container( color: Colors.grey,
foregroundDecoration: const BoxDecoration( backgroundBlendMode: BlendMode.saturation,
color: Colors.grey, ),
backgroundBlendMode: BlendMode.saturation, child: const Opacity(
), opacity: 0.5,
child: const Opacity( child: Image(image: AssetImage('assets/gecko_certify.png')),
opacity: 0.5,
child: Image(image: AssetImage('assets/gecko_certify.png')),
),
), ),
), ),
), ),

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/providers/substrate_sdk.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/widgets/ud_unit_display.dart'; import 'package:gecko/widgets/ud_unit_display.dart';
@ -34,9 +33,7 @@ class Balance extends StatelessWidget {
walletOptions.balanceCache[address] != -1) { walletOptions.balanceCache[address] != -1) {
return Row(children: [ return Row(children: [
Text(walletOptions.balanceCache[address]!.toString(), Text(walletOptions.balanceCache[address]!.toString(),
style: TextStyle( style: TextStyle(fontSize: size, color: color)),
fontSize: isTall ? size : size * 0.9,
color: color)),
const SizedBox(width: 5), const SizedBox(width: 5),
UdUnitDisplay(size: size, color: color), UdUnitDisplay(size: size, color: color),
]); ]);
@ -58,7 +55,7 @@ class Balance extends StatelessWidget {
Text( Text(
walletOptions.balanceCache[address]!.toString(), walletOptions.balanceCache[address]!.toString(),
style: TextStyle( style: TextStyle(
fontSize: isTall ? size : size * 0.9, fontSize: size,
color: color, color: color,
), ),
), ),

View File

@ -32,12 +32,12 @@ class GeckoBottomAppBar extends StatelessWidget {
child: Container( child: Container(
color: yellowC, color: yellowC,
width: size.width, width: size.width,
height: 80, height: 70,
child: Row(mainAxisAlignment: MainAxisAlignment.start, children: [ child: Row(mainAxisAlignment: MainAxisAlignment.start, children: [
const Spacer(), const Spacer(),
const SizedBox(width: 11), const SizedBox(width: 11),
IconButton( IconButton(
key: keyAppBarSearch, key: keyAppBarHome,
iconSize: 55, iconSize: 55,
icon: const Icon(Icons.home_outlined), icon: const Icon(Icons.home_outlined),
onPressed: () { onPressed: () {
@ -52,7 +52,6 @@ class GeckoBottomAppBar extends StatelessWidget {
const Spacer(), const Spacer(),
IconButton( IconButton(
key: keyAppBarQrcode, key: keyAppBarQrcode,
iconSize: 70,
icon: const Image(image: AssetImage('assets/qrcode-scan.png')), icon: const Image(image: AssetImage('assets/qrcode-scan.png')),
onPressed: () async { onPressed: () async {
historyProvider.scan(homeContext); historyProvider.scan(homeContext);
@ -61,6 +60,7 @@ class GeckoBottomAppBar extends StatelessWidget {
const Spacer(), const Spacer(),
const SizedBox(width: 15), const SizedBox(width: 15),
Stack( Stack(
alignment: AlignmentDirectional.center,
children: [ children: [
if (lockAction) if (lockAction)
Center( Center(
@ -86,7 +86,6 @@ class GeckoBottomAppBar extends StatelessWidget {
), ),
IconButton( IconButton(
key: keyAppBarChest, key: keyAppBarChest,
iconSize: 60,
icon: const Image(image: AssetImage('assets/wallet.png')), icon: const Image(image: AssetImage('assets/wallet.png')),
onPressed: lockAction onPressed: lockAction
? null ? null

View File

@ -18,7 +18,7 @@ class BubbleSpeak extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Bubble( return Bubble(
padding: long == null padding: long == null
? const BubbleEdges.all(20) ? const BubbleEdges.all(18)
: BubbleEdges.symmetric(horizontal: long, vertical: 30), : BubbleEdges.symmetric(horizontal: long, vertical: 30),
elevation: 5, elevation: 5,
color: backgroundColor, color: backgroundColor,
@ -26,7 +26,7 @@ class BubbleSpeak extends StatelessWidget {
text, text,
key: textKey, key: textKey,
style: const TextStyle( style: const TextStyle(
color: Colors.black, fontSize: 21, fontWeight: FontWeight.w400), color: Colors.black, fontSize: 18, fontWeight: FontWeight.w400),
), ),
); );
} }

View File

@ -21,7 +21,7 @@ class AddNewDerivationButton extends StatelessWidget {
String newDerivationName = String newDerivationName =
'${'wallet'.tr()} ${myWalletProvider.listWallets.last.number! + 2}'; '${'wallet'.tr()} ${myWalletProvider.listWallets.last.number! + 2}';
return Padding( return Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(12),
child: ClipRRect( child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(12)), borderRadius: const BorderRadius.all(Radius.circular(12)),
child: Column(children: <Widget>[ child: Column(children: <Widget>[
@ -56,17 +56,17 @@ class AddNewDerivationButton extends StatelessWidget {
child: Center( child: Center(
child: myWalletProvider.isNewDerivationLoading child: myWalletProvider.isNewDerivationLoading
? const SizedBox( ? const SizedBox(
height: 60, height: 50,
width: 60, width: 50,
child: CircularProgressIndicator( child: CircularProgressIndicator(
color: orangeC, color: orangeC,
strokeWidth: 7, strokeWidth: 6,
), ),
) )
: const Text( : const Text(
'+', '+',
style: TextStyle( style: TextStyle(
fontSize: 150, fontSize: 120,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xFFFCB437)), color: Color(0xFFFCB437)),
)), )),

View File

@ -19,12 +19,12 @@ class ChestOptionsButtons extends StatelessWidget {
return Column(children: [ return Column(children: [
const SizedBox(height: 50), const SizedBox(height: 50),
SizedBox( SizedBox(
height: 80, height: 65,
width: 420, width: 340,
child: ElevatedButton.icon( child: ElevatedButton.icon(
icon: Image.asset( icon: Image.asset(
'assets/chests/config.png', 'assets/chests/config.png',
height: 60, height: 40,
), ),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
foregroundColor: Colors.black, elevation: 2, foregroundColor: Colors.black, elevation: 2,
@ -39,67 +39,67 @@ class ChestOptionsButtons extends StatelessWidget {
label: Text( label: Text(
" ${"manageChest".tr()}", " ${"manageChest".tr()}",
style: const TextStyle( style: const TextStyle(
fontSize: 22, fontSize: 19,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xff8a3c0f), color: Color(0xff8a3c0f),
), ),
), ),
)), )),
const SizedBox(height: 30), const SizedBox(height: 20),
Row( InkWell(
mainAxisAlignment: MainAxisAlignment.center, key: keyImportG1v1,
children: [ onTap: () {
SvgPicture.asset( Navigator.push(
'assets/cesium_bw2.svg', context,
semanticsLabel: 'CS', MaterialPageRoute(builder: (context) {
height: 50, return const ImportG1v1();
), }),
const SizedBox(width: 5), );
InkWell( },
key: keyImportG1v1, child: Row(
onTap: () { mainAxisAlignment: MainAxisAlignment.center,
Navigator.push( children: [
context, SvgPicture.asset(
MaterialPageRoute(builder: (context) { 'assets/cesium_bw2.svg',
return const ImportG1v1(); semanticsLabel: 'CS',
}), height: 40,
); ),
}, const SizedBox(width: 5),
child: SizedBox( SizedBox(
width: 350, width: 300,
height: 60, height: 60,
child: Center( child: Center(
child: Text('importG1v1'.tr(), child: Text('importG1v1'.tr(),
style: TextStyle( style: TextStyle(
fontSize: 22, fontSize: 18,
color: Colors.blue[900], color: Colors.blue[900],
fontWeight: FontWeight.w500))), fontWeight: FontWeight.w500))),
), ),
), ],
],
),
const SizedBox(height: 20),
InkWell(
key: keyChangeChest,
onTap: () {
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) {
// return const ChooseChest();
// }),
// );
},
child: SizedBox(
width: 400,
height: 60,
child: Center(
child: Text('changeChest'.tr(),
style: const TextStyle(
fontSize: 22,
color: Colors.grey, //orangeC
fontWeight: FontWeight.w500))),
), ),
), ),
const SizedBox(height: 20),
// InkWell(
// key: keyChangeChest,
// onTap: () {
// // Navigator.push(
// // context,
// // MaterialPageRoute(builder: (context) {
// // return const ChooseChest();
// // }),
// // );
// },
// child: SizedBox(
// width: 270,
// height: 60,
// child: Center(
// child: Text('changeChest'.tr(),
// style: const TextStyle(
// fontSize: 20,
// color: Colors.grey, //orangeC
// fontWeight: FontWeight.w500))),
// ),
// ),
const SizedBox(height: 30) const SizedBox(height: 30)
]); ]);
} }

View File

@ -41,11 +41,11 @@ class HomeButtons extends StatelessWidget {
color: orangeC, // button color color: orangeC, // button color
child: InkWell( child: InkWell(
key: keyOpenSearch, key: keyOpenSearch,
child: Padding( child: const Padding(
padding: const EdgeInsets.all(18), padding: EdgeInsets.all(16),
child: Image( child: Image(
image: const AssetImage('assets/home/loupe.png'), image: AssetImage('assets/home/loupe.png'),
height: 62 * ratio), height: 58),
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -58,17 +58,17 @@ class HomeButtons extends StatelessWidget {
), ),
), ),
), ),
const SizedBox(height: 12), const SizedBox(height: 10),
Text( Text(
"searchWallet".tr(), "searchWallet".tr(),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 15 * ratio, fontSize: 13.5,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
) )
]), ]),
const SizedBox(width: 120), const SizedBox(width: 110),
Column(children: <Widget>[ Column(children: <Widget>[
Container( Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
@ -107,27 +107,27 @@ class HomeButtons extends StatelessWidget {
Navigator.pushNamed(context, '/mywallets'); Navigator.pushNamed(context, '/mywallets');
} }
}, },
child: Padding( child: const Padding(
padding: const EdgeInsets.all(18), padding: EdgeInsets.all(15),
child: Image( child: Image(
image: const AssetImage('assets/home/wallet.png'), image: AssetImage('assets/home/wallet.png'),
height: 68 * ratio))), height: 61))),
), ),
), ),
), ),
const SizedBox(height: 12), const SizedBox(height: 10),
Text( Text(
"manageWallets".tr(), "manageWallets".tr(),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 15 * ratio, fontSize: 13.5,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
) )
]) ])
]), ]),
Padding( Padding(
padding: EdgeInsets.only(top: 35 * ratio), padding: const EdgeInsets.only(top: 35),
child: child:
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
Column(children: <Widget>[ Column(children: <Widget>[
@ -144,30 +144,30 @@ class HomeButtons extends StatelessWidget {
child: Material( child: Material(
color: orangeC, // button color color: orangeC, // button color
child: InkWell( child: InkWell(
child: Padding( child: const Padding(
padding: const EdgeInsets.all(18), padding: EdgeInsets.all(14),
child: Image( child: Image(
image: const AssetImage('assets/home/qrcode.png'), image: AssetImage('assets/home/qrcode.png'),
height: 68 * ratio)), height: 62)),
onTap: () async { onTap: () async {
await historyProvider.scan(context); await historyProvider.scan(context);
}), }),
), ),
), ),
), ),
const SizedBox(height: 12), const SizedBox(height: 10),
Text( Text(
"scanQRCode".tr(), "scanQRCode".tr(),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: const TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 15 * ratio, fontSize: 13.5,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
) )
]) ])
]), ]),
), ),
SizedBox(height: isTall ? 80 : 40) const SizedBox(height: 70)
]); ]);
} }
} }

View File

@ -16,7 +16,7 @@ class CertTile extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
int keyID = 0; int keyID = 0;
const double avatarSize = 200; const double avatarSize = 50;
return Column( return Column(
children: listCerts.map((repository) { children: listCerts.map((repository) {
@ -25,15 +25,17 @@ class CertTile extends StatelessWidget {
padding: const EdgeInsets.only(right: 0), padding: const EdgeInsets.only(right: 0),
child: ListTile( child: ListTile(
key: keyTransaction(keyID++), key: keyTransaction(keyID++),
contentPadding: const EdgeInsets.only( contentPadding:
left: 20, right: 30, top: 15, bottom: 15), const EdgeInsets.only(left: 10, right: 0, top: 7, bottom: 7),
leading: ClipOval( leading: ClipOval(
child: defaultAvatar(avatarSize), child: defaultAvatar(avatarSize),
), ),
title: Padding( title: Padding(
padding: const EdgeInsets.only(bottom: 5), padding: const EdgeInsets.only(bottom: 2),
child: Text(repository['name'], child: Text(
style: const TextStyle(fontSize: 22)), repository['name'],
style: const TextStyle(fontSize: 18),
),
), ),
subtitle: RichText( subtitle: RichText(
text: TextSpan( text: TextSpan(
@ -44,12 +46,13 @@ class CertTile extends StatelessWidget {
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
text: repository['date'], text: repository['date'],
style: const TextStyle(fontSize: 16),
), ),
if (repository[2] != '') if (repository[2] != '')
TextSpan( TextSpan(
text: ' · ', text: ' · ',
style: TextStyle( style: TextStyle(
fontSize: 20, fontSize: 19,
color: Colors.grey[550], color: Colors.grey[550],
), ),
), ),
@ -57,8 +60,9 @@ class CertTile extends StatelessWidget {
text: getShortPubkey(repository['address']), text: getShortPubkey(repository['address']),
style: TextStyle( style: TextStyle(
fontStyle: FontStyle.italic, fontStyle: FontStyle.italic,
fontFamily: 'Monospace',
color: Colors.grey[600], color: Colors.grey[600],
fontSize: 18), fontSize: 16),
), ),
], ],
), ),

View File

@ -35,7 +35,7 @@ class Certifications extends StatelessWidget {
) )
], ],
) )
: const Text(''); : const SizedBox();
}); });
}), }),
]); ]);

View File

@ -6,9 +6,14 @@ import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/widgets/cert_tile.dart'; import 'package:gecko/widgets/cert_tile.dart';
import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:graphql_flutter/graphql_flutter.dart';
class CertsSent extends StatelessWidget { class CertsList extends StatelessWidget {
const CertsSent({Key? key, required this.address}) : super(key: key); const CertsList(
{Key? key,
required this.address,
this.direction = CertDirection.received})
: super(key: key);
final String address; final String address;
final CertDirection direction;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -21,6 +26,17 @@ class CertsSent extends StatelessWidget {
'$indexerEndpoint/v1/graphql', '$indexerEndpoint/v1/graphql',
); );
late String gertCertsReq;
late String certFrom;
if (direction == CertDirection.received) {
gertCertsReq = getCertsReceived;
certFrom = 'issuer';
} else {
gertCertsReq = getCertsSent;
certFrom = 'receiver';
}
final client = ValueNotifier( final client = ValueNotifier(
GraphQLClient( GraphQLClient(
cache: GraphQLCache(store: HiveStore()), cache: GraphQLCache(store: HiveStore()),
@ -31,7 +47,7 @@ class CertsSent extends StatelessWidget {
client: client, client: client,
child: Query( child: Query(
options: QueryOptions( options: QueryOptions(
document: gql(getCertsSent), document: gql(gertCertsReq),
variables: <String, dynamic>{ variables: <String, dynamic>{
'address': address, 'address': address,
}, },
@ -62,44 +78,46 @@ class CertsSent extends StatelessWidget {
) )
]); ]);
} }
final List certsData = result.data!['certification'];
List listCerts = [];
for (final cert in certsData) {
final String issuerAddress = cert[certFrom]['pubkey'];
final String issuerName = cert[certFrom]['name'];
final date = DateTime.parse(cert['created_at']);
final dp = DateTime(date.year, date.month, date.day);
final dateForm = '${dp.day}-${dp.month}-${dp.year}';
listCerts.add({
'address': issuerAddress,
'name': issuerName,
'date': dateForm
});
}
// Build history list // Build history list
return SizedBox( return SizedBox(
height: windowHeight, height: windowHeight,
child: ListView( child: ListView(
key: keyListTransactions, key: keyListTransactions,
children: <Widget>[certsView(result)], children: <Widget>[
result.data == null
? Column(children: <Widget>[
const SizedBox(height: 50),
Text(
"noTransactionToDisplay".tr(),
style: const TextStyle(fontSize: 18),
)
])
: Column(children: <Widget>[
CertTile(listCerts: listCerts),
])
],
), ),
); );
}, },
), ),
); );
} }
Widget certsView(QueryResult result) {
List listCerts = [];
final List certsData = result.data!['certification'];
for (final cert in certsData) {
final String issuerAddress = cert['receiver']['pubkey'];
final String issuerName = cert['receiver']['name'];
final date = DateTime.parse(cert['created_at']);
final dp = DateTime(date.year, date.month, date.day);
final dateForm = '${dp.day}-${dp.month}-${dp.year}';
listCerts.add(
{'address': issuerAddress, 'name': issuerName, 'date': dateForm});
}
return result.data == null
? Column(children: <Widget>[
const SizedBox(height: 50),
Text(
"noTransactionToDisplay".tr(),
style: const TextStyle(fontSize: 18),
)
])
: Column(children: <Widget>[
CertTile(listCerts: listCerts),
]);
}
} }
enum CertDirection { received, sent }

View File

@ -1,104 +0,0 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/models/queries_indexer.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/widgets/cert_tile.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
class CertsReceived extends StatelessWidget {
const CertsReceived({Key? key, required this.address}) : super(key: key);
final String address;
@override
Widget build(BuildContext context) {
final screenHeight = MediaQuery.of(context).size.height;
final appBarHeight = AppBar().preferredSize.height;
log.d(appBarHeight);
final windowHeight = screenHeight - appBarHeight - 200;
final httpLink = HttpLink(
'$indexerEndpoint/v1/graphql',
);
final client = ValueNotifier(
GraphQLClient(
cache: GraphQLCache(store: HiveStore()),
link: httpLink,
),
);
return GraphQLProvider(
client: client,
child: Query(
options: QueryOptions(
document: gql(getCertsReceived),
variables: <String, dynamic>{
'address': address,
},
),
builder: (QueryResult result, {fetchMore, refetch}) {
if (result.isLoading && result.data == null) {
return const Center(
child: CircularProgressIndicator(),
);
}
if (result.hasException || result.data == null) {
log.e('Error Indexer: ${result.exception}');
return Column(children: <Widget>[
const SizedBox(height: 50),
Text(
"noNetworkNoHistory".tr(),
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 18),
)
]);
} else if (result.data?['certification']?.isEmpty) {
return Column(children: <Widget>[
const SizedBox(height: 50),
Text(
"noDataToDisplay".tr(),
style: const TextStyle(fontSize: 18),
)
]);
}
// Build history list
return SizedBox(
height: windowHeight,
child: ListView(
key: keyListTransactions,
children: <Widget>[certsView(result)],
),
);
},
),
);
}
Widget certsView(QueryResult result) {
List listCerts = [];
final List certsData = result.data!['certification'];
for (final cert in certsData) {
final String issuerAddress = cert['issuer']['pubkey'];
final String issuerName = cert['issuer']['name'];
final date = DateTime.parse(cert['created_at']);
final dp = DateTime(date.year, date.month, date.day);
final dateForm = '${dp.day}-${dp.month}-${dp.year}';
listCerts.add(
{'address': issuerAddress, 'name': issuerName, 'date': dateForm});
}
return result.data == null
? Column(children: <Widget>[
const SizedBox(height: 50),
Text(
"noTransactionToDisplay".tr(),
style: const TextStyle(fontSize: 18),
)
])
: Column(children: <Widget>[
CertTile(listCerts: listCerts),
]);
}
}

View File

@ -0,0 +1,36 @@
import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/widgets/commons/loading.dart';
import 'package:provider/provider.dart';
class CesiumAvatar extends StatelessWidget {
const CesiumAvatar({Key? key, required this.address, this.size = 15})
: super(key: key);
final String address;
final double size;
@override
Widget build(BuildContext context) {
final csProvider = Provider.of<CesiumPlusProvider>(context, listen: false);
return ClipOval(
child: FutureBuilder(
future: csProvider.getAvatar(address, size),
builder: ((context, AsyncSnapshot<Image> avatar) {
if (avatar.hasError) {
log.e(avatar.error);
return (Icon(Icons.close_outlined,
color: Colors.red, size: size));
} else if (avatar.connectionState != ConnectionState.done) {
return SizedBox(
width: size,
height: size,
child: const FractionallySizedBox(
widthFactor: 0.6, heightFactor: 0.6, child: Loading()));
}
return avatar.data!;
})),
);
}
}

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
class BuildImage extends StatelessWidget { class BuildImage extends StatelessWidget {
const BuildImage({ const BuildImage({
@ -17,8 +16,8 @@ class BuildImage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: const EdgeInsets.all(0), padding: const EdgeInsets.all(0),
width: 440, width: imageWidth,
height: isTall ? boxHeight : boxHeight * 0.9, height: boxHeight,
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: const LinearGradient( gradient: const LinearGradient(
begin: Alignment.topLeft, begin: Alignment.topLeft,
@ -29,6 +28,6 @@ class BuildImage extends StatelessWidget {
], ],
), ),
border: Border.all(color: Colors.grey[900]!)), border: Border.all(color: Colors.grey[900]!)),
child: Image.asset('assets/onBoarding/$assetName', width: imageWidth)); child: Image.asset('assets/onBoarding/$assetName'));
} }
} }

View File

@ -16,8 +16,10 @@ class BuildProgressBar extends StatelessWidget {
dotsCount: 10, dotsCount: 10,
position: pagePosition, position: pagePosition,
decorator: DotsDecorator( decorator: DotsDecorator(
size: const Size.square(7),
activeSize: const Size.square(10),
spacing: const EdgeInsets.symmetric(horizontal: 10), spacing: const EdgeInsets.symmetric(horizontal: 10),
color: Colors.grey[300]!, // Inactive color color: Colors.grey[400]!,
activeColor: orangeC, activeColor: orangeC,
), ),
); );

View File

@ -1,12 +1,11 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart'; import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:gecko/globals.dart';
class BuildText extends StatelessWidget { class BuildText extends StatelessWidget {
const BuildText({ const BuildText({
Key? key, Key? key,
required this.text, required this.text,
this.size = 20, this.size = 18,
this.isMd = true, this.isMd = true,
}) : super(key: key); }) : super(key: key);
@ -17,16 +16,13 @@ class BuildText extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mdStyle = MarkdownStyleSheet( final mdStyle = MarkdownStyleSheet(
p: TextStyle( p: TextStyle(fontSize: size, color: Colors.black, letterSpacing: 0.3),
fontSize: isTall ? size : size * 0.9,
color: Colors.black,
letterSpacing: 0.3),
textAlign: WrapAlignment.spaceBetween, textAlign: WrapAlignment.spaceBetween,
); );
return Container( return Container(
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
width: 440, width: 375,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, border: Border.all(color: Colors.grey[900]!)), color: Colors.white, border: Border.all(color: Colors.grey[900]!)),
child: isMd child: isMd
@ -34,9 +30,7 @@ class BuildText extends StatelessWidget {
: Text(text, : Text(text,
textAlign: TextAlign.justify, textAlign: TextAlign.justify,
style: TextStyle( style: TextStyle(
fontSize: isTall ? size : size * 0.9, fontSize: size, color: Colors.black, letterSpacing: 0.3)),
color: Colors.black,
letterSpacing: 0.3)),
); );
} }
} }

View File

@ -194,24 +194,3 @@ bool isAddress(address) {
return false; return false;
} }
} }
// Widget geckoAppBar() {
// return AppBar(
// toolbarHeight: 60 * ratio,
// elevation: 0,
// leading: IconButton(
// icon: const Icon(Icons.arrow_back, color: Colors.black),
// onPressed: () {
// _walletOptions.isEditing = false;
// _walletOptions.isBalanceBlur = false;
// Navigator.pop(context);
// }),
// title: SizedBox(
// height: 22,
// child: Consumer<WalletOptionsProvider>(
// builder: (context, walletProvider, _) {
// return Text(_walletOptions.nameController.text);
// }),
// ),
// );
// }

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/widgets/commons/build_image.dart'; import 'package:gecko/widgets/commons/build_image.dart';
import 'package:gecko/widgets/commons/build_progress_bar.dart'; import 'package:gecko/widgets/commons/build_progress_bar.dart';
import 'package:gecko/widgets/commons/build_text.dart'; import 'package:gecko/widgets/commons/build_text.dart';
@ -15,9 +14,9 @@ class InfoIntro extends StatelessWidget {
required this.pagePosition, required this.pagePosition,
this.isMd = false, this.isMd = false,
this.isFast = false, this.isFast = false,
this.boxHeight = 440, this.boxHeight = 375,
this.imageWidth = 350, this.imageWidth = 375,
this.textSize = 20, this.textSize = 18,
}) : super(key: key); }) : super(key: key);
final String text; final String text;
@ -34,12 +33,10 @@ class InfoIntro extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column(children: <Widget>[ return Column(children: <Widget>[
SizedBox(height: isTall ? 40 : 20), const SizedBox(height: 25),
BuildProgressBar(pagePosition: pagePosition), BuildProgressBar(pagePosition: pagePosition),
SizedBox(height: isTall ? 40 : 20), const SizedBox(height: 25),
BuildText(text: text, size: textSize, isMd: isMd), BuildText(text: text, size: textSize, isMd: isMd),
BuildImage( BuildImage(
assetName: assetName, boxHeight: boxHeight, imageWidth: imageWidth), assetName: assetName, boxHeight: boxHeight, imageWidth: imageWidth),
Expanded( Expanded(
@ -49,8 +46,7 @@ class InfoIntro extends StatelessWidget {
text: buttonText, nextScreen: nextScreen, isFast: false), text: buttonText, nextScreen: nextScreen, isFast: false),
), ),
), ),
// const SizedBox(height: 40), const SizedBox(height: 40),
SizedBox(height: isTall ? 40 : 20),
]); ]);
} }
} }

View File

@ -0,0 +1,25 @@
import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
class Loading extends StatelessWidget {
const Loading({
Key? key,
this.size = 15,
this.stroke = 2,
}) : super(key: key);
final double size;
final double stroke;
@override
Widget build(BuildContext context) {
return SizedBox(
height: size,
width: size,
child: CircularProgressIndicator(
color: orangeC,
strokeWidth: stroke,
),
);
}
}

View File

@ -18,8 +18,8 @@ class NextButton extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return SizedBox(
width: 380 * ratio, width: 370,
height: 60 * ratio, height: 60,
child: ElevatedButton( child: ElevatedButton(
key: keyGoNext, key: keyGoNext,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
@ -32,7 +32,7 @@ class NextButton extends StatelessWidget {
}, },
child: Text( child: Text(
text, text,
style: TextStyle(fontSize: 23 * ratio, fontWeight: FontWeight.w600), style: const TextStyle(fontSize: 23, fontWeight: FontWeight.w600),
), ),
), ),
); );

View File

@ -1,15 +1,14 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/models/g1_wallets_list.dart'; import 'package:gecko/models/g1_wallets_list.dart';
import 'package:gecko/models/wallet_data.dart'; import 'package:gecko/models/wallet_data.dart';
import 'package:gecko/models/widgets_keys.dart'; import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/providers/duniter_indexer.dart'; import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/substrate_sdk.dart'; import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/wallets_profiles.dart'; import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/screens/wallet_view.dart'; import 'package:gecko/screens/wallet_view.dart';
import 'package:gecko/widgets/balance.dart'; import 'package:gecko/widgets/balance.dart';
import 'package:gecko/widgets/cesium_avatar.dart';
import 'package:gecko/widgets/name_by_address.dart'; import 'package:gecko/widgets/name_by_address.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -17,11 +16,9 @@ class ContactsList extends StatelessWidget {
const ContactsList({ const ContactsList({
Key? key, Key? key,
required this.myContacts, required this.myContacts,
required this.avatarSize,
}) : super(key: key); }) : super(key: key);
final List<G1WalletsList> myContacts; final List<G1WalletsList> myContacts;
final double avatarSize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -30,11 +27,11 @@ class ContactsList extends StatelessWidget {
final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false); final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false);
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 5),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
const SizedBox(height: 20, width: double.infinity), const SizedBox(height: 10, width: double.infinity),
if (myContacts.isEmpty) if (myContacts.isEmpty)
Text('noContacts'.tr()) Text('noContacts'.tr())
else else
@ -45,9 +42,10 @@ class ContactsList extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 5), padding: const EdgeInsets.symmetric(horizontal: 5),
child: ListTile( child: ListTile(
key: keySearchResult('keyID++'), key: keySearchResult('keyID++'),
horizontalTitleGap: 40, horizontalTitleGap: 7,
contentPadding: const EdgeInsets.all(5), contentPadding: const EdgeInsets.all(5),
leading: defaultAvatar(avatarSize), leading:
CesiumAvatar(address: g1Wallet.address, size: 55),
title: Row(children: <Widget>[ title: Row(children: <Widget>[
Text(getShortPubkey(g1Wallet.address), Text(getShortPubkey(g1Wallet.address),
style: const TextStyle( style: const TextStyle(
@ -87,13 +85,9 @@ class ContactsList extends StatelessWidget {
MaterialPageRoute(builder: (context) { MaterialPageRoute(builder: (context) {
walletsProfilesClass.address = g1Wallet.address; walletsProfilesClass.address = g1Wallet.address;
return WalletViewScreen( return WalletViewScreen(
address: g1Wallet.address, address: g1Wallet.address,
username: duniterIndexer username: duniterIndexer
.walletNameIndexer[g1Wallet.address], .walletNameIndexer[g1Wallet.address]);
avatar: g1WalletsBox
.get(g1Wallet.address)
?.avatar,
);
}), }),
); );
}), }),

View File

@ -23,9 +23,7 @@ class DragTuleAction extends StatelessWidget {
delay: const Duration(milliseconds: 200), delay: const Duration(milliseconds: 200),
data: wallet.address, data: wallet.address,
dragAnchorStrategy: (Draggable<Object> _, BuildContext __, Offset ___) => dragAnchorStrategy: (Draggable<Object> _, BuildContext __, Offset ___) =>
const Offset(0, 0), const Offset(55, 55),
// feedbackOffset: const Offset(-500, -500),
// dragAnchorStrategy: childDragAnchorStrategy,
onDragStarted: () => myWalletProvider.dragAddress = wallet, onDragStarted: () => myWalletProvider.dragAddress = wallet,
onDragEnd: (_) { onDragEnd: (_) {
myWalletProvider.lastFlyBy = null; myWalletProvider.lastFlyBy = null;

View File

@ -31,15 +31,16 @@ class DragWalletsInfo extends StatelessWidget {
return Container( return Container(
color: yellowC, color: yellowC,
width: screenWidth, width: screenWidth,
height: 80, height: 90,
child: Center( child: Center(
child: Column( child: Column(
children: [ children: [
const SizedBox(height: 2), const SizedBox(height: 2),
Text('${'executeATransfer'.tr()}:'), Text('${'executeATransfer'.tr()}:'),
MarkdownBody(data: '${'from'.tr()} **$fromName**'), MarkdownBody(data: '${'from'.tr(args: [''])} **$fromName**'),
if (isSameAddress) Text('chooseATargetWallet'.tr()), if (isSameAddress) Text('chooseATargetWallet'.tr()),
if (!isSameAddress) MarkdownBody(data: 'Vers: **$toName**'), if (!isSameAddress)
MarkdownBody(data: '${'to'.tr(args: [''])} **$toName**'),
], ],
)), )),
); );

View File

@ -19,82 +19,116 @@ class MainDrawer extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Drawer( const listStyle = TextStyle(fontSize: 16);
child: Column(
children: <Widget>[ return SizedBox(
Expanded( width: MediaQuery.of(context).size.width * 0.67,
child: ListView(padding: EdgeInsets.zero, children: <Widget>[ child: Drawer(
const DrawerHeader( child: Column(
decoration: BoxDecoration( children: <Widget>[
color: orangeC, Expanded(
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
const DrawerHeader(
decoration: BoxDecoration(
color: orangeC,
),
child: Column(children: <Widget>[
Image(
image: AssetImage('assets/icon/gecko_final.png'),
height: 130),
]),
), ),
child: Column(children: <Widget>[ const SizedBox(height: 10),
SizedBox(height: 0), Opacity(
Image( opacity: 0.8,
image: AssetImage('assets/icon/gecko_final.png'), child: ListTile(
height: 130), key: keyParameters,
]), leading: const Icon(Icons.settings),
), title: Text(
ListTile( 'parameters'.tr(),
key: keyParameters, style: listStyle,
title: Text('parameters'.tr()), ),
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) { MaterialPageRoute(builder: (context) {
return SettingsScreen(); return SettingsScreen();
}),
);
},
),
),
const SizedBox(height: 5),
if (isWalletsExists)
Opacity(
opacity: 0.8,
child: ListTile(
key: keyContacts,
leading: const Icon(Icons.contacts_rounded),
title: Text(
'contactsManagement'.tr(),
style: listStyle,
),
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return const ContactsScreen();
}),
);
},
),
),
const SizedBox(height: 5),
if (kDebugMode)
Opacity(
opacity: 0.8,
child: ListTile(
key: keyDebugScreen,
leading: const Icon(Icons.developer_mode_rounded),
title: Text(
'Debug screen'.tr(),
style: listStyle,
),
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return const DebugScreen();
}),
);
},
),
),
])),
Align(
alignment: FractionalOffset.bottomCenter,
child: InkWell(
key: keyCopyAddress,
splashColor: orangeC,
child: Padding(
padding: const EdgeInsets.all(15),
child: Opacity(
opacity: 0.8,
child: Text('Ğecko v$appVersion',
style: const TextStyle(fontSize: 13)),
),
),
onTap: () {
Clipboard.setData(
ClipboardData(text: 'Ğecko v$appVersion'));
snackMessage(context,
message:
'Le numéro de version de Ğecko a été copié dans votre presse papier',
duration: 4);
}), }),
);
},
), ),
if (isWalletsExists) const SizedBox(height: 15)
ListTile( ],
key: keyContacts, ),
title: Text('contactsManagement'.tr()),
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return const ContactsScreen();
}),
);
},
),
if (kDebugMode)
ListTile(
key: keyDebugScreen,
title: Text('Debug screen'.tr()),
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return const DebugScreen();
}),
);
},
),
])),
Align(
alignment: FractionalOffset.bottomCenter,
child: InkWell(
key: keyCopyAddress,
splashColor: orangeC,
child: Padding(
padding: const EdgeInsets.all(20),
child: Text('Ğecko v$appVersion')),
onTap: () {
Clipboard.setData(ClipboardData(text: 'Ğecko v$appVersion'));
snackMessage(context,
message:
'Le numéro de version de Ğecko a été copié dans votre presse papier',
duration: 4);
}),
),
const SizedBox(height: 20)
],
), ),
); );
} }

View File

@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:gecko/globals.dart'; import 'package:gecko/globals.dart';
import 'package:gecko/models/widgets_keys.dart'; import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/providers/duniter_indexer.dart'; import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/substrate_sdk.dart'; import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/wallet_options.dart'; import 'package:gecko/providers/wallet_options.dart';
@ -10,6 +9,7 @@ import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/screens/certifications.dart'; import 'package:gecko/screens/certifications.dart';
import 'package:gecko/widgets/balance.dart'; import 'package:gecko/widgets/balance.dart';
import 'package:gecko/widgets/certifications.dart'; import 'package:gecko/widgets/certifications.dart';
import 'package:gecko/widgets/cesium_avatar.dart';
import 'package:gecko/widgets/commons/offline_info.dart'; import 'package:gecko/widgets/commons/offline_info.dart';
import 'package:gecko/widgets/idty_status.dart'; import 'package:gecko/widgets/idty_status.dart';
import 'package:gecko/widgets/page_route_no_transition.dart'; import 'package:gecko/widgets/page_route_no_transition.dart';
@ -27,7 +27,7 @@ class HeaderProfile extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
const double avatarSize = 140; const double avatarSize = 130;
final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false); final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false);
final walletOptions = final walletOptions =
Provider.of<WalletOptionsProvider>(context, listen: false); Provider.of<WalletOptionsProvider>(context, listen: false);
@ -37,7 +37,7 @@ class HeaderProfile extends StatelessWidget {
Consumer<SubstrateSdk>(builder: (context, sub, _) { Consumer<SubstrateSdk>(builder: (context, sub, _) {
bool isAccountExist = walletOptions.balanceCache[address] != 0; bool isAccountExist = walletOptions.balanceCache[address] != 0;
return Container( return Container(
height: 185, height: 170,
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.topCenter, begin: Alignment.topCenter,
@ -50,13 +50,13 @@ class HeaderProfile extends StatelessWidget {
)); ));
}), }),
Padding( Padding(
padding: const EdgeInsets.only(left: 30, right: 40), padding: const EdgeInsets.only(left: 20, right: 20),
child: Row(children: <Widget>[ child: Row(children: <Widget>[
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
height: 10, height: 5,
color: yellowC, color: yellowC,
), ),
Row(children: [ Row(children: [
@ -69,14 +69,15 @@ class HeaderProfile extends StatelessWidget {
child: Text( child: Text(
getShortPubkey(address), getShortPubkey(address),
style: const TextStyle( style: const TextStyle(
fontSize: 30, fontSize: 27,
fontWeight: FontWeight.w800, fontFamily: 'Monospace',
fontWeight: FontWeight.w900,
), ),
), ),
), ),
]), ]),
const SizedBox(height: 18), const SizedBox(height: 15),
Balance(address: address, size: 25), Balance(address: address, size: 23),
const SizedBox(height: 5), const SizedBox(height: 5),
InkWell( InkWell(
onTap: () => sub.certsCounterCache[address] != null onTap: () => sub.certsCounterCache[address] != null
@ -106,10 +107,10 @@ class HeaderProfile extends StatelessWidget {
), ),
]), ]),
const Spacer(), const Spacer(),
// const SizedBox(width: 20),
Column(children: <Widget>[ Column(children: <Widget>[
ClipOval( const SizedBox(height: 15),
child: defaultAvatar(avatarSize), CesiumAvatar(address: address, size: avatarSize),
),
]), ]),
]), ]),
), ),

View File

@ -24,7 +24,7 @@ class HistoryView extends StatelessWidget {
final sub = Provider.of<SubstrateSdk>(homeContext, listen: false); final sub = Provider.of<SubstrateSdk>(homeContext, listen: false);
int keyID = 0; int keyID = 0;
const double avatarSize = 200; const double avatarSize = 50;
bool isMigrationPassed = false; bool isMigrationPassed = false;
List<String> pastDelimiters = []; List<String> pastDelimiters = [];
@ -51,21 +51,19 @@ class HistoryView extends StatelessWidget {
return Column(children: <Widget>[ return Column(children: <Widget>[
if (isMigrationTime) if (isMigrationTime)
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 30), padding: const EdgeInsets.symmetric(vertical: 25),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
const Image( const Image(
image: AssetImage('assets/party.png'), height: 40), image: AssetImage('assets/party.png'), height: 40),
const SizedBox(width: 40),
Text( Text(
'blockchainStart'.tr(), 'blockchainStart'.tr(),
style: const TextStyle( style: const TextStyle(
fontSize: 25, fontSize: 23,
color: Colors.blueAccent, color: Colors.blueAccent,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
const SizedBox(width: 40),
const Image( const Image(
image: AssetImage('assets/party.png'), height: 40), image: AssetImage('assets/party.png'), height: 40),
], ],
@ -76,7 +74,7 @@ class HistoryView extends StatelessWidget {
!(pastDelimiters[pastDelimiters.length - 2] == !(pastDelimiters[pastDelimiters.length - 2] ==
answer['dateDelimiter'])) answer['dateDelimiter']))
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 30), padding: const EdgeInsets.symmetric(vertical: 20),
child: Text( child: Text(
answer['dateDelimiter'], answer['dateDelimiter'],
style: const TextStyle( style: const TextStyle(
@ -117,30 +115,29 @@ class HistoryView extends StatelessWidget {
}), }),
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
const Icon( Icon(
Icons.account_circle, Icons.account_circle,
size: 40, size: 40,
color: Colors.blueAccent, color: Colors.green[700],
), ),
const SizedBox(width: 40),
Column(children: [ Column(children: [
Text( Text(
'Identité migré:'.tr(), 'Identité migré:'.tr(),
style: const TextStyle( style: TextStyle(
fontSize: 25, fontSize: 23,
color: Colors.blueAccent, color: Colors.green[700],
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
), ),
Text( Text('from'.tr(args: [
'Ancienne adresse: ${getShortPubkey(sub.oldOwnerKeys[address]![0])}') ' ${getShortPubkey(sub.oldOwnerKeys[address]![0])}'
])),
]), ]),
const SizedBox(width: 40), Icon(
const Icon(
Icons.account_circle, Icons.account_circle,
size: 40, size: 40,
color: Colors.blueAccent, color: Colors.green[700],
), ),
], ],
), ),

View File

@ -117,7 +117,7 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
top: 24, bottom: 0, left: 24, right: 24), top: 15, bottom: 0, left: 17, right: 17),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -128,11 +128,11 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
Text( Text(
'executeATransfer'.tr(), 'executeATransfer'.tr(),
style: const TextStyle( style: const TextStyle(
fontSize: 26, fontWeight: FontWeight.w700), fontSize: 24, fontWeight: FontWeight.w700),
), ),
IconButton( IconButton(
key: keyPopButton, key: keyPopButton,
iconSize: 40, iconSize: 35,
icon: const Icon(Icons.cancel_outlined), icon: const Icon(Icons.cancel_outlined),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
@ -141,7 +141,7 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
]), ]),
const SizedBox(height: 5), const SizedBox(height: 5),
Text( Text(
'from'.tr(), 'from'.tr(args: ['']),
style: TextStyle( style: TextStyle(
fontSize: 19, fontSize: 19,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
@ -149,31 +149,62 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
), ),
const SizedBox(height: 5), const SizedBox(height: 5),
Consumer<SubstrateSdk>(builder: (context, sub, _) { Consumer<SubstrateSdk>(builder: (context, sub, _) {
return DropdownButton( return Container(
dropdownColor: const Color(0xffffeed1), decoration: BoxDecoration(
elevation: 12, border: Border.all(
key: keyDropdownWallets, color: Colors.blueAccent.shade200, width: 2),
value: defaultWallet, borderRadius:
menuMaxHeight: 300, const BorderRadius.all(Radius.circular(10.0)),
onTap: () { ),
FocusScope.of(context).requestFocus(amountFocus); padding: const EdgeInsets.all(0),
}, child: DropdownButton(
selectedItemBuilder: (_) { dropdownColor: const Color(0xffffeed1),
return myWalletProvider.listWallets elevation: 12,
key: keyDropdownWallets,
value: defaultWallet,
menuMaxHeight: 300,
onTap: () {
FocusScope.of(context)
.requestFocus(amountFocus);
},
selectedItemBuilder: (_) {
return myWalletProvider.listWallets
.map((WalletData wallet) {
return Container(
width: 330,
padding: const EdgeInsets.all(8),
child: Visibility(
visible: wallet.address ==
defaultWallet.address,
child: Row(children: [
NameByAddress(
wallet: wallet,
fontStyle: FontStyle.normal),
const Spacer(),
Balance(
address: wallet.address, size: 20),
]),
),
);
}).toList();
},
onChanged: (WalletData? newSelectedWallet) async {
defaultWallet = newSelectedWallet!;
await sub.setCurrentWallet(newSelectedWallet);
sub.reload();
amountFocus.requestFocus();
setState(() {});
},
items: myWalletProvider.listWallets
.map((WalletData wallet) { .map((WalletData wallet) {
return Container( return DropdownMenuItem(
width: 408, value: wallet,
decoration: BoxDecoration( key: keySelectThisWallet(wallet.address),
border: Border.all( child: Container(
color: Colors.blueAccent.shade200, color: const Color(0xffffeed1),
width: 2), width: 332,
borderRadius: const BorderRadius.all( height: 80,
Radius.circular(10.0)), padding: const EdgeInsets.all(7),
),
padding: const EdgeInsets.all(7),
child: Visibility(
visible:
wallet.address == defaultWallet.address,
child: Row(children: [ child: Row(children: [
NameByAddress( NameByAddress(
wallet: wallet, wallet: wallet,
@ -184,58 +215,26 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
]), ]),
), ),
); );
}).toList(); }).toList()),
}, );
onChanged: (WalletData? newSelectedWallet) async {
defaultWallet = newSelectedWallet!;
await sub.setCurrentWallet(newSelectedWallet);
sub.reload();
amountFocus.requestFocus();
setState(() {});
},
items: myWalletProvider.listWallets
.map((WalletData wallet) {
return DropdownMenuItem(
value: wallet,
key: keySelectThisWallet(wallet.address),
child: Container(
color: const Color(0xffffeed1),
width: 408,
height: 80,
padding: const EdgeInsets.all(7),
child: Row(children: [
NameByAddress(
wallet: wallet,
fontStyle: FontStyle.normal),
const Spacer(),
Balance(address: wallet.address, size: 20),
]),
),
);
}).toList());
}), }),
const SizedBox(height: 12), const SizedBox(height: 12),
Row( Row(
children: [ children: [
Text( Text(
'to'.tr(), 'to'.tr(args: ['']),
style: TextStyle( style: TextStyle(
fontSize: 19, fontSize: 19,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.grey[600]), color: Colors.grey[600]),
), ),
const SizedBox(width: 10), const SizedBox(width: 10),
Column( Text(
children: [ username ?? getShortPubkey(toAddress),
const SizedBox(height: 2), style: const TextStyle(
Text( fontSize: 21,
username ?? getShortPubkey(toAddress), fontWeight: FontWeight.w600,
style: const TextStyle( ),
fontSize: 21,
fontWeight: FontWeight.w600,
),
),
],
), ),
], ],
), ),
@ -320,10 +319,10 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
color: Colors.grey[500]!, width: 2), color: Colors.grey[500]!, width: 2),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
contentPadding: const EdgeInsets.all(15), contentPadding: const EdgeInsets.all(10),
), ),
style: const TextStyle( style: const TextStyle(
fontSize: 33, fontSize: 30,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),

View File

@ -0,0 +1,52 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/providers/generate_wallets.dart';
import 'package:provider/provider.dart';
class ScanDerivationsInfo extends StatelessWidget {
const ScanDerivationsInfo({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final generateWalletProvider =
Provider.of<GenerateWalletsProvider>(context);
return Visibility(
visible: generateWalletProvider.scanStatus != ScanDerivationsStatus.none,
child: Padding(
padding: const EdgeInsets.only(bottom: 15),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (generateWalletProvider.scanStatus ==
ScanDerivationsStatus.rootScanning)
Text('scanRootDerivationInProgress'.tr()),
if (generateWalletProvider.scanStatus ==
ScanDerivationsStatus.scanning)
Text('derivationsScanProgress'
.tr(args: [generateWalletProvider.numberScan.toString()])),
if (generateWalletProvider.scanStatus ==
ScanDerivationsStatus.import)
Text("importDerivationsInProgress".tr(args: [
'${generateWalletProvider.scanedWalletNumber}',
'${generateWalletProvider.scanedValidWalletNumber}'
])),
const SizedBox(width: 10),
const SizedBox(
height: 22,
width: 22,
child: CircularProgressIndicator(
color: orangeC,
strokeWidth: 3,
),
),
],
),
),
);
}
}
enum ScanDerivationsStatus { none, rootScanning, scanning, import }

View File

@ -4,13 +4,13 @@ import 'package:flutter/material.dart';
import 'package:gecko/globals.dart'; import 'package:gecko/globals.dart';
import 'package:gecko/models/queries_indexer.dart'; import 'package:gecko/models/queries_indexer.dart';
import 'package:gecko/models/widgets_keys.dart'; import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/providers/duniter_indexer.dart'; import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/search.dart'; import 'package:gecko/providers/search.dart';
import 'package:gecko/providers/substrate_sdk.dart'; import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/wallets_profiles.dart'; import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/screens/wallet_view.dart'; import 'package:gecko/screens/wallet_view.dart';
import 'package:gecko/widgets/balance.dart'; import 'package:gecko/widgets/balance.dart';
import 'package:gecko/widgets/cesium_avatar.dart';
import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -80,58 +80,54 @@ class SearchIdentityQuery extends StatelessWidget {
return Expanded( return Expanded(
child: ListView(children: <Widget>[ child: ListView(children: <Widget>[
for (Map profile in identities) for (Map profile in identities)
Padding( ListTile(
padding: const EdgeInsets.symmetric(horizontal: 5), key: keySearchResult(profile['pubkey']),
child: ListTile( horizontalTitleGap: 10,
key: keySearchResult(profile['pubkey']), contentPadding: const EdgeInsets.only(right: 2),
horizontalTitleGap: 40, leading: CesiumAvatar(
contentPadding: const EdgeInsets.all(5), address: profile['pubkey'], size: avatarSize),
leading: defaultAvatar(avatarSize), title: Row(children: <Widget>[
title: Row(children: <Widget>[ Text(getShortPubkey(profile['pubkey']),
Text(getShortPubkey(profile['pubkey']), style: const TextStyle(
style: const TextStyle( fontSize: 18,
fontSize: 18, fontFamily: 'Monospace',
fontFamily: 'Monospace', fontWeight: FontWeight.w500),
fontWeight: FontWeight.w500), textAlign: TextAlign.center),
textAlign: TextAlign.center), ]),
]), trailing: SizedBox(
trailing: SizedBox( width: 120,
width: 110, child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end, children: [
children: [ Column(
Column( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: [
children: [ Balance(
Balance( address: profile['pubkey'], size: 16),
address: profile['pubkey'], size: 16), ]),
]), ]),
]), ),
), subtitle: Row(children: <Widget>[
subtitle: Row(children: <Widget>[ Text(profile['name'] ?? '',
Text(profile['name'] ?? '', style: const TextStyle(
style: const TextStyle( fontSize: 18, fontWeight: FontWeight.w500),
fontSize: 18, fontWeight: FontWeight.w500), textAlign: TextAlign.center),
textAlign: TextAlign.center), ]),
]), dense: false,
dense: false, isThreeLine: false,
isThreeLine: false, onTap: () {
onTap: () { Navigator.pop(context);
Navigator.pop(context); Navigator.push(
Navigator.push( context,
context, MaterialPageRoute(builder: (context) {
MaterialPageRoute(builder: (context) { walletsProfiles.address = profile['pubkey'];
walletsProfiles.address = profile['pubkey']; return WalletViewScreen(
return WalletViewScreen( address: profile['pubkey'],
address: profile['pubkey'], username: profile['name'],
username: profile['name'], );
avatar: }),
g1WalletsBox.get(profile['pubkey'])?.avatar, );
); }),
}),
);
}),
),
]), ]),
); );
}), }),

View File

@ -3,13 +3,13 @@ import 'package:gecko/globals.dart';
import 'package:gecko/models/g1_wallets_list.dart'; import 'package:gecko/models/g1_wallets_list.dart';
import 'package:gecko/models/wallet_data.dart'; import 'package:gecko/models/wallet_data.dart';
import 'package:gecko/models/widgets_keys.dart'; import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/providers/duniter_indexer.dart'; import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/search.dart'; import 'package:gecko/providers/search.dart';
import 'package:gecko/providers/substrate_sdk.dart'; import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/wallets_profiles.dart'; import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/screens/wallet_view.dart'; import 'package:gecko/screens/wallet_view.dart';
import 'package:gecko/widgets/balance.dart'; import 'package:gecko/widgets/balance.dart';
import 'package:gecko/widgets/cesium_avatar.dart';
import 'package:gecko/widgets/name_by_address.dart'; import 'package:gecko/widgets/name_by_address.dart';
import 'package:gecko/widgets/search_identity_query.dart'; import 'package:gecko/widgets/search_identity_query.dart';
@ -41,7 +41,7 @@ class SearchResult extends StatelessWidget {
return Expanded( return Expanded(
child: ListView(children: <Widget>[ child: ListView(children: <Widget>[
for (G1WalletsList g1Wallet in snapshot.data ?? []) for (G1WalletsList g1Wallet in snapshot.data ?? [])
resultTile(g1Wallet, context), resultTileAddressSearch(g1Wallet, context),
]), ]),
); );
} }
@ -58,54 +58,50 @@ class SearchResult extends StatelessWidget {
); );
} }
Padding resultTile(G1WalletsList g1Wallet, BuildContext context) { Widget resultTileAddressSearch(G1WalletsList g1Wallet, BuildContext context) {
return Padding( return ListTile(
padding: const EdgeInsets.symmetric(horizontal: 5), key: keySearchResult(g1Wallet.address),
child: ListTile( horizontalTitleGap: 10,
key: keySearchResult(g1Wallet.address), contentPadding: const EdgeInsets.all(5),
horizontalTitleGap: 40, leading: CesiumAvatar(address: g1Wallet.address, size: avatarSize),
contentPadding: const EdgeInsets.all(5), title: Row(children: <Widget>[
leading: defaultAvatar(avatarSize), Text(getShortPubkey(g1Wallet.address),
title: Row(children: <Widget>[ style: const TextStyle(
Text(getShortPubkey(g1Wallet.address), fontSize: 18,
style: const TextStyle( fontFamily: 'Monospace',
fontSize: 18, fontWeight: FontWeight.w500),
fontFamily: 'Monospace', textAlign: TextAlign.center),
fontWeight: FontWeight.w500), ]),
textAlign: TextAlign.center), trailing:
]), Column(mainAxisAlignment: MainAxisAlignment.center, children: [
trailing: SizedBox(
width: 110,
child: Row(mainAxisAlignment: MainAxisAlignment.end, children: [
Column(mainAxisAlignment: MainAxisAlignment.center, children: [ Column(mainAxisAlignment: MainAxisAlignment.center, children: [
SizedBox( Balance(address: g1Wallet.address, size: 16),
width: 110,
child: Row(mainAxisAlignment: MainAxisAlignment.end, children: [
Column(mainAxisAlignment: MainAxisAlignment.center, children: [
Balance(address: g1Wallet.address, size: 16),
]),
]), ]),
), ]),
]), ),
subtitle: Row(children: <Widget>[ ]),
NameByAddress( subtitle: Row(children: <Widget>[
wallet: WalletData(address: g1Wallet.address), NameByAddress(
), wallet: WalletData(address: g1Wallet.address),
]), ),
dense: false, ]),
isThreeLine: false, dense: false,
onTap: () { isThreeLine: false,
Navigator.pop(context); onTap: () {
Navigator.push( Navigator.pop(context);
context, Navigator.push(
MaterialPageRoute(builder: (context) { context,
walletsProfilesClass.address = g1Wallet.address; MaterialPageRoute(builder: (context) {
return WalletViewScreen( walletsProfilesClass.address = g1Wallet.address;
address: g1Wallet.address, return WalletViewScreen(
username: g1Wallet.username, address: g1Wallet.address,
avatar: g1Wallet.avatar, username: g1Wallet.username,
); );
}), }),
); );
}), });
);
} }
} }

View File

@ -36,7 +36,7 @@ class TransactionTile extends StatelessWidget {
child: ListTile( child: ListTile(
key: keyTransaction(newKey), key: keyTransaction(newKey),
contentPadding: contentPadding:
const EdgeInsets.only(left: 20, right: 30, top: 15, bottom: 15), const EdgeInsets.symmetric(horizontal: 15, vertical: 5),
leading: ClipOval( leading: ClipOval(
child: defaultAvatar(avatarSize), child: defaultAvatar(avatarSize),
), ),

View File

@ -21,15 +21,14 @@ class UdUnitDisplay extends StatelessWidget {
children: [ children: [
Text( Text(
'ud'.tr(args: ['']), 'ud'.tr(args: ['']),
style: TextStyle( style: TextStyle(fontSize: size, color: color),
fontSize: isTall ? size : size * 0.9, color: color),
), ),
Column( Column(
children: [ children: [
Text( Text(
currencyName, currencyName,
style: TextStyle( style: TextStyle(
fontSize: (isTall ? size : size * 0.9) * 0.7, fontSize: size * 0.7,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: color), color: color),
), ),
@ -38,8 +37,6 @@ class UdUnitDisplay extends StatelessWidget {
) )
], ],
) )
: Text(currencyName, : Text(currencyName, style: TextStyle(fontSize: size, color: color));
style:
TextStyle(fontSize: isTall ? size : size * 0.9, color: color));
} }
} }

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/models/wallet_data.dart'; import 'package:gecko/models/wallet_data.dart';
import 'package:truncate/truncate.dart'; import 'package:truncate/truncate.dart';
@ -23,7 +22,7 @@ class WalletName extends StatelessWidget {
truncate(wallet.name ?? '', 20), truncate(wallet.name ?? '', 20),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: isTall ? newSize : newSize * 0.9, fontSize: newSize,
color: color, color: color,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
fontStyle: FontStyle.italic, fontStyle: FontStyle.italic,

View File

@ -24,7 +24,7 @@ class WalletTile extends StatelessWidget {
final defaultWallet = myWalletProvider.getDefaultWallet(); final defaultWallet = myWalletProvider.getDefaultWallet();
return Padding( return Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(12),
child: GestureDetector( child: GestureDetector(
key: keyOpenWallet(repository.address), key: keyOpenWallet(repository.address),
onTap: () { onTap: () {
@ -91,12 +91,12 @@ class WalletTile extends StatelessWidget {
children: [ children: [
Column( Column(
children: [ children: [
const SizedBox(height: 7), const SizedBox(height: 3),
Opacity( Opacity(
opacity: 0.7, opacity: 0.7,
child: NameByAddress( child: NameByAddress(
wallet: repository, wallet: repository,
size: 20, size: 19,
color: color:
defaultWallet.address == repository.address defaultWallet.address == repository.address
? Colors.white ? Colors.white
@ -134,8 +134,7 @@ class BalanceBuilder extends StatelessWidget {
width: double.infinity, width: double.infinity,
color: isDefault ? orangeC : yellowC, color: isDefault ? orangeC : yellowC,
child: Padding( child: Padding(
padding: padding: const EdgeInsets.only(left: 5, right: 5, top: 30, bottom: 7),
const EdgeInsets.only(left: 5, right: 5, top: 38, bottom: 10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -143,7 +142,7 @@ class BalanceBuilder extends StatelessWidget {
opacity: 0.7, opacity: 0.7,
child: Balance( child: Balance(
address: address, address: address,
size: 16, size: 15,
color: isDefault ? Colors.white : Colors.black, color: isDefault ? Colors.white : Colors.black,
loadingColor: isDefault ? yellowC : orangeC), loadingColor: isDefault ? yellowC : orangeC),
) )

View File

@ -22,7 +22,7 @@ class WalletTileMembre extends StatelessWidget {
final myWalletProvider = Provider.of<MyWalletsProvider>(context); final myWalletProvider = Provider.of<MyWalletsProvider>(context);
final defaultWallet = myWalletProvider.getDefaultWallet(); final defaultWallet = myWalletProvider.getDefaultWallet();
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 70, vertical: 20), padding: const EdgeInsets.symmetric(horizontal: 60, vertical: 16),
child: GestureDetector( child: GestureDetector(
key: keyOpenWallet(repository.address), key: keyOpenWallet(repository.address),
onTap: () { onTap: () {
@ -37,7 +37,7 @@ class WalletTileMembre extends StatelessWidget {
}, },
child: SizedBox( child: SizedBox(
key: repository.number == 1 ? keyDragAndDrop : const Key('nothing'), key: repository.number == 1 ? keyDragAndDrop : const Key('nothing'),
height: 240, height: 200,
child: ClipOvalShadow( child: ClipOvalShadow(
shadow: const Shadow( shadow: const Shadow(
color: Colors.transparent, color: Colors.transparent,
@ -84,12 +84,12 @@ class WalletTileMembre extends StatelessWidget {
), ),
), ),
Positioned( Positioned(
left: 25, left: 20,
top: 25, top: 20,
child: Opacity( child: Opacity(
opacity: 0.6, opacity: 0.6,
child: Image.asset('assets/medal.png', child: Image.asset('assets/medal.png',
color: Colors.black, height: 40), color: Colors.black, height: 35),
), ),
), ),
], ],
@ -101,7 +101,7 @@ class WalletTileMembre extends StatelessWidget {
isDefault: repository.address == defaultWallet.address), isDefault: repository.address == defaultWallet.address),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [ Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Column(children: [ Column(children: [
const SizedBox(height: 10), const SizedBox(height: 7),
Opacity( Opacity(
opacity: 0.7, opacity: 0.7,
child: NameByAddress( child: NameByAddress(
@ -116,7 +116,7 @@ class WalletTileMembre extends StatelessWidget {
]), ]),
]), ]),
Positioned( Positioned(
right: 25, right: 12,
top: 25, top: 25,
child: Opacity( child: Opacity(
opacity: 0.7, opacity: 0.7,
@ -125,7 +125,7 @@ class WalletTileMembre extends StatelessWidget {
color: defaultWallet.address == repository.address color: defaultWallet.address == repository.address
? Colors.white ? Colors.white
: Colors.black, : Colors.black,
size: 18), size: 16),
), ),
), ),
]), ]),
@ -155,7 +155,7 @@ class BalanceBuilder extends StatelessWidget {
color: isDefault ? orangeC : yellowC, color: isDefault ? orangeC : yellowC,
child: Padding( child: Padding(
padding: padding:
const EdgeInsets.only(left: 5, right: 5, top: 45, bottom: 15), const EdgeInsets.only(left: 5, right: 5, top: 37, bottom: 12),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [

View File

@ -298,7 +298,7 @@ packages:
source: hosted source: hosted
version: "0.3.3+7" version: "0.3.3+7"
crypto: crypto:
dependency: transitive dependency: "direct main"
description: description:
name: crypto name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
@ -711,6 +711,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
hive_generator:
dependency: "direct dev"
description:
name: hive_generator
sha256: "06cb8f58ace74de61f63500564931f9505368f45f98958bd7a6c35ba24159db4"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
html: html:
dependency: transitive dependency: transitive
description: description:
@ -1192,8 +1200,8 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: gecko-fixes-3 ref: "8b254d9e98cb367b4a57d67f8c6f5bbe89a52552"
resolved-ref: ac7347e907ca30766eedb9e15583ebc20916d56c resolved-ref: "8b254d9e98cb367b4a57d67f8c6f5bbe89a52552"
url: "https://github.com/poka-IT/sdk.git" url: "https://github.com/poka-IT/sdk.git"
source: git source: git
version: "0.5.4+4" version: "0.5.4+4"
@ -1290,10 +1298,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: responsive_framework name: responsive_framework
sha256: e083346029b008335b008274c4d3fac5b9e0ca8796f201ed20884f579101d584 sha256: "23aa7be5d5136922df708f6ddccb5ec4e0eb8bc576c3f105f5093f31d6b68e50"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.2.0" version: "1.1.1"
rxdart: rxdart:
dependency: transitive dependency: transitive
description: description:
@ -1411,6 +1419,22 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.99" version: "0.0.99"
source_gen:
dependency: transitive
description:
name: source_gen
sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16
url: "https://pub.dev"
source: hosted
version: "1.4.0"
source_helper:
dependency: transitive
description:
name: source_helper
sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd"
url: "https://pub.dev"
source: hosted
version: "1.3.4"
source_span: source_span:
dependency: transitive dependency: transitive
description: description:

View File

@ -5,7 +5,7 @@ description: Pay with G1.
# pub.dev using `pub publish`. This is preferred for private packages. # pub.dev using `pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 0.1.2+59 version: 0.1.3+60
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"
@ -31,7 +31,7 @@ dependencies:
git: git:
url: https://github.com/insinfo/qr.flutter.git url: https://github.com/insinfo/qr.flutter.git
ref: master ref: master
responsive_framework: 0.2.0 responsive_framework: ^1.1.1
sentry_flutter: ^7.4.1 sentry_flutter: ^7.4.1
truncate: ^3.0.1 truncate: ^3.0.1
unorm_dart: ^0.3.0 unorm_dart: ^0.3.0
@ -43,8 +43,8 @@ dependencies:
# url: https://github.com/polkawallet-io/sdk.git # url: https://github.com/polkawallet-io/sdk.git
# ref: develop # ref: develop
url: https://github.com/poka-IT/sdk.git url: https://github.com/poka-IT/sdk.git
ref: gecko-fixes-3 # ref: gecko-fixes-3
# ref: ff98a117e86060a91113107f31355a17ccfb346c ref: 8b254d9e98cb367b4a57d67f8c6f5bbe89a52552
dots_indicator: ^3.0.0 dots_indicator: ^3.0.0
connectivity_plus: ^3.0.2 connectivity_plus: ^3.0.2
image_cropper: ^4.0.1 image_cropper: ^4.0.1
@ -59,12 +59,14 @@ dependencies:
tutorial_coach_mark: ^1.2.8 tutorial_coach_mark: ^1.2.8
confetti: ^0.7.0 confetti: ^0.7.0
url_launcher: ^6.1.11 url_launcher: ^6.1.11
crypto: ^3.0.3
dev_dependencies: dev_dependencies:
# flutter_launcher_icons: ^0.9.2 # flutter_launcher_icons: ^0.9.2
# flutter_launcher_icons_maker: ^^0.10.2 # flutter_launcher_icons_maker: ^^0.10.2
icons_launcher: ^2.0.6 icons_launcher: ^2.0.6
build_runner: ^2.1.2 build_runner: ^2.1.2
hive_generator: ^2.0.1
flutter_lints: ^3.0.1 flutter_lints: ^3.0.1
flutter_test: flutter_test:
sdk: flutter sdk: flutter

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -e
fVersion=$(grep "version: " pubspec.yaml | awk '{ print $2 }') fVersion=$(grep "version: " pubspec.yaml | awk '{ print $2 }')
withPush=$1 withPush=$1
@ -19,7 +21,8 @@ echo "Nom du build final: ${APPNAME}-${VERSION}+${BUILD}.apk"
flutter clean flutter clean
if [[ $1 == "bundle" ]]; then if [[ $1 == "bundle" ]]; then
flutter build appbundle --release --target-platform android-arm,android-arm64 --build-name $VERSION --build-number $BUILD flutter build appbundle --release --build-name $VERSION --build-number $BUILD
exit 0
else else
# flutter build apk --release --split-per-abi --target-platform android-arm,android-arm64 --build-name $VERSION --build-number $BUILD # flutter build apk --release --split-per-abi --target-platform android-arm,android-arm64 --build-name $VERSION --build-number $BUILD
flutter build apk --release --split-per-abi --build-name $VERSION --build-number $BUILD flutter build apk --release --split-per-abi --build-name $VERSION --build-number $BUILD