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",
"months": "{} months",
"certify": "Certify this\nidentity",
"from": "From:",
"to": "To:",
"from": "From:{}",
"to": "To:{}",
"amount": "Amount:",
"choiceOfSourceWallet": "Choose a source wallet",
"extrinsicInProgress": "{} in progress",
@ -171,16 +171,18 @@
"cancel": "Cancel",
"inBlockchainResult": "In {} blockchain",
"search": "Search an identity\nor an address",
"currencyNode": "{} node :",
"currencyNode": "node",
"contactsManagementWithNbr": "My contacts ({})",
"contactsManagement": "My contacts",
"noContacts": "You don't have any contact",
"addContact": "Add\nto contacts",
"removeContact": "Remove\nthis contact",
"derivationsScanProgress": "Scan address {}/{}",
"scanRootDerivationInProgress": "Scan root address",
"derivationsScanProgress": "Scan {} firsts addresses",
"importDerivationsInProgress": "Import address {}/{}",
"youAreOffline": "You are offline...",
"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",
"thisAccountIsEmpty": "This account is empty",
"youCannotMigrateIdentityToExistingIdentity": "You cannot migrate an identity\nto an account that already has an identity",

View File

@ -160,8 +160,8 @@
"days": "{} dias",
"months": "{} meses",
"certify": "Certificar esta\nidentidad",
"from": "De:",
"to": "A:",
"from": "De:{}",
"to": "A:{}",
"amount": "Importe:",
"choiceOfSourceWallet": "Elige un monedero de origen",
"extrinsicInProgress": "{} en progreso",
@ -172,16 +172,18 @@
"cancel": "Cancelar",
"inBlockchainResult": "En la blockchain {}",
"search": "Buscar una identidad\no una dirección",
"currencyNode": "Nodo {} :",
"currencyNode": "Nodo",
"contactsManagementWithNbr": "Mis contactos ({})",
"contactsManagement": "Mis contactos",
"noContacts": "No tienes ningún contacto",
"addContact": "Añadir\na contactos",
"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...",
"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",
"thisAccountIsEmpty": "Esta cuenta está vacía",
"youCannotMigrateIdentityToExistingIdentity": "No se puede migrar una identidad\na una cuenta que ya tiene una identidad",

View File

@ -159,8 +159,8 @@
"days": "{} jours",
"months": "{} mois",
"certify": "Certifier cette\nidentité",
"from": "Depuis:",
"to": "Vers:",
"from": "Depuis:{}",
"to": "Vers:{}",
"amount": "Montant:",
"choiceOfSourceWallet": "Choix du portefeuille source",
"extrinsicInProgress": "{} en cours",
@ -171,16 +171,18 @@
"cancel": "Annuler",
"inBlockchainResult": "Dans la blockchain {}",
"search": "Rechercher une identité\nou une adresse",
"currencyNode": "Noeud {} :",
"currencyNode": "Noeud",
"contactsManagementWithNbr": "Mes contacts ({})",
"contactsManagement": "Mes contacts",
"noContacts": "Vous n'avez aucun contact",
"addContact": "Ajouter\naux contacts",
"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...",
"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",
"thisAccountIsEmpty": "Ce compte est vide",
"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",
"inBlockchainResult": "Nella blockchain {}",
"search": "Cerca una identitá\no un indirizzo",
"currencyNode": "Nodo {} :",
"currencyNode": "Nodo",
"contactsManagementWithNbr": "I miei contatti ({})",
"contactsManagement": "I miei contatti",
"noContacts": "Non ci sono contatti salvati",
@ -181,7 +181,7 @@
"derivationsScanProgress": "Scannerizzando l'indirizzo {}/{}",
"youAreOffline": "Disconnesso...",
"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",
"thisAccountIsEmpty": "Questo conto é vuoto",
"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());
// Search Wallet 5 again
await tapKey(keyAppBarSearch);
await tapKey(keyAppBarHome);
final addressToSearch = await clipPaste();
final endAddress = addressToSearch.substring(addressToSearch.length - 6);
expect(addressToSearch, test5.address);

View File

@ -23,14 +23,10 @@ late Box<G1WalletsList> contactsBox;
// late Box keystoreBox;
late Directory imageDirectory;
// String cesiumPod = "https://g1.data.le-sou.org";
String cesiumPod = "https://g1.data.presles.fr";
String cesiumPod = "https://g1.data.le-sou.org";
// String cesiumPod = "https://g1.data.presles.fr";
// String cesiumPod = "https://g1.data.e-is.pro";
// Responsive ratios
late bool isTall;
late double ratio;
// Contexts
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/settings_provider.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/home.dart';
import 'package:gecko/providers/my_wallets.dart';
@ -133,23 +134,21 @@ class Gecko extends StatelessWidget {
ChangeNotifierProvider(create: (_) => CesiumPlusProvider()),
ChangeNotifierProvider(create: (_) => SubstrateSdk()),
ChangeNotifierProvider(create: (_) => DuniterIndexer()),
ChangeNotifierProvider(create: (_) => SettingsProvider())
ChangeNotifierProvider(create: (_) => SettingsProvider()),
ChangeNotifierProvider(create: (_) => V2sDatapodProvider())
],
child: MaterialApp(
localizationsDelegates: context.localizationDelegates,
supportedLocales: context.supportedLocales,
locale: context.locale,
builder: (context, widget) => ResponsiveWrapper.builder(
BouncingScrollWrapper.builder(context, widget!),
maxWidth: 1200,
minWidth: 480,
defaultScale: true,
breakpoints: [
const ResponsiveBreakpoint.resize(480, name: MOBILE),
const ResponsiveBreakpoint.autoScale(800, name: TABLET),
const ResponsiveBreakpoint.resize(1000, name: DESKTOP),
],
background: Container(color: backgroundColor)),
builder: (context, child) => ResponsiveBreakpoints.builder(
child: child!,
breakpoints: [
const Breakpoint(start: 0, end: 450, name: MOBILE),
const Breakpoint(start: 451, end: 800, name: TABLET),
const Breakpoint(start: 801, end: double.infinity, name: DESKTOP),
],
),
title: 'Ğecko',
theme: ThemeData(
appBarTheme: const AppBarTheme(
@ -159,6 +158,7 @@ class Gecko extends StatelessWidget {
primaryColor: const Color(0xffFFD58D),
scaffoldBackgroundColor: backgroundColor,
canvasColor: backgroundColor,
dialogBackgroundColor: backgroundColor,
textTheme: const TextTheme(
bodyLarge: TextStyle(fontSize: 16),
bodyMedium: TextStyle(fontSize: 18),

View File

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

View File

@ -20,17 +20,16 @@ class G1WalletsListAdapter extends TypeAdapter<G1WalletsList> {
address: fields[0] as String,
balance: fields[1] as double?,
id: fields[2] as Id?,
avatar: fields[3] as Image?,
username: fields[4] as String?,
csName: fields[5] as String?,
isMembre: fields[6] as bool?,
username: fields[3] as String?,
csName: fields[4] as String?,
isMembre: fields[5] as bool?,
);
}
@override
void write(BinaryWriter writer, G1WalletsList obj) {
writer
..writeByte(7)
..writeByte(6)
..writeByte(0)
..write(obj.address)
..writeByte(1)
@ -38,12 +37,10 @@ class G1WalletsListAdapter extends TypeAdapter<G1WalletsList> {
..writeByte(2)
..write(obj.id)
..writeByte(3)
..write(obj.avatar)
..writeByte(4)
..write(obj.username)
..writeByte(5)
..writeByte(4)
..write(obj.csName)
..writeByte(6)
..writeByte(5)
..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 keyCancel = Key('keyCancel');
const keyConfirm = Key('keyConfirm');
const keyAppBarSearch = Key('keyAppBarSearch');
const keyAppBarHome = Key('keyAppBarSearch');
const keyAppBarQrcode = Key('keyAppBarQrcode');
const keyAppBarChest = Key('keyAppBarChest');
@ -28,6 +28,7 @@ final keyDragAndDrop = GlobalKey(debugLabel: 'keyDragAndDrop');
// Wallet options
const keyCopyAddress = Key('keyCopyAddress');
const keyCopyPubkey = Key('keyCopyPubkey');
const keyOpenActivity = Key('keyOpenActivity');
const keyManageMembership = Key('keyManageMembership');
const keySetDefaultWallet = Key('keySetDefaultWallet');

View File

@ -2,8 +2,13 @@ import 'dart:convert';
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/providers/substrate_sdk.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;
class CesiumPlusProvider with ChangeNotifier {
@ -11,105 +16,186 @@ class CesiumPlusProvider with ChangeNotifier {
CancelToken avatarCancelToken = CancelToken();
Future<List> _buildQuery(pubkey) async {
var queryGetAvatar = json.encode({
"query": {
"bool": {
"should": [
{
"match": {
'_id': {"query": pubkey, "boost": 2}
}
},
{
"prefix": {'_id': pubkey}
}
]
}
},
"highlight": {
"fields": {"title": {}, "tags": {}}
},
"from": 0,
"size": 100,
"_source": [
"title",
"avatar",
"avatar._content_type",
"description",
"city",
"address",
"socials.url",
"creationTime",
"membersCount",
"type"
],
"indices_boost": {"user": 100, "page": 1, "group": 0.01}
final Map<String, String> _headers = {
'Content-type': 'application/json',
'Accept': 'application/json',
};
// List _buildQueryGetAvatar(String pubkeyV1) {
// final queryGetAvatar = json.encode({
// "query": {
// "bool": {
// "should": [
// {
// "match": {
// '_id': {"query": pubkeyV1, "boost": 1}
// }
// },
// {
// "prefix": {'_id': pubkeyV1}
// }
// ]
// }
// },
// "_source": [
// "avatar",
// "avatar._content_type",
// ],
// "indices_boost": {"user": 1, "page": 1, "group": 0.01}
// });
// const requestUrl = "/user,page,group/profile,record/_search";
// final podRequest = cesiumPod + requestUrl;
// return [podRequest, queryGetAvatar];
// }
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";
String podRequest = cesiumPod + requestUrl;
final requestUrl =
"/user/profile?pubkey=$pubkeyV1/_update?pubkey=$pubkeyV1";
final podRequest = cesiumPod + requestUrl;
Map<String, String> headers = {
'Content-type': 'application/json',
'Accept': 'application/json',
final signedDocument = await signDoc(queryGetAvatar, address);
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 {
String? name;
if (g1WalletsBox.get(pubkey)?.csName != null) {
return g1WalletsBox.get(pubkey)!.csName!;
}
List queryOptions = await _buildQuery(pubkey);
Future<bool> setAvatar(String address, String avatarPath) async {
final sub = Provider.of<SubstrateSdk>(homeContext, listen: false);
final pubkeyV1 = await sub.addressToPubkeyB58(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);
}
final Uint8List avatarBytes = await File(avatarPath).readAsBytes();
final avatarString = base64Encode(avatarBytes);
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(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);
List queryOptions =
await _buildQuerySetAvatar(pubkeyV1, address, avatarString);
log.d(queryOptions[0]);
log.d(jsonDecode(queryOptions[1]));
late Response response;
try {
@ -117,7 +203,7 @@ class CesiumPlusProvider with ChangeNotifier {
.post(queryOptions[0],
data: queryOptions[1],
options: Options(
headers: queryOptions[2],
headers: _headers,
sendTimeout: const Duration(seconds: 4),
receiveTimeout: const Duration(seconds: 15),
),
@ -125,33 +211,51 @@ class CesiumPlusProvider with ChangeNotifier {
.timeout(
const Duration(seconds: 15),
);
// response = await http.post((Uri.parse(queryOptions[0])),
// body: queryOptions[1], headers: queryOptions[2]);
log.d(response.data);
return response.statusCode == 200;
} catch (e) {
log.e(e);
return false;
}
}
if (response.data['hits']['hits'].toString() == '[]' ||
!response.data['hits']['hits'][0]['_source'].containsKey("avatar")) {
return defaultAvatar(size);
Future<String> getLocalPath() async {
final directory = await getApplicationDocumentsDirectory();
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 =
response.data['hits']['hits'][0]['_source']['avatar']['_content'];
var avatarFile =
File('${(await getTemporaryDirectory()).path}/avatar_$pubkey.png');
await avatarFile.writeAsBytes(base64.decode(avatar));
final finalAvatar = Image.file(
Future<Image> getAvatarLocal(String address, double size) async {
final path = await getLocalPath();
final avatarFile = File('$path/avatars/$address');
return Image.file(
avatarFile,
height: size,
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/wallet_data.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:provider/provider.dart';
import "package:unorm_dart/unorm_dart.dart" as unorm;
@ -19,6 +20,7 @@ class GenerateWalletsProvider with ChangeNotifier {
final walletNameFocus = FocusNode();
Color? askedWordColor = Colors.black;
bool isAskedWordValid = false;
var scanStatus = ScanDerivationsStatus.none;
int scanedValidWalletNumber = -1;
int scanedWalletNumber = -1;
int numberScan = 60;
@ -296,7 +298,6 @@ class GenerateWalletsProvider with ChangeNotifier {
final sub = Provider.of<SubstrateSdk>(context, listen: false);
final currentChestNumber = configBox.get('currentChest');
bool isAlive = false;
scanedValidWalletNumber = 0;
scanedWalletNumber = 0;
Map<String, int> addressToScan = {};
notifyListeners();
@ -305,14 +306,14 @@ class GenerateWalletsProvider with ChangeNotifier {
return false;
}
scanStatus = ScanDerivationsStatus.rootScanning;
final hasRoot = await scanRootBalance(sub, currentChestNumber);
scanedWalletNumber = 1;
notifyListeners();
if (hasRoot) {
scanedValidWalletNumber = 1;
isAlive = true;
}
scanStatus = ScanDerivationsStatus.scanning;
for (int derivationNbr in [for (var i = 0; i < numberScan; i += 1) i]) {
final addressData = await sub.sdk.api.keyring.addressFromMnemonic(
sub.currencyParameters['ss58']!,
@ -328,35 +329,37 @@ class GenerateWalletsProvider with ChangeNotifier {
onTimeout: () => {},
);
for (String scannedWallet in balanceList.keys) {
if (balanceList[scannedWallet]!['transferableBalance'] != 0) {
isAlive = true;
String walletName = scanedValidWalletNumber == 0
? 'currentWallet'.tr()
: '${'wallet'.tr()} ${scanedValidWalletNumber + 1}';
await sub.importAccount(
mnemonic: generatedMnemonic!,
derivePath: "//${addressToScan[scannedWallet]}",
password: pin.text);
// Remove unused wallets
balanceList.removeWhere((key, value) => value['transferableBalance'] == 0);
scanedValidWalletNumber = balanceList.length + scanedWalletNumber;
WalletData myWallet = WalletData(
chest: currentChestNumber,
address: scannedWallet,
number: scanedValidWalletNumber,
name: walletName,
derivation: addressToScan[scannedWallet],
imageDefaultPath: '${scanedValidWalletNumber % 4}.png',
isOwned: true);
await walletBox.put(myWallet.address, myWallet);
scanedValidWalletNumber = scanedValidWalletNumber + 1;
}
scanedWalletNumber = scanedWalletNumber + 1;
scanStatus = ScanDerivationsStatus.import;
for (String scannedWallet in balanceList.keys) {
isAlive = true;
String walletName = scanedWalletNumber == 0
? 'currentWallet'.tr()
: '${'wallet'.tr()} ${scanedWalletNumber + 1}';
await sub.importAccount(
mnemonic: generatedMnemonic!,
derivePath: "//${addressToScan[scannedWallet]}",
password: pin.text);
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();
}
log.d(scanedWalletNumber);
scanedWalletNumber = -1;
scanedValidWalletNumber = -1;
scanStatus = ScanDerivationsStatus.none;
scanedWalletNumber = scanedValidWalletNumber = -1;
notifyListeners();
return isAlive;
}
@ -387,6 +390,7 @@ class GenerateWalletsProvider with ChangeNotifier {
imageDefaultPath: '0.png',
isOwned: true);
await walletBox.put(myWallet.address, myWallet);
scanedWalletNumber++;
return true;
} else {
return false;

View File

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

View File

@ -37,7 +37,7 @@ class SubstrateSdk with ChangeNotifier {
bool importIsLoading = false;
int blocNumber = 0;
bool isLoadingEndpoint = false;
String transactionStatus = '';
String? transactionStatus;
final int initSs58 = 42;
Map<String, int> currencyParameters = {};
TextEditingController csSalt = TextEditingController();
@ -136,6 +136,42 @@ class SubstrateSdk with ChangeNotifier {
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 //////////
////////////////////////////////////////////
@ -435,7 +471,6 @@ class SubstrateSdk with ChangeNotifier {
wrapPromise: false,
) ??
[];
// log.d('genesisHash: $genesisHash');
// log.d('genesisHash: ${HEX.decode(genesisHash.substring(2))}');
return genesisHash;
}
@ -449,9 +484,16 @@ class SubstrateSdk with ChangeNotifier {
return pubkeyByte;
}
// Future pubkeyToAddress(String pubkey) async {
// await sdk.api.account.encodeAddress([pubkey]);
// }
Future<String> addressToPubkeyB58(String address) async {
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 {
try {
@ -677,7 +719,8 @@ class SubstrateSdk with ChangeNotifier {
Future<String> importAccount(
{String mnemonic = '',
String derivePath = '',
required String password}) async {
required String password,
CryptoType cryptoType = CryptoType.sr25519}) async {
const keytype = KeyType.mnemonic;
if (mnemonic != '') generatedMnemonic = mnemonic;
@ -691,7 +734,7 @@ class SubstrateSdk with ChangeNotifier {
name: derivePath,
password: password,
derivePath: derivePath,
cryptoType: CryptoType.sr25519)
cryptoType: cryptoType)
.catchError((e) {
importIsLoading = false;
notifyListeners();
@ -748,12 +791,6 @@ class SubstrateSdk with ChangeNotifier {
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,
String passOld, String passNew) async {
final account = getKeypair(address);
@ -908,7 +945,7 @@ class SubstrateSdk with ChangeNotifier {
required String destAddress,
required double amount,
required String password}) async {
transactionStatus = '';
transactionStatus = 'sending';
final sender = await _setSender(fromAddress);
@ -960,7 +997,7 @@ class SubstrateSdk with ChangeNotifier {
Future<String> certify(
String fromAddress, String destAddress, String password) async {
transactionStatus = '';
transactionStatus = 'sending';
final statusList = await idtyStatus([fromAddress, destAddress]);
final myIdtyStatus = statusList[0];
@ -1005,9 +1042,13 @@ class SubstrateSdk with ChangeNotifier {
sender,
);
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 {
txInfo = TxInfoData(
'cert',
@ -1028,6 +1069,7 @@ class SubstrateSdk with ChangeNotifier {
Future<String> confirmIdentity(
String fromAddress, String name, String password) async {
transactionStatus = 'sending';
final sender = await _setSender(fromAddress);
final txInfo = TxInfoData(
@ -1047,7 +1089,7 @@ class SubstrateSdk with ChangeNotifier {
required String destPassword,
required Map fromBalance,
bool withBalance = false}) async {
transactionStatus = '';
transactionStatus = 'sending';
final sender = await _setSender(fromAddress);
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/models/wallet_data.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/screens/myWallets/unlocking_wallet.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}";
if (croppedFile != null) {
@ -119,6 +123,7 @@ class WalletOptionsProvider with ChangeNotifier {
return '';
}
// await imageFile.copy(newPath);
datapod.setAvatar(address.text, newPath);
log.i(newPath);
return newPath;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -48,12 +48,8 @@ class _CustomDerivationState extends State<CustomDerivation> {
return Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('createCustomDerivation'.tr()),
)),
appBar:
AppBar(toolbarHeight: 60, title: Text('createCustomDerivation'.tr())),
body: Center(
child: SafeArea(
child: Column(children: <Widget>[
@ -100,8 +96,8 @@ class _CustomDerivationState extends State<CustomDerivation> {
),
const Spacer(flex: 1),
SizedBox(
width: 410,
height: 70,
width: 300,
height: 60,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white, elevation: 4,
@ -135,14 +131,14 @@ class _CustomDerivationState extends State<CustomDerivation> {
int.parse(dropdownValue!),
);
}
Navigator.pop(context);
Navigator.pop(context);
Navigator.popUntil(
context, ModalRoute.withName('/mywallets'));
}
},
child: Text(
'validate'.tr(),
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(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('importOldAccount'.tr()),
)),
appBar: AppBar(toolbarHeight: 60, title: Text('importOldAccount'.tr())),
body: SafeArea(
child: Consumer<SubstrateSdk>(builder: (context, sub, _) {
return FutureBuilder(
@ -106,7 +101,7 @@ class ImportG1v1 extends StatelessWidget {
final unit = isUdUnit ? 'ud'.tr(args: ['']) : currencyName;
return Column(children: <Widget>[
const SizedBox(height: 20),
const SizedBox(height: 10),
TextFormField(
key: keyCesiumId,
autofocus: true,
@ -117,9 +112,12 @@ class ImportG1v1 extends StatelessWidget {
}
debounce = Timer(
const Duration(milliseconds: debouneTime), () {
sub.reload();
sub.csToV2Address(
sub.csSalt.text, sub.csPassword.text);
if (sub.csSalt.text != '' &&
sub.csPassword.text != '') {
sub.reload();
sub.csToV2Address(
sub.csSalt.text, sub.csPassword.text);
}
});
},
keyboardType: TextInputType.text,
@ -154,9 +152,12 @@ class ImportG1v1 extends StatelessWidget {
debounce = Timer(
const Duration(milliseconds: debouneTime), () {
sub.g1V1NewAddress = '';
sub.reload();
sub.csToV2Address(
sub.csSalt.text, sub.csPassword.text);
if (sub.csSalt.text != '' &&
sub.csPassword.text != '') {
sub.reload();
sub.csToV2Address(
sub.csSalt.text, sub.csPassword.text);
}
});
},
keyboardType: TextInputType.text,
@ -179,39 +180,67 @@ class ImportG1v1 extends StatelessWidget {
),
),
const SizedBox(height: 20),
GestureDetector(
key: keyCopyAddress,
onTap: () {
Clipboard.setData(
ClipboardData(text: sub.g1V1OldPubkey));
snackCopyKey(context);
},
child: Text(
sub.g1V1OldPubkey,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
),
Visibility(
visible: sub.g1V1OldPubkey != '',
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
children: [
GestureDetector(
key: keyCopyPubkey,
onTap: () {
Clipboard.setData(
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),
Text(
'${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()),
Text('migrateToThisWallet'.tr()),
const SizedBox(height: 5),
DropdownButtonHideUnderline(
key: keySelectWallet,
@ -235,10 +264,10 @@ class ImportG1v1 extends StatelessWidget {
},
),
),
const SizedBox(height: 30),
const SizedBox(height: 10),
SizedBox(
width: 380 * ratio,
height: 60 * ratio,
width: 350,
height: 50,
child: ElevatedButton(
key: keyConfirm,
style: ElevatedButton.styleFrom(
@ -270,7 +299,7 @@ class ImportG1v1 extends StatelessWidget {
balance: balance,
idtyStatus: idtyStatus);
Navigator.pop(context);
Navigator.push(
await Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return TransactionInProgress(
@ -286,9 +315,8 @@ class ImportG1v1 extends StatelessWidget {
: null,
child: Text(
'migrateAccount'.tr(),
style: TextStyle(
fontSize: 23 * ratio,
fontWeight: FontWeight.w600),
style: const TextStyle(
fontSize: 23, fontWeight: FontWeight.w600),
),
),
),
@ -312,5 +340,6 @@ class ImportG1v1 extends StatelessWidget {
sub.csSalt.text = '';
sub.csPassword.text = '';
sub.g1V1NewAddress = '';
sub.g1V1OldPubkey = '';
}
}

View File

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

View File

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

View File

@ -36,18 +36,13 @@ class RestoreChest extends StatelessWidget {
},
child: Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('restoreAChest'.tr()),
)),
appBar: AppBar(toolbarHeight: 60, title: Text('restoreAChest'.tr())),
body: SafeArea(
child: Stack(children: [
Column(children: <Widget>[
SizedBox(height: isTall ? 30 : 15),
const SizedBox(height: 25),
bubbleSpeak('toRestoreEnterMnemonic'.tr()),
SizedBox(height: isTall ? 30 : 15),
const SizedBox(height: 25),
Column(children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -82,7 +77,7 @@ class RestoreChest extends StatelessWidget {
child: Align(
alignment: Alignment.center,
child: SizedBox(
width: 410,
width: 370,
height: 70,
child: ElevatedButton(
key: keyGoNext,
@ -121,7 +116,7 @@ class RestoreChest extends StatelessWidget {
Column(children: [
const SizedBox(height: 20),
SizedBox(
width: 190,
width: 220,
height: 60,
child: ElevatedButton(
key: keyPastMnemonic,
@ -137,14 +132,14 @@ class RestoreChest extends StatelessWidget {
children: [
const Icon(
Icons.content_paste_go,
size: 27,
size: 30,
),
// const SizedBox(width: 10),
Text(
'pasteFromClipboard'.tr(),
textAlign: TextAlign.center,
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) {
return Bubble(
margin: const BubbleEdges.symmetric(horizontal: 20),
padding: BubbleEdges.all(isTall ? 25 : 15),
padding: const BubbleEdges.all(20),
borderWidth: 1,
borderColor: Colors.black,
radius: Radius.zero,
@ -171,7 +166,7 @@ class RestoreChest extends StatelessWidget {
key: keyBubbleSpeak,
textAlign: TextAlign.justify,
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);
return Container(
width: 102,
height: 40 * ratio,
width: 90,
height: 40,
// ),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
@ -213,7 +208,7 @@ class RestoreChest extends StatelessWidget {
}
},
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(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('myMnemonic'.tr()),
)),
appBar: AppBar(toolbarHeight: 60, title: Text('myMnemonic'.tr())),
body: SafeArea(
child: Column(children: <Widget>[
const Spacer(flex: 1),
@ -64,62 +59,67 @@ class ShowSeed extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(children: [
BuildText(text: 'keepYourMnemonicSecret'.tr()),
SizedBox(height: 35 * ratio),
BuildText(
text: 'keepYourMnemonicSecret'.tr(), size: 17),
const SizedBox(height: 35),
sentanceArray(context, seed.data!.split(' ')),
const SizedBox(height: 20),
SizedBox(
height: 40,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: Colors.black,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
Row(
children: [
SizedBox(
height: 40,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
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: () {
Clipboard.setData(
ClipboardData(text: seed.data!));
snackCopySeed(context);
},
child: Row(children: <Widget>[
Image.asset(
'assets/walletOptions/copy-white.png',
height: 25,
const SizedBox(width: 50),
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return PrintWallet(seed.data);
}),
);
},
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(
width: 380 * ratio,
height: 60 * ratio,
width: 370,
height: 60,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white, elevation: 4,
@ -130,8 +130,8 @@ class ShowSeed extends StatelessWidget {
},
child: Text(
'close'.tr(),
style: TextStyle(
fontSize: 23 * ratio, fontWeight: FontWeight.w600),
style: const TextStyle(
fontSize: 23, fontWeight: FontWeight.w600),
),
),
),
@ -141,61 +141,57 @@ class ShowSeed extends StatelessWidget {
}
Widget sentanceArray(BuildContext context, List mnemonic) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 3),
child: Container(
constraints: const BoxConstraints(maxWidth: 450),
decoration: BoxDecoration(
border: Border.all(color: Colors.black),
color: const Color(0xffeeeedd),
borderRadius: const BorderRadius.all(
Radius.circular(10),
)),
padding: const EdgeInsets.all(20),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Row(children: <Widget>[
arrayCell(mnemonic[0], 1),
arrayCell(mnemonic[1], 2),
arrayCell(mnemonic[2], 3),
arrayCell(mnemonic[3], 4),
]),
const SizedBox(height: 15),
Row(children: <Widget>[
arrayCell(mnemonic[4], 5),
arrayCell(mnemonic[5], 6),
arrayCell(mnemonic[6], 7),
arrayCell(mnemonic[7], 8),
]),
const SizedBox(height: 15),
Row(children: <Widget>[
arrayCell(mnemonic[8], 9),
arrayCell(mnemonic[9], 10),
arrayCell(mnemonic[10], 11),
arrayCell(mnemonic[11], 12),
]),
])),
);
return Container(
constraints: const BoxConstraints(maxWidth: 375),
decoration: BoxDecoration(
border: Border.all(color: Colors.black),
color: const Color(0xffeeeedd),
borderRadius: const BorderRadius.all(
Radius.circular(10),
)),
padding: const EdgeInsets.all(15),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Row(children: <Widget>[
arrayCell(mnemonic[0], 1),
arrayCell(mnemonic[1], 2),
arrayCell(mnemonic[2], 3),
arrayCell(mnemonic[3], 4),
]),
const SizedBox(height: 15),
Row(children: <Widget>[
arrayCell(mnemonic[4], 5),
arrayCell(mnemonic[5], 6),
arrayCell(mnemonic[6], 7),
arrayCell(mnemonic[7], 8),
]),
const SizedBox(height: 15),
Row(children: <Widget>[
arrayCell(mnemonic[8], 9),
arrayCell(mnemonic[9], 10),
arrayCell(mnemonic[10], 11),
arrayCell(mnemonic[11], 12),
]),
]));
}
Widget arrayCell(dataWord, int nbr) {
log.d(nbr);
return SizedBox(
width: 100,
width: 85,
child: Column(children: <Widget>[
Text(
nbr.toString(),
style:
TextStyle(fontSize: 13 * ratio, color: const Color(0xff6b6b52)),
style: const TextStyle(fontSize: 13, color: Color(0xff6b6b52)),
),
Text(
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,
foregroundColor: Colors.black,
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text(
'printMyMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
toolbarHeight: 60,
title: Text(
'printMyMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
),
body: PdfPreview(

View File

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

View File

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

View File

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

View File

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

View File

@ -15,13 +15,10 @@ class OnboardingStepOne extends StatelessWidget {
return Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text(
'newWallet'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
toolbarHeight: 60,
title: Text(
'newWallet'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
),
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/widgets/commons/fader_transition.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:provider/provider.dart';
@ -48,48 +49,22 @@ class OnboardingStepTen extends StatelessWidget {
child: Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text(
'myPassword'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
toolbarHeight: 60,
title: Text(
'myPassword'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
),
extendBodyBehindAppBar: true,
body: SafeArea(
child: Stack(children: [
Column(children: <Widget>[
SizedBox(height: isTall ? 40 : 20),
const SizedBox(height: 25),
const BuildProgressBar(pagePosition: 9),
SizedBox(height: isTall ? 40 : 20),
const SizedBox(height: 25),
BuildText(text: "geckoWillCheckPassword".tr()),
SizedBox(height: isTall ? 60 : 10),
Visibility(
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,
),
),
],
),
),
),
const SizedBox(height: 25),
const ScanDerivationsInfo(),
Consumer<MyWalletsProvider>(builder: (context, mw, _) {
return Visibility(
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, _) {
return sub.nodeConnected
? pinForm(context, walletOptions, pinLenght, 1, 2)
@ -195,7 +170,7 @@ class OnboardingStepTen extends StatelessWidget {
borderWidth: 4,
shape: PinCodeFieldShape.box,
borderRadius: BorderRadius.circular(5),
fieldHeight: 50 * ratio,
fieldHeight: 50,
fieldWidth: 50,
activeFillColor: Colors.black,
),

View File

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

View File

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

View File

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

View File

@ -40,47 +40,30 @@ class _ChooseChestState extends State<OnboardingStepFive> {
return Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text(
'yourMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
toolbarHeight: 60,
title: Text(
'yourMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
),
extendBodyBehindAppBar: true,
body: SafeArea(
child: Stack(children: [
Column(children: [
SizedBox(height: isTall ? 40 : 20),
const SizedBox(height: 25),
const BuildProgressBar(pagePosition: 4),
SizedBox(height: isTall ? 40 : 20),
BuildText(text: 'geckoGeneratedYourMnemonicKeepItSecret'.tr()),
SizedBox(height: 35 * ratio),
const SizedBox(height: 25),
BuildText(
text: 'geckoGeneratedYourMnemonicKeepItSecret'.tr(), size: 18),
const SizedBox(height: 15),
sentanceArray(context),
SizedBox(height: 17 * ratio),
const SizedBox(height: 17),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return PrintWallet(
generateWalletProvider.generatedMnemonic!);
}),
);
},
child: Image.asset(
'assets/printer.png',
height: 42 * ratio,
),
),
SizedBox(
height: 40,
width: 120,
width: 130,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
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(
child: Align(
alignment: Alignment.bottomCenter,
child: SizedBox(
width: 380 * ratio,
height: 60 * ratio,
width: 370,
height: 60,
child: ElevatedButton(
key: keyGenerateMnemonic,
style: ElevatedButton.styleFrom(
@ -129,17 +128,16 @@ class _ChooseChestState extends State<OnboardingStepFive> {
},
child: Text("chooseAnotherMnemonic".tr(),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 22 * ratio,
fontWeight: FontWeight.w600))),
style: const TextStyle(
fontSize: 22, fontWeight: FontWeight.w600))),
),
),
),
SizedBox(height: 22 * ratio),
const SizedBox(height: 22),
nextButton(
context, "iNotedMyMnemonic".tr(), false, widget.skipIntro),
const Spacer(),
// SizedBox(height: 35 * ratio),
// SizedBox(height: 35),
]),
const OfflineInfo(),
]),
@ -152,68 +150,65 @@ Widget sentanceArray(BuildContext context) {
final generateWalletProvider =
Provider.of<GenerateWalletsProvider>(context, listen: false);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 3),
child: Container(
constraints: const BoxConstraints(maxWidth: 450),
decoration: BoxDecoration(
border: Border.all(color: Colors.black),
color: const Color(0xffeeeedd),
borderRadius: const BorderRadius.all(
Radius.circular(10),
)),
padding: const EdgeInsets.all(20),
child: FutureBuilder(
future: generateWalletProvider.generateWordList(context),
builder: (BuildContext context, AsyncSnapshot<List> data) {
if (!data.hasData) {
return const Text('');
} else {
mnemoList = data;
return Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Row(children: <Widget>[
arrayCell(data.data![0]),
arrayCell(data.data![1]),
arrayCell(data.data![2]),
arrayCell(data.data![3]),
]),
const SizedBox(height: 15),
Row(children: <Widget>[
arrayCell(data.data![4]),
arrayCell(data.data![5]),
arrayCell(data.data![6]),
arrayCell(data.data![7]),
]),
const SizedBox(height: 15),
Row(children: <Widget>[
arrayCell(data.data![8]),
arrayCell(data.data![9]),
arrayCell(data.data![10]),
arrayCell(data.data![11]),
]),
]);
}
}),
),
return Container(
constraints: const BoxConstraints(maxWidth: 375),
decoration: BoxDecoration(
border: Border.all(color: Colors.black),
color: const Color(0xffeeeedd),
borderRadius: const BorderRadius.all(
Radius.circular(10),
)),
padding: const EdgeInsets.all(15),
child: FutureBuilder(
future: generateWalletProvider.generateWordList(context),
builder: (BuildContext context, AsyncSnapshot<List> data) {
if (!data.hasData) {
return const Text('');
} else {
mnemoList = data;
return Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Row(children: <Widget>[
arrayCell(data.data![0]),
arrayCell(data.data![1]),
arrayCell(data.data![2]),
arrayCell(data.data![3]),
]),
const SizedBox(height: 12),
Row(children: <Widget>[
arrayCell(data.data![4]),
arrayCell(data.data![5]),
arrayCell(data.data![6]),
arrayCell(data.data![7]),
]),
const SizedBox(height: 12),
Row(children: <Widget>[
arrayCell(data.data![8]),
arrayCell(data.data![9]),
arrayCell(data.data![10]),
arrayCell(data.data![11]),
]),
]);
}
}),
);
}
Widget arrayCell(dataWord) {
return SizedBox(
width: 100,
width: 85,
child: Column(children: <Widget>[
Text(
dataWord.split(':')[0],
style: TextStyle(fontSize: 13 * ratio, color: const Color(0xff6b6b52)),
style: const TextStyle(fontSize: 13, color: Color(0xff6b6b52)),
),
Text(
dataWord.split(':')[1],
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 =
Provider.of<MyWalletsProvider>(context, listen: false);
return SizedBox(
width: 380 * ratio,
height: 60 * ratio,
width: 370,
height: 60,
child: ElevatedButton(
key: keyGoNext,
style: ElevatedButton.styleFrom(
@ -251,7 +246,7 @@ Widget nextButton(
},
child: 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,
extendBodyBehindAppBar: true,
appBar: AppBar(
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text(
'yourMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
toolbarHeight: 60,
title: Text(
'yourMnemonic'.tr(),
style: const TextStyle(fontWeight: FontWeight.w600),
),
),
body: SafeArea(
@ -56,23 +53,23 @@ class OnboardingStepSix extends StatelessWidget {
Align(
alignment: Alignment.topCenter,
child: Column(children: [
SizedBox(height: isTall ? 40 : 20),
const SizedBox(height: 25),
const BuildProgressBar(pagePosition: 5),
SizedBox(height: isTall ? 40 : 20),
const SizedBox(height: 25),
BuildText(
text: "didYouNoteMnemonicToBeSureTypeWord".tr(args: [
(generateWalletProvider.nbrWord + 1).toString()
]),
size: 20,
size: 18,
isMd: true),
SizedBox(height: isTall ? 70 : 20),
const SizedBox(height: 40),
Text('${generateWalletProvider.nbrWord + 1}',
key: keyAskedWord,
style: TextStyle(
fontSize: isTall ? 17 : 15,
style: const TextStyle(
fontSize: 20,
color: orangeC,
fontWeight: FontWeight.w400)),
const SizedBox(height: 10),
fontWeight: FontWeight.w500)),
const SizedBox(height: 5),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(7),
@ -80,7 +77,7 @@ class OnboardingStepSix extends StatelessWidget {
color: Colors.grey[600]!,
width: 3,
)),
width: 430,
width: 350,
child: TextFormField(
key: keyInputWord,
autofocus: true,
@ -95,7 +92,7 @@ class OnboardingStepSix extends StatelessWidget {
textAlign: TextAlign.center,
decoration: InputDecoration(
labelStyle: TextStyle(
fontSize: 22.0,
fontSize: 19,
color: Colors.grey[500],
fontWeight: FontWeight.w500),
labelText: generateWalletProvider.isAskedWordValid
@ -103,10 +100,10 @@ class OnboardingStepSix extends StatelessWidget {
: "${generateWalletProvider.nbrWordAlpha} ${"nthMnemonicWord".tr()}",
fillColor: const Color(0xffeeeedd),
filled: true,
contentPadding: const EdgeInsets.all(12),
contentPadding: const EdgeInsets.all(10),
),
style: TextStyle(
fontSize: 40.0,
fontSize: 32,
color: generateWalletProvider.askedWordColor,
fontWeight: FontWeight.w500))),
Visibility(
@ -133,7 +130,7 @@ class OnboardingStepSix extends StatelessWidget {
// ),
// ),
// ),
SizedBox(height: 35 * ratio),
const SizedBox(height: 40),
]),
),
const OfflineInfo(),
@ -152,8 +149,8 @@ Widget nextButton(BuildContext context, String text, nextScreen, bool isFast) {
generateWalletProvider.askedWordColor = Colors.black;
return SizedBox(
width: 380 * ratio,
height: 60 * ratio,
width: 370,
height: 60,
child: ElevatedButton(
key: keyGoNext,
style: ElevatedButton.styleFrom(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -20,7 +20,7 @@ class SearchResultScreen extends StatelessWidget {
Provider.of<WalletsProfilesProvider>(context, listen: false);
final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false);
double avatarSize = 55;
double avatarSize = 45;
// List<G1WalletsList> myContacts = contactsBox.toMap().values.toList();
// myContacts = myContacts
// .where((map) =>
@ -33,11 +33,8 @@ class SearchResultScreen extends StatelessWidget {
backgroundColor: backgroundColor,
appBar: AppBar(
elevation: 1,
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('researchResults'.tr()),
),
toolbarHeight: 60,
title: Text('researchResults'.tr()),
),
bottomNavigationBar: const GeckoBottomAppBar(),
body: SafeArea(
@ -47,7 +44,7 @@ class SearchResultScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
const SizedBox(height: 30),
const SizedBox(height: 20),
Center(
child: Column(
children: <Widget>[
@ -73,12 +70,12 @@ class SearchResultScreen extends StatelessWidget {
// avatarSize: avatarSize,
// walletsProfilesClass: walletsProfilesClass,
// duniterIndexer: duniterIndexer),
const SizedBox(height: 40),
const SizedBox(height: 22),
Text(
'inBlockchainResult'.tr(args: [currencyName]),
style: const TextStyle(fontSize: 20),
style: const TextStyle(fontSize: 18),
),
const SizedBox(height: 20),
const SizedBox(height: 15),
SearchResult(
searchProvider: searchProvider,
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/substrate_sdk.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/widgets/commons/loading.dart';
import 'package:polkawallet_sdk/api/types/networkParams.dart';
import 'package:provider/provider.dart';
@ -18,61 +19,54 @@ class SettingsScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
const double buttonHigh = 50;
const double buttonWidth = 240;
const double fontSize = 16;
return Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
title: SizedBox(
height: 22,
child: Text('parameters'.tr()),
)),
appBar: AppBar(toolbarHeight: 60, title: Text('parameters'.tr())),
body: Column(children: <Widget>[
const SizedBox(height: 30),
Text(
'networkSettings'.tr(),
style: TextStyle(color: Colors.grey[500], fontSize: 22),
style: TextStyle(color: Colors.grey[500], fontSize: 20),
),
const SizedBox(height: 20),
duniterEndpointSelection(context),
const SizedBox(height: 30),
indexerEndpointSelection(context),
const SizedBox(height: 40),
const SizedBox(height: 35),
Text(
'displaySettings'.tr(),
style: TextStyle(color: Colors.grey[500], fontSize: 22),
style: TextStyle(color: Colors.grey[500], fontSize: 20),
),
const SizedBox(height: 20),
chooseCurrencyUnit(context),
// SizedBox(height: isTall ? 80 : 120),
const Spacer(),
SizedBox(
height: buttonHigh,
width: buttonWidth,
child: Center(
child: InkWell(
key: keyDeleteAllWallets,
onTap: () async {
log.i('Oublier tous mes coffres');
await _myWallets.deleteAllWallet(context);
},
child: Text(
'forgetAllMyChests'.tr(),
style: const TextStyle(
fontSize: fontSize + 4,
color: Color(0xffD80000),
fontWeight: FontWeight.w600,
Center(
child: InkWell(
key: keyDeleteAllWallets,
onTap: () async {
log.i('Oublier tous mes coffres');
await _myWallets.deleteAllWallet(context);
},
child: SizedBox(
height: 40,
width: 220,
child: Center(
child: Text(
'forgetAllMyChests'.tr(),
style: const TextStyle(
fontSize: 18,
color: Color(0xffD80000),
fontWeight: FontWeight.w600,
),
),
),
),
),
),
// 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);
return Expanded(
child: Row(children: [
const SizedBox(width: 10),
const SizedBox(width: 2),
SizedBox(
width: 80,
width: 60,
child: Text(
'currencyNode'.tr(args: ['']),
'currencyNode'.tr(),
),
),
const Spacer(),
Icon(sub.nodeConnected && !sub.isLoadingEndpoint
? Icons.check
: Icons.close),
SizedBox(
width: 30,
child: Icon(sub.nodeConnected && !sub.isLoadingEndpoint
? Icons.check
: Icons.close),
),
if (sub.nodeConnected && !sub.isLoadingEndpoint)
const Icon(Icons.add_card_sharp, size: 0.01),
const Spacer(),
SizedBox(
width: 280,
height: 52,
width: 240,
child: Consumer<SettingsProvider>(builder: (context, set, _) {
return DropdownButtonHideUnderline(
key: keySelectDuniterNodeDropDown,
@ -184,9 +182,9 @@ class SettingsScreen extends StatelessWidget {
);
}),
),
const Spacer(flex: 5),
const Spacer(flex: 3),
sub.isLoadingEndpoint
? const CircularProgressIndicator(color: orangeC)
? const Loading(size: 33, stroke: 2.5)
: Consumer<SettingsProvider>(builder: (context, set, _) {
return IconButton(
key: keyConnectToEndpoint,
@ -196,7 +194,7 @@ class SettingsScreen extends StatelessWidget {
sub.getConnectedEndpoint()
? orangeC
: Colors.grey[500],
size: 40,
size: 36,
),
onPressed: selectedDuniterEndpoint !=
sub.getConnectedEndpoint()
@ -297,9 +295,9 @@ class SettingsScreen extends StatelessWidget {
log.d(indexer.listIndexerEndpoints);
return Expanded(
child: Row(children: [
const SizedBox(width: 10),
const SizedBox(width: 5),
const SizedBox(
width: 80,
width: 65,
// child: Text('indexer'.tr()), // why translation does not work??
child: Text('Indexer'),
),
@ -307,7 +305,7 @@ class SettingsScreen extends StatelessWidget {
Icon(indexerEndpoint != '' ? Icons.check : Icons.close),
const Spacer(),
SizedBox(
width: 280,
width: 240,
child: Consumer<SettingsProvider>(builder: (context, set, _) {
return DropdownButtonHideUnderline(
child: DropdownButton(
@ -332,7 +330,7 @@ class SettingsScreen extends StatelessWidget {
),
const Spacer(flex: 5),
indexer.isLoadingIndexer
? const CircularProgressIndicator(color: orangeC)
? const Loading(size: 33, stroke: 2.5)
: Consumer<SettingsProvider>(builder: (context, set, _) {
return IconButton(
icon: Icon(
@ -340,7 +338,7 @@ class SettingsScreen extends StatelessWidget {
color: selectedIndexerEndpoint != indexerEndpoint
? orangeC
: Colors.grey[500],
size: 40,
size: 36,
),
onPressed: selectedIndexerEndpoint != indexerEndpoint
? () async {

View File

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

View File

@ -27,8 +27,7 @@ class TransactionInProgress extends StatelessWidget {
Provider.of<WalletsProfilesProvider>(context, listen: false);
final myWalletProvider =
Provider.of<MyWalletsProvider>(context, listen: false);
bool isValid = false;
bool isLoading = false;
var txStatus = TransactionStatus.none;
final result = sub.transactionStatus;
final from = fromAddress ??
@ -54,7 +53,7 @@ class TransactionInProgress extends StatelessWidget {
String resultText = '';
final Map<String, String> resultMap = {
'': 'sending'.tr(),
'sending': 'sending'.tr(),
'Ready': 'propagating'.tr(),
'Broadcast': 'validating'.tr(),
'cert.NotRespectCertPeriod': '24hbetweenCerts'.tr(),
@ -68,18 +67,21 @@ class TransactionInProgress extends StatelessWidget {
'Exception: timeout': 'execTimeoutOver'.tr(),
};
if (result.contains('blockHash: ')) {
isValid = true;
if (result == null) {
txStatus = TransactionStatus.none;
} else if (result.contains('blockHash: ')) {
txStatus = TransactionStatus.success;
resultText = 'extrinsicValidated'
.tr(args: [actionMap[transType] ?? 'strangeTransaction'.tr()]);
log.i('Bloc of last transaction: ${sub.blocNumber} --- $result');
} else if (result.contains('Exception: ')) {
txStatus = TransactionStatus.failed;
resultText = "${"anErrorOccurred".tr()}:\n";
final String exception = result.split('Exception: ')[1];
resultText = resultMap[exception] ?? "$resultText\n$exception";
log.d('Error: $exception');
} else {
isLoading = true;
txStatus = TransactionStatus.loading;
resultText = resultMap[result] ?? 'unknown status...';
}
@ -87,24 +89,21 @@ class TransactionInProgress extends StatelessWidget {
return PopScope(
onPopInvoked: (_) {
sub.transactionStatus = '';
sub.transactionStatus = null;
},
child: Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
toolbarHeight: 60 * ratio,
toolbarHeight: 60,
elevation: 0,
automaticallyImplyLeading: false,
title: SizedBox(
height: 22,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('extrinsicInProgress'.tr(args: [
actionMap[transType] ?? 'strangeTransaction'.tr()
]))
]),
)),
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('extrinsicInProgress'.tr(args: [
actionMap[transType] ?? 'strangeTransaction'.tr()
]))
])),
body: SafeArea(
child: Align(
alignment: FractionalOffset.bottomCenter,
@ -143,17 +142,24 @@ class TransactionInProgress extends StatelessWidget {
style: const TextStyle(
fontSize: 18, fontWeight: FontWeight.w600),
),
const SizedBox(height: 10),
Text(
'toMinus'.tr(),
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 18),
),
Text(
toUsername ?? to,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 18, fontWeight: FontWeight.w600),
Visibility(
visible: from != to,
child: Column(
children: [
const SizedBox(height: 10),
Text(
'toMinus'.tr(),
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 18),
),
Text(
toUsername ?? to,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 18, fontWeight: FontWeight.w600),
),
],
),
),
const SizedBox(height: 20),
]),
@ -162,7 +168,7 @@ class TransactionInProgress extends StatelessWidget {
const Spacer(),
Column(children: [
Visibility(
visible: isLoading,
visible: txStatus == TransactionStatus.loading,
child: const SizedBox(
height: 18,
width: 18,
@ -173,18 +179,29 @@ class TransactionInProgress extends StatelessWidget {
),
),
Visibility(
visible: !isLoading,
child: Icon(
isValid ? Icons.done_all : Icons.close,
visible: txStatus == TransactionStatus.success,
child: const Icon(
Icons.done_all,
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),
Text(
resultText,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 19 * ratio),
Visibility(
visible: txStatus != TransactionStatus.none,
child: Text(
resultText,
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 19),
),
),
]),
const Spacer(),
@ -192,8 +209,8 @@ class TransactionInProgress extends StatelessWidget {
child: Align(
alignment: Alignment.bottomCenter,
child: SizedBox(
width: 380 * ratio,
height: 60 * ratio,
width: 300,
height: 55,
child: ElevatedButton(
key: keyCloseTransactionScreen,
style: ElevatedButton.styleFrom(
@ -201,23 +218,24 @@ class TransactionInProgress extends StatelessWidget {
backgroundColor: orangeC, // foreground
),
onPressed: () {
sub.transactionStatus = '';
sub.transactionStatus = null;
Navigator.pop(context);
},
child: Text(
'close'.tr(),
style: TextStyle(
fontSize: 23 * ratio,
fontWeight: FontWeight.w600),
style: const TextStyle(
fontSize: 23, 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, prefer_const_constructors
// ignore_for_file: use_build_context_synchronously
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/services.dart';
@ -7,7 +6,6 @@ import 'package:gecko/globals.dart';
import 'package:flutter/material.dart';
import 'package:gecko/models/g1_wallets_list.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/substrate_sdk.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:qr_flutter/qr_flutter.dart';
const double buttonSize = 85;
const double buttonFontSize = 16;
class WalletViewScreen extends StatelessWidget {
const WalletViewScreen(
{required this.address, required this.username, this.avatar, Key? key})
{required this.address, required this.username, Key? key})
: super(key: key);
final String address;
final String? username;
final Image? avatar;
final double buttonSize = 100;
final double buttonFontSize = 18;
@override
Widget build(BuildContext context) {
@ -55,7 +53,7 @@ class WalletViewScreen extends StatelessWidget {
resizeToAvoidBottomInset: true,
appBar: AppBar(
elevation: 0,
toolbarHeight: 60 * ratio,
toolbarHeight: 60,
actions: [
Row(
children: [
@ -100,22 +98,18 @@ class WalletViewScreen extends StatelessWidget {
],
)
],
title: SizedBox(
height: 22,
child: Text(duniterIndexer
.walletNameIndexer[walletProfile.address] ==
null
? 'seeAWallet'.tr()
: 'memberAccountOf'.tr(args: [
duniterIndexer.walletNameIndexer[walletProfile.address] ??
'?'
]))),
title: Text(duniterIndexer.walletNameIndexer[walletProfile.address] ==
null
? 'seeAWallet'.tr()
: 'memberAccountOf'.tr(args: [
duniterIndexer.walletNameIndexer[walletProfile.address] ?? '?'
])),
),
bottomNavigationBar: const GeckoBottomAppBar(),
body: SafeArea(
child: Column(children: <Widget>[
HeaderProfile(address: address, username: username),
SizedBox(height: isTall ? 30 : 15),
const SizedBox(height: 25),
Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
Column(children: <Widget>[
SizedBox(
@ -127,18 +121,17 @@ class WalletViewScreen extends StatelessWidget {
key: keyViewActivity,
splashColor: orangeC, // inkwell color
child: const Padding(
padding: EdgeInsets.all(13),
child: Image(
image: AssetImage(
'assets/walletOptions/clock.png'),
height: 90)),
padding: EdgeInsets.all(11),
child: Image(
image:
AssetImage('assets/walletOptions/clock.png'),
),
),
onTap: () {
Navigator.push(
context,
PageNoTransit(builder: (context) {
return ActivityScreen(
address: address,
avatar: defaultAvatar(50));
return ActivityScreen(address: address);
}),
);
}),
@ -149,7 +142,7 @@ class WalletViewScreen extends StatelessWidget {
Text(
"displayNActivity".tr(),
textAlign: TextAlign.center,
style: TextStyle(
style: const TextStyle(
fontSize: buttonFontSize, fontWeight: FontWeight.w500),
),
]),
@ -277,7 +270,7 @@ class WalletViewScreen extends StatelessWidget {
? "certify".tr()
: "createIdentity".tr(),
textAlign: TextAlign.center,
style: TextStyle(
style: const TextStyle(
fontSize: buttonFontSize,
fontWeight: FontWeight.w500),
),
@ -304,10 +297,11 @@ class WalletViewScreen extends StatelessWidget {
key: keyCopyAddress,
splashColor: orangeC,
child: const Padding(
padding: EdgeInsets.all(20),
child: Image(
image: AssetImage('assets/copy_key.png'),
height: 90)),
padding: EdgeInsets.all(17),
child: Image(
image: AssetImage('assets/copy_key.png'),
),
),
onTap: () {
Clipboard.setData(ClipboardData(text: address));
snackCopyKey(context);
@ -319,7 +313,7 @@ class WalletViewScreen extends StatelessWidget {
Text(
"copyAddress".tr(),
textAlign: TextAlign.center,
style: TextStyle(
style: const TextStyle(
fontSize: buttonFontSize, fontWeight: FontWeight.w500),
),
]),
@ -365,7 +359,7 @@ class WalletViewScreen extends StatelessWidget {
}
: null,
child: const Padding(
padding: EdgeInsets.all(14),
padding: EdgeInsets.all(10),
child: Image(
image: AssetImage('assets/vector_white.png')),
)),
@ -385,7 +379,7 @@ class WalletViewScreen extends StatelessWidget {
fontWeight: FontWeight.w500),
);
}),
SizedBox(height: isTall ? 50 : 20)
const SizedBox(height: 50)
]),
));
}
@ -394,17 +388,14 @@ class WalletViewScreen extends StatelessWidget {
return Column(children: <Widget>[
SizedBox(
height: buttonSize,
child: Padding(
padding: const EdgeInsets.only(bottom: 0),
child: Container(
foregroundDecoration: const BoxDecoration(
color: Colors.grey,
backgroundBlendMode: BlendMode.saturation,
),
child: const Opacity(
opacity: 0.5,
child: Image(image: AssetImage('assets/gecko_certify.png')),
),
child: Container(
foregroundDecoration: const BoxDecoration(
color: Colors.grey,
backgroundBlendMode: BlendMode.saturation,
),
child: const Opacity(
opacity: 0.5,
child: Image(image: AssetImage('assets/gecko_certify.png')),
),
),
),

View File

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

View File

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

View File

@ -18,7 +18,7 @@ class BubbleSpeak extends StatelessWidget {
Widget build(BuildContext context) {
return Bubble(
padding: long == null
? const BubbleEdges.all(20)
? const BubbleEdges.all(18)
: BubbleEdges.symmetric(horizontal: long, vertical: 30),
elevation: 5,
color: backgroundColor,
@ -26,7 +26,7 @@ class BubbleSpeak extends StatelessWidget {
text,
key: textKey,
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 =
'${'wallet'.tr()} ${myWalletProvider.listWallets.last.number! + 2}';
return Padding(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.all(12),
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(12)),
child: Column(children: <Widget>[
@ -56,17 +56,17 @@ class AddNewDerivationButton extends StatelessWidget {
child: Center(
child: myWalletProvider.isNewDerivationLoading
? const SizedBox(
height: 60,
width: 60,
height: 50,
width: 50,
child: CircularProgressIndicator(
color: orangeC,
strokeWidth: 7,
strokeWidth: 6,
),
)
: const Text(
'+',
style: TextStyle(
fontSize: 150,
fontSize: 120,
fontWeight: FontWeight.w700,
color: Color(0xFFFCB437)),
)),

View File

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

View File

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

View File

@ -16,7 +16,7 @@ class CertTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
int keyID = 0;
const double avatarSize = 200;
const double avatarSize = 50;
return Column(
children: listCerts.map((repository) {
@ -25,15 +25,17 @@ class CertTile extends StatelessWidget {
padding: const EdgeInsets.only(right: 0),
child: ListTile(
key: keyTransaction(keyID++),
contentPadding: const EdgeInsets.only(
left: 20, right: 30, top: 15, bottom: 15),
contentPadding:
const EdgeInsets.only(left: 10, right: 0, top: 7, bottom: 7),
leading: ClipOval(
child: defaultAvatar(avatarSize),
),
title: Padding(
padding: const EdgeInsets.only(bottom: 5),
child: Text(repository['name'],
style: const TextStyle(fontSize: 22)),
padding: const EdgeInsets.only(bottom: 2),
child: Text(
repository['name'],
style: const TextStyle(fontSize: 18),
),
),
subtitle: RichText(
text: TextSpan(
@ -44,12 +46,13 @@ class CertTile extends StatelessWidget {
children: <TextSpan>[
TextSpan(
text: repository['date'],
style: const TextStyle(fontSize: 16),
),
if (repository[2] != '')
TextSpan(
text: ' · ',
style: TextStyle(
fontSize: 20,
fontSize: 19,
color: Colors.grey[550],
),
),
@ -57,8 +60,9 @@ class CertTile extends StatelessWidget {
text: getShortPubkey(repository['address']),
style: TextStyle(
fontStyle: FontStyle.italic,
fontFamily: 'Monospace',
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:graphql_flutter/graphql_flutter.dart';
class CertsSent extends StatelessWidget {
const CertsSent({Key? key, required this.address}) : super(key: key);
class CertsList extends StatelessWidget {
const CertsList(
{Key? key,
required this.address,
this.direction = CertDirection.received})
: super(key: key);
final String address;
final CertDirection direction;
@override
Widget build(BuildContext context) {
@ -21,6 +26,17 @@ class CertsSent extends StatelessWidget {
'$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(
GraphQLClient(
cache: GraphQLCache(store: HiveStore()),
@ -31,7 +47,7 @@ class CertsSent extends StatelessWidget {
client: client,
child: Query(
options: QueryOptions(
document: gql(getCertsSent),
document: gql(gertCertsReq),
variables: <String, dynamic>{
'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
return SizedBox(
height: windowHeight,
child: ListView(
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:gecko/globals.dart';
class BuildImage extends StatelessWidget {
const BuildImage({
@ -17,8 +16,8 @@ class BuildImage extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(0),
width: 440,
height: isTall ? boxHeight : boxHeight * 0.9,
width: imageWidth,
height: boxHeight,
decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.topLeft,
@ -29,6 +28,6 @@ class BuildImage extends StatelessWidget {
],
),
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,
position: pagePosition,
decorator: DotsDecorator(
size: const Size.square(7),
activeSize: const Size.square(10),
spacing: const EdgeInsets.symmetric(horizontal: 10),
color: Colors.grey[300]!, // Inactive color
color: Colors.grey[400]!,
activeColor: orangeC,
),
);

View File

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

View File

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

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

View File

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

View File

@ -31,15 +31,16 @@ class DragWalletsInfo extends StatelessWidget {
return Container(
color: yellowC,
width: screenWidth,
height: 80,
height: 90,
child: Center(
child: Column(
children: [
const SizedBox(height: 2),
Text('${'executeATransfer'.tr()}:'),
MarkdownBody(data: '${'from'.tr()} **$fromName**'),
MarkdownBody(data: '${'from'.tr(args: [''])} **$fromName**'),
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
Widget build(BuildContext context) {
return Drawer(
child: Column(
children: <Widget>[
Expanded(
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
const DrawerHeader(
decoration: BoxDecoration(
color: orangeC,
const listStyle = TextStyle(fontSize: 16);
return SizedBox(
width: MediaQuery.of(context).size.width * 0.67,
child: Drawer(
child: Column(
children: <Widget>[
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>[
SizedBox(height: 0),
Image(
image: AssetImage('assets/icon/gecko_final.png'),
height: 130),
]),
),
ListTile(
key: keyParameters,
title: Text('parameters'.tr()),
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return SettingsScreen();
const SizedBox(height: 10),
Opacity(
opacity: 0.8,
child: ListTile(
key: keyParameters,
leading: const Icon(Icons.settings),
title: Text(
'parameters'.tr(),
style: listStyle,
),
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
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)
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)
],
const SizedBox(height: 15)
],
),
),
);
}

View File

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

View File

@ -24,7 +24,7 @@ class HistoryView extends StatelessWidget {
final sub = Provider.of<SubstrateSdk>(homeContext, listen: false);
int keyID = 0;
const double avatarSize = 200;
const double avatarSize = 50;
bool isMigrationPassed = false;
List<String> pastDelimiters = [];
@ -51,21 +51,19 @@ class HistoryView extends StatelessWidget {
return Column(children: <Widget>[
if (isMigrationTime)
Padding(
padding: const EdgeInsets.symmetric(vertical: 30),
padding: const EdgeInsets.symmetric(vertical: 25),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
const Image(
image: AssetImage('assets/party.png'), height: 40),
const SizedBox(width: 40),
Text(
'blockchainStart'.tr(),
style: const TextStyle(
fontSize: 25,
fontSize: 23,
color: Colors.blueAccent,
fontWeight: FontWeight.w500),
),
const SizedBox(width: 40),
const Image(
image: AssetImage('assets/party.png'), height: 40),
],
@ -76,7 +74,7 @@ class HistoryView extends StatelessWidget {
!(pastDelimiters[pastDelimiters.length - 2] ==
answer['dateDelimiter']))
Padding(
padding: const EdgeInsets.symmetric(vertical: 30),
padding: const EdgeInsets.symmetric(vertical: 20),
child: Text(
answer['dateDelimiter'],
style: const TextStyle(
@ -117,30 +115,29 @@ class HistoryView extends StatelessWidget {
}),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
const Icon(
Icon(
Icons.account_circle,
size: 40,
color: Colors.blueAccent,
color: Colors.green[700],
),
const SizedBox(width: 40),
Column(children: [
Text(
'Identité migré:'.tr(),
style: const TextStyle(
fontSize: 25,
color: Colors.blueAccent,
style: TextStyle(
fontSize: 23,
color: Colors.green[700],
fontWeight: FontWeight.w500),
),
Text(
'Ancienne adresse: ${getShortPubkey(sub.oldOwnerKeys[address]![0])}')
Text('from'.tr(args: [
' ${getShortPubkey(sub.oldOwnerKeys[address]![0])}'
])),
]),
const SizedBox(width: 40),
const Icon(
Icon(
Icons.account_circle,
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(
padding: const EdgeInsets.only(
top: 24, bottom: 0, left: 24, right: 24),
top: 15, bottom: 0, left: 17, right: 17),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@ -128,11 +128,11 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
Text(
'executeATransfer'.tr(),
style: const TextStyle(
fontSize: 26, fontWeight: FontWeight.w700),
fontSize: 24, fontWeight: FontWeight.w700),
),
IconButton(
key: keyPopButton,
iconSize: 40,
iconSize: 35,
icon: const Icon(Icons.cancel_outlined),
onPressed: () {
Navigator.pop(context);
@ -141,7 +141,7 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
]),
const SizedBox(height: 5),
Text(
'from'.tr(),
'from'.tr(args: ['']),
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w500,
@ -149,31 +149,62 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
),
const SizedBox(height: 5),
Consumer<SubstrateSdk>(builder: (context, sub, _) {
return DropdownButton(
dropdownColor: const Color(0xffffeed1),
elevation: 12,
key: keyDropdownWallets,
value: defaultWallet,
menuMaxHeight: 300,
onTap: () {
FocusScope.of(context).requestFocus(amountFocus);
},
selectedItemBuilder: (_) {
return myWalletProvider.listWallets
return Container(
decoration: BoxDecoration(
border: Border.all(
color: Colors.blueAccent.shade200, width: 2),
borderRadius:
const BorderRadius.all(Radius.circular(10.0)),
),
padding: const EdgeInsets.all(0),
child: DropdownButton(
dropdownColor: const Color(0xffffeed1),
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) {
return Container(
width: 408,
decoration: BoxDecoration(
border: Border.all(
color: Colors.blueAccent.shade200,
width: 2),
borderRadius: const BorderRadius.all(
Radius.circular(10.0)),
),
padding: const EdgeInsets.all(7),
child: Visibility(
visible:
wallet.address == defaultWallet.address,
return DropdownMenuItem(
value: wallet,
key: keySelectThisWallet(wallet.address),
child: Container(
color: const Color(0xffffeed1),
width: 332,
height: 80,
padding: const EdgeInsets.all(7),
child: Row(children: [
NameByAddress(
wallet: wallet,
@ -184,58 +215,26 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
]),
),
);
}).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());
}).toList()),
);
}),
const SizedBox(height: 12),
Row(
children: [
Text(
'to'.tr(),
'to'.tr(args: ['']),
style: TextStyle(
fontSize: 19,
fontWeight: FontWeight.w500,
color: Colors.grey[600]),
),
const SizedBox(width: 10),
Column(
children: [
const SizedBox(height: 2),
Text(
username ?? getShortPubkey(toAddress),
style: const TextStyle(
fontSize: 21,
fontWeight: FontWeight.w600,
),
),
],
Text(
username ?? getShortPubkey(toAddress),
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),
borderRadius: BorderRadius.circular(8),
),
contentPadding: const EdgeInsets.all(15),
contentPadding: const EdgeInsets.all(10),
),
style: const TextStyle(
fontSize: 33,
fontSize: 30,
color: Colors.black,
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/models/queries_indexer.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/search.dart';
import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/screens/wallet_view.dart';
import 'package:gecko/widgets/balance.dart';
import 'package:gecko/widgets/cesium_avatar.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:provider/provider.dart';
@ -80,58 +80,54 @@ class SearchIdentityQuery extends StatelessWidget {
return Expanded(
child: ListView(children: <Widget>[
for (Map profile in identities)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 5),
child: ListTile(
key: keySearchResult(profile['pubkey']),
horizontalTitleGap: 40,
contentPadding: const EdgeInsets.all(5),
leading: defaultAvatar(avatarSize),
title: Row(children: <Widget>[
Text(getShortPubkey(profile['pubkey']),
style: const TextStyle(
fontSize: 18,
fontFamily: 'Monospace',
fontWeight: FontWeight.w500),
textAlign: TextAlign.center),
]),
trailing: SizedBox(
width: 110,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Balance(
address: profile['pubkey'], size: 16),
]),
]),
),
subtitle: Row(children: <Widget>[
Text(profile['name'] ?? '',
style: const TextStyle(
fontSize: 18, fontWeight: FontWeight.w500),
textAlign: TextAlign.center),
]),
dense: false,
isThreeLine: false,
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
walletsProfiles.address = profile['pubkey'];
return WalletViewScreen(
address: profile['pubkey'],
username: profile['name'],
avatar:
g1WalletsBox.get(profile['pubkey'])?.avatar,
);
}),
);
}),
),
ListTile(
key: keySearchResult(profile['pubkey']),
horizontalTitleGap: 10,
contentPadding: const EdgeInsets.only(right: 2),
leading: CesiumAvatar(
address: profile['pubkey'], size: avatarSize),
title: Row(children: <Widget>[
Text(getShortPubkey(profile['pubkey']),
style: const TextStyle(
fontSize: 18,
fontFamily: 'Monospace',
fontWeight: FontWeight.w500),
textAlign: TextAlign.center),
]),
trailing: SizedBox(
width: 120,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Balance(
address: profile['pubkey'], size: 16),
]),
]),
),
subtitle: Row(children: <Widget>[
Text(profile['name'] ?? '',
style: const TextStyle(
fontSize: 18, fontWeight: FontWeight.w500),
textAlign: TextAlign.center),
]),
dense: false,
isThreeLine: false,
onTap: () {
Navigator.pop(context);
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
walletsProfiles.address = profile['pubkey'];
return WalletViewScreen(
address: profile['pubkey'],
username: profile['name'],
);
}),
);
}),
]),
);
}),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -298,7 +298,7 @@ packages:
source: hosted
version: "0.3.3+7"
crypto:
dependency: transitive
dependency: "direct main"
description:
name: crypto
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
@ -711,6 +711,14 @@ packages:
url: "https://pub.dev"
source: hosted
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:
dependency: transitive
description:
@ -1192,8 +1200,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: gecko-fixes-3
resolved-ref: ac7347e907ca30766eedb9e15583ebc20916d56c
ref: "8b254d9e98cb367b4a57d67f8c6f5bbe89a52552"
resolved-ref: "8b254d9e98cb367b4a57d67f8c6f5bbe89a52552"
url: "https://github.com/poka-IT/sdk.git"
source: git
version: "0.5.4+4"
@ -1290,10 +1298,10 @@ packages:
dependency: "direct main"
description:
name: responsive_framework
sha256: e083346029b008335b008274c4d3fac5b9e0ca8796f201ed20884f579101d584
sha256: "23aa7be5d5136922df708f6ddccb5ec4e0eb8bc576c3f105f5093f31d6b68e50"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "1.1.1"
rxdart:
dependency: transitive
description:
@ -1411,6 +1419,22 @@ packages:
description: flutter
source: sdk
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:
dependency: transitive
description:

View File

@ -5,7 +5,7 @@ description: Pay with G1.
# 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
version: 0.1.2+59
version: 0.1.3+60
environment:
sdk: ">=2.12.0 <3.0.0"
@ -31,7 +31,7 @@ dependencies:
git:
url: https://github.com/insinfo/qr.flutter.git
ref: master
responsive_framework: 0.2.0
responsive_framework: ^1.1.1
sentry_flutter: ^7.4.1
truncate: ^3.0.1
unorm_dart: ^0.3.0
@ -43,8 +43,8 @@ dependencies:
# url: https://github.com/polkawallet-io/sdk.git
# ref: develop
url: https://github.com/poka-IT/sdk.git
ref: gecko-fixes-3
# ref: ff98a117e86060a91113107f31355a17ccfb346c
# ref: gecko-fixes-3
ref: 8b254d9e98cb367b4a57d67f8c6f5bbe89a52552
dots_indicator: ^3.0.0
connectivity_plus: ^3.0.2
image_cropper: ^4.0.1
@ -59,12 +59,14 @@ dependencies:
tutorial_coach_mark: ^1.2.8
confetti: ^0.7.0
url_launcher: ^6.1.11
crypto: ^3.0.3
dev_dependencies:
# flutter_launcher_icons: ^0.9.2
# flutter_launcher_icons_maker: ^^0.10.2
icons_launcher: ^2.0.6
build_runner: ^2.1.2
hive_generator: ^2.0.1
flutter_lints: ^3.0.1
flutter_test:
sdk: flutter

View File

@ -1,5 +1,7 @@
#!/bin/bash
set -e
fVersion=$(grep "version: " pubspec.yaml | awk '{ print $2 }')
withPush=$1
@ -19,7 +21,8 @@ echo "Nom du build final: ${APPNAME}-${VERSION}+${BUILD}.apk"
flutter clean
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
# 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