UI: upgrade responsive_framework with breaking sizes
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 16 KiB |
|
@ -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,7 +171,7 @@
|
|||
"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",
|
||||
|
@ -182,7 +182,7 @@
|
|||
"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",
|
||||
|
|
|
@ -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,7 +172,7 @@
|
|||
"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",
|
||||
|
@ -183,7 +183,7 @@
|
|||
"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",
|
||||
|
|
|
@ -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,7 +171,7 @@
|
|||
"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",
|
||||
|
@ -182,7 +182,7 @@
|
|||
"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é",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
extensions:
|
|
@ -11,7 +11,6 @@ import 'tests_utility.dart';
|
|||
|
||||
Future changeNode() async {
|
||||
const ipAddress = '10.0.2.2';
|
||||
log.d('ip address: $ipAddress');
|
||||
|
||||
await tapKey(keyDrawerMenu);
|
||||
await tapKey(keyParameters);
|
||||
|
|
|
@ -11,9 +11,7 @@ import 'package:provider/provider.dart';
|
|||
import 'dart:io' as io;
|
||||
import 'package:gecko/main.dart' as app;
|
||||
|
||||
const bool isHumanReading = false;
|
||||
// final bool isHumanReading =
|
||||
// dotenv.env['isHumanReading'] == 'true' ? true : false;
|
||||
const isHumanReading = false;
|
||||
Timeout testTimeout([int seconds = 120]) =>
|
||||
Timeout(Duration(seconds: isHumanReading ? 600 : seconds));
|
||||
final sub = Provider.of<SubstrateSdk>(homeContext, listen: false);
|
||||
|
@ -57,7 +55,7 @@ Future pump(
|
|||
{Duration duration = const Duration(milliseconds: 300),
|
||||
int number = 1}) async {
|
||||
for (int i = 0; i < number; i++) {
|
||||
log.d("pump $i");
|
||||
log.i("pump $i");
|
||||
await tester.pump(duration = duration);
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +76,7 @@ Future tapKey(Key buttonKey,
|
|||
await tester.pumpAndSettle(Duration(milliseconds: duration));
|
||||
}
|
||||
final Finder finder = customFinder ?? find.byKey(buttonKey);
|
||||
log.d('INTEGRATION TEST: Tap on ${finder.describeMatch(Plurality.zero)}}');
|
||||
log.i('INTEGRATION TEST: Tap on ${finder.describeMatch(Plurality.zero)}}');
|
||||
await tester.tap(selectLast ? finder.last : finder);
|
||||
humanRead();
|
||||
}
|
||||
|
@ -106,7 +104,7 @@ Future<void> waitForButtonEnabled(Key key,
|
|||
bool reverse = false}) async {
|
||||
final end = DateTime.now().add(timeout);
|
||||
|
||||
log.d('INTEGRATION TEST: Wait for $key to be enabled');
|
||||
log.i('INTEGRATION TEST: Wait for $key to be enabled');
|
||||
|
||||
do {
|
||||
if (DateTime.now().isAfter(end)) {
|
||||
|
@ -121,7 +119,7 @@ Future<void> waitForButtonEnabled(Key key,
|
|||
|
||||
Future goBack() async {
|
||||
final NavigatorState navigator = tester.state(find.byType(Navigator));
|
||||
log.d('INTEGRATION TEST: Go back');
|
||||
log.i('INTEGRATION TEST: Go back');
|
||||
navigator.pop();
|
||||
await tester.pumpAndSettle();
|
||||
humanRead();
|
||||
|
@ -131,7 +129,7 @@ Future enterText(Key fieldKey, String textIn, [int duration = 200]) async {
|
|||
if (duration != 0) {
|
||||
await tester.pumpAndSettle(Duration(milliseconds: duration));
|
||||
}
|
||||
log.d('INTEGRATION TEST: Enter text: $textIn');
|
||||
log.i('INTEGRATION TEST: Enter text: $textIn');
|
||||
await tester.enterText(find.byKey(fieldKey), textIn);
|
||||
humanRead();
|
||||
}
|
||||
|
@ -145,7 +143,7 @@ Future<void> waitFor(String text,
|
|||
final end = DateTime.now().add(timeout);
|
||||
|
||||
Finder finder = exactMatch ? find.text(text) : find.textContaining(text);
|
||||
log.d('INTEGRATION TEST: Wait for: $text');
|
||||
log.i('INTEGRATION TEST: Wait for: $text');
|
||||
|
||||
final searchType = reverse ? 'reversed text' : 'text';
|
||||
|
||||
|
@ -182,7 +180,7 @@ Future<bool> isIconPresent(IconData icon,
|
|||
await tester.pumpAndSettle();
|
||||
final finder = find.byIcon(icon);
|
||||
humanRead();
|
||||
return finder.evaluate().isEmpty ? false : true;
|
||||
return finder.evaluate().isNotEmpty;
|
||||
}
|
||||
|
||||
Future spawnBlock({int number = 1, int duration = 200, int? until}) async {
|
||||
|
|
|
@ -22,15 +22,12 @@ late Box<G1WalletsList> g1WalletsBox;
|
|||
late Box<G1WalletsList> contactsBox;
|
||||
// late Box keystoreBox;
|
||||
late Directory imageDirectory;
|
||||
late bool isTall;
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -139,17 +139,14 @@ class Gecko extends StatelessWidget {
|
|||
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(
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
|
||||
double scaleSize(double size) {
|
||||
final scale = MediaQuery.of(homeContext).size.width / 375;
|
||||
return size * scale;
|
||||
}
|
||||
|
||||
TextStyle scaledTextStyle({
|
||||
double fontSize = 16,
|
||||
double? height,
|
||||
FontStyle? fontStyle,
|
||||
FontWeight? fontWeight,
|
||||
Color? color,
|
||||
List<Shadow>? shadows,
|
||||
String? fontFamily,
|
||||
double? letterSpacing,
|
||||
}) {
|
||||
return TextStyle(
|
||||
fontSize: scaleSize(fontSize),
|
||||
height: height,
|
||||
fontWeight: fontWeight,
|
||||
fontStyle: fontStyle,
|
||||
color: color,
|
||||
shadows: shadows,
|
||||
fontFamily: fontFamily,
|
||||
letterSpacing: letterSpacing,
|
||||
);
|
||||
}
|
||||
|
||||
class ScaledSizedBox extends SizedBox {
|
||||
ScaledSizedBox({
|
||||
Key? key,
|
||||
double? width,
|
||||
double? height,
|
||||
Widget? child,
|
||||
}) : super(
|
||||
key: key,
|
||||
width: width != null ? scaleSize(width) : null,
|
||||
height: height != null ? scaleSize(height) : null,
|
||||
child: child,
|
||||
);
|
||||
}
|
|
@ -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');
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:dio/dio.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -194,8 +195,6 @@ class CesiumPlusProvider with ChangeNotifier {
|
|||
|
||||
List queryOptions =
|
||||
await _buildQuerySetAvatar(pubkeyV1, address, avatarString);
|
||||
log.d(queryOptions[0]);
|
||||
log.d(jsonDecode(queryOptions[1]));
|
||||
|
||||
late Response response;
|
||||
try {
|
||||
|
@ -211,7 +210,6 @@ class CesiumPlusProvider with ChangeNotifier {
|
|||
.timeout(
|
||||
const Duration(seconds: 15),
|
||||
);
|
||||
log.d(response.data);
|
||||
return response.statusCode == 200;
|
||||
} catch (e) {
|
||||
log.e(e);
|
||||
|
@ -260,4 +258,4 @@ class CesiumPlusProvider with ChangeNotifier {
|
|||
}
|
||||
|
||||
Image defaultAvatar(double size) =>
|
||||
Image.asset(('assets/icon_user.png'), height: size);
|
||||
Image.asset(('assets/icon_user.png'), height: scaleSize(size));
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -42,7 +43,6 @@ class ChestProvider with ChangeNotifier {
|
|||
|
||||
List<String> getChestWallets(ChestData chest) {
|
||||
List<String> toDelete = [];
|
||||
log.d(chest.key);
|
||||
walletBox.toMap().forEach((key, WalletData value) {
|
||||
if (value.chest == chest.key) {
|
||||
toDelete.add(value.address);
|
||||
|
@ -54,19 +54,27 @@ class ChestProvider with ChangeNotifier {
|
|||
Future<bool?> _confirmDeletingChest(context, String? walletName) async {
|
||||
return showDialog<bool>(
|
||||
context: context,
|
||||
barrierDismissible: true, // user must tap button!
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text('areYouSureToDeleteWallet'.tr(args: [walletName!])),
|
||||
title: Text(
|
||||
'areYouSureToDeleteWallet'.tr(args: [walletName!]),
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: Text("no".tr(), key: keyCancel),
|
||||
child: Text("no".tr(),
|
||||
style:
|
||||
scaledTextStyle(fontSize: 17, color: Colors.blueAccent),
|
||||
key: keyCancel),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, false);
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: Text("yes".tr(), key: keyConfirm),
|
||||
child: Text("yes".tr(),
|
||||
style: scaledTextStyle(fontSize: 17, color: Colors.red),
|
||||
key: keyConfirm),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, true);
|
||||
},
|
||||
|
|
|
@ -30,7 +30,7 @@ class DuniterIndexer with ChangeNotifier {
|
|||
final request = await client.postUrl(Uri.parse('$endpoint/v1/graphql'));
|
||||
final response = await request.close();
|
||||
if (response.statusCode != 200) {
|
||||
log.d('INDEXER IS OFFLINE');
|
||||
log.w('INDEXER IS OFFLINE');
|
||||
indexerEndpoint = '';
|
||||
isLoadingIndexer = false;
|
||||
notifyListeners();
|
||||
|
@ -46,7 +46,7 @@ class DuniterIndexer with ChangeNotifier {
|
|||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
log.d('INDEXER IS OFFLINE');
|
||||
log.w('INDEXER IS OFFLINE');
|
||||
indexerEndpoint = '';
|
||||
isLoadingIndexer = false;
|
||||
notifyListeners();
|
||||
|
@ -54,21 +54,6 @@ class DuniterIndexer with ChangeNotifier {
|
|||
}
|
||||
}
|
||||
|
||||
// Future checkIndexerEndpointBackground() async {
|
||||
// final oldEndpoint = indexerEndpoint;
|
||||
// while (true) {
|
||||
// await Future.delayed(const Duration(seconds: 30));
|
||||
// final isValid = await checkIndexerEndpoint(oldEndpoint);
|
||||
// if (!isValid) {
|
||||
// log.d('INDEXER IS OFFILINE');
|
||||
// indexerEndpoint = '';
|
||||
// } else {
|
||||
// // log.d('Indexer is online');
|
||||
// indexerEndpoint = oldEndpoint;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
Future<String> getValidIndexerEndpoint() async {
|
||||
// await configBox.delete('indexerEndpoint');
|
||||
|
||||
|
@ -77,7 +62,6 @@ class DuniterIndexer with ChangeNotifier {
|
|||
.then((jsonStr) => jsonDecode(jsonStr));
|
||||
// _listEndpoints.shuffle();
|
||||
|
||||
log.d(listIndexerEndpoints);
|
||||
listIndexerEndpoints.add('Personnalisé');
|
||||
|
||||
if (configBox.containsKey('customIndexer')) {
|
||||
|
@ -140,7 +124,7 @@ class DuniterIndexer with ChangeNotifier {
|
|||
}
|
||||
} while (statusCode != 200);
|
||||
|
||||
log.i('INDEXER: $indexerEndpoint');
|
||||
log.i('Indexer: $indexerEndpoint');
|
||||
return indexerEndpoint;
|
||||
}
|
||||
|
||||
|
@ -203,7 +187,7 @@ class DuniterIndexer with ChangeNotifier {
|
|||
if (fetchMoreCursor != null) {
|
||||
transBC = parseHistory(blockchainTX, pubkey);
|
||||
} else {
|
||||
log.i("###### DEBUG H - Début de l'historique");
|
||||
log.d("Activity start of $pubkey");
|
||||
}
|
||||
|
||||
return opts;
|
||||
|
@ -222,7 +206,7 @@ Future<bool> isIdtyExist(String name) async {
|
|||
'name': name,
|
||||
};
|
||||
final result = await _execQuery(isIdtyExistQ, variables);
|
||||
return result.data!['identity']?.isEmpty ?? false ? false : true;
|
||||
return result.data!['identity']?.isNotEmpty ?? false;
|
||||
}
|
||||
|
||||
Future<DateTime> getBlockStart() async {
|
||||
|
@ -311,12 +295,6 @@ Map computeHistoryView(repository, String address) {
|
|||
bool isMigrationTime =
|
||||
startBlockchainInitialized && date.compareTo(startBlockchainTime) < 0;
|
||||
|
||||
//TODO: Migration date and transaction migration doesn't match, add this event to v2s indexer.
|
||||
|
||||
// log.d('debug date transaction: $date');
|
||||
// log.d('debug date identity migration: ${sub.oldOwnerKeys[address]?[1]}');
|
||||
// isChangeOwnerkeyTime = date.compareTo(sub.oldOwnerKeys[address]?[1] ?? DateTime(2000)) < 0;
|
||||
|
||||
return {
|
||||
'finalAmount': finalAmount,
|
||||
'isMigrationTime': isMigrationTime,
|
||||
|
|
|
@ -85,10 +85,8 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
final expectedWord = mnemo.split(' ')[nbrWord];
|
||||
final normInputWord = unorm.nfkd(inputWord);
|
||||
|
||||
log.i("Is $expectedWord equal to input $normInputWord ?");
|
||||
if (expectedWord == normInputWord ||
|
||||
(kDebugMode && inputWord == 'triche')) {
|
||||
log.d('Word is OK');
|
||||
isAskedWordValid = true;
|
||||
askedWordColor = Colors.green[600];
|
||||
// walletNameFocus.nextFocus();
|
||||
|
@ -155,7 +153,6 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
String walletPubkey = cesiumWallet.pubkey;
|
||||
|
||||
cesiumPubkey.text = walletPubkey;
|
||||
log.d(walletPubkey);
|
||||
}
|
||||
|
||||
void cesiumIDisVisible() {
|
||||
|
@ -202,7 +199,7 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
if (bip39Words(appLang).contains(word.toLowerCase())) {
|
||||
for (var bipWord in bip39Words(appLang)) {
|
||||
if (bipWord.startsWith(word)) {
|
||||
isValid = nbrMatch == 0 ? true : false;
|
||||
isValid = nbrMatch == 0;
|
||||
if (checkRedondance) nbrMatch = nbrMatch + 1;
|
||||
}
|
||||
}
|
||||
|
@ -357,7 +354,6 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
notifyListeners();
|
||||
}
|
||||
|
||||
log.d(scanedWalletNumber);
|
||||
scanStatus = ScanDerivationsStatus.none;
|
||||
scanedWalletNumber = scanedValidWalletNumber = -1;
|
||||
notifyListeners();
|
||||
|
@ -375,8 +371,6 @@ class GenerateWalletsProvider with ChangeNotifier {
|
|||
onTimeout: () => {},
|
||||
);
|
||||
|
||||
log.d(
|
||||
"${addressData.address!}: ${balance['transferableBalance']} $currencyName");
|
||||
if (balance['transferableBalance'] != 0) {
|
||||
String walletName = 'myRootWallet'.tr();
|
||||
await sub.importAccount(mnemonic: generatedMnemonic!, password: pin.text);
|
||||
|
|
|
@ -109,7 +109,6 @@ class HomeProvider with ChangeNotifier {
|
|||
configBox.put('endpoint', listEndpoints);
|
||||
}
|
||||
|
||||
log.i('ENDPOINT: $listEndpoints');
|
||||
return listEndpoints;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,30 +26,22 @@ class MyWalletsProvider with ChangeNotifier {
|
|||
return configBox.get('currentChest');
|
||||
}
|
||||
|
||||
bool checkIfWalletExist() {
|
||||
if (chestBox.isEmpty) {
|
||||
// log.i('No wallets detected');
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
bool isWalletsExists() => chestBox.isNotEmpty;
|
||||
|
||||
Future<List<WalletData>> readAllWallets([int? chest]) async {
|
||||
final sub = Provider.of<SubstrateSdk>(homeContext, listen: false);
|
||||
chest = chest ?? configBox.get('currentChest') ?? 0;
|
||||
chest = chest ?? getCurrentChest();
|
||||
listWallets.clear();
|
||||
final wallets = walletBox.toMap().values.toList();
|
||||
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));
|
||||
} else {
|
||||
listWallets.add(walletFromBox);
|
||||
}
|
||||
if (walletFromBox.chest != chest) {
|
||||
continue;
|
||||
}
|
||||
if (walletFromBox.identityStatus == IdtyStatus.unknown) {
|
||||
walletsToScan.putIfAbsent(walletFromBox.address, (() => walletFromBox));
|
||||
} else {
|
||||
listWallets.add(walletFromBox);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,7 +213,7 @@ class MyWalletsProvider with ChangeNotifier {
|
|||
if (listWallets.isEmpty) {
|
||||
newDerivationNbr = 2;
|
||||
} else {
|
||||
WalletData lastWallet = listWallets.reduce(
|
||||
final lastWallet = listWallets.reduce(
|
||||
(curr, next) => curr.derivation! > next.derivation! ? curr : next);
|
||||
|
||||
if (lastWallet.derivation == -1) {
|
||||
|
@ -237,7 +229,7 @@ class MyWalletsProvider with ChangeNotifier {
|
|||
}
|
||||
|
||||
int lockPin = 0;
|
||||
Future resetPinCode([int minutes = 15]) async {
|
||||
Future debounceResetPinCode([int minutes = 15]) async {
|
||||
lockPin++;
|
||||
final actualLock = lockPin;
|
||||
await Future.delayed(
|
||||
|
|
|
@ -5,73 +5,14 @@ import 'package:gecko/providers/wallets_profiles.dart';
|
|||
class SearchProvider with ChangeNotifier {
|
||||
TextEditingController searchController = TextEditingController();
|
||||
List searchResult = [];
|
||||
final cacheDuring = 20 * 60 * 1000; //First number is minutes
|
||||
int cacheTime = 0;
|
||||
int resultLenght = 0;
|
||||
|
||||
void reload() {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// Future<List> searchBlockchain() async {
|
||||
// searchResult.clear();
|
||||
// int searchTime = DateTime.now().millisecondsSinceEpoch;
|
||||
// WalletsProfilesProvider _walletProfiles = WalletsProfilesProvider('pubkey');
|
||||
|
||||
// if (cacheTime + cacheDuring <= searchTime) {
|
||||
// g1WalletsBox.clear();
|
||||
// // final url = Uri.parse('https://g1-stats.axiom-team.fr/data/forbes.json');
|
||||
// // final response = await http.get(url);
|
||||
|
||||
// var dio = Dio();
|
||||
// late Response response;
|
||||
// try {
|
||||
// response = await dio.get(
|
||||
// 'https://g1-stats.axiom-team.fr/data/forbes.json',
|
||||
// options: Options(
|
||||
// sendTimeout: 5000,
|
||||
// receiveTimeout: 10000,
|
||||
// ),
|
||||
// );
|
||||
// // response = await http.post((Uri.parse(queryOptions[0])),
|
||||
// // body: queryOptions[1], headers: queryOptions[2]);
|
||||
// } catch (e) {
|
||||
// log.e(e);
|
||||
// }
|
||||
|
||||
// List<G1WalletsList> _listWallets = _parseG1Wallets(response.data)!;
|
||||
// Map<String?, G1WalletsList> _mapWallets = {
|
||||
// for (var e in _listWallets) e.pubkey: e
|
||||
// };
|
||||
|
||||
// await g1WalletsBox.putAll(_mapWallets);
|
||||
// cacheTime = DateTime.now().millisecondsSinceEpoch;
|
||||
// }
|
||||
|
||||
// g1WalletsBox.toMap().forEach((key, value) {
|
||||
// if ((value.id != null &&
|
||||
// value.id!.username != null &&
|
||||
// value.id!.username!
|
||||
// .toLowerCase()
|
||||
// .contains(searchController.text)) ||
|
||||
// value.pubkey!.contains(searchController.text)) {
|
||||
// searchResult.add(value);
|
||||
// return;
|
||||
// }
|
||||
// });
|
||||
|
||||
// if (searchResult.isEmpty &&
|
||||
// _walletProfiles.isPubkey(searchController.text)) {
|
||||
// searchResult = [G1WalletsList(pubkey: searchController.text)];
|
||||
// }
|
||||
|
||||
// return searchResult;
|
||||
// }
|
||||
|
||||
Future<List<G1WalletsList>> searchAddress() async {
|
||||
final walletProfiles = WalletsProfilesProvider('pubkey');
|
||||
|
||||
if (walletProfiles.isAddress(searchController.text)) {
|
||||
if (isAddress(searchController.text)) {
|
||||
G1WalletsList wallet = G1WalletsList(address: searchController.text);
|
||||
return [wallet];
|
||||
} else {
|
||||
|
@ -79,11 +20,3 @@ class SearchProvider with ChangeNotifier {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// List<G1WalletsList>? _parseG1Wallets(var responseBody) {
|
||||
// final parsed = responseBody.cast<Map<String, dynamic>>();
|
||||
|
||||
// return parsed
|
||||
// .map<G1WalletsList>((json) => G1WalletsList.fromJson(json))
|
||||
// .toList();
|
||||
// }
|
||||
|
|
|
@ -40,8 +40,8 @@ class SubstrateSdk with ChangeNotifier {
|
|||
String? transactionStatus;
|
||||
final int initSs58 = 42;
|
||||
Map<String, int> currencyParameters = {};
|
||||
TextEditingController csSalt = TextEditingController();
|
||||
TextEditingController csPassword = TextEditingController();
|
||||
final csSalt = TextEditingController();
|
||||
final csPassword = TextEditingController();
|
||||
String g1V1NewAddress = '';
|
||||
String g1V1OldPubkey = '';
|
||||
bool isCesiumIDVisible = false;
|
||||
|
@ -140,35 +140,12 @@ class SubstrateSdk with ChangeNotifier {
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -232,7 +209,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
Future<bool> hasAccountConsumers(String address) async {
|
||||
final accountInfo = await _getStorage('system.account("$address")');
|
||||
final consumers = accountInfo['consumers'];
|
||||
return consumers == 0 ? false : true;
|
||||
return !(consumers == 0);
|
||||
}
|
||||
|
||||
Future<int> getUdValue() async {
|
||||
|
@ -355,9 +332,6 @@ class SubstrateSdk with ChangeNotifier {
|
|||
}
|
||||
}
|
||||
|
||||
// log.d(
|
||||
// "debug computeUnclaimUds: ${pastReevals.reversed} --- $firstEligibleUd --- $currentUdIndex");
|
||||
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
|
@ -462,7 +436,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
if (idtyIndex == -1) return false;
|
||||
|
||||
final isSmith = await _getStorage('smithMembership.membership($idtyIndex)');
|
||||
return isSmith == null ? false : true;
|
||||
return !(isSmith == null);
|
||||
}
|
||||
|
||||
Future<String> getGenesisHash() async {
|
||||
|
@ -471,8 +445,6 @@ class SubstrateSdk with ChangeNotifier {
|
|||
wrapPromise: false,
|
||||
) ??
|
||||
[];
|
||||
// log.d('genesisHash: $genesisHash');
|
||||
// log.d('genesisHash: ${HEX.decode(genesisHash.substring(2))}');
|
||||
return genesisHash;
|
||||
}
|
||||
|
||||
|
@ -497,23 +469,23 @@ class SubstrateSdk with ChangeNotifier {
|
|||
}
|
||||
|
||||
Future initCurrencyParameters() async {
|
||||
try {
|
||||
currencyParameters['ss58'] =
|
||||
await _getStorageConst('system.ss58Prefix.words');
|
||||
currencyParameters['minCertForMembership'] =
|
||||
await _getStorageConst('wot.minCertForMembership.words');
|
||||
currencyParameters['newAccountPrice'] =
|
||||
await _getStorageConst('account.newAccountPrice.words');
|
||||
currencyParameters['existentialDeposit'] =
|
||||
await _getStorageConst('balances.existentialDeposit.words');
|
||||
currencyParameters['certPeriod'] =
|
||||
await _getStorageConst('cert.certPeriod.words');
|
||||
currencyParameters['certMaxByIssuer'] =
|
||||
await _getStorageConst('cert.maxByIssuer.words');
|
||||
currencyParameters['certValidityPeriod'] =
|
||||
await _getStorageConst('cert.validityPeriod.words');
|
||||
} catch (e) {
|
||||
log.i('error while getting storageVals (network?) :: $e');
|
||||
const currencyParametersNames = {
|
||||
'ss58': 'system.ss58Prefix.words',
|
||||
'minCertForMembership': 'wot.minCertForMembership.words',
|
||||
'newAccountPrice': 'account.newAccountPrice.words',
|
||||
'existentialDeposit': 'balances.existentialDeposit.words',
|
||||
'certPeriod': 'cert.certPeriod.words',
|
||||
'certMaxByIssuer': 'cert.maxByIssuer.words',
|
||||
'certValidityPeriod': 'cert.validityPeriod.words',
|
||||
};
|
||||
|
||||
for (var param in currencyParametersNames.keys) {
|
||||
try {
|
||||
currencyParameters[param] =
|
||||
await _getStorageConst(currencyParametersNames[param]!);
|
||||
} catch (e) {
|
||||
log.e('error while getting param $param :: $e');
|
||||
}
|
||||
}
|
||||
log.i('currencyParameters: $currencyParameters');
|
||||
}
|
||||
|
@ -603,7 +575,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
// final dateText = await sdk.webView!
|
||||
// .evalJavascript('api.tx($dateTextByte)', wrapPromise: false);
|
||||
|
||||
// log.d('aaaaaaaaaaaaaaaaaaaaa: $dateText');
|
||||
// log.d('Blockchain start: $dateText');
|
||||
return DateFormat();
|
||||
}
|
||||
|
||||
|
@ -654,12 +626,10 @@ class SubstrateSdk with ChangeNotifier {
|
|||
notifyListeners();
|
||||
if (resNode != null) {
|
||||
nodeConnected = true;
|
||||
// await getSs58Prefix();
|
||||
|
||||
// Subscribe bloc number
|
||||
sdk.api.setting.subscribeBestNumber((res) {
|
||||
blocNumber = int.parse(res.toString());
|
||||
// log.d(sdk.api.connectedNode?.endpoint);
|
||||
if (sdk.api.connectedNode?.endpoint == null) {
|
||||
nodeConnected = false;
|
||||
homeProvider.changeMessage("networkLost".tr(), 0);
|
||||
|
@ -673,6 +643,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
|
||||
// Currency parameters
|
||||
await initCurrencyParameters();
|
||||
|
||||
// Indexer Blockchain start
|
||||
getBlockStart();
|
||||
|
||||
|
@ -681,15 +652,14 @@ class SubstrateSdk with ChangeNotifier {
|
|||
"wellConnectedToNode"
|
||||
.tr(args: [getConnectedEndpoint()!.split('/')[2]]),
|
||||
5);
|
||||
// snackNode(ctx, true);
|
||||
} else {
|
||||
nodeConnected = false;
|
||||
notifyListeners();
|
||||
homeProvider.changeMessage("noDuniterEndointAvailable".tr(), 0);
|
||||
if (!myWalletProvider.checkIfWalletExist()) snackNode(homeContext, false);
|
||||
if (!myWalletProvider.isWalletsExists()) snackNode(homeContext, false);
|
||||
}
|
||||
|
||||
log.d(sdk.api.connectedNode?.endpoint);
|
||||
log.i('Connected to node: ${sdk.api.connectedNode?.endpoint}');
|
||||
}
|
||||
|
||||
List<NetworkParams> getDuniterBootstrap() {
|
||||
|
@ -741,7 +711,6 @@ class SubstrateSdk with ChangeNotifier {
|
|||
notifyListeners();
|
||||
});
|
||||
if (json == null) return '';
|
||||
// log.d(json);
|
||||
try {
|
||||
await sdk.api.keyring.addAccount(
|
||||
keyring,
|
||||
|
@ -798,7 +767,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
final myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
keyring.setCurrent(account);
|
||||
myWalletProvider.resetPinCode();
|
||||
myWalletProvider.debounceResetPinCode();
|
||||
|
||||
return await sdk.api.keyring.changePassword(keyring, passOld, passNew);
|
||||
}
|
||||
|
@ -1036,7 +1005,7 @@ class SubstrateSdk with ChangeNotifier {
|
|||
toIdtyStatus == IdtyStatus.confirmed) {
|
||||
if (toCerts![0] >= currencyParameters['minCertForMembership']! - 1 &&
|
||||
toIdtyStatus != IdtyStatus.validated) {
|
||||
log.i('Batch cert and membership validation');
|
||||
log.d('Batch cert and membership validation');
|
||||
txInfo = TxInfoData(
|
||||
'utility',
|
||||
'batchAll',
|
||||
|
@ -1109,8 +1078,6 @@ class SubstrateSdk with ChangeNotifier {
|
|||
await _signMessage(messageToSign, destAddress, destPassword);
|
||||
final newKeySigType = '{"Sr25519": "$newKeySig"}';
|
||||
|
||||
// messageToSign: [105, 99, 111, 107, 7, 193, 18, 255, 106, 185, 215, 208, 213, 49, 235, 229, 159, 152, 179, 83, 24, 178, 129, 59, 22, 85, 87, 115, 128, 129, 157, 56, 214, 24, 45, 153, 21, 0, 0, 0, 181, 82, 178, 99, 198, 4, 156, 190, 78, 35, 102, 137, 255, 7, 162, 31, 16, 79, 255, 132, 130, 237, 230, 222, 176, 88, 245, 217, 237, 78, 196, 239]
|
||||
|
||||
log.d("""
|
||||
fromAddress: $fromAddress
|
||||
destAddress: $destAddress
|
||||
|
@ -1210,7 +1177,6 @@ newKeySig: $newKeySigType""");
|
|||
password: password,
|
||||
);
|
||||
|
||||
log.d('g1migration idtyStatus: $idtyStatus');
|
||||
if (idtyStatus != IdtyStatus.none) {
|
||||
await migrateIdentity(
|
||||
fromAddress: keypair.address!,
|
||||
|
|
|
@ -58,7 +58,6 @@ class WalletOptionsProvider with ChangeNotifier {
|
|||
final myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
final defaultWallet = myWalletProvider.getDefaultWallet();
|
||||
log.d(defaultWallet.address);
|
||||
sub.pay(
|
||||
fromAddress: wallet.address,
|
||||
destAddress: defaultWallet.address,
|
||||
|
@ -118,9 +117,6 @@ class WalletOptionsProvider with ChangeNotifier {
|
|||
log.w('No image selected.');
|
||||
return '';
|
||||
}
|
||||
// await imageFile.copy(newPath);
|
||||
|
||||
log.i(newPath);
|
||||
return newPath;
|
||||
} else {
|
||||
log.w('No image selected.');
|
||||
|
|
|
@ -5,6 +5,7 @@ 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/scale_functions.dart';
|
||||
import 'package:gecko/screens/wallet_view.dart';
|
||||
import 'package:jdenticon_dart/jdenticon_dart.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
@ -36,6 +37,7 @@ class WalletsProfilesProvider with ChangeNotifier {
|
|||
return 'false';
|
||||
}
|
||||
if (isAddress(barcode.rawContent)) {
|
||||
address = barcode.rawContent;
|
||||
Navigator.popUntil(
|
||||
context,
|
||||
ModalRoute.withName('/'),
|
||||
|
@ -55,51 +57,6 @@ class WalletsProfilesProvider with ChangeNotifier {
|
|||
return barcode.rawContent;
|
||||
}
|
||||
|
||||
// Future<String> pay(BuildContext context, {int? derivation}) async {
|
||||
// MyWalletsProvider _myWalletProvider =
|
||||
// Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
// int? currentChest = configBox.get('currentChest');
|
||||
// String result;
|
||||
|
||||
// derivation ??=
|
||||
// _myWalletProvider.getDefaultWallet(currentChest)!.derivation!;
|
||||
// result = await Gva(node: endPointGVA).pay(
|
||||
// recipient: pubkey!,
|
||||
// amount: double.parse(payAmount.text),
|
||||
// mnemonic: _myWalletProvider.mnemonic,
|
||||
// comment: payComment.text,
|
||||
// derivation: derivation,
|
||||
// lang: appLang);
|
||||
|
||||
// return result;
|
||||
// }
|
||||
|
||||
bool isAddress(address) {
|
||||
final RegExp regExp = RegExp(
|
||||
r'^[a-zA-Z0-9]+$',
|
||||
caseSensitive: false,
|
||||
multiLine: false,
|
||||
);
|
||||
|
||||
if (regExp.hasMatch(address) == true &&
|
||||
address.length > 45 &&
|
||||
address.length < 52) {
|
||||
log.d("C'est une adresse !");
|
||||
|
||||
this.address = address;
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// poka: Do99s6wQR2JLfhirPdpAERSjNbmjjECzGxHNJMiNKT3P
|
||||
// Pi: D2meevcAHFTS2gQMvmRW5Hzi25jDdikk4nC4u1FkwRaU // For debug
|
||||
// Boris: JE6mkuzSpT3ePciCPRTpuMT9fqPUVVLJz2618d33p7tn
|
||||
// Matograine portefeuille: 9p5nHsES6xujFR7pw2yGy4PLKKHgWsMvsDHaHF64Uj25.
|
||||
// Lion simone: 78jhpprYkMNF6i5kQPXfkAVBpd2aqcpieNsXTSW4c21f
|
||||
|
||||
void resetdHistory() {
|
||||
notifyListeners();
|
||||
}
|
||||
|
@ -108,21 +65,6 @@ class WalletsProfilesProvider with ChangeNotifier {
|
|||
return Jdenticon.toSvg(pubkey);
|
||||
}
|
||||
|
||||
// Future<num> getBalance(String _pubkey) async {
|
||||
// final url = Uri.parse(
|
||||
// '$endPointGVA?query={%20balance(script:%20%22$_pubkey%22)%20{%20amount%20base%20}%20}');
|
||||
// final response = await http.get(url);
|
||||
// final result = json.decode(response.body);
|
||||
|
||||
// if (result['data']['balance'] == null) {
|
||||
// balance = 0.0;
|
||||
// } else {
|
||||
// balance = removeDecimalZero(result['data']['balance']['amount'] / 100);
|
||||
// }
|
||||
|
||||
// return balance;
|
||||
// }
|
||||
|
||||
Future<num?> getBalance(String? pubkey) async {
|
||||
while (_balance == null) {
|
||||
await Future.delayed(const Duration(milliseconds: 50));
|
||||
|
@ -136,14 +78,12 @@ class WalletsProfilesProvider with ChangeNotifier {
|
|||
}
|
||||
|
||||
Future addContact(G1WalletsList profile) async {
|
||||
// log.d(profile.username);
|
||||
if (isContact(profile.address)) {
|
||||
await contactsBox.delete(profile.address);
|
||||
snackMessage(homeContext,
|
||||
message: 'removedFromcontacts'.tr(), duration: 4);
|
||||
} else {
|
||||
await contactsBox.put(profile.address, profile);
|
||||
// drawStar(Size(50, 50));
|
||||
snackMessage(homeContext, message: 'addedToContacts'.tr(), duration: 4);
|
||||
}
|
||||
notifyListeners();
|
||||
|
@ -154,12 +94,28 @@ class WalletsProfilesProvider with ChangeNotifier {
|
|||
}
|
||||
}
|
||||
|
||||
bool isAddress(address) {
|
||||
final RegExp regExp = RegExp(
|
||||
r'^[a-zA-Z0-9]+$',
|
||||
caseSensitive: false,
|
||||
multiLine: false,
|
||||
);
|
||||
|
||||
if (regExp.hasMatch(address) == true &&
|
||||
address.length > 45 &&
|
||||
address.length < 52) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
snackMessage(context,
|
||||
{required String message, int duration = 2, double fontSize = 16}) {
|
||||
final snackBar = SnackBar(
|
||||
backgroundColor: Colors.grey[900],
|
||||
padding: const EdgeInsets.all(20),
|
||||
content: Text(message, style: TextStyle(fontSize: fontSize)),
|
||||
padding: EdgeInsets.all(scaleSize(19)),
|
||||
content: Text(message, style: scaledTextStyle(fontSize: fontSize)),
|
||||
duration: Duration(seconds: duration));
|
||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||
}
|
||||
|
@ -167,9 +123,9 @@ snackMessage(context,
|
|||
snackCopyKey(context) {
|
||||
final snackBar = SnackBar(
|
||||
backgroundColor: Colors.grey[900],
|
||||
padding: const EdgeInsets.all(20),
|
||||
padding: EdgeInsets.all(scaleSize(19)),
|
||||
content: Text("thisAddressHasBeenCopiedToClipboard".tr(),
|
||||
style: const TextStyle(fontSize: 16)),
|
||||
style: scaledTextStyle(fontSize: 16)),
|
||||
duration: const Duration(seconds: 2));
|
||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||
}
|
||||
|
@ -177,9 +133,9 @@ snackCopyKey(context) {
|
|||
snackCopySeed(context) {
|
||||
final snackBar = SnackBar(
|
||||
backgroundColor: Colors.grey[900],
|
||||
padding: const EdgeInsets.all(20),
|
||||
padding: EdgeInsets.all(scaleSize(19)),
|
||||
content: Text("thisMnemonicHasBeenCopiedToClipboard".tr(),
|
||||
style: const TextStyle(fontSize: 17)),
|
||||
style: scaledTextStyle(fontSize: 16)),
|
||||
duration: const Duration(seconds: 4));
|
||||
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
|
@ -12,8 +13,7 @@ import 'package:gecko/widgets/history_query.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
|
||||
class ActivityScreen extends StatefulWidget {
|
||||
const ActivityScreen(
|
||||
{required this.address, this.username})
|
||||
const ActivityScreen({required this.address, this.username})
|
||||
: super(key: keyActivityScreen);
|
||||
final String address;
|
||||
final String? username;
|
||||
|
@ -42,10 +42,10 @@ class _ActivityScreenState extends State<ActivityScreen> {
|
|||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text('accountActivity'.tr()),
|
||||
toolbarHeight: scaleSize(57),
|
||||
title: Text(
|
||||
'accountActivity'.tr(),
|
||||
style: scaledTextStyle(fontSize: 20),
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: const GeckoBottomAppBar(),
|
||||
|
|
|
@ -2,10 +2,11 @@ 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/models/scale_functions.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';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
|
||||
class CertificationsScreen extends StatelessWidget {
|
||||
const CertificationsScreen(
|
||||
|
@ -18,41 +19,39 @@ class CertificationsScreen extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text('certificationsOf'.tr(args: [username])),
|
||||
)),
|
||||
appBar: GeckoAppBar('certificationsOf'.tr(args: [username])),
|
||||
body: SafeArea(
|
||||
child: Accordion(
|
||||
paddingListTop: 10,
|
||||
paddingListTop: 7,
|
||||
paddingListBottom: 10,
|
||||
maxOpenSections: 1,
|
||||
headerBackgroundColorOpened: orangeC,
|
||||
scaleWhenAnimating: true,
|
||||
openAndCloseAnimation: true,
|
||||
headerPadding:
|
||||
const EdgeInsets.symmetric(vertical: 7, horizontal: 15),
|
||||
headerPadding: EdgeInsets.symmetric(
|
||||
vertical: scaleSize(6), horizontal: scaleSize(14)),
|
||||
sectionOpeningHapticFeedback: SectionHapticFeedback.heavy,
|
||||
sectionClosingHapticFeedback: SectionHapticFeedback.light,
|
||||
children: [
|
||||
AccordionSection(
|
||||
isOpen: true,
|
||||
leftIcon:
|
||||
const Icon(Icons.insights_rounded, color: Colors.black),
|
||||
leftIcon: Icon(
|
||||
Icons.insights_rounded,
|
||||
color: Colors.black,
|
||||
size: scaleSize(20),
|
||||
),
|
||||
headerBackgroundColor: yellowC,
|
||||
headerBackgroundColorOpened: orangeC,
|
||||
header: Row(children: [
|
||||
Text(
|
||||
'received'.tr(),
|
||||
style: const TextStyle(fontSize: 20),
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
ScaledSizedBox(width: 5),
|
||||
CertsCounter(address: address)
|
||||
]),
|
||||
content: CertsReceived(address: address),
|
||||
content: CertsList(
|
||||
address: address, direction: CertDirection.sent),
|
||||
contentHorizontalPadding: 0,
|
||||
contentBorderWidth: 1,
|
||||
),
|
||||
|
@ -65,13 +64,16 @@ class CertificationsScreen extends StatelessWidget {
|
|||
header: Row(children: [
|
||||
Text(
|
||||
'sent'.tr(),
|
||||
style: const TextStyle(fontSize: 20),
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
ScaledSizedBox(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 ...'),
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
@ -14,11 +15,7 @@ class DebugScreen extends StatelessWidget {
|
|||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: const SizedBox(
|
||||
height: 22,
|
||||
child: Text('Debug screen'),
|
||||
)),
|
||||
toolbarHeight: scaleSize(57), title: const Text('Debug screen')),
|
||||
body: SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
const SizedBox(height: 40),
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:gecko/models/g1_wallets_list.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/cesium_plus.dart';
|
||||
import 'package:gecko/providers/chest_provider.dart';
|
||||
|
@ -45,7 +46,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||
final csProvider =
|
||||
Provider.of<CesiumPlusProvider>(context, listen: false);
|
||||
|
||||
final bool isWalletsExists = myWalletProvider.checkIfWalletExist();
|
||||
final bool isWalletsExists = myWalletProvider.isWalletsExists();
|
||||
|
||||
// Check if versionData non compatible, drop everything
|
||||
if (configBox.get('dataVersion') == null) {
|
||||
|
@ -88,7 +89,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||
Connectivity()
|
||||
.onConnectivityChanged
|
||||
.listen((ConnectivityResult result) async {
|
||||
log.d('Network changed: $result');
|
||||
log.i('Network changed: $result');
|
||||
if (result == ConnectivityResult.none) {
|
||||
sub.nodeConnected = false;
|
||||
await sub.sdk.api.setting.unsubscribeBestNumber();
|
||||
|
@ -114,19 +115,16 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||
|
||||
final myWalletProvider = Provider.of<MyWalletsProvider>(context);
|
||||
Provider.of<ChestProvider>(context);
|
||||
final bool isWalletsExists = myWalletProvider.checkIfWalletExist();
|
||||
final isWalletsExists = myWalletProvider.isWalletsExists();
|
||||
|
||||
isTall = false;
|
||||
ratio = 1;
|
||||
if (MediaQuery.of(context).size.height >= 930) {
|
||||
isTall = true;
|
||||
ratio = 1.125;
|
||||
}
|
||||
isTall = (MediaQuery.of(context).size.height /
|
||||
MediaQuery.of(context).size.width) >
|
||||
1.75;
|
||||
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
drawer: MainDrawer(isWalletsExists: isWalletsExists),
|
||||
backgroundColor: const Color(0xffF9F9F1),
|
||||
backgroundColor: yellowC,
|
||||
body: isWalletsExists ? geckHome(context) : welcomeHome(context));
|
||||
}
|
||||
}
|
||||
|
@ -146,42 +144,43 @@ Widget geckHome(context) {
|
|||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
|
||||
Stack(children: <Widget>[
|
||||
Positioned(
|
||||
top: statusBarHeight + 10,
|
||||
left: 15,
|
||||
top: statusBarHeight + scaleSize(10),
|
||||
left: scaleSize(15),
|
||||
child: Builder(
|
||||
builder: (context) => IconButton(
|
||||
key: keyDrawerMenu,
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.menu,
|
||||
color: Colors.white,
|
||||
size: 35,
|
||||
color: Colors.black,
|
||||
size: scaleSize(35),
|
||||
),
|
||||
onPressed: () => Scaffold.of(context).openDrawer(),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Align(
|
||||
child:
|
||||
Image(image: AssetImage('assets/home/header.png'), height: 210),
|
||||
Align(
|
||||
child: Image(
|
||||
image: const AssetImage('assets/home/header.png'),
|
||||
height: scaleSize(165)),
|
||||
),
|
||||
]),
|
||||
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(
|
||||
style: scaledTextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
fontSize: 19,
|
||||
fontWeight: FontWeight.w700,
|
||||
shadows: <Shadow>[
|
||||
Shadow(
|
||||
const Shadow(
|
||||
offset: Offset(0, 0),
|
||||
blurRadius: 20,
|
||||
color: Colors.black,
|
||||
),
|
||||
Shadow(
|
||||
const Shadow(
|
||||
offset: Offset(0, 0),
|
||||
blurRadius: 20,
|
||||
color: Colors.black,
|
||||
|
@ -198,7 +197,7 @@ Widget geckHome(context) {
|
|||
),
|
||||
]),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
ScaledSizedBox(height: 15),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
|
@ -233,37 +232,38 @@ Widget welcomeHome(context) {
|
|||
Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
|
||||
Stack(children: <Widget>[
|
||||
Positioned(
|
||||
top: statusBarHeight + 10,
|
||||
left: 15,
|
||||
top: statusBarHeight + scaleSize(10),
|
||||
left: scaleSize(15),
|
||||
child: Builder(
|
||||
builder: (context) => IconButton(
|
||||
key: keyDrawerMenu,
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.menu,
|
||||
color: Colors.white,
|
||||
size: 35,
|
||||
color: Colors.black,
|
||||
size: scaleSize(35),
|
||||
),
|
||||
onPressed: () => Scaffold.of(context).openDrawer(),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Align(
|
||||
child:
|
||||
Image(image: AssetImage('assets/home/header.png'), height: 210),
|
||||
Align(
|
||||
child: Image(
|
||||
image: const AssetImage('assets/home/header.png'),
|
||||
height: scaleSize(165)),
|
||||
),
|
||||
]),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 1 * ratio),
|
||||
padding: const EdgeInsets.only(top: 1),
|
||||
child:
|
||||
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
|
||||
Text(
|
||||
"fastAppDescription".tr(args: [currencyName]),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
style: scaledTextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 24,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w700,
|
||||
shadows: <Shadow>[
|
||||
shadows: const <Shadow>[
|
||||
Shadow(
|
||||
offset: Offset(0, 0),
|
||||
blurRadius: 20,
|
||||
|
@ -296,34 +296,29 @@ 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>[
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(top: 55),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: scaleSize(55)),
|
||||
child: Image(
|
||||
image: AssetImage('assets/home/gecko-bienvenue.png'),
|
||||
height: 220,
|
||||
image: const AssetImage(
|
||||
'assets/home/gecko-bienvenue.png'),
|
||||
height: scaleSize(180),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 180,
|
||||
child: BubbleSpeak(text: "noLizard".tr()),
|
||||
),
|
||||
const Positioned(
|
||||
left: 200,
|
||||
top: 60,
|
||||
child: Image(
|
||||
image: AssetImage('assets/home/bout_de_bulle.png'),
|
||||
),
|
||||
left: scaleSize(160),
|
||||
top: 10,
|
||||
child: BubbleSpeakWithTail(text: "noLizard".tr()),
|
||||
),
|
||||
]),
|
||||
),
|
||||
]),
|
||||
SizedBox(
|
||||
width: 410,
|
||||
height: 70,
|
||||
ScaledSizedBox(
|
||||
width: 330,
|
||||
height: 60,
|
||||
child: ElevatedButton(
|
||||
key: keyOnboardingNewChest,
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
@ -342,19 +337,21 @@ Widget welcomeHome(context) {
|
|||
},
|
||||
child: Text(
|
||||
'createWallet'.tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 24, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 21,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 25 * ratio),
|
||||
SizedBox(
|
||||
width: 410,
|
||||
height: 70,
|
||||
ScaledSizedBox(height: scaleSize(25)),
|
||||
ScaledSizedBox(
|
||||
width: 330,
|
||||
height: 60,
|
||||
child: OutlinedButton(
|
||||
key: keyRestoreChest,
|
||||
style: OutlinedButton.styleFrom(
|
||||
side: const BorderSide(width: 4, color: orangeC)),
|
||||
side: BorderSide(width: scaleSize(4), color: orangeC)),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
|
@ -367,14 +364,14 @@ Widget welcomeHome(context) {
|
|||
},
|
||||
child: Text(
|
||||
"restoreWallet".tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 24,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 21,
|
||||
color: orangeC,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: isTall ? 100 : 50)
|
||||
const Spacer(flex: 3),
|
||||
]),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:durt/durt.dart';
|
||||
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
|
@ -48,11 +49,8 @@ class _ChangePinScreenState extends State<ChangePinScreen> {
|
|||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
elevation: 1,
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(widget.walletName!),
|
||||
),
|
||||
toolbarHeight: scaleSize(57),
|
||||
title: Text(widget.walletName!),
|
||||
),
|
||||
body: Center(
|
||||
child: SafeArea(
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
|
@ -15,6 +16,7 @@ import 'package:gecko/screens/myWallets/show_seed.dart';
|
|||
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
||||
import 'package:gecko/widgets/bottom_app_bar.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class ChestOptions extends StatelessWidget {
|
||||
|
@ -31,28 +33,13 @@ class ChestOptions extends StatelessWidget {
|
|||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
elevation: 1,
|
||||
toolbarHeight: 60 * ratio,
|
||||
// leading: IconButton(
|
||||
// icon: const Icon(Icons.arrow_back, color: Colors.black),
|
||||
// onPressed: () {
|
||||
// // Navigator.popUntil(
|
||||
// // context,
|
||||
// // ModalRoute.withName('/mywallets'),
|
||||
// // );
|
||||
// Navigator.pop(context);
|
||||
// }),
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(currentChest.name!),
|
||||
)),
|
||||
appBar: GeckoAppBar(currentChest.name!),
|
||||
bottomNavigationBar: const GeckoBottomAppBar(),
|
||||
body: Stack(children: [
|
||||
Builder(
|
||||
builder: (ctx) => SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
SizedBox(height: 30 * ratio),
|
||||
ScaledSizedBox(height: 20),
|
||||
InkWell(
|
||||
key: keyShowSeed,
|
||||
onTap: () async {
|
||||
|
@ -82,26 +69,29 @@ class ChestOptions extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 50,
|
||||
child: ScaledSizedBox(
|
||||
height: 60,
|
||||
child: Row(children: <Widget>[
|
||||
const SizedBox(width: 20),
|
||||
ScaledSizedBox(width: 20),
|
||||
Image.asset(
|
||||
'assets/onBoarding/phrase_de_restauration_flou.png',
|
||||
width: 60,
|
||||
width: scaleSize(60),
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
Text(
|
||||
'displayMnemonic'.tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
color: orangeC,
|
||||
ScaledSizedBox(width: 13),
|
||||
ScaledSizedBox(
|
||||
width: 270,
|
||||
child: Text(
|
||||
'displayMnemonic'.tr(),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
color: orangeC,
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10 * ratio),
|
||||
ScaledSizedBox(height: 2),
|
||||
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
return InkWell(
|
||||
key: keyChangePin,
|
||||
|
@ -126,19 +116,19 @@ class ChestOptions extends StatelessWidget {
|
|||
// }
|
||||
// }
|
||||
// : null,
|
||||
child: SizedBox(
|
||||
height: 50,
|
||||
child: ScaledSizedBox(
|
||||
height: 60,
|
||||
child: Row(children: <Widget>[
|
||||
const SizedBox(width: 26),
|
||||
ScaledSizedBox(width: 30),
|
||||
Image.asset(
|
||||
'assets/chests/secret_code.png',
|
||||
height: 25,
|
||||
height: scaleSize(22),
|
||||
),
|
||||
const SizedBox(width: 18),
|
||||
ScaledSizedBox(width: 18),
|
||||
Text(
|
||||
'changePassword'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
color: sub.nodeConnected
|
||||
? Colors.grey[500]
|
||||
: Colors.grey[500]),
|
||||
|
@ -146,7 +136,7 @@ class ChestOptions extends StatelessWidget {
|
|||
])),
|
||||
);
|
||||
}),
|
||||
SizedBox(height: 10 * ratio),
|
||||
ScaledSizedBox(height: 2),
|
||||
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
return InkWell(
|
||||
key: keycreateRootDerivation,
|
||||
|
@ -162,19 +152,19 @@ class ChestOptions extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
: null,
|
||||
child: SizedBox(
|
||||
height: 50,
|
||||
child: ScaledSizedBox(
|
||||
height: 60,
|
||||
child: Row(children: <Widget>[
|
||||
const SizedBox(width: 35),
|
||||
const Icon(
|
||||
ScaledSizedBox(width: 37),
|
||||
Icon(
|
||||
Icons.manage_accounts,
|
||||
size: 33,
|
||||
size: scaleSize(31),
|
||||
),
|
||||
const SizedBox(width: 25),
|
||||
ScaledSizedBox(width: 23),
|
||||
Text(
|
||||
'createDerivation'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
color: sub.nodeConnected
|
||||
? Colors.black
|
||||
: Colors.grey[500]),
|
||||
|
@ -183,26 +173,26 @@ class ChestOptions extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
}),
|
||||
SizedBox(height: 10 * ratio),
|
||||
ScaledSizedBox(height: 2),
|
||||
InkWell(
|
||||
key: keyDeleteChest,
|
||||
onTap: () async {
|
||||
await chestProvider.deleteChest(context, currentChest);
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 50,
|
||||
child: ScaledSizedBox(
|
||||
height: 60,
|
||||
child: Row(children: <Widget>[
|
||||
const SizedBox(width: 28),
|
||||
ScaledSizedBox(width: 32),
|
||||
Image.asset(
|
||||
'assets/walletOptions/trash.png',
|
||||
height: 45,
|
||||
height: scaleSize(38),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
ScaledSizedBox(width: 22),
|
||||
Text(
|
||||
'deleteChest'.tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
color: Color(0xffD80000),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
color: const Color(0xffD80000),
|
||||
),
|
||||
),
|
||||
]),
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
|
@ -34,14 +35,10 @@ class _ChooseChestState extends State<ChooseChest> {
|
|||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text('selectMyChest'.tr()),
|
||||
)),
|
||||
toolbarHeight: scaleSize(57), 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 +99,7 @@ class _ChooseChestState extends State<ChooseChest> {
|
|||
);
|
||||
}).toList(),
|
||||
),
|
||||
SizedBox(height: 80 * ratio),
|
||||
const SizedBox(height: 80),
|
||||
SizedBox(
|
||||
width: 400,
|
||||
height: 70,
|
||||
|
|
|
@ -4,9 +4,11 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class CustomDerivation extends StatefulWidget {
|
||||
|
@ -48,28 +50,27 @@ class _CustomDerivationState extends State<CustomDerivation> {
|
|||
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text('createCustomDerivation'.tr()),
|
||||
)),
|
||||
appBar: GeckoAppBar('createCustomDerivation'.tr()),
|
||||
body: Center(
|
||||
child: SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
const Spacer(),
|
||||
Text(
|
||||
'chooseDerivation'.tr(),
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
SizedBox(
|
||||
ScaledSizedBox(height: 20),
|
||||
ScaledSizedBox(
|
||||
width: 100,
|
||||
child: DropdownButton<String>(
|
||||
value: dropdownValue,
|
||||
menuMaxHeight: 300,
|
||||
icon: const Icon(Icons.arrow_downward),
|
||||
icon: Icon(
|
||||
Icons.arrow_downward,
|
||||
size: scaleSize(20),
|
||||
),
|
||||
elevation: 16,
|
||||
style: const TextStyle(color: orangeC),
|
||||
style: scaledTextStyle(color: orangeC),
|
||||
underline: Container(
|
||||
height: 2,
|
||||
color: orangeC,
|
||||
|
@ -83,14 +84,14 @@ class _CustomDerivationState extends State<CustomDerivation> {
|
|||
.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: SizedBox(
|
||||
child: ScaledSizedBox(
|
||||
width: 75,
|
||||
child: Row(children: [
|
||||
const Spacer(),
|
||||
Text(
|
||||
value,
|
||||
style: const TextStyle(
|
||||
fontSize: 20, color: Colors.black),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17, color: Colors.black),
|
||||
),
|
||||
const Spacer(),
|
||||
]),
|
||||
|
@ -99,13 +100,14 @@ class _CustomDerivationState extends State<CustomDerivation> {
|
|||
),
|
||||
),
|
||||
const Spacer(flex: 1),
|
||||
SizedBox(
|
||||
width: 410,
|
||||
height: 70,
|
||||
ScaledSizedBox(
|
||||
width: 240,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.white, elevation: 4,
|
||||
backgroundColor: orangeC, // foreground
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 4,
|
||||
backgroundColor: orangeC,
|
||||
),
|
||||
onPressed: () async {
|
||||
WalletData? defaultWallet =
|
||||
|
@ -141,8 +143,10 @@ class _CustomDerivationState extends State<CustomDerivation> {
|
|||
},
|
||||
child: Text(
|
||||
'validate'.tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 24, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 19,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:flutter/services.dart';
|
|||
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -15,6 +16,7 @@ import 'package:gecko/providers/wallets_profiles.dart';
|
|||
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
||||
import 'package:gecko/screens/transaction_in_progress.dart';
|
||||
import 'package:gecko/widgets/certifications.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:gecko/widgets/idty_status.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
@ -32,20 +34,13 @@ class ImportG1v1 extends StatelessWidget {
|
|||
bool canValidate = false;
|
||||
String validationStatus = '';
|
||||
|
||||
log.d(myWalletProvider.listWallets);
|
||||
|
||||
return PopScope(
|
||||
onPopInvoked: (_) {
|
||||
resetScreen(context);
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text('importOldAccount'.tr()),
|
||||
)),
|
||||
appBar: GeckoAppBar('importOldAccount'.tr()),
|
||||
body: SafeArea(
|
||||
child: Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
return FutureBuilder(
|
||||
|
@ -53,15 +48,15 @@ class ImportG1v1 extends StatelessWidget {
|
|||
sub.g1V1NewAddress, selectedWallet.address),
|
||||
builder: (BuildContext context, AsyncSnapshot<List> status) {
|
||||
if (status.data == null) {
|
||||
return const Column(children: [
|
||||
SizedBox(height: 80),
|
||||
return Column(children: [
|
||||
ScaledSizedBox(height: 80),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
ScaledSizedBox(
|
||||
height: 35,
|
||||
width: 35,
|
||||
child: CircularProgressIndicator(
|
||||
child: const CircularProgressIndicator(
|
||||
color: orangeC,
|
||||
strokeWidth: 4,
|
||||
),
|
||||
|
@ -106,7 +101,7 @@ class ImportG1v1 extends StatelessWidget {
|
|||
final unit = isUdUnit ? 'ud'.tr(args: ['']) : currencyName;
|
||||
|
||||
return Column(children: <Widget>[
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(height: 10),
|
||||
TextFormField(
|
||||
key: keyCesiumId,
|
||||
autofocus: true,
|
||||
|
@ -117,15 +112,18 @@ 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,
|
||||
controller: sub.csSalt,
|
||||
obscureText: !sub
|
||||
.isCesiumIDVisible, //This will obscure text dynamically
|
||||
obscureText: !sub.isCesiumIDVisible,
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'enterCesiumId'.tr(),
|
||||
suffixIcon: IconButton(
|
||||
|
@ -135,6 +133,7 @@ class ImportG1v1 extends StatelessWidget {
|
|||
? Icons.visibility_off
|
||||
: Icons.visibility,
|
||||
color: Colors.black,
|
||||
size: scaleSize(22),
|
||||
),
|
||||
onPressed: () {
|
||||
sub.cesiumIDisVisible();
|
||||
|
@ -142,7 +141,7 @@ class ImportG1v1 extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(height: 7),
|
||||
TextFormField(
|
||||
key: keyCesiumPassword,
|
||||
autofocus: true,
|
||||
|
@ -154,15 +153,18 @@ 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,
|
||||
controller: sub.csPassword,
|
||||
obscureText: !sub
|
||||
.isCesiumIDVisible, //This will obscure text dynamically
|
||||
obscureText: !sub.isCesiumIDVisible,
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'enterCesiumPassword'.tr(),
|
||||
suffixIcon: IconButton(
|
||||
|
@ -171,6 +173,7 @@ class ImportG1v1 extends StatelessWidget {
|
|||
? Icons.visibility_off
|
||||
: Icons.visibility,
|
||||
color: Colors.black,
|
||||
size: scaleSize(22),
|
||||
),
|
||||
onPressed: () {
|
||||
sub.cesiumIDisVisible();
|
||||
|
@ -178,45 +181,75 @@ 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,
|
||||
),
|
||||
ScaledSizedBox(height: 20),
|
||||
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: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontFamily: 'Monospace'),
|
||||
),
|
||||
),
|
||||
ScaledSizedBox(height: 5),
|
||||
GestureDetector(
|
||||
key: keyCopyAddress,
|
||||
onTap: () {
|
||||
Clipboard.setData(
|
||||
ClipboardData(text: sub.g1V1OldPubkey));
|
||||
snackCopyKey(context);
|
||||
},
|
||||
child: Text(
|
||||
'v2: ${getShortPubkey(sub.g1V1NewAddress)}',
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontFamily: 'Monospace'),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
ScaledSizedBox(width: 30),
|
||||
Column(
|
||||
children: [
|
||||
Text(
|
||||
'${balance['transferableBalance']} $unit',
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
IdentityStatus(
|
||||
address: sub.g1V1NewAddress,
|
||||
isOwner: false,
|
||||
color: Colors.black),
|
||||
ScaledSizedBox(width: 10),
|
||||
Certifications(
|
||||
address: sub.g1V1NewAddress, size: 14)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(height: 20),
|
||||
Text(
|
||||
'${balance['transferableBalance']} $unit',
|
||||
style: const TextStyle(fontSize: 17),
|
||||
'migrateToThisWallet'.tr(),
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
IdentityStatus(
|
||||
address: sub.g1V1NewAddress,
|
||||
isOwner: false,
|
||||
color: Colors.black),
|
||||
const SizedBox(width: 10),
|
||||
Certifications(address: sub.g1V1NewAddress, size: 14)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text('selectDestWallet'.tr()),
|
||||
const SizedBox(height: 5),
|
||||
ScaledSizedBox(height: 5),
|
||||
DropdownButtonHideUnderline(
|
||||
key: keySelectWallet,
|
||||
child: DropdownButton(
|
||||
// alignment: AlignmentDirectional.topStart,
|
||||
value: selectedWallet,
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
items: myWalletProvider.listWallets.map((wallet) {
|
||||
|
@ -225,7 +258,7 @@ class ImportG1v1 extends StatelessWidget {
|
|||
value: wallet,
|
||||
child: Text(
|
||||
wallet.name!,
|
||||
style: const TextStyle(fontSize: 18),
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
|
@ -235,15 +268,16 @@ class ImportG1v1 extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
SizedBox(
|
||||
width: 380 * ratio,
|
||||
height: 60 * ratio,
|
||||
ScaledSizedBox(height: 10),
|
||||
ScaledSizedBox(
|
||||
width: 320,
|
||||
height: 50,
|
||||
child: ElevatedButton(
|
||||
key: keyConfirm,
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.white, elevation: 4,
|
||||
backgroundColor: orangeC, // foreground
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 4,
|
||||
backgroundColor: orangeC,
|
||||
),
|
||||
onPressed: canValidate
|
||||
? () async {
|
||||
|
@ -270,7 +304,7 @@ class ImportG1v1 extends StatelessWidget {
|
|||
balance: balance,
|
||||
idtyStatus: idtyStatus);
|
||||
Navigator.pop(context);
|
||||
Navigator.push(
|
||||
await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return TransactionInProgress(
|
||||
|
@ -286,17 +320,17 @@ class ImportG1v1 extends StatelessWidget {
|
|||
: null,
|
||||
child: Text(
|
||||
'migrateAccount'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 23 * ratio,
|
||||
fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 20, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
ScaledSizedBox(height: 10),
|
||||
Text(
|
||||
validationStatus,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 15, color: Colors.grey[600]),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 14, color: Colors.grey[600]),
|
||||
)
|
||||
]);
|
||||
});
|
||||
|
@ -312,5 +346,6 @@ class ImportG1v1 extends StatelessWidget {
|
|||
sub.csSalt.text = '';
|
||||
sub.csPassword.text = '';
|
||||
sub.g1V1NewAddress = '';
|
||||
sub.g1V1OldPubkey = '';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -12,6 +13,7 @@ import 'package:gecko/widgets/commons/common_elements.dart';
|
|||
import 'package:gecko/screens/myWallets/migrate_identity.dart';
|
||||
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
||||
import 'package:gecko/screens/transaction_in_progress.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
// import 'package:gecko/models/wallet_data.dart';
|
||||
// import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -31,44 +33,39 @@ class ManageMembership extends StatelessWidget {
|
|||
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: const Text('manageMembership').tr(),
|
||||
)),
|
||||
appBar: GeckoAppBar('manageMembership'.tr()),
|
||||
body: SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(height: 20),
|
||||
migrateIdentity(context),
|
||||
const SizedBox(height: 10),
|
||||
ScaledSizedBox(height: 10),
|
||||
FutureBuilder(
|
||||
future: sub.isSmith(address),
|
||||
builder: (BuildContext context, AsyncSnapshot<bool> isSmith) {
|
||||
if (isSmith.data ?? false) {
|
||||
return SizedBox(
|
||||
return ScaledSizedBox(
|
||||
height: 75,
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
const SizedBox(width: 20),
|
||||
ScaledSizedBox(width: 17),
|
||||
Image.asset(
|
||||
'assets/skull_Icon.png',
|
||||
color: Colors.grey[500],
|
||||
height: 30,
|
||||
height: scaleSize(28),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
ScaledSizedBox(width: 12),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('revokeMyIdentity'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 18,
|
||||
color: Colors.grey[500])),
|
||||
const SizedBox(height: 2),
|
||||
ScaledSizedBox(height: 2),
|
||||
Text("youCannotRevokeThisIdentity".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.grey[500])),
|
||||
]),
|
||||
],
|
||||
|
@ -77,7 +74,6 @@ class ManageMembership extends StatelessWidget {
|
|||
return revokeMyIdentity(context);
|
||||
}
|
||||
})
|
||||
// const SizedBox(height: 20),
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
@ -93,13 +89,13 @@ class ManageMembership extends StatelessWidget {
|
|||
}),
|
||||
);
|
||||
},
|
||||
child: const SizedBox(
|
||||
height: 60,
|
||||
child: ScaledSizedBox(
|
||||
height: 55,
|
||||
child: Row(children: <Widget>[
|
||||
SizedBox(width: 16),
|
||||
Icon(Icons.change_circle_outlined, size: 35),
|
||||
SizedBox(width: 11.5),
|
||||
Text('Migrer mon identité', style: TextStyle(fontSize: 20)),
|
||||
ScaledSizedBox(width: 16),
|
||||
Icon(Icons.change_circle_outlined, size: scaleSize(32)),
|
||||
ScaledSizedBox(width: 11.5),
|
||||
Text('Migrer mon identité', style: scaledTextStyle(fontSize: 18)),
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
@ -109,7 +105,6 @@ class ManageMembership extends StatelessWidget {
|
|||
return InkWell(
|
||||
key: keyRevokeIdty,
|
||||
onTap: () async {
|
||||
// TODOO: Generate revoke document, and understand extrinsic identity.revokeIdentity options
|
||||
final answer = await confirmPopup(context,
|
||||
'Êtes-vous certains de vouloir révoquer définitivement cette identité ?') ??
|
||||
false;
|
||||
|
@ -119,10 +114,6 @@ class ManageMembership extends StatelessWidget {
|
|||
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
final sub = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
|
||||
// MyWalletsProvider mw = MyWalletsProvider();
|
||||
// final wallet = mw.getWalletDataByAddress(address);
|
||||
// await sub.setCurrentWallet(wallet!);
|
||||
|
||||
WalletData? defaultWallet = myWalletProvider.getDefaultWallet();
|
||||
String? pin;
|
||||
if (myWalletProvider.pinCode == '') {
|
||||
|
@ -151,16 +142,16 @@ class ManageMembership extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 60,
|
||||
child: ScaledSizedBox(
|
||||
height: 55,
|
||||
child: Row(children: <Widget>[
|
||||
const SizedBox(width: 20),
|
||||
ScaledSizedBox(width: 20),
|
||||
Image.asset(
|
||||
'assets/skull_Icon.png',
|
||||
height: 30,
|
||||
height: scaleSize(28),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
const Text('Révoquer mon adhésion', style: TextStyle(fontSize: 20)),
|
||||
ScaledSizedBox(width: 16),
|
||||
Text('Révoquer mon adhésion', style: scaledTextStyle(fontSize: 18)),
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
|
@ -13,6 +14,7 @@ import 'package:gecko/providers/substrate_sdk.dart';
|
|||
import 'package:gecko/providers/wallet_options.dart';
|
||||
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
||||
import 'package:gecko/screens/transaction_in_progress.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class MigrateIdentityScreen extends StatelessWidget {
|
||||
|
@ -42,20 +44,20 @@ class MigrateIdentityScreen extends StatelessWidget {
|
|||
String validationStatus = '';
|
||||
|
||||
final mdStyle = MarkdownStyleSheet(
|
||||
p: const TextStyle(fontSize: 18, color: Colors.black, letterSpacing: 0.3),
|
||||
p: scaledTextStyle(fontSize: 17, color: Colors.black, letterSpacing: 0.3),
|
||||
textAlign: WrapAlignment.center,
|
||||
);
|
||||
|
||||
if (walletsList.length < 2) {
|
||||
return const Column(
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(height: 80),
|
||||
ScaledSizedBox(height: 80),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Vous devez avoir au moins 2 portefeuilles\npour effecter cette opération',
|
||||
style: TextStyle(fontSize: 20),
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
)
|
||||
],
|
||||
)
|
||||
|
@ -65,12 +67,7 @@ class MigrateIdentityScreen extends StatelessWidget {
|
|||
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text('importOldAccount'.tr()),
|
||||
)),
|
||||
appBar: GeckoAppBar('migrateIdentity'.tr()),
|
||||
body: SafeArea(
|
||||
child: Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
return FutureBuilder(
|
||||
|
@ -78,31 +75,27 @@ class MigrateIdentityScreen extends StatelessWidget {
|
|||
fromAddress, selectedWallet.address),
|
||||
builder: (BuildContext context, AsyncSnapshot<List> status) {
|
||||
if (status.data == null) {
|
||||
return const Column(children: [
|
||||
SizedBox(height: 80),
|
||||
return Column(children: [
|
||||
ScaledSizedBox(height: 80),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
SizedBox(
|
||||
height: 35,
|
||||
width: 35,
|
||||
ScaledSizedBox(
|
||||
height: scaleSize(32),
|
||||
width: scaleSize(32),
|
||||
child: CircularProgressIndicator(
|
||||
color: orangeC,
|
||||
strokeWidth: 4,
|
||||
strokeWidth: scaleSize(4),
|
||||
),
|
||||
),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
// log.d('statusData: ${status.data}');
|
||||
|
||||
final Map balance = status.data?[0] ?? {};
|
||||
final IdtyStatus idtyStatus = status.data?[1];
|
||||
final IdtyStatus myIdtyStatus = status.data?[2];
|
||||
final bool hasConsumer = status.data?[3] ?? false;
|
||||
final bool isSmith = status.data?[4] ?? false;
|
||||
|
||||
// log.d('hasconsumer: $hasConsumer');
|
||||
|
||||
if (isSmith) {
|
||||
canValidate = false;
|
||||
validationStatus = 'smithCantMigrateIdentity'.tr();
|
||||
|
@ -122,24 +115,19 @@ class MigrateIdentityScreen extends StatelessWidget {
|
|||
: 'thisAccountIsEmpty'.tr();
|
||||
}
|
||||
|
||||
log.d(
|
||||
'tatatata: ${sub.g1V1NewAddress}, ${selectedWallet.address}, $balance, $idtyStatus, $myIdtyStatus');
|
||||
|
||||
final walletsList = myWalletProvider.listWallets.toList();
|
||||
|
||||
walletsList
|
||||
.removeWhere((element) => element.address == fromAddress);
|
||||
// walletsList.add(WalletData(address: 'custom', name: 'custom'));
|
||||
|
||||
final bool isUdUnit = configBox.get('isUdUnit') ?? false;
|
||||
final unit = isUdUnit ? 'ud'.tr(args: ['']) : currencyName;
|
||||
|
||||
return Column(children: <Widget>[
|
||||
const Row(children: []),
|
||||
const SizedBox(height: 20),
|
||||
|
||||
SizedBox(
|
||||
width: 400,
|
||||
ScaledSizedBox(height: 18),
|
||||
ScaledSizedBox(
|
||||
width: 320,
|
||||
child: MarkdownBody(
|
||||
data: 'areYouSureMigrateIdentity'.tr(args: [
|
||||
duniterIndexer.walletNameIndexer[fromAddress] ??
|
||||
|
@ -148,30 +136,13 @@ class MigrateIdentityScreen extends StatelessWidget {
|
|||
]),
|
||||
styleSheet: mdStyle),
|
||||
),
|
||||
// Text(
|
||||
// 'areYouSureMigrateIdentity'.tr(args: [
|
||||
// duniterIndexer
|
||||
// .walletNameIndexer[fromAddress]!,
|
||||
// '$balance $currencyName'
|
||||
// ]),
|
||||
// textAlign: TextAlign.center,
|
||||
// ),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
sub.g1V1NewAddress,
|
||||
style: const TextStyle(
|
||||
fontSize: 14.0,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: 'Monospace'),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text('selectDestWallet'.tr()),
|
||||
const SizedBox(height: 5),
|
||||
ScaledSizedBox(height: 55),
|
||||
Text('migrateToThisWallet'.tr(),
|
||||
style: scaledTextStyle(fontSize: 17)),
|
||||
ScaledSizedBox(height: 5),
|
||||
DropdownButtonHideUnderline(
|
||||
key: keySelectWallet,
|
||||
child: DropdownButton(
|
||||
// alignment: AlignmentDirectional.topStart,
|
||||
value: selectedWallet,
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
items: walletsList.map((wallet) {
|
||||
|
@ -180,7 +151,7 @@ class MigrateIdentityScreen extends StatelessWidget {
|
|||
value: wallet,
|
||||
child: Text(
|
||||
wallet.name!,
|
||||
style: const TextStyle(fontSize: 18),
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
|
@ -190,19 +161,19 @@ class MigrateIdentityScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
SizedBox(
|
||||
width: 380 * ratio,
|
||||
height: 60 * ratio,
|
||||
const Spacer(flex: 2),
|
||||
ScaledSizedBox(
|
||||
width: 320,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyConfirm,
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.white, elevation: 4,
|
||||
backgroundColor: orangeC, // foreground
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 4,
|
||||
backgroundColor: orangeC,
|
||||
),
|
||||
onPressed: canValidate
|
||||
? () async {
|
||||
log.d('GOOO');
|
||||
WalletData? defaultWallet =
|
||||
myWalletProvider.getDefaultWallet();
|
||||
|
||||
|
@ -219,38 +190,47 @@ class MigrateIdentityScreen extends StatelessWidget {
|
|||
);
|
||||
}
|
||||
|
||||
sub.migrateIdentity(
|
||||
fromAddress: fromAddress,
|
||||
destAddress: selectedWallet.address,
|
||||
fromPassword: pin ?? myWalletProvider.pinCode,
|
||||
destPassword: pin ?? myWalletProvider.pinCode,
|
||||
withBalance: true,
|
||||
fromBalance: balance);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return TransactionInProgress(
|
||||
transType: 'identityMigration',
|
||||
fromAddress: getShortPubkey(fromAddress),
|
||||
toAddress: getShortPubkey(
|
||||
selectedWallet.address));
|
||||
}),
|
||||
);
|
||||
if (myWalletProvider.pinCode != '') {
|
||||
sub.migrateIdentity(
|
||||
fromAddress: fromAddress,
|
||||
destAddress: selectedWallet.address,
|
||||
fromPassword:
|
||||
pin ?? myWalletProvider.pinCode,
|
||||
destPassword:
|
||||
pin ?? myWalletProvider.pinCode,
|
||||
withBalance: true,
|
||||
fromBalance: balance);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return TransactionInProgress(
|
||||
transType: 'identityMigration',
|
||||
fromAddress:
|
||||
getShortPubkey(fromAddress),
|
||||
toAddress: getShortPubkey(
|
||||
selectedWallet.address));
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
: null,
|
||||
child: Text(
|
||||
'migrateIdentity'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 23 * ratio, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
ScaledSizedBox(height: 10),
|
||||
Text(
|
||||
validationStatus,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 15, color: Colors.grey[600]),
|
||||
)
|
||||
style:
|
||||
scaledTextStyle(fontSize: 15, color: Colors.grey[600]),
|
||||
),
|
||||
const Spacer(),
|
||||
]);
|
||||
});
|
||||
}),
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/generate_wallets.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
|
@ -12,6 +13,7 @@ import 'package:gecko/screens/onBoarding/7.dart';
|
|||
import 'package:gecko/screens/onBoarding/9.dart';
|
||||
import 'package:gecko/widgets/commons/fader_transition.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
// import 'package:gecko/models/home.dart';
|
||||
// import 'package:provider/provider.dart';
|
||||
|
@ -36,18 +38,13 @@ class RestoreChest extends StatelessWidget {
|
|||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text('restoreAChest'.tr()),
|
||||
)),
|
||||
appBar: GeckoAppBar('restoreAChest'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
Column(children: <Widget>[
|
||||
SizedBox(height: isTall ? 30 : 15),
|
||||
ScaledSizedBox(height: isTall ? 20 : 3),
|
||||
bubbleSpeak('toRestoreEnterMnemonic'.tr()),
|
||||
SizedBox(height: isTall ? 30 : 15),
|
||||
ScaledSizedBox(height: isTall ? 20 : 5),
|
||||
Column(children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
|
@ -57,7 +54,7 @@ class RestoreChest extends StatelessWidget {
|
|||
arrayCell(context, genW.cellController2),
|
||||
arrayCell(context, genW.cellController3),
|
||||
]),
|
||||
const SizedBox(height: 15),
|
||||
ScaledSizedBox(height: isTall ? 10 : 3),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
|
@ -66,7 +63,7 @@ class RestoreChest extends StatelessWidget {
|
|||
arrayCell(context, genW.cellController6),
|
||||
arrayCell(context, genW.cellController7),
|
||||
]),
|
||||
const SizedBox(height: 15),
|
||||
ScaledSizedBox(height: isTall ? 10 : 3),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
|
@ -81,9 +78,9 @@ class RestoreChest extends StatelessWidget {
|
|||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.center,
|
||||
child: SizedBox(
|
||||
width: 410,
|
||||
height: 70,
|
||||
child: ScaledSizedBox(
|
||||
width: 340,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyGoNext,
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
@ -110,8 +107,10 @@ class RestoreChest extends StatelessWidget {
|
|||
},
|
||||
child: Text(
|
||||
'restoreThisChest'.tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 24, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -119,10 +118,10 @@ class RestoreChest extends StatelessWidget {
|
|||
))
|
||||
else
|
||||
Column(children: [
|
||||
const SizedBox(height: 20),
|
||||
SizedBox(
|
||||
width: 190,
|
||||
height: 60,
|
||||
ScaledSizedBox(height: 20),
|
||||
ScaledSizedBox(
|
||||
width: 210,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyPastMnemonic,
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
@ -135,16 +134,15 @@ class RestoreChest extends StatelessWidget {
|
|||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.content_paste_go,
|
||||
size: 27,
|
||||
size: scaleSize(28),
|
||||
),
|
||||
// const SizedBox(width: 10),
|
||||
Text(
|
||||
'pasteFromClipboard'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 17, fontWeight: FontWeight.w400),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
)),
|
||||
|
@ -161,7 +159,7 @@ class RestoreChest extends StatelessWidget {
|
|||
Widget bubbleSpeak(String text) {
|
||||
return Bubble(
|
||||
margin: const BubbleEdges.symmetric(horizontal: 20),
|
||||
padding: BubbleEdges.all(isTall ? 25 : 15),
|
||||
padding: BubbleEdges.all(scaleSize(15)),
|
||||
borderWidth: 1,
|
||||
borderColor: Colors.black,
|
||||
radius: Radius.zero,
|
||||
|
@ -170,8 +168,8 @@ class RestoreChest extends StatelessWidget {
|
|||
text,
|
||||
key: keyBubbleSpeak,
|
||||
textAlign: TextAlign.justify,
|
||||
style: const TextStyle(
|
||||
color: Colors.black, fontSize: 19, fontWeight: FontWeight.w400),
|
||||
style: scaledTextStyle(
|
||||
color: Colors.black, fontSize: 17, fontWeight: FontWeight.w400),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -181,8 +179,8 @@ class RestoreChest extends StatelessWidget {
|
|||
Provider.of<GenerateWalletsProvider>(context);
|
||||
|
||||
return Container(
|
||||
width: 102,
|
||||
height: 40 * ratio,
|
||||
width: scaleSize(87),
|
||||
height: scaleSize(37),
|
||||
// ),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.grey),
|
||||
|
@ -213,7 +211,7 @@ class RestoreChest extends StatelessWidget {
|
|||
}
|
||||
},
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 20),
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -221,7 +219,7 @@ class RestoreChest extends StatelessWidget {
|
|||
Future<bool?> badMnemonicPopup(BuildContext context) async {
|
||||
return showDialog<bool>(
|
||||
context: context,
|
||||
barrierDismissible: true, // user must tap button!
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Phrase incorrecte'),
|
||||
|
|
|
@ -3,12 +3,14 @@ import 'package:flutter/services.dart';
|
|||
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:gecko/providers/wallets_profiles.dart';
|
||||
import 'package:gecko/widgets/commons/build_text.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:pdf/pdf.dart';
|
||||
import 'package:printing/printing.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -33,12 +35,7 @@ class ShowSeed extends StatelessWidget {
|
|||
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text('myMnemonic'.tr()),
|
||||
)),
|
||||
appBar: GeckoAppBar('myMnemonic'.tr()),
|
||||
body: SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
const Spacer(flex: 1),
|
||||
|
@ -48,10 +45,10 @@ class ShowSeed extends StatelessWidget {
|
|||
builder: (BuildContext context, AsyncSnapshot<String?> seed) {
|
||||
if (seed.connectionState != ConnectionState.done ||
|
||||
seed.hasError) {
|
||||
return const SizedBox(
|
||||
return ScaledSizedBox(
|
||||
height: 15,
|
||||
width: 15,
|
||||
child: CircularProgressIndicator(
|
||||
child: const CircularProgressIndicator(
|
||||
color: orangeC,
|
||||
strokeWidth: 2,
|
||||
),
|
||||
|
@ -64,74 +61,82 @@ class ShowSeed extends StatelessWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Column(children: [
|
||||
BuildText(text: 'keepYourMnemonicSecret'.tr()),
|
||||
SizedBox(height: 35 * ratio),
|
||||
BuildText(
|
||||
text: 'keepYourMnemonicSecret'.tr(), size: 16),
|
||||
ScaledSizedBox(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),
|
||||
ScaledSizedBox(height: 20),
|
||||
Row(
|
||||
children: [
|
||||
ScaledSizedBox(
|
||||
height: 39,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.black,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: orangeC,
|
||||
elevation: 1,
|
||||
),
|
||||
onPressed: () {
|
||||
Clipboard.setData(
|
||||
ClipboardData(text: seed.data!));
|
||||
snackCopySeed(context);
|
||||
},
|
||||
child: Row(children: <Widget>[
|
||||
Image.asset(
|
||||
'assets/walletOptions/copy-white.png',
|
||||
height: scaleSize(24),
|
||||
),
|
||||
ScaledSizedBox(width: 7),
|
||||
Text(
|
||||
'copy'.tr(),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 14, 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,
|
||||
ScaledSizedBox(width: 50),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return PrintWallet(seed.data);
|
||||
}),
|
||||
);
|
||||
},
|
||||
child: Image.asset(
|
||||
'assets/printer.png',
|
||||
height: scaleSize(38),
|
||||
),
|
||||
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),
|
||||
SizedBox(
|
||||
width: 380 * ratio,
|
||||
height: 60 * ratio,
|
||||
const Spacer(flex: 3),
|
||||
ScaledSizedBox(
|
||||
width: 240,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.white, elevation: 4,
|
||||
backgroundColor: orangeC, // foreground
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 4,
|
||||
backgroundColor: orangeC,
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text(
|
||||
'close'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 23 * ratio, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 19,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -141,61 +146,55 @@ 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: BoxConstraints(maxWidth: scaleSize(360)),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.black),
|
||||
color: const Color(0xffeeeedd),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10),
|
||||
)),
|
||||
padding: EdgeInsets.all(scaleSize(14)),
|
||||
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),
|
||||
]),
|
||||
ScaledSizedBox(height: 15),
|
||||
Row(children: <Widget>[
|
||||
arrayCell(mnemonic[4], 5),
|
||||
arrayCell(mnemonic[5], 6),
|
||||
arrayCell(mnemonic[6], 7),
|
||||
arrayCell(mnemonic[7], 8),
|
||||
]),
|
||||
ScaledSizedBox(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,
|
||||
return ScaledSizedBox(
|
||||
width: 82,
|
||||
child: Column(children: <Widget>[
|
||||
Text(
|
||||
nbr.toString(),
|
||||
style:
|
||||
TextStyle(fontSize: 13 * ratio, color: const Color(0xff6b6b52)),
|
||||
style: scaledTextStyle(fontSize: 11, color: const Color(0xff6b6b52)),
|
||||
),
|
||||
Text(
|
||||
dataWord,
|
||||
key: keyMnemonicWord(dataWord),
|
||||
style: TextStyle(fontSize: 17 * ratio, color: Colors.black),
|
||||
style: scaledTextStyle(fontSize: 16, color: Colors.black),
|
||||
),
|
||||
]),
|
||||
);
|
||||
|
@ -219,13 +218,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: scaleSize(57),
|
||||
title: Text(
|
||||
'printMyMnemonic'.tr(),
|
||||
style: scaledTextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
body: PdfPreview(
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/foundation.dart';
|
||||
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -58,15 +59,15 @@ class UnlockingWallet extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
Stack(children: <Widget>[
|
||||
Positioned(
|
||||
top: 10, //statusBarHeight + 10,
|
||||
top: 10,
|
||||
left: 15,
|
||||
child: Builder(
|
||||
builder: (context) => IconButton(
|
||||
key: keyPopButton,
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.arrow_back,
|
||||
color: Colors.black,
|
||||
size: 30,
|
||||
size: scaleSize(28),
|
||||
),
|
||||
onPressed: () {
|
||||
myWalletProvider.isPinValid = false;
|
||||
|
@ -77,52 +78,55 @@ class UnlockingWallet extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
Column(children: <Widget>[
|
||||
SizedBox(height: isTall ? 100 : 20),
|
||||
ScaledSizedBox(height: isTall ? 80 : 65),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
currentChest.imageFile == null
|
||||
? Image.asset(
|
||||
'assets/chests/${currentChest.imageName}',
|
||||
width: isTall ? 130 : 100,
|
||||
width: scaleSize(95),
|
||||
)
|
||||
: Image.file(
|
||||
currentChest.imageFile!,
|
||||
width: isTall ? 130 : 100,
|
||||
width: scaleSize(127),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
SizedBox(
|
||||
ScaledSizedBox(width: 5),
|
||||
ScaledSizedBox(
|
||||
width: 250,
|
||||
child: Text(
|
||||
currentChest.name!,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 25,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 22,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w700),
|
||||
)),
|
||||
]),
|
||||
SizedBox(height: 30 * ratio),
|
||||
SizedBox(
|
||||
width: 400,
|
||||
ScaledSizedBox(height: isTall ? 30 : 15),
|
||||
ScaledSizedBox(
|
||||
width: 350,
|
||||
child: Text(
|
||||
'toUnlockEnterPassword'.tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 19,
|
||||
textAlign: TextAlign.center,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400),
|
||||
)),
|
||||
SizedBox(height: 30 * ratio),
|
||||
ScaledSizedBox(height: isTall ? 30 : 15),
|
||||
if (!myWalletProvider.isPinValid &&
|
||||
!myWalletProvider.isPinLoading)
|
||||
Text(
|
||||
"thisIsNotAGoodCode".tr(),
|
||||
style: const TextStyle(
|
||||
color: Colors.red, fontWeight: FontWeight.w500),
|
||||
style: scaledTextStyle(
|
||||
color: Colors.red,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 16),
|
||||
),
|
||||
SizedBox(height: 10 * ratio),
|
||||
ScaledSizedBox(height: isTall ? 8 : 0),
|
||||
pinForm(context, pinLenght),
|
||||
SizedBox(height: 3 * ratio),
|
||||
ScaledSizedBox(height: 8),
|
||||
if (canUnlock)
|
||||
Consumer<WalletOptionsProvider>(
|
||||
builder: (context, sub, _) {
|
||||
|
@ -132,49 +136,50 @@ class UnlockingWallet extends StatelessWidget {
|
|||
walletOptions.changePinCacheChoice();
|
||||
},
|
||||
child: Row(children: [
|
||||
const SizedBox(height: 30),
|
||||
ScaledSizedBox(height: 30),
|
||||
const Spacer(),
|
||||
Icon(
|
||||
configBox.get('isCacheChecked')
|
||||
? Icons.check_box
|
||||
: Icons.check_box_outline_blank,
|
||||
color: orangeC,
|
||||
size: scaleSize(22),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ScaledSizedBox(width: 8),
|
||||
Text(
|
||||
'rememberPassword'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16, color: Colors.grey[700]),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 15, color: Colors.grey[700]),
|
||||
),
|
||||
const Spacer()
|
||||
]),
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 10),
|
||||
// const ScaledSizedBox(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: ScaledSizedBox(
|
||||
// width: 400,
|
||||
// height: 50,
|
||||
// child: Center(
|
||||
// child: Text(
|
||||
// 'changeChest'.tr(),
|
||||
// style: const scaledTextStyle(
|
||||
// fontSize: 22,
|
||||
// color: Colors.grey, // orangeC
|
||||
// fontWeight: FontWeight.w600),
|
||||
// ),
|
||||
// ),
|
||||
// )),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
|
@ -193,21 +198,22 @@ class UnlockingWallet extends StatelessWidget {
|
|||
// return Text(
|
||||
// 'Impossible de retrouver votre\nportefeuille par défaut.\nID: ${defaultWallet.id()}',
|
||||
// textAlign: TextAlign.center,
|
||||
// style: const TextStyle(
|
||||
// style: const scaledTextStyle(
|
||||
// color: Colors.redAccent, fontWeight: FontWeight.w500),
|
||||
// );
|
||||
// }
|
||||
|
||||
return Form(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 5 * ratio, horizontal: 30),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: scaleSize(3), horizontal: scaleSize(isTall ? 30 : 15)),
|
||||
child: PinCodeTextField(
|
||||
key: keyPinForm,
|
||||
textCapitalization: TextCapitalization.characters,
|
||||
focusNode: pinFocus,
|
||||
autoFocus: true,
|
||||
appContext: context,
|
||||
pastedTextStyle: TextStyle(
|
||||
pastedTextStyle: scaledTextStyle(
|
||||
color: Colors.green.shade600,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
@ -216,6 +222,7 @@ class UnlockingWallet extends StatelessWidget {
|
|||
obscuringCharacter: '*',
|
||||
animationType: AnimationType.slide,
|
||||
animationDuration: const Duration(milliseconds: 40),
|
||||
useHapticFeedback: true,
|
||||
validator: (v) {
|
||||
if (v!.length < pinLenght) {
|
||||
return "yourPasswordLengthIsX".tr(args: [pinLenght.toString()]);
|
||||
|
@ -228,13 +235,13 @@ class UnlockingWallet extends StatelessWidget {
|
|||
borderWidth: 4,
|
||||
shape: PinCodeFieldShape.box,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
fieldHeight: 50 * ratio,
|
||||
fieldWidth: 50,
|
||||
fieldHeight: scaleSize(47),
|
||||
fieldWidth: scaleSize(47),
|
||||
activeFillColor: Colors.black,
|
||||
),
|
||||
showCursor: kDebugMode ? false : true,
|
||||
showCursor: !kDebugMode,
|
||||
cursorColor: Colors.black,
|
||||
textStyle: const TextStyle(fontSize: 27, height: 1.6),
|
||||
textStyle: scaledTextStyle(fontSize: 25, height: 1.6),
|
||||
backgroundColor: const Color(0xffF9F9F1),
|
||||
enableActiveFill: false,
|
||||
controller: enterPin,
|
||||
|
@ -263,7 +270,7 @@ class UnlockingWallet extends StatelessWidget {
|
|||
myWalletProvider.isPinValid = true;
|
||||
myWalletProvider.isPinLoading = false;
|
||||
pinColor = Colors.green[400];
|
||||
myWalletProvider.resetPinCode();
|
||||
myWalletProvider.debounceResetPinCode();
|
||||
Navigator.pop(context, pin.toUpperCase());
|
||||
}
|
||||
},
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -23,7 +24,6 @@ import 'package:gecko/widgets/idty_status.dart';
|
|||
import 'package:gecko/widgets/name_by_address.dart';
|
||||
import 'package:gecko/widgets/page_route_no_transition.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
|
||||
class WalletOptions extends StatelessWidget {
|
||||
|
@ -49,8 +49,6 @@ class WalletOptions extends StatelessWidget {
|
|||
final isWalletNameIndexed =
|
||||
duniterIndexer.walletNameIndexer[walletOptions.address.text] != null;
|
||||
|
||||
log.d("Wallet options: $currentChest:${wallet.derivation}");
|
||||
|
||||
return PopScope(
|
||||
onPopInvoked: (_) {
|
||||
walletOptions.isEditing = false;
|
||||
|
@ -61,18 +59,18 @@ class WalletOptions extends StatelessWidget {
|
|||
backgroundColor: backgroundColor,
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
toolbarHeight: scaleSize(57),
|
||||
elevation: 0,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Consumer<WalletOptionsProvider>(
|
||||
builder: (context, walletProvider, _) {
|
||||
return Text(isWalletNameIndexed
|
||||
title: Consumer<WalletOptionsProvider>(
|
||||
builder: (context, walletProvider, _) {
|
||||
return Text(
|
||||
isWalletNameIndexed
|
||||
? duniterIndexer
|
||||
.walletNameIndexer[walletOptions.address.text]!
|
||||
: wallet.name!);
|
||||
}),
|
||||
),
|
||||
: wallet.name!,
|
||||
style: scaledTextStyle(fontSize: 20),
|
||||
);
|
||||
}),
|
||||
actions: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
|
@ -88,7 +86,7 @@ class WalletOptions extends StatelessWidget {
|
|||
child: QrImageWidget(
|
||||
data: walletOptions.address.text,
|
||||
version: QrVersions.auto,
|
||||
size: 80,
|
||||
size: scaleSize(70),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -99,7 +97,7 @@ class WalletOptions extends StatelessWidget {
|
|||
builder: (ctx) => SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
Container(
|
||||
height: isTall ? 5 : 0,
|
||||
height: 5,
|
||||
color: yellowC,
|
||||
),
|
||||
Consumer<WalletOptionsProvider>(
|
||||
|
@ -116,14 +114,15 @@ class WalletOptions extends StatelessWidget {
|
|||
)),
|
||||
child: Row(children: <Widget>[
|
||||
const Spacer(flex: 1),
|
||||
ScaledSizedBox(width: 15),
|
||||
avatar(walletProvider),
|
||||
const Spacer(flex: 1),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Stack(children: [
|
||||
SizedBox(
|
||||
width: 250,
|
||||
ScaledSizedBox(
|
||||
width: 230,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
@ -131,7 +130,7 @@ class WalletOptions extends StatelessWidget {
|
|||
builder: (context, walletProvider, _) {
|
||||
return NameByAddress(
|
||||
wallet: wallet,
|
||||
size: 29,
|
||||
size: 24,
|
||||
color: Colors.black,
|
||||
fontWeight: wallet.identityStatus ==
|
||||
IdtyStatus.validated
|
||||
|
@ -142,7 +141,7 @@ class WalletOptions extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
ScaledSizedBox(width: 10),
|
||||
if (duniterIndexer
|
||||
.walletNameIndexer[wallet.address] ==
|
||||
null)
|
||||
|
@ -161,16 +160,16 @@ class WalletOptions extends StatelessWidget {
|
|||
walletOptions.isEditing
|
||||
? 'assets/walletOptions/android-checkmark.png'
|
||||
: 'assets/walletOptions/edit.png',
|
||||
width: 25,
|
||||
height: 25),
|
||||
width: scaleSize(23),
|
||||
height: scaleSize(23)),
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
SizedBox(height: isTall ? 5 : 0),
|
||||
ScaledSizedBox(height: 5),
|
||||
Balance(
|
||||
address: walletProvider.address.text, size: 24),
|
||||
const SizedBox(width: 30),
|
||||
address: walletProvider.address.text, size: 20),
|
||||
ScaledSizedBox(width: 30),
|
||||
InkWell(
|
||||
onTap: () => sub.certsCounterCache[
|
||||
walletProvider.address.text] !=
|
||||
|
@ -200,10 +199,10 @@ class WalletOptions extends StatelessWidget {
|
|||
color: orangeC),
|
||||
Certifications(
|
||||
address: walletProvider.address.text,
|
||||
size: 20)
|
||||
size: 17)
|
||||
]),
|
||||
),
|
||||
SizedBox(height: 10 * ratio),
|
||||
ScaledSizedBox(height: 10),
|
||||
]),
|
||||
const Spacer(flex: 2),
|
||||
]),
|
||||
|
@ -214,24 +213,7 @@ class WalletOptions extends StatelessWidget {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
// InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(builder: (context) {
|
||||
// return QrCodeFullscreen(
|
||||
// _walletOptions.address.text,
|
||||
// );
|
||||
// }),
|
||||
// );
|
||||
// },
|
||||
// child: QrImageWidget(
|
||||
// data: _walletOptions.address.text,
|
||||
// version: QrVersions.auto,
|
||||
// size: isTall ? 150 : 80,
|
||||
// ),
|
||||
// ),
|
||||
SizedBox(height: 30 * ratio),
|
||||
ScaledSizedBox(height: 25),
|
||||
Consumer<WalletOptionsProvider>(
|
||||
builder: (context, walletProvider, _) {
|
||||
final defaultWallet =
|
||||
|
@ -242,24 +224,24 @@ class WalletOptions extends StatelessWidget {
|
|||
return Column(children: [
|
||||
confirmIdentityButton(walletProvider),
|
||||
pubkeyWidget(walletProvider, ctx),
|
||||
SizedBox(height: 10 * ratio),
|
||||
ScaledSizedBox(height: 11),
|
||||
activityWidget(
|
||||
context, historyProvider, walletProvider),
|
||||
SizedBox(height: 12 * ratio),
|
||||
ScaledSizedBox(height: 11),
|
||||
setDefaultWalletWidget(
|
||||
context,
|
||||
walletProvider,
|
||||
myWalletProvider,
|
||||
walletOptions,
|
||||
currentChest),
|
||||
SizedBox(height: 17 * ratio),
|
||||
ScaledSizedBox(height: 11),
|
||||
Column(children: [
|
||||
if (!walletProvider.isDefaultWallet &&
|
||||
!wallet.isMembre())
|
||||
deleteWallet(
|
||||
context, walletProvider, currentChest)
|
||||
else
|
||||
const SizedBox(),
|
||||
ScaledSizedBox(),
|
||||
if (wallet.isMembre())
|
||||
const ManageMembershipButton()
|
||||
])
|
||||
|
@ -294,11 +276,11 @@ class WalletOptions extends StatelessWidget {
|
|||
child: wallet.imageCustomPath == null || wallet.imageCustomPath == ''
|
||||
? Image.asset(
|
||||
'assets/avatars/${wallet.imageDefaultPath}',
|
||||
width: 110,
|
||||
width: scaleSize(122),
|
||||
)
|
||||
: Container(
|
||||
width: 150,
|
||||
height: 150,
|
||||
width: scaleSize(122),
|
||||
height: scaleSize(122),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.transparent,
|
||||
|
@ -321,7 +303,7 @@ class WalletOptions extends StatelessWidget {
|
|||
},
|
||||
child: Image.asset(
|
||||
'assets/walletOptions/camera.png',
|
||||
height: 40,
|
||||
height: scaleSize(38),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -338,9 +320,9 @@ class WalletOptions extends StatelessWidget {
|
|||
(BuildContext context, AsyncSnapshot<List<IdtyStatus>> snapshot) {
|
||||
if (snapshot.data!.first == IdtyStatus.created) {
|
||||
return Column(children: [
|
||||
SizedBox(
|
||||
width: 320,
|
||||
height: 60,
|
||||
ScaledSizedBox(
|
||||
width: 310,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyConfirmIdentity,
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
@ -358,24 +340,24 @@ class WalletOptions extends StatelessWidget {
|
|||
},
|
||||
child: Text(
|
||||
'confirmMyIdentity'.tr(),
|
||||
style: const TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: 21, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 7),
|
||||
ScaledSizedBox(height: 7),
|
||||
Text(
|
||||
"someoneCreatedYourIdentity".tr(args: [currencyName]),
|
||||
style: TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.grey[600],
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
ScaledSizedBox(height: 40),
|
||||
]);
|
||||
} else {
|
||||
return const SizedBox();
|
||||
return ScaledSizedBox();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -389,24 +371,24 @@ class WalletOptions extends StatelessWidget {
|
|||
Clipboard.setData(ClipboardData(text: walletProvider.address.text));
|
||||
snackCopyKey(ctx);
|
||||
},
|
||||
child: SizedBox(
|
||||
child: ScaledSizedBox(
|
||||
height: 50,
|
||||
child: Row(children: <Widget>[
|
||||
const SizedBox(width: 30),
|
||||
ScaledSizedBox(width: 26),
|
||||
Image.asset(
|
||||
'assets/walletOptions/key.png',
|
||||
height: 45,
|
||||
height: scaleSize(42),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
ScaledSizedBox(width: 19),
|
||||
Text(shortPubkey,
|
||||
style: const TextStyle(
|
||||
fontSize: 22,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 19,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontFamily: 'Monospace',
|
||||
color: Colors.black)),
|
||||
const SizedBox(width: 15),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
const Spacer(),
|
||||
ScaledSizedBox(
|
||||
height: 35,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.black,
|
||||
|
@ -414,7 +396,7 @@ class WalletOptions extends StatelessWidget {
|
|||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: orangeC,
|
||||
elevation: 1, // foreground
|
||||
elevation: 1,
|
||||
),
|
||||
onPressed: () {
|
||||
Clipboard.setData(
|
||||
|
@ -424,16 +406,12 @@ class WalletOptions extends StatelessWidget {
|
|||
child: Row(children: <Widget>[
|
||||
Image.asset(
|
||||
'assets/walletOptions/copy-white.png',
|
||||
height: 25,
|
||||
height: scaleSize(23),
|
||||
),
|
||||
const SizedBox(width: 7),
|
||||
Text(
|
||||
'copy'.tr(),
|
||||
style: TextStyle(fontSize: 15, color: Colors.grey[50]),
|
||||
)
|
||||
]),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
@ -446,7 +424,6 @@ class WalletOptions extends StatelessWidget {
|
|||
return InkWell(
|
||||
key: keyOpenActivity,
|
||||
onTap: () {
|
||||
// _historyProvider.nPage = 1;
|
||||
Navigator.push(
|
||||
context,
|
||||
PageNoTransit(builder: (context) {
|
||||
|
@ -454,18 +431,16 @@ class WalletOptions extends StatelessWidget {
|
|||
}),
|
||||
);
|
||||
},
|
||||
child: SizedBox(
|
||||
child: ScaledSizedBox(
|
||||
height: 50,
|
||||
child: Row(children: <Widget>[
|
||||
const SizedBox(width: 30),
|
||||
ScaledSizedBox(width: 26),
|
||||
Image.asset(
|
||||
'assets/walletOptions/clock.png',
|
||||
height: 45,
|
||||
height: scaleSize(42),
|
||||
),
|
||||
const SizedBox(width: 22),
|
||||
Text("displayActivity".tr(),
|
||||
style:
|
||||
const TextStyle(fontSize: 20, fontWeight: FontWeight.w500)),
|
||||
ScaledSizedBox(width: 20),
|
||||
Text("displayActivity".tr(), style: scaledTextStyle(fontSize: 18)),
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
@ -487,28 +462,34 @@ class WalletOptions extends StatelessWidget {
|
|||
await setDefaultWallet(context, currentChest);
|
||||
}
|
||||
: null,
|
||||
child: SizedBox(
|
||||
height: 50,
|
||||
child: ScaledSizedBox(
|
||||
height: 60,
|
||||
child: Row(children: <Widget>[
|
||||
const SizedBox(width: 31),
|
||||
CircleAvatar(
|
||||
backgroundColor:
|
||||
Colors.grey[walletProvider.isDefaultWallet ? 300 : 500],
|
||||
child: Image.asset(
|
||||
'assets/walletOptions/android-checkmark.png',
|
||||
height: 25,
|
||||
ScaledSizedBox(width: isTall ? 28 : 23),
|
||||
ScaledSizedBox(
|
||||
height: 42,
|
||||
child: CircleAvatar(
|
||||
backgroundColor:
|
||||
Colors.grey[walletProvider.isDefaultWallet ? 300 : 500],
|
||||
child: Image.asset(
|
||||
'assets/walletOptions/android-checkmark.png',
|
||||
height: scaleSize(23),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 22),
|
||||
Text(
|
||||
walletProvider.isDefaultWallet
|
||||
? 'thisWalletIsDefault'.tr()
|
||||
: 'defineWalletAsDefault'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: walletProvider.isDefaultWallet
|
||||
? Colors.grey[500]
|
||||
: Colors.black)),
|
||||
ScaledSizedBox(width: isTall ? 21 : 18),
|
||||
ScaledSizedBox(
|
||||
width: 250,
|
||||
child: Text(
|
||||
walletProvider.isDefaultWallet
|
||||
? 'thisWalletIsDefault'.tr()
|
||||
: 'defineWalletAsDefault'.tr(),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 18,
|
||||
color: walletProvider.isDefaultWallet
|
||||
? Colors.grey[500]
|
||||
: Colors.black)),
|
||||
),
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
@ -522,8 +503,6 @@ class WalletOptions extends StatelessWidget {
|
|||
final walletOptions =
|
||||
Provider.of<WalletOptionsProvider>(context, listen: false);
|
||||
|
||||
// WalletData defaultWallet = _myWalletProvider.getDefaultWallet()!;
|
||||
// defaultWallet = wallet;
|
||||
await sub.setCurrentWallet(wallet);
|
||||
await myWalletProvider.readAllWallets(currentChest);
|
||||
myWalletProvider.reload();
|
||||
|
@ -539,8 +518,6 @@ class WalletOptions extends StatelessWidget {
|
|||
final defaultWallet = myWalletProvider.getDefaultWallet();
|
||||
final bool isDefaultWallet =
|
||||
walletOptions.address.text == defaultWallet.address;
|
||||
// return Consumer<MyWalletsProvider>(
|
||||
// builder: (context, _myWalletProvider, _) {
|
||||
return FutureBuilder(
|
||||
future: sub.hasAccountConsumers(wallet.address),
|
||||
builder: (BuildContext context, AsyncSnapshot<bool> hasConsumers) {
|
||||
|
@ -568,17 +545,17 @@ class WalletOptions extends StatelessWidget {
|
|||
: null,
|
||||
child: canDelete
|
||||
? Row(children: <Widget>[
|
||||
const SizedBox(width: 30),
|
||||
ScaledSizedBox(width: 27),
|
||||
Image.asset(
|
||||
'assets/walletOptions/trash.png',
|
||||
height: 45,
|
||||
height: scaleSize(42),
|
||||
),
|
||||
const SizedBox(width: 19),
|
||||
ScaledSizedBox(width: 19),
|
||||
Text('deleteThisWallet'.tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 20, color: Color(0xffD80000))),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 18, color: const Color(0xffD80000))),
|
||||
])
|
||||
: const SizedBox(width: 30),
|
||||
: ScaledSizedBox(width: 30),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/chest_data.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
|
@ -44,15 +45,21 @@ class _WalletsHomeState extends State<WalletsHome> {
|
|||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
elevation: 1,
|
||||
toolbarHeight: 60 * ratio,
|
||||
toolbarHeight: scaleSize(57),
|
||||
title: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/chests/${currentChest.imageName}',
|
||||
height: 32,
|
||||
),
|
||||
const SizedBox(width: 17),
|
||||
Text(currentChest.name!, style: TextStyle(color: Colors.grey[850])),
|
||||
ScaledSizedBox(width: 17),
|
||||
Text(
|
||||
currentChest.name!,
|
||||
style: scaledTextStyle(
|
||||
color: Colors.grey[850],
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
backgroundColor: const Color(0xffFFD58D),
|
||||
|
@ -73,11 +80,11 @@ class _WalletsHomeState extends State<WalletsHome> {
|
|||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState != ConnectionState.done ||
|
||||
snapshot.hasError) {
|
||||
return const Center(
|
||||
child: SizedBox(
|
||||
return Center(
|
||||
child: ScaledSizedBox(
|
||||
height: 50,
|
||||
width: 50,
|
||||
child: CircularProgressIndicator(
|
||||
child: const CircularProgressIndicator(
|
||||
color: orangeC,
|
||||
strokeWidth: 3,
|
||||
),
|
||||
|
@ -96,19 +103,19 @@ class _WalletsHomeState extends State<WalletsHome> {
|
|||
|
||||
Widget myWalletsTiles(BuildContext context, int currentChestNumber) {
|
||||
final myWalletProvider = Provider.of<MyWalletsProvider>(context);
|
||||
final bool isWalletsExists = myWalletProvider.checkIfWalletExist();
|
||||
final bool isWalletsExists = myWalletProvider.isWalletsExists();
|
||||
|
||||
if (!isWalletsExists) {
|
||||
return const Text('');
|
||||
}
|
||||
|
||||
if (myWalletProvider.listWallets.isEmpty) {
|
||||
return const Expanded(
|
||||
return Expanded(
|
||||
child: Column(children: <Widget>[
|
||||
Center(
|
||||
child: Text(
|
||||
'Veuillez générer votre premier portefeuille',
|
||||
style: TextStyle(fontSize: 17, fontWeight: FontWeight.w500),
|
||||
style: scaledTextStyle(fontSize: 17, fontWeight: FontWeight.w500),
|
||||
)),
|
||||
]));
|
||||
}
|
||||
|
@ -131,9 +138,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,13 +155,13 @@ class _WalletsHomeState extends State<WalletsHome> {
|
|||
TargetContent(
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset('assets/drag-and-drop.png', height: 140),
|
||||
const SizedBox(height: 15),
|
||||
Image.asset('assets/drag-and-drop.png', height: scaleSize(115)),
|
||||
ScaledSizedBox(height: 15),
|
||||
Text(
|
||||
'explainDraggableWallet'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 22, fontWeight: FontWeight.w500),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 20, fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
))
|
||||
|
@ -178,35 +185,38 @@ class _WalletsHomeState extends State<WalletsHome> {
|
|||
configBox.put('showDraggableTutorial', false);
|
||||
}
|
||||
|
||||
return CustomScrollView(slivers: <Widget>[
|
||||
const SliverToBoxAdapter(child: SizedBox(height: 20)),
|
||||
if (idtyWallet.address != '')
|
||||
SliverToBoxAdapter(
|
||||
child: DragTuleAction(
|
||||
wallet: idtyWallet,
|
||||
child: WalletTileMembre(repository: idtyWallet),
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5),
|
||||
child: CustomScrollView(slivers: <Widget>[
|
||||
SliverToBoxAdapter(child: ScaledSizedBox(height: 12)),
|
||||
if (idtyWallet.address != '')
|
||||
SliverToBoxAdapter(
|
||||
child: DragTuleAction(
|
||||
wallet: idtyWallet,
|
||||
child: WalletTileMembre(repository: idtyWallet),
|
||||
),
|
||||
),
|
||||
),
|
||||
SliverGrid.count(
|
||||
key: keyListWallets,
|
||||
crossAxisCount: nTule,
|
||||
childAspectRatio: 1,
|
||||
crossAxisSpacing: 0,
|
||||
mainAxisSpacing: 0,
|
||||
children: <Widget>[
|
||||
for (WalletData repository in listWalletsWithoutIdty)
|
||||
DragTuleAction(
|
||||
wallet: repository,
|
||||
child: WalletTile(repository: repository),
|
||||
),
|
||||
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
return sub.nodeConnected &&
|
||||
myWalletProvider.listWallets.length < maxWalletsInSafe
|
||||
? const AddNewDerivationButton()
|
||||
: const Text('');
|
||||
}),
|
||||
]),
|
||||
const SliverToBoxAdapter(child: ChestOptionsButtons()),
|
||||
]);
|
||||
SliverGrid.count(
|
||||
key: keyListWallets,
|
||||
crossAxisCount: nTule,
|
||||
childAspectRatio: 1,
|
||||
crossAxisSpacing: 0,
|
||||
mainAxisSpacing: 0,
|
||||
children: <Widget>[
|
||||
for (WalletData repository in listWalletsWithoutIdty)
|
||||
DragTuleAction(
|
||||
wallet: repository,
|
||||
child: WalletTile(repository: repository),
|
||||
),
|
||||
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
return sub.nodeConnected &&
|
||||
myWalletProvider.listWallets.length < maxWalletsInSafe
|
||||
? const AddNewDerivationButton()
|
||||
: const Text('');
|
||||
}),
|
||||
]),
|
||||
const SliverToBoxAdapter(child: ChestOptionsButtons()),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:gecko/providers/wallets_profiles.dart';
|
||||
import 'package:gecko/widgets/bottom_app_bar.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:gecko/widgets/contacts_list.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
@ -24,15 +25,8 @@ class ContactsScreen extends StatelessWidget {
|
|||
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
elevation: 1,
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(
|
||||
'contactsManagementWithNbr'.tr(args: ['${myContacts.length}'])),
|
||||
),
|
||||
),
|
||||
appBar: GeckoAppBar(
|
||||
'contactsManagementWithNbr'.tr(args: ['${myContacts.length}'])),
|
||||
bottomNavigationBar: const GeckoBottomAppBar(),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
|
|
|
@ -6,6 +6,7 @@ import 'package:gecko/globals.dart';
|
|||
import 'package:gecko/screens/onBoarding/2.dart';
|
||||
import 'package:gecko/widgets/commons/intro_info.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
|
||||
class OnboardingStepOne extends StatelessWidget {
|
||||
const OnboardingStepOne({Key? key}) : super(key: key);
|
||||
|
@ -14,17 +15,7 @@ class OnboardingStepOne extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(
|
||||
'newWallet'.tr(),
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: GeckoAppBar('newWallet'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
InfoIntro(
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/generate_wallets.dart';
|
||||
|
@ -16,6 +17,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/commons/top_appbar.dart';
|
||||
import 'package:gecko/widgets/scan_derivations_info.dart';
|
||||
import 'package:pin_code_fields/pin_code_fields.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -48,25 +50,15 @@ 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),
|
||||
),
|
||||
),
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: GeckoAppBar('myPassword'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
Column(children: <Widget>[
|
||||
SizedBox(height: isTall ? 40 : 20),
|
||||
ScaledSizedBox(height: isTall ? 25 : 5),
|
||||
const BuildProgressBar(pagePosition: 9),
|
||||
SizedBox(height: isTall ? 40 : 20),
|
||||
ScaledSizedBox(height: isTall ? 25 : 5),
|
||||
BuildText(text: "geckoWillCheckPassword".tr()),
|
||||
SizedBox(height: isTall ? 60 : 10),
|
||||
ScaledSizedBox(height: isTall ? 25 : 0),
|
||||
const ScanDerivationsInfo(),
|
||||
Consumer<MyWalletsProvider>(builder: (context, mw, _) {
|
||||
return Visibility(
|
||||
|
@ -74,12 +66,14 @@ class OnboardingStepTen extends StatelessWidget {
|
|||
!myWalletProvider.isPinLoading,
|
||||
child: Text(
|
||||
"thisIsNotAGoodCode".tr(),
|
||||
style: const TextStyle(
|
||||
color: Colors.red, fontWeight: FontWeight.w500),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 16,
|
||||
color: Colors.red,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
);
|
||||
}),
|
||||
SizedBox(height: isTall ? 20 : 10),
|
||||
ScaledSizedBox(height: isTall ? 20 : 0),
|
||||
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
return sub.nodeConnected
|
||||
? pinForm(context, walletOptions, pinLenght, 1, 2)
|
||||
|
@ -88,7 +82,7 @@ class OnboardingStepTen extends StatelessWidget {
|
|||
children: [
|
||||
Text(
|
||||
"youHaveToBeConnectedToValidateChest".tr(),
|
||||
style: const TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: 20,
|
||||
color: Colors.redAccent,
|
||||
fontWeight: FontWeight.w500,
|
||||
|
@ -106,25 +100,25 @@ class OnboardingStepTen extends StatelessWidget {
|
|||
walletOptions.changePinCacheChoice();
|
||||
},
|
||||
child: Row(children: [
|
||||
const SizedBox(height: 30),
|
||||
ScaledSizedBox(height: isTall ? 30 : 0),
|
||||
const Spacer(),
|
||||
Icon(
|
||||
configBox.get('isCacheChecked') ?? false
|
||||
? Icons.check_box
|
||||
: Icons.check_box_outline_blank,
|
||||
color: orangeC,
|
||||
size: scaleSize(22),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ScaledSizedBox(width: 8),
|
||||
Text(
|
||||
'rememberPassword'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16, color: Colors.grey[700]),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 15, color: Colors.grey[700]),
|
||||
),
|
||||
const Spacer()
|
||||
]))
|
||||
: const Text('');
|
||||
}),
|
||||
const SizedBox(height: 10),
|
||||
]),
|
||||
const OfflineInfo(),
|
||||
]),
|
||||
|
@ -159,6 +153,7 @@ class OnboardingStepTen extends StatelessWidget {
|
|||
length: pinLenght,
|
||||
obscureText: true,
|
||||
obscuringCharacter: '*',
|
||||
useHapticFeedback: true,
|
||||
animationType: AnimationType.slide,
|
||||
animationDuration: const Duration(milliseconds: 40),
|
||||
validator: (v) {
|
||||
|
@ -173,13 +168,13 @@ class OnboardingStepTen extends StatelessWidget {
|
|||
borderWidth: 4,
|
||||
shape: PinCodeFieldShape.box,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
fieldHeight: 50 * ratio,
|
||||
fieldWidth: 50,
|
||||
fieldHeight: scaleSize(47),
|
||||
fieldWidth: scaleSize(47),
|
||||
activeFillColor: Colors.black,
|
||||
),
|
||||
showCursor: kDebugMode ? false : true,
|
||||
showCursor: !kDebugMode,
|
||||
cursorColor: Colors.black,
|
||||
textStyle: const TextStyle(fontSize: 27, height: 1.6),
|
||||
textStyle: const TextStyle(fontSize: 25, height: 1.6),
|
||||
backgroundColor: const Color(0xffF9F9F1),
|
||||
enableActiveFill: false,
|
||||
controller: enterPin,
|
||||
|
@ -194,7 +189,6 @@ class OnboardingStepTen extends StatelessWidget {
|
|||
onCompleted: (pin) async {
|
||||
myWalletProvider.pinCode = pin.toUpperCase();
|
||||
myWalletProvider.pinLenght = pinLenght;
|
||||
log.d('$pin || ${generateWalletProvider.pin.text}');
|
||||
if (pin.toUpperCase() == generateWalletProvider.pin.text) {
|
||||
pinColor = Colors.green[500];
|
||||
myWalletProvider.isPinLoading = false;
|
||||
|
@ -225,8 +219,7 @@ class OnboardingStepTen extends StatelessWidget {
|
|||
myWalletProvider.reload();
|
||||
|
||||
generateWalletProvider.generatedMnemonic = '';
|
||||
myWalletProvider.resetPinCode();
|
||||
// sleep(const Duration(milliseconds: 500));
|
||||
myWalletProvider.debounceResetPinCode();
|
||||
Navigator.push(
|
||||
context,
|
||||
FaderTransition(
|
||||
|
@ -238,7 +231,6 @@ class OnboardingStepTen extends StatelessWidget {
|
|||
myWalletProvider.isPinValid = false;
|
||||
pinColor = Colors.red[600];
|
||||
enterPin.text = '';
|
||||
// myWalletProvider.reload();
|
||||
pinFocus.requestFocus();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -5,8 +5,10 @@ import 'package:confetti/confetti.dart';
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/widgets/commons/build_text.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
|
||||
class OnboardingStepEleven extends StatelessWidget {
|
||||
const OnboardingStepEleven({Key? key}) : super(key: key);
|
||||
|
@ -20,35 +22,24 @@ class OnboardingStepEleven extends StatelessWidget {
|
|||
canPop: false,
|
||||
child: Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
leading: const Icon(Icons.check),
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(
|
||||
'allGood'.tr(),
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: GeckoAppBar('allGood'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
Column(children: <Widget>[
|
||||
const SizedBox(height: 40),
|
||||
ScaledSizedBox(height: isTall ? 25 : 5),
|
||||
BuildText(
|
||||
text: "yourChestAndWalletWereCreatedSuccessfully".tr()),
|
||||
SizedBox(height: isTall ? 20 : 10),
|
||||
ScaledSizedBox(height: isTall ? 15 : 5),
|
||||
Image.asset(
|
||||
'assets/onBoarding/gecko-clin.gif',
|
||||
height: isTall ? 400 : 300,
|
||||
height: scaleSize(isTall ? 330 : 280),
|
||||
),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: finishButton(context)),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
ScaledSizedBox(height: isTall ? 40 : 5),
|
||||
]),
|
||||
Align(
|
||||
alignment: Alignment.topLeft,
|
||||
|
@ -83,9 +74,9 @@ class OnboardingStepEleven extends StatelessWidget {
|
|||
}
|
||||
|
||||
Widget finishButton(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: 380 * ratio,
|
||||
height: 60 * ratio,
|
||||
return ScaledSizedBox(
|
||||
width: 340,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyGoWalletsHome,
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
@ -99,7 +90,8 @@ Widget finishButton(BuildContext context) {
|
|||
},
|
||||
child: Text(
|
||||
"accessMyChest".tr(),
|
||||
style: TextStyle(fontSize: 22 * ratio, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 21, fontWeight: FontWeight.w600, color: Colors.white),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:gecko/globals.dart';
|
|||
import 'package:gecko/screens/onBoarding/3.dart';
|
||||
import 'package:gecko/widgets/commons/intro_info.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
|
||||
class OnboardingStepTwo extends StatelessWidget {
|
||||
const OnboardingStepTwo({Key? key}) : super(key: key);
|
||||
|
@ -15,17 +16,7 @@ class OnboardingStepTwo extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(
|
||||
'yourMnemonic'.tr(),
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: GeckoAppBar('yourMnemonic'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
InfoIntro(
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:gecko/globals.dart';
|
|||
import 'package:gecko/screens/onBoarding/4.dart';
|
||||
import 'package:gecko/widgets/commons/intro_info.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
|
||||
class OnboardingStepThree extends StatelessWidget {
|
||||
const OnboardingStepThree({Key? key}) : super(key: key);
|
||||
|
@ -15,25 +16,17 @@ class OnboardingStepThree extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(
|
||||
'yourMnemonic'.tr(),
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: GeckoAppBar('yourMnemonic'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
InfoIntro(
|
||||
text: 'warningForgotPassword'.tr(),
|
||||
assetName: 'forgot_password.png'.tr(),
|
||||
buttonText: '>',
|
||||
nextScreen: const OnboardingStepFor(),
|
||||
pagePosition: 2),
|
||||
text: 'warningForgotPassword'.tr(),
|
||||
assetName: 'forgot_password.png'.tr(),
|
||||
buttonText: '>',
|
||||
nextScreen: const OnboardingStepFor(),
|
||||
pagePosition: 2,
|
||||
boxHeight: 316,
|
||||
),
|
||||
const OfflineInfo(),
|
||||
]),
|
||||
),
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:gecko/globals.dart';
|
|||
import 'package:gecko/screens/onBoarding/5.dart';
|
||||
import 'package:gecko/widgets/commons/intro_info.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
|
||||
class OnboardingStepFor extends StatelessWidget {
|
||||
const OnboardingStepFor({Key? key}) : super(key: key);
|
||||
|
@ -15,17 +16,7 @@ class OnboardingStepFor extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(
|
||||
'yourMnemonic'.tr(),
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: GeckoAppBar('yourMnemonic'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
InfoIntro(
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/generate_wallets.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -15,6 +16,7 @@ import 'package:gecko/widgets/commons/build_text.dart';
|
|||
import 'package:gecko/screens/onBoarding/6.dart';
|
||||
import 'package:gecko/widgets/commons/fader_transition.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
AsyncSnapshot<List>? mnemoList;
|
||||
|
@ -39,30 +41,53 @@ 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),
|
||||
),
|
||||
),
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: GeckoAppBar('yourMnemonic'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
Column(children: [
|
||||
SizedBox(height: isTall ? 40 : 20),
|
||||
ScaledSizedBox(height: isTall ? 25 : 5),
|
||||
const BuildProgressBar(pagePosition: 4),
|
||||
SizedBox(height: isTall ? 40 : 20),
|
||||
ScaledSizedBox(height: isTall ? 25 : 5),
|
||||
BuildText(text: 'geckoGeneratedYourMnemonicKeepItSecret'.tr()),
|
||||
SizedBox(height: 35 * ratio),
|
||||
ScaledSizedBox(height: isTall ? 15 : 5),
|
||||
sentanceArray(context),
|
||||
SizedBox(height: 17 * ratio),
|
||||
ScaledSizedBox(height: isTall ? 17 : 5),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ScaledSizedBox(
|
||||
height: 40,
|
||||
width: 132,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.black,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: orangeC,
|
||||
elevation: 1,
|
||||
),
|
||||
onPressed: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: generateWalletProvider.generatedMnemonic!));
|
||||
snackCopySeed(context);
|
||||
},
|
||||
child: Row(children: <Widget>[
|
||||
Image.asset(
|
||||
'assets/walletOptions/copy-white.png',
|
||||
height: scaleSize(23),
|
||||
),
|
||||
const Spacer(),
|
||||
Text(
|
||||
'copy'.tr(),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 15, color: Colors.grey[50]),
|
||||
),
|
||||
const Spacer(),
|
||||
]),
|
||||
),
|
||||
),
|
||||
ScaledSizedBox(width: 70),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
|
@ -75,71 +100,39 @@ class _ChooseChestState extends State<OnboardingStepFive> {
|
|||
},
|
||||
child: Image.asset(
|
||||
'assets/printer.png',
|
||||
height: 42 * ratio,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
width: 120,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.black,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
backgroundColor: orangeC,
|
||||
elevation: 1, // foreground
|
||||
),
|
||||
onPressed: () {
|
||||
Clipboard.setData(ClipboardData(
|
||||
text: generateWalletProvider.generatedMnemonic!));
|
||||
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]),
|
||||
)
|
||||
]),
|
||||
height: scaleSize(42),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
ScaledSizedBox(height: isTall ? 17 : 5),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: SizedBox(
|
||||
width: 380 * ratio,
|
||||
height: 60 * ratio,
|
||||
child: ScaledSizedBox(
|
||||
width: 350,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyGenerateMnemonic,
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.black, elevation: 4,
|
||||
backgroundColor: const Color(0xffFFD58D), // foreground
|
||||
foregroundColor: Colors.black,
|
||||
elevation: 4,
|
||||
backgroundColor: const Color(0xffFFD58D),
|
||||
),
|
||||
onPressed: () {
|
||||
// _generateWalletProvider.reloadBuild();
|
||||
setState(() {});
|
||||
},
|
||||
child: Text("chooseAnotherMnemonic".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 22 * ratio,
|
||||
fontWeight: FontWeight.w600))),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 22, fontWeight: FontWeight.w600))),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 22 * ratio),
|
||||
ScaledSizedBox(height: isTall ? 20 : 10),
|
||||
nextButton(
|
||||
context, "iNotedMyMnemonic".tr(), false, widget.skipIntro),
|
||||
const Spacer(),
|
||||
// SizedBox(height: 35 * ratio),
|
||||
isTall ? const Spacer() : const SizedBox(height: 5),
|
||||
]),
|
||||
const OfflineInfo(),
|
||||
]),
|
||||
|
@ -152,68 +145,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: BoxConstraints(maxWidth: scaleSize(isTall ? 355 : 340)),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: Colors.black),
|
||||
color: const Color(0xffeeeedd),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10),
|
||||
)),
|
||||
padding: EdgeInsets.all(scaleSize(11)),
|
||||
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]),
|
||||
]),
|
||||
ScaledSizedBox(height: 12),
|
||||
Row(children: <Widget>[
|
||||
arrayCell(data.data![4]),
|
||||
arrayCell(data.data![5]),
|
||||
arrayCell(data.data![6]),
|
||||
arrayCell(data.data![7]),
|
||||
]),
|
||||
ScaledSizedBox(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,
|
||||
return ScaledSizedBox(
|
||||
width: scaleSize(isTall ? 78 : 91),
|
||||
child: Column(children: <Widget>[
|
||||
Text(
|
||||
dataWord.split(':')[0],
|
||||
style: TextStyle(fontSize: 13 * ratio, color: const Color(0xff6b6b52)),
|
||||
style: scaledTextStyle(fontSize: 12, color: const Color(0xff6b6b52)),
|
||||
),
|
||||
Text(
|
||||
dataWord.split(':')[1],
|
||||
key: keyMnemonicWord(dataWord.split(':')[0]),
|
||||
style: TextStyle(fontSize: 17 * ratio, color: Colors.black),
|
||||
style: scaledTextStyle(fontSize: 16, color: Colors.black),
|
||||
),
|
||||
]),
|
||||
);
|
||||
|
@ -225,9 +215,9 @@ Widget nextButton(
|
|||
Provider.of<GenerateWalletsProvider>(context, listen: false);
|
||||
final myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
return SizedBox(
|
||||
width: 380 * ratio,
|
||||
height: 60 * ratio,
|
||||
return ScaledSizedBox(
|
||||
width: 350,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyGoNext,
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
@ -251,7 +241,8 @@ Widget nextButton(
|
|||
},
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(fontSize: 22 * ratio, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 22, fontWeight: FontWeight.w600, color: Colors.white),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/generate_wallets.dart';
|
||||
import 'package:gecko/widgets/commons/build_progress_bar.dart';
|
||||
|
@ -13,6 +13,7 @@ import 'package:gecko/screens/onBoarding/7.dart';
|
|||
import 'package:gecko/screens/onBoarding/9.dart';
|
||||
import 'package:gecko/widgets/commons/fader_transition.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class OnboardingStepSix extends StatelessWidget {
|
||||
|
@ -22,7 +23,7 @@ class OnboardingStepSix extends StatelessWidget {
|
|||
|
||||
final bool skipIntro;
|
||||
String? generatedMnemonic;
|
||||
TextEditingController wordController = TextEditingController();
|
||||
final wordController = TextEditingController();
|
||||
final TextEditingController _mnemonicController = TextEditingController();
|
||||
|
||||
@override
|
||||
|
@ -40,47 +41,37 @@ class OnboardingStepSix extends StatelessWidget {
|
|||
child: Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
resizeToAvoidBottomInset: false,
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(
|
||||
'yourMnemonic'.tr(),
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
appBar: GeckoAppBar('yourMnemonic'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
Align(
|
||||
alignment: Alignment.topCenter,
|
||||
child: Column(children: [
|
||||
SizedBox(height: isTall ? 40 : 20),
|
||||
ScaledSizedBox(height: isTall ? 25 : 5),
|
||||
const BuildProgressBar(pagePosition: 5),
|
||||
SizedBox(height: isTall ? 40 : 20),
|
||||
ScaledSizedBox(height: isTall ? 25 : 5),
|
||||
BuildText(
|
||||
text: "didYouNoteMnemonicToBeSureTypeWord".tr(args: [
|
||||
(generateWalletProvider.nbrWord + 1).toString()
|
||||
]),
|
||||
size: 20,
|
||||
isMd: true),
|
||||
SizedBox(height: isTall ? 70 : 20),
|
||||
Text('${generateWalletProvider.nbrWord + 1}',
|
||||
key: keyAskedWord,
|
||||
style: TextStyle(
|
||||
fontSize: isTall ? 17 : 15,
|
||||
color: orangeC,
|
||||
fontWeight: FontWeight.w400)),
|
||||
const SizedBox(height: 10),
|
||||
ScaledSizedBox(height: isTall ? 40 : 5),
|
||||
if (isTall)
|
||||
Text('${generateWalletProvider.nbrWord + 1}',
|
||||
key: keyAskedWord,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 20,
|
||||
color: orangeC,
|
||||
fontWeight: FontWeight.w500)),
|
||||
if (isTall) ScaledSizedBox(height: 5),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
border: Border.all(
|
||||
color: Colors.grey[600]!,
|
||||
width: 3,
|
||||
width: scaleSize(3),
|
||||
)),
|
||||
width: 430,
|
||||
width: scaleSize(340),
|
||||
child: TextFormField(
|
||||
key: keyInputWord,
|
||||
autofocus: true,
|
||||
|
@ -94,8 +85,8 @@ class OnboardingStepSix extends StatelessWidget {
|
|||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: InputDecoration(
|
||||
labelStyle: TextStyle(
|
||||
fontSize: 22.0,
|
||||
labelStyle: scaledTextStyle(
|
||||
fontSize: 19,
|
||||
color: Colors.grey[500],
|
||||
fontWeight: FontWeight.w500),
|
||||
labelText: generateWalletProvider.isAskedWordValid
|
||||
|
@ -103,10 +94,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,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 26,
|
||||
color: generateWalletProvider.askedWordColor,
|
||||
fontWeight: FontWeight.w500))),
|
||||
Visibility(
|
||||
|
@ -133,7 +124,7 @@ class OnboardingStepSix extends StatelessWidget {
|
|||
// ),
|
||||
// ),
|
||||
// ),
|
||||
SizedBox(height: 35 * ratio),
|
||||
ScaledSizedBox(height: 40),
|
||||
]),
|
||||
),
|
||||
const OfflineInfo(),
|
||||
|
@ -151,9 +142,9 @@ Widget nextButton(BuildContext context, String text, nextScreen, bool isFast) {
|
|||
generateWalletProvider.isAskedWordValid = false;
|
||||
generateWalletProvider.askedWordColor = Colors.black;
|
||||
|
||||
return SizedBox(
|
||||
width: 380 * ratio,
|
||||
height: 60 * ratio,
|
||||
return ScaledSizedBox(
|
||||
width: 340,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyGoNext,
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
@ -166,7 +157,8 @@ Widget nextButton(BuildContext context, String text, nextScreen, bool isFast) {
|
|||
},
|
||||
child: Text(
|
||||
text,
|
||||
style: const TextStyle(fontSize: 24, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 22, fontWeight: FontWeight.w600, color: Colors.white),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
// ignore_for_file: file_names
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/screens/onBoarding/8.dart';
|
||||
import 'package:gecko/widgets/commons/intro_info.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
|
||||
class OnboardingStepSeven extends StatelessWidget {
|
||||
const OnboardingStepSeven({Key? key, this.scanDerivation = false})
|
||||
|
@ -16,17 +17,7 @@ class OnboardingStepSeven extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(
|
||||
'myPassword'.tr(),
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: GeckoAppBar('myPassword'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
InfoIntro(
|
||||
|
@ -35,7 +26,7 @@ class OnboardingStepSeven extends StatelessWidget {
|
|||
buttonText: '>',
|
||||
nextScreen: OnboardingStepEight(scanDerivation: scanDerivation),
|
||||
pagePosition: 6,
|
||||
boxHeight: 400),
|
||||
boxHeight: 320),
|
||||
const OfflineInfo(),
|
||||
]),
|
||||
),
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
// ignore_for_file: file_names
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/screens/onBoarding/9.dart';
|
||||
import 'package:gecko/widgets/commons/intro_info.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
|
||||
class OnboardingStepEight extends StatelessWidget {
|
||||
const OnboardingStepEight({Key? key, this.scanDerivation = false})
|
||||
|
@ -16,17 +17,7 @@ class OnboardingStepEight extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text(
|
||||
'myPassword'.tr(),
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: GeckoAppBar('myPassword'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
InfoIntro(
|
||||
|
@ -35,7 +26,8 @@ class OnboardingStepEight extends StatelessWidget {
|
|||
buttonText: '>',
|
||||
nextScreen: OnboardingStepNine(scanDerivation: scanDerivation),
|
||||
pagePosition: 7,
|
||||
isMd: true),
|
||||
isMd: true,
|
||||
boxHeight: 320),
|
||||
const OfflineInfo(),
|
||||
]),
|
||||
),
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
// ignore_for_file: file_names
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/generate_wallets.dart';
|
||||
import 'package:gecko/widgets/commons/build_progress_bar.dart';
|
||||
|
@ -10,6 +11,7 @@ import 'package:gecko/widgets/commons/build_text.dart';
|
|||
import 'package:gecko/screens/onBoarding/10.dart';
|
||||
import 'package:gecko/widgets/commons/next_button.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class OnboardingStepNine extends StatelessWidget {
|
||||
|
@ -21,8 +23,6 @@ class OnboardingStepNine extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
final generateWalletProvider =
|
||||
Provider.of<GenerateWalletsProvider>(context);
|
||||
// final myWalletProvider =
|
||||
// Provider.of<MyWalletsProvider>(context);
|
||||
|
||||
generateWalletProvider.pin.text = debugPin // kDebugMode &&
|
||||
? 'AAAAA'
|
||||
|
@ -30,25 +30,15 @@ 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),
|
||||
),
|
||||
),
|
||||
),
|
||||
extendBodyBehindAppBar: true,
|
||||
appBar: GeckoAppBar('myPassword'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
Column(children: <Widget>[
|
||||
SizedBox(height: isTall ? 40 : 20),
|
||||
ScaledSizedBox(height: isTall ? 25 : 5),
|
||||
const BuildProgressBar(pagePosition: 8),
|
||||
SizedBox(height: isTall ? 40 : 20),
|
||||
ScaledSizedBox(height: isTall ? 25 : 5),
|
||||
BuildText(text: "hereIsThePasswordKeepIt".tr()),
|
||||
const SizedBox(height: 100),
|
||||
ScaledSizedBox(height: isTall ? 60 : 10),
|
||||
Stack(
|
||||
alignment: Alignment.centerRight,
|
||||
children: <Widget>[
|
||||
|
@ -60,9 +50,9 @@ class OnboardingStepNine extends StatelessWidget {
|
|||
maxLines: 1,
|
||||
textAlign: TextAlign.center,
|
||||
decoration: const InputDecoration(),
|
||||
style: const TextStyle(
|
||||
style: scaledTextStyle(
|
||||
letterSpacing: 5,
|
||||
fontSize: 35.0,
|
||||
fontSize: 33,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold)),
|
||||
IconButton(
|
||||
|
@ -74,18 +64,18 @@ class OnboardingStepNine extends StatelessWidget {
|
|||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
ScaledSizedBox(height: isTall ? 30 : 15),
|
||||
Text(
|
||||
'Pendant la phase de test de Ğecko,\nles codes secrets\nsont systématiquement AAAAA.'
|
||||
.tr(),
|
||||
style: TextStyle(color: Colors.grey[700], fontSize: 15),
|
||||
style: scaledTextStyle(color: Colors.grey[700], fontSize: 14),
|
||||
textAlign: TextAlign.center),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: SizedBox(
|
||||
width: 380 * ratio,
|
||||
height: 60 * ratio,
|
||||
child: ScaledSizedBox(
|
||||
width: 340,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyChangePin,
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
@ -99,16 +89,16 @@ class OnboardingStepNine extends StatelessWidget {
|
|||
reload: true);
|
||||
},
|
||||
child: Text("chooseAnotherPassword".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 22 * ratio,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w600))),
|
||||
))),
|
||||
SizedBox(height: 22 * ratio),
|
||||
ScaledSizedBox(height: 20),
|
||||
NextButton(
|
||||
text: "iNotedMyPassword".tr(),
|
||||
nextScreen: OnboardingStepTen(scanDerivation: scanDerivation),
|
||||
isFast: false),
|
||||
SizedBox(height: 35 * ratio),
|
||||
ScaledSizedBox(height: 40),
|
||||
]),
|
||||
const OfflineInfo(),
|
||||
]),
|
||||
|
|
|
@ -2,52 +2,85 @@
|
|||
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
// import 'package:gecko/models/home.dart';
|
||||
// import 'package:provider/provider.dart';
|
||||
import 'package:screen_brightness/screen_brightness.dart';
|
||||
|
||||
class QrCodeFullscreen extends StatelessWidget {
|
||||
TextEditingController tplController = TextEditingController();
|
||||
class QrCodeFullscreen extends StatefulWidget {
|
||||
const QrCodeFullscreen(this.address, {this.color, Key? key})
|
||||
: super(key: key);
|
||||
|
||||
QrCodeFullscreen(this.address, {this.color, Key? key}) : super(key: key);
|
||||
final String address;
|
||||
final Color? color;
|
||||
|
||||
@override
|
||||
State<QrCodeFullscreen> createState() => _QrCodeFullscreenState();
|
||||
}
|
||||
|
||||
class _QrCodeFullscreenState extends State<QrCodeFullscreen> {
|
||||
final tplController = TextEditingController();
|
||||
|
||||
Future<void> setBrightness(double brightness) async {
|
||||
try {
|
||||
await ScreenBrightness().setScreenBrightness(brightness);
|
||||
} catch (e) {
|
||||
log.e(e.toString());
|
||||
throw 'Failed to set brightness';
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> resetBrightness() async {
|
||||
try {
|
||||
await ScreenBrightness().resetScreenBrightness();
|
||||
} catch (e) {
|
||||
log.e(e.toString());
|
||||
throw 'Failed to reset brightness';
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
setBrightness(1);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: color ?? Colors.black,
|
||||
toolbarHeight: 60 * ratio,
|
||||
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),
|
||||
),
|
||||
)),
|
||||
body: SafeArea(
|
||||
child: SizedBox.expand(
|
||||
child: Container(
|
||||
color: color ?? backgroundColor,
|
||||
child: Column(
|
||||
children: [
|
||||
const Spacer(),
|
||||
QrImageWidget(
|
||||
data: address,
|
||||
version: QrVersions.auto,
|
||||
size: 350,
|
||||
),
|
||||
const Spacer(flex: 2),
|
||||
],
|
||||
)),
|
||||
return PopScope(
|
||||
onPopInvoked: (_) {
|
||||
resetBrightness();
|
||||
},
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: widget.color ?? Colors.black,
|
||||
toolbarHeight: scaleSize(57),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back, color: orangeC),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
}),
|
||||
title: Text(
|
||||
'QR Code de ${getShortPubkey(widget.address)}',
|
||||
style: scaledTextStyle(color: orangeC, fontSize: 20),
|
||||
)),
|
||||
body: SafeArea(
|
||||
child: SizedBox.expand(
|
||||
child: Container(
|
||||
color: widget.color ?? backgroundColor,
|
||||
child: Column(
|
||||
children: [
|
||||
const Spacer(),
|
||||
QrImageWidget(
|
||||
data: widget.address,
|
||||
version: QrVersions.auto,
|
||||
size: scaleSize(320),
|
||||
),
|
||||
const Spacer(flex: 2),
|
||||
],
|
||||
)),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -6,12 +6,14 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/search.dart';
|
||||
import 'package:gecko/widgets/commons/common_elements.dart';
|
||||
import 'package:gecko/providers/wallets_profiles.dart';
|
||||
import 'package:gecko/screens/search_result.dart';
|
||||
import 'package:gecko/screens/wallet_view.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class SearchScreen extends StatefulWidget {
|
||||
|
@ -28,9 +30,11 @@ 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
|
||||
|
@ -44,10 +48,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: (_) {
|
||||
|
@ -55,18 +56,11 @@ class _SearchScreenState extends State<SearchScreen> {
|
|||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
elevation: 1,
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text('search'.tr()),
|
||||
),
|
||||
),
|
||||
appBar: GeckoAppBar('search'.tr()),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
Column(children: <Widget>[
|
||||
SizedBox(height: isTall ? 200 : 100),
|
||||
ScaledSizedBox(height: isTall ? 165 : 60),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 17),
|
||||
child: TextField(
|
||||
|
@ -102,7 +96,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 = '',
|
||||
|
@ -112,15 +106,16 @@ class _SearchScreenState extends State<SearchScreen> {
|
|||
icon: Icon(
|
||||
Icons.close,
|
||||
color: Colors.grey[600],
|
||||
size: 30,
|
||||
size: scaleSize(28),
|
||||
),
|
||||
),
|
||||
),
|
||||
prefixIcon: const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 17),
|
||||
child: Image(
|
||||
image: AssetImage('assets/loupe-noire.png'),
|
||||
height: 35),
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 13),
|
||||
child: Image.asset(
|
||||
'assets/loupe-noire.png',
|
||||
height: scaleSize(10),
|
||||
),
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderSide:
|
||||
|
@ -131,19 +126,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,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Spacer(flex: 1),
|
||||
SizedBox(
|
||||
width: 320,
|
||||
height: 90,
|
||||
const Spacer(),
|
||||
ScaledSizedBox(
|
||||
width: 270,
|
||||
height: 70,
|
||||
child: ElevatedButton(
|
||||
key: keyConfirmSearch,
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
@ -177,12 +172,14 @@ class _SearchScreenState extends State<SearchScreen> {
|
|||
? 'pasteAddress'.tr()
|
||||
: 'search'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 21, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
Spacer(flex: screenHeight <= 800 ? 1 : 2),
|
||||
const Spacer(),
|
||||
]),
|
||||
const OfflineInfo(),
|
||||
]),
|
||||
|
|
|
@ -2,11 +2,13 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
import 'package:gecko/providers/wallets_profiles.dart';
|
||||
import 'package:gecko/providers/search.dart';
|
||||
import 'package:gecko/widgets/bottom_app_bar.dart';
|
||||
import 'package:gecko/widgets/commons/offline_info.dart';
|
||||
import 'package:gecko/widgets/commons/top_appbar.dart';
|
||||
import 'package:gecko/widgets/search_result_list.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
@ -20,25 +22,11 @@ class SearchResultScreen extends StatelessWidget {
|
|||
Provider.of<WalletsProfilesProvider>(context, listen: false);
|
||||
final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false);
|
||||
|
||||
double avatarSize = 55;
|
||||
// List<G1WalletsList> myContacts = contactsBox.toMap().values.toList();
|
||||
// myContacts = myContacts
|
||||
// .where((map) =>
|
||||
// (map.username ?? '').contains(searchProvider.searchController.text))
|
||||
// .toList();
|
||||
|
||||
// final searchProvider.resultLenght.toString();
|
||||
double avatarSize = scaleSize(37);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
elevation: 1,
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Text('researchResults'.tr()),
|
||||
),
|
||||
),
|
||||
appBar: GeckoAppBar('researchResults'.tr()),
|
||||
bottomNavigationBar: const GeckoBottomAppBar(),
|
||||
body: SafeArea(
|
||||
child: Stack(children: [
|
||||
|
@ -47,38 +35,39 @@ class SearchResultScreen extends StatelessWidget {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
const SizedBox(height: 30),
|
||||
ScaledSizedBox(height: 20),
|
||||
Center(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Text(
|
||||
"resultsFor".tr(),
|
||||
style: TextStyle(color: Colors.grey[600]),
|
||||
style: scaledTextStyle(
|
||||
color: Colors.grey[600], fontSize: 16),
|
||||
),
|
||||
Text(
|
||||
'"${searchProvider.searchController.text}"',
|
||||
style: const TextStyle(
|
||||
fontStyle: FontStyle.italic, fontSize: 21),
|
||||
style: scaledTextStyle(
|
||||
fontStyle: FontStyle.italic, fontSize: 18),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
// const SizedBox(height: 40),
|
||||
// ScaledSizedBox(height: 40),
|
||||
// Text(
|
||||
// 'Dans mes contacts'.tr(args: [currencyName]),
|
||||
// style: const TextStyle(fontSize: 20),
|
||||
// style: scaledTextStyle(fontSize: 20),
|
||||
// ),
|
||||
// ContactsList(
|
||||
// myContacts: myContacts,
|
||||
// avatarSize: avatarSize,
|
||||
// walletsProfilesClass: walletsProfilesClass,
|
||||
// duniterIndexer: duniterIndexer),
|
||||
const SizedBox(height: 40),
|
||||
ScaledSizedBox(height: 22),
|
||||
Text(
|
||||
'inBlockchainResult'.tr(args: [currencyName]),
|
||||
style: const TextStyle(fontSize: 20),
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(height: 13),
|
||||
SearchResult(
|
||||
searchProvider: searchProvider,
|
||||
duniterIndexer: duniterIndexer,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
|
@ -8,6 +9,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,89 +20,85 @@ 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()),
|
||||
toolbarHeight: scaleSize(57),
|
||||
title: Text(
|
||||
'parameters'.tr(),
|
||||
style: scaledTextStyle(fontSize: 21),
|
||||
)),
|
||||
body: Column(children: <Widget>[
|
||||
const SizedBox(height: 30),
|
||||
ScaledSizedBox(height: 30),
|
||||
Text(
|
||||
'networkSettings'.tr(),
|
||||
style: TextStyle(color: Colors.grey[500], fontSize: 22),
|
||||
style: scaledTextStyle(color: Colors.grey[500]!, fontSize: 20),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(height: 20),
|
||||
duniterEndpointSelection(context),
|
||||
const SizedBox(height: 30),
|
||||
ScaledSizedBox(height: 30),
|
||||
indexerEndpointSelection(context),
|
||||
const SizedBox(height: 40),
|
||||
ScaledSizedBox(height: 35),
|
||||
Text(
|
||||
'displaySettings'.tr(),
|
||||
style: TextStyle(color: Colors.grey[500], fontSize: 22),
|
||||
style: scaledTextStyle(color: Colors.grey[500]!, fontSize: 20),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(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.w('Oublier tous mes coffres');
|
||||
await _myWallets.deleteAllWallet(context);
|
||||
},
|
||||
child: ScaledSizedBox(
|
||||
height: scaleSize(40),
|
||||
width: 220,
|
||||
child: Center(
|
||||
child: Text(
|
||||
'forgetAllMyChests'.tr(),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 18,
|
||||
color: const Color(0xffD80000),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
// const Spacer(),
|
||||
SizedBox(height: isTall ? 90 : 60),
|
||||
ScaledSizedBox(height: 70),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
Widget chooseCurrencyUnit(BuildContext context) {
|
||||
HomeProvider homeProvider =
|
||||
Provider.of<HomeProvider>(context, listen: false);
|
||||
final homeProvider = Provider.of<HomeProvider>(context, listen: false);
|
||||
return InkWell(
|
||||
key: keyUdUnit,
|
||||
onTap: () async {
|
||||
await homeProvider.changeCurrencyUnit(context);
|
||||
},
|
||||
child: SizedBox(
|
||||
child: ScaledSizedBox(
|
||||
height: 50,
|
||||
child: Row(
|
||||
children: [
|
||||
const SizedBox(width: 12),
|
||||
Text('showUdAmounts'.tr()),
|
||||
ScaledSizedBox(width: 12),
|
||||
Text('showUdAmounts'.tr(), style: scaledTextStyle(fontSize: 16)),
|
||||
const Spacer(),
|
||||
Consumer<HomeProvider>(builder: (context, homeProvider, _) {
|
||||
final bool isUdUnit = configBox.get('isUdUnit') ?? false;
|
||||
return Icon(
|
||||
isUdUnit ? Icons.check_box : Icons.check_box_outline_blank,
|
||||
color: orangeC,
|
||||
size: 32,
|
||||
size: scaleSize(30),
|
||||
);
|
||||
}),
|
||||
const SizedBox(width: 30),
|
||||
ScaledSizedBox(width: 30),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -133,7 +131,7 @@ class SettingsScreen extends StatelessWidget {
|
|||
selectedDuniterEndpoint = customEndpoint.endpoint;
|
||||
}
|
||||
|
||||
TextEditingController endpointController = TextEditingController(
|
||||
final endpointController = TextEditingController(
|
||||
text: configBox.containsKey('customEndpoint')
|
||||
? configBox.get('customEndpoint')
|
||||
: 'wss://');
|
||||
|
@ -141,30 +139,34 @@ class SettingsScreen extends StatelessWidget {
|
|||
return Column(children: <Widget>[
|
||||
Row(children: [
|
||||
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
log.d(sub.sdk.api.connectedNode?.endpoint);
|
||||
return Expanded(
|
||||
child: Row(children: [
|
||||
const SizedBox(width: 10),
|
||||
SizedBox(
|
||||
width: 80,
|
||||
ScaledSizedBox(width: 2),
|
||||
ScaledSizedBox(
|
||||
width: 55,
|
||||
child: Text(
|
||||
'currencyNode'.tr(args: ['']),
|
||||
'currencyNode'.tr(),
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Icon(sub.nodeConnected && !sub.isLoadingEndpoint
|
||||
? Icons.check
|
||||
: Icons.close),
|
||||
ScaledSizedBox(
|
||||
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,
|
||||
ScaledSizedBox(
|
||||
height: 52,
|
||||
width: 230,
|
||||
child: Consumer<SettingsProvider>(builder: (context, set, _) {
|
||||
return DropdownButtonHideUnderline(
|
||||
key: keySelectDuniterNodeDropDown,
|
||||
child: DropdownButton(
|
||||
// alignment: AlignmentDirectional.topStart,
|
||||
style: scaledTextStyle(fontSize: 16, color: Colors.black),
|
||||
value: selectedDuniterEndpoint,
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
items: duniterBootstrapNodes
|
||||
|
@ -176,7 +178,6 @@ class SettingsScreen extends StatelessWidget {
|
|||
);
|
||||
}).toList(),
|
||||
onChanged: (String? newEndpoint) {
|
||||
log.d(newEndpoint!);
|
||||
selectedDuniterEndpoint = newEndpoint;
|
||||
set.reload();
|
||||
},
|
||||
|
@ -184,9 +185,9 @@ class SettingsScreen extends StatelessWidget {
|
|||
);
|
||||
}),
|
||||
),
|
||||
const Spacer(flex: 5),
|
||||
const Spacer(flex: 3),
|
||||
sub.isLoadingEndpoint
|
||||
? const CircularProgressIndicator(color: orangeC)
|
||||
? Loading(size: scaleSize(32), stroke: 2.5)
|
||||
: Consumer<SettingsProvider>(builder: (context, set, _) {
|
||||
return IconButton(
|
||||
key: keyConnectToEndpoint,
|
||||
|
@ -196,7 +197,7 @@ class SettingsScreen extends StatelessWidget {
|
|||
sub.getConnectedEndpoint()
|
||||
? orangeC
|
||||
: Colors.grey[500],
|
||||
size: 40,
|
||||
size: scaleSize(35),
|
||||
),
|
||||
onPressed: selectedDuniterEndpoint !=
|
||||
sub.getConnectedEndpoint()
|
||||
|
@ -226,13 +227,14 @@ class SettingsScreen extends StatelessWidget {
|
|||
Consumer<SettingsProvider>(builder: (context, set, _) {
|
||||
return Visibility(
|
||||
visible: selectedDuniterEndpoint == 'Personnalisé',
|
||||
child: SizedBox(
|
||||
child: ScaledSizedBox(
|
||||
width: 200,
|
||||
height: 50,
|
||||
child: TextField(
|
||||
key: keyCustomDuniterEndpoint,
|
||||
controller: endpointController,
|
||||
autocorrect: false,
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -244,17 +246,15 @@ class SettingsScreen extends StatelessWidget {
|
|||
Consumer<SettingsProvider>(builder: (context, set, _) {
|
||||
return Visibility(
|
||||
visible: selectedDuniterEndpoint == 'Auto',
|
||||
child: SizedBox(
|
||||
child: ScaledSizedBox(
|
||||
width: 250,
|
||||
height: sub.getConnectedEndpoint() == null ? 60 : 20,
|
||||
child: Text(
|
||||
sub.getConnectedEndpoint() ??
|
||||
"anAutoNodeChoosed"
|
||||
.tr(), //"Un noeud sûr et valide sera choisi automatiquement parmis une liste aléatoire.",
|
||||
style: TextStyle(
|
||||
sub.getConnectedEndpoint() ?? "anAutoNodeChoosed".tr(),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 15,
|
||||
fontStyle: FontStyle.italic,
|
||||
color: Colors.grey[700]),
|
||||
color: Colors.grey[700]!),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -263,7 +263,7 @@ class SettingsScreen extends StatelessWidget {
|
|||
'blockN'.tr(args: [
|
||||
sub.blocNumber.toString()
|
||||
]), //'bloc N°${sub.blocNumber}',
|
||||
style: TextStyle(fontSize: 14, color: Colors.grey[700]),
|
||||
style: scaledTextStyle(fontSize: 14, color: Colors.grey[700]),
|
||||
)
|
||||
],
|
||||
);
|
||||
|
@ -285,7 +285,7 @@ class SettingsScreen extends StatelessWidget {
|
|||
selectedIndexerEndpoint = duniterIndexer.listIndexerEndpoints[0];
|
||||
}
|
||||
|
||||
TextEditingController indexerEndpointController = TextEditingController(
|
||||
final indexerEndpointController = TextEditingController(
|
||||
text: configBox.containsKey('customIndexer')
|
||||
? configBox.get('customIndexer')
|
||||
: 'https://');
|
||||
|
@ -293,25 +293,22 @@ class SettingsScreen extends StatelessWidget {
|
|||
return Column(children: <Widget>[
|
||||
Row(children: [
|
||||
Consumer<DuniterIndexer>(builder: (context, indexer, _) {
|
||||
log.d(selectedIndexerEndpoint);
|
||||
log.d(indexer.listIndexerEndpoints);
|
||||
return Expanded(
|
||||
child: Row(children: [
|
||||
const SizedBox(width: 10),
|
||||
const SizedBox(
|
||||
width: 80,
|
||||
// child: Text('indexer'.tr()), // why translation does not work??
|
||||
child: Text('Indexer'),
|
||||
ScaledSizedBox(width: 5),
|
||||
ScaledSizedBox(
|
||||
width: 55,
|
||||
child: Text('Indexer', style: scaledTextStyle(fontSize: 16)),
|
||||
),
|
||||
const Spacer(),
|
||||
Icon(indexerEndpoint != '' ? Icons.check : Icons.close),
|
||||
const Spacer(),
|
||||
SizedBox(
|
||||
width: 280,
|
||||
ScaledSizedBox(
|
||||
width: 230,
|
||||
child: Consumer<SettingsProvider>(builder: (context, set, _) {
|
||||
return DropdownButtonHideUnderline(
|
||||
child: DropdownButton(
|
||||
// alignment: AlignmentDirectional.topStart,
|
||||
style: scaledTextStyle(fontSize: 16, color: Colors.black),
|
||||
value: selectedIndexerEndpoint,
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
items:
|
||||
|
@ -322,7 +319,6 @@ class SettingsScreen extends StatelessWidget {
|
|||
);
|
||||
}).toList(),
|
||||
onChanged: (newEndpoint) {
|
||||
log.d(newEndpoint!);
|
||||
selectedIndexerEndpoint = newEndpoint.toString();
|
||||
set.reload();
|
||||
},
|
||||
|
@ -332,7 +328,7 @@ class SettingsScreen extends StatelessWidget {
|
|||
),
|
||||
const Spacer(flex: 5),
|
||||
indexer.isLoadingIndexer
|
||||
? const CircularProgressIndicator(color: orangeC)
|
||||
? Loading(size: scaleSize(32), stroke: 2.5)
|
||||
: Consumer<SettingsProvider>(builder: (context, set, _) {
|
||||
return IconButton(
|
||||
icon: Icon(
|
||||
|
@ -340,7 +336,7 @@ class SettingsScreen extends StatelessWidget {
|
|||
color: selectedIndexerEndpoint != indexerEndpoint
|
||||
? orangeC
|
||||
: Colors.grey[500],
|
||||
size: 40,
|
||||
size: scaleSize(35),
|
||||
),
|
||||
onPressed: selectedIndexerEndpoint != indexerEndpoint
|
||||
? () async {
|
||||
|
@ -356,7 +352,6 @@ class SettingsScreen extends StatelessWidget {
|
|||
} else {
|
||||
configBox.delete('customIndexer');
|
||||
}
|
||||
log.d('connection to indexer $finalEndpoint');
|
||||
await indexer
|
||||
.checkIndexerEndpoint(finalEndpoint);
|
||||
}
|
||||
|
@ -370,12 +365,13 @@ class SettingsScreen extends StatelessWidget {
|
|||
Consumer<SettingsProvider>(builder: (context, set, _) {
|
||||
return Visibility(
|
||||
visible: selectedIndexerEndpoint == 'Personnalisé',
|
||||
child: SizedBox(
|
||||
child: ScaledSizedBox(
|
||||
width: 200,
|
||||
height: 50,
|
||||
child: TextField(
|
||||
controller: indexerEndpointController,
|
||||
autocorrect: false,
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -384,14 +380,12 @@ class SettingsScreen extends StatelessWidget {
|
|||
return Consumer<SettingsProvider>(builder: (context, set, _) {
|
||||
return Visibility(
|
||||
visible: selectedIndexerEndpoint == 'Auto',
|
||||
child: SizedBox(
|
||||
child: ScaledSizedBox(
|
||||
width: 250,
|
||||
height: 60,
|
||||
child: Text(
|
||||
sub.getConnectedEndpoint() ??
|
||||
"anAutoNodeChoosed"
|
||||
.tr(), //"Un noeud sûr et valide sera choisi automatiquement parmis une liste aléatoire.",
|
||||
style: TextStyle(
|
||||
sub.getConnectedEndpoint() ?? "anAutoNodeChoosed".tr(),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 15,
|
||||
fontStyle: FontStyle.italic,
|
||||
color: Colors.grey[700]),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
|
||||
class TemplateScreen extends StatelessWidget {
|
||||
const TemplateScreen({Key? key}) : super(key: key);
|
||||
|
@ -11,11 +12,7 @@ class TemplateScreen extends StatelessWidget {
|
|||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
title: const SizedBox(
|
||||
height: 22,
|
||||
child: Text('Template screen'),
|
||||
)),
|
||||
toolbarHeight: scaleSize(57), title: const Text('Template screen')),
|
||||
body: const SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
SizedBox(height: 20),
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
|
@ -73,13 +74,12 @@ class TransactionInProgress extends StatelessWidget {
|
|||
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');
|
||||
log.e('Error: $exception');
|
||||
} else {
|
||||
txStatus = TransactionStatus.loading;
|
||||
resultText = resultMap[result] ?? 'unknown status...';
|
||||
|
@ -94,19 +94,19 @@ class TransactionInProgress extends StatelessWidget {
|
|||
child: Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 60 * ratio,
|
||||
toolbarHeight: scaleSize(57),
|
||||
elevation: 0,
|
||||
automaticallyImplyLeading: false,
|
||||
title: SizedBox(
|
||||
height: 22,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text('extrinsicInProgress'.tr(args: [
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'extrinsicInProgress'.tr(args: [
|
||||
actionMap[transType] ?? 'strangeTransaction'.tr()
|
||||
]))
|
||||
]),
|
||||
)),
|
||||
]),
|
||||
style: scaledTextStyle(fontSize: 20),
|
||||
)
|
||||
])),
|
||||
body: SafeArea(
|
||||
child: Align(
|
||||
alignment: FractionalOffset.bottomCenter,
|
||||
|
@ -123,52 +123,58 @@ class TransactionInProgress extends StatelessWidget {
|
|||
],
|
||||
)),
|
||||
child: Column(children: <Widget>[
|
||||
const SizedBox(height: 10),
|
||||
ScaledSizedBox(height: 10),
|
||||
if (transType == 'pay')
|
||||
Text(
|
||||
isUdUnit
|
||||
? 'ud'.tr(args: ['$amount '])
|
||||
: '$amount $currencyName',
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 18, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17, fontWeight: FontWeight.w500),
|
||||
),
|
||||
if (transType == 'pay') const SizedBox(height: 10),
|
||||
if (transType == 'pay') ScaledSizedBox(height: 10),
|
||||
Text(
|
||||
'fromMinus'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 18),
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
Text(
|
||||
from,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 18, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17, fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
'toMinus'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 18),
|
||||
Visibility(
|
||||
visible: from != to,
|
||||
child: Column(
|
||||
children: [
|
||||
ScaledSizedBox(height: 10),
|
||||
Text(
|
||||
'toMinus'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
Text(
|
||||
toUsername ?? to,
|
||||
textAlign: TextAlign.center,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17, fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Text(
|
||||
toUsername ?? to,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 18, fontWeight: FontWeight.w600),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(height: 20),
|
||||
]),
|
||||
),
|
||||
// const SizedBox(height: 20, width: double.infinity),
|
||||
const Spacer(),
|
||||
Column(children: [
|
||||
Visibility(
|
||||
visible: txStatus == TransactionStatus.loading,
|
||||
child: const SizedBox(
|
||||
height: 18,
|
||||
width: 18,
|
||||
child: CircularProgressIndicator(
|
||||
child: ScaledSizedBox(
|
||||
height: 17,
|
||||
width: 17,
|
||||
child: const CircularProgressIndicator(
|
||||
color: orangeC,
|
||||
strokeWidth: 2,
|
||||
),
|
||||
|
@ -176,27 +182,27 @@ class TransactionInProgress extends StatelessWidget {
|
|||
),
|
||||
Visibility(
|
||||
visible: txStatus == TransactionStatus.success,
|
||||
child: const Icon(
|
||||
child: Icon(
|
||||
Icons.done_all,
|
||||
size: 35,
|
||||
size: scaleSize(32),
|
||||
color: Colors.greenAccent,
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: txStatus == TransactionStatus.failed,
|
||||
child: const Icon(
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
size: 35,
|
||||
size: scaleSize(32),
|
||||
color: Colors.redAccent,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
ScaledSizedBox(height: 10),
|
||||
Visibility(
|
||||
visible: txStatus != TransactionStatus.none,
|
||||
child: Text(
|
||||
resultText,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 19 * ratio),
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
),
|
||||
),
|
||||
]),
|
||||
|
@ -204,9 +210,9 @@ class TransactionInProgress extends StatelessWidget {
|
|||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: SizedBox(
|
||||
width: 380 * ratio,
|
||||
height: 60 * ratio,
|
||||
child: ScaledSizedBox(
|
||||
width: 300,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyCloseTransactionScreen,
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
@ -219,15 +225,14 @@ class TransactionInProgress extends StatelessWidget {
|
|||
},
|
||||
child: Text(
|
||||
'close'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 23 * ratio,
|
||||
fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 20, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: isTall ? 80 : 20)
|
||||
ScaledSizedBox(height: 80)
|
||||
])),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
|
|||
import 'package:gecko/globals.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/g1_wallets_list.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
|
@ -23,8 +24,8 @@ import 'package:gecko/widgets/payment_popup.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
import 'package:qr_flutter/qr_flutter.dart';
|
||||
|
||||
const double buttonSize = 100;
|
||||
const double buttonFontSize = 18;
|
||||
const double buttonSize = 83;
|
||||
const double buttonFontSize = 14;
|
||||
|
||||
class WalletViewScreen extends StatelessWidget {
|
||||
const WalletViewScreen(
|
||||
|
@ -35,25 +36,24 @@ class WalletViewScreen extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
WalletsProfilesProvider walletProfile =
|
||||
final walletProfile =
|
||||
Provider.of<WalletsProfilesProvider>(context, listen: false);
|
||||
final sub = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
final myWalletProvider =
|
||||
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||
final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false);
|
||||
WalletData? defaultWallet = myWalletProvider.getDefaultWallet();
|
||||
final defaultWallet = myWalletProvider.getDefaultWallet();
|
||||
|
||||
walletProfile.address = address;
|
||||
sub.setCurrentWallet(defaultWallet);
|
||||
|
||||
log.d("username: $username");
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: backgroundColor,
|
||||
resizeToAvoidBottomInset: true,
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
toolbarHeight: 60 * ratio,
|
||||
toolbarHeight: scaleSize(57),
|
||||
titleSpacing: 10,
|
||||
actions: [
|
||||
Row(
|
||||
children: [
|
||||
|
@ -65,7 +65,6 @@ class WalletViewScreen extends StatelessWidget {
|
|||
g1WalletsBox.toMap().forEach((key, value) {
|
||||
if (key == address) newContact = value;
|
||||
});
|
||||
// G1WalletsList(pubkey: pubkey!, username: username);
|
||||
await walletProfile.addContact(
|
||||
newContact ?? G1WalletsList(address: address));
|
||||
},
|
||||
|
@ -73,11 +72,11 @@ class WalletViewScreen extends StatelessWidget {
|
|||
walletProfile.isContact(address)
|
||||
? Icons.add_reaction_rounded
|
||||
: Icons.add_reaction_outlined,
|
||||
size: 35,
|
||||
size: scaleSize(33),
|
||||
),
|
||||
);
|
||||
}),
|
||||
const SizedBox(width: 10),
|
||||
ScaledSizedBox(width: isTall ? 10 : 0),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
|
@ -92,44 +91,42 @@ class WalletViewScreen extends StatelessWidget {
|
|||
child: QrImageWidget(
|
||||
data: walletProfile.address,
|
||||
version: QrVersions.auto,
|
||||
size: 80,
|
||||
size: scaleSize(65),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
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] ??
|
||||
'?'
|
||||
]),
|
||||
style: scaledTextStyle(fontSize: 18),
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: const GeckoBottomAppBar(),
|
||||
body: SafeArea(
|
||||
child: Column(children: <Widget>[
|
||||
HeaderProfile(address: address, username: username),
|
||||
SizedBox(height: isTall ? 30 : 15),
|
||||
ScaledSizedBox(height: 25),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
|
||||
Column(children: <Widget>[
|
||||
SizedBox(
|
||||
ScaledSizedBox(
|
||||
height: buttonSize,
|
||||
child: ClipOval(
|
||||
child: Material(
|
||||
color: yellowC,
|
||||
child: InkWell(
|
||||
key: keyViewActivity,
|
||||
splashColor: orangeC, // inkwell color
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(13),
|
||||
child: Image(
|
||||
image: AssetImage(
|
||||
'assets/walletOptions/clock.png'),
|
||||
height: 90)),
|
||||
splashColor: orangeC,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(scaleSize(10)),
|
||||
child:
|
||||
Image.asset('assets/walletOptions/clock.png'),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
|
@ -141,11 +138,11 @@ class WalletViewScreen extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 9),
|
||||
ScaledSizedBox(height: 6),
|
||||
Text(
|
||||
"displayNActivity".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: buttonFontSize, fontWeight: FontWeight.w500),
|
||||
),
|
||||
]),
|
||||
|
@ -154,10 +151,8 @@ class WalletViewScreen extends StatelessWidget {
|
|||
return FutureBuilder(
|
||||
future: sub.certState(defaultWallet.address, address),
|
||||
builder: (context, AsyncSnapshot<Map<String, int>> snapshot) {
|
||||
if (snapshot.data == null) return const SizedBox();
|
||||
if (snapshot.data == null) return ScaledSizedBox();
|
||||
String duration = '';
|
||||
log.d(
|
||||
'${getShortPubkey(address)} --- certDelay ${snapshot.data!['certDelay']} --- certRenewable ${snapshot.data!['certRenewable']}');
|
||||
|
||||
if (snapshot.data!['certDelay'] != null ||
|
||||
snapshot.data!['certRenewable'] != null) {
|
||||
|
@ -199,7 +194,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
if (snapshot.data!['canCert'] != null ||
|
||||
duration == 'seconds'.tr(args: ['0']))
|
||||
Column(children: <Widget>[
|
||||
SizedBox(
|
||||
ScaledSizedBox(
|
||||
height: buttonSize,
|
||||
child: ClipOval(
|
||||
child: Material(
|
||||
|
@ -267,13 +262,13 @@ class WalletViewScreen extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 9),
|
||||
ScaledSizedBox(height: 6),
|
||||
Text(
|
||||
toStatus == null
|
||||
? "certify".tr()
|
||||
: "createIdentity".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: buttonFontSize,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
|
@ -291,7 +286,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
);
|
||||
}),
|
||||
Column(children: <Widget>[
|
||||
SizedBox(
|
||||
ScaledSizedBox(
|
||||
height: buttonSize,
|
||||
child: ClipOval(
|
||||
child: Material(
|
||||
|
@ -299,11 +294,12 @@ class WalletViewScreen extends StatelessWidget {
|
|||
child: InkWell(
|
||||
key: keyCopyAddress,
|
||||
splashColor: orangeC,
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: Image(
|
||||
image: AssetImage('assets/copy_key.png'),
|
||||
height: 90)),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(scaleSize(17)),
|
||||
child: const Image(
|
||||
image: AssetImage('assets/copy_key.png'),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: address));
|
||||
snackCopyKey(context);
|
||||
|
@ -311,11 +307,11 @@ class WalletViewScreen extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 9),
|
||||
ScaledSizedBox(height: 6),
|
||||
Text(
|
||||
"copyAddress".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: buttonFontSize, fontWeight: FontWeight.w500),
|
||||
),
|
||||
]),
|
||||
|
@ -325,7 +321,7 @@ class WalletViewScreen extends StatelessWidget {
|
|||
return Opacity(
|
||||
opacity: sub.nodeConnected ? 1 : 0.5,
|
||||
child: Container(
|
||||
height: buttonSize,
|
||||
height: scaleSize(buttonSize),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xff7c94b6),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(100)),
|
||||
|
@ -360,9 +356,9 @@ class WalletViewScreen extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
: null,
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(14),
|
||||
child: Image(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(scaleSize(10)),
|
||||
child: const Image(
|
||||
image: AssetImage('assets/vector_white.png')),
|
||||
)),
|
||||
),
|
||||
|
@ -370,44 +366,41 @@ class WalletViewScreen extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 9),
|
||||
ScaledSizedBox(height: 6),
|
||||
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
return Text(
|
||||
'doATransfer'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
style: scaledTextStyle(
|
||||
color: sub.nodeConnected ? Colors.black : Colors.grey[500],
|
||||
fontSize: buttonFontSize,
|
||||
fontWeight: FontWeight.w500),
|
||||
);
|
||||
}),
|
||||
SizedBox(height: isTall ? 50 : 20)
|
||||
ScaledSizedBox(height: isTall ? 50 : 7)
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
||||
Widget waitToCert(String status, String duration) {
|
||||
return Column(children: <Widget>[
|
||||
SizedBox(
|
||||
ScaledSizedBox(
|
||||
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')),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
status.tr(args: [duration]),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: buttonFontSize - 4,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.grey[600]),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:gecko/providers/wallet_options.dart';
|
||||
import 'package:gecko/widgets/ud_unit_display.dart';
|
||||
|
@ -22,54 +22,50 @@ class Balance extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
final walletOptions =
|
||||
Provider.of<WalletOptionsProvider>(context, listen: false);
|
||||
return Column(children: <Widget>[
|
||||
Consumer<SubstrateSdk>(builder: (context, sdk, _) {
|
||||
return FutureBuilder(
|
||||
future: sdk.getBalance(address),
|
||||
builder: (BuildContext context,
|
||||
AsyncSnapshot<Map<String, double>> globalBalance) {
|
||||
if (globalBalance.connectionState != ConnectionState.done ||
|
||||
globalBalance.hasError) {
|
||||
if (walletOptions.balanceCache[address] != null &&
|
||||
walletOptions.balanceCache[address] != -1) {
|
||||
return Row(children: [
|
||||
Text(walletOptions.balanceCache[address]!.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: isTall ? size : size * 0.9,
|
||||
color: color)),
|
||||
const SizedBox(width: 5),
|
||||
UdUnitDisplay(size: size, color: color),
|
||||
]);
|
||||
} else {
|
||||
return SizedBox(
|
||||
height: 15,
|
||||
width: 15,
|
||||
child: CircularProgressIndicator(
|
||||
color: loadingColor,
|
||||
strokeWidth: 2,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
walletOptions.balanceCache[address] =
|
||||
globalBalance.data!['transferableBalance']!;
|
||||
if (walletOptions.balanceCache[address] != -1) {
|
||||
return Consumer<SubstrateSdk>(builder: (context, sdk, _) {
|
||||
return FutureBuilder(
|
||||
future: sdk.getBalance(address),
|
||||
builder: (BuildContext context,
|
||||
AsyncSnapshot<Map<String, double>> globalBalance) {
|
||||
if (globalBalance.connectionState != ConnectionState.done ||
|
||||
globalBalance.hasError) {
|
||||
if (walletOptions.balanceCache[address] != null &&
|
||||
walletOptions.balanceCache[address] != -1) {
|
||||
return Row(children: [
|
||||
Text(
|
||||
walletOptions.balanceCache[address]!.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: isTall ? size : size * 0.9,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
UdUnitDisplay(size: size, color: color),
|
||||
Text(walletOptions.balanceCache[address]!.toString(),
|
||||
style: scaledTextStyle(fontSize: size, color: color)),
|
||||
ScaledSizedBox(width: 5),
|
||||
UdUnitDisplay(size: scaleSize(size), color: color),
|
||||
]);
|
||||
} else {
|
||||
return const Text('');
|
||||
return ScaledSizedBox(
|
||||
height: 15,
|
||||
width: 15,
|
||||
child: CircularProgressIndicator(
|
||||
color: loadingColor,
|
||||
strokeWidth: 2,
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
}),
|
||||
]);
|
||||
}
|
||||
walletOptions.balanceCache[address] =
|
||||
globalBalance.data!['transferableBalance']!;
|
||||
if (walletOptions.balanceCache[address] != -1) {
|
||||
return Row(children: [
|
||||
Text(
|
||||
walletOptions.balanceCache[address]!.toString(),
|
||||
style: scaledTextStyle(
|
||||
fontSize: size,
|
||||
color: color,
|
||||
),
|
||||
),
|
||||
ScaledSizedBox(width: 5),
|
||||
UdUnitDisplay(size: scaleSize(size), color: color),
|
||||
]);
|
||||
} else {
|
||||
return const Text('');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -32,13 +33,13 @@ class GeckoBottomAppBar extends StatelessWidget {
|
|||
child: Container(
|
||||
color: yellowC,
|
||||
width: size.width,
|
||||
height: 80,
|
||||
height: scaleSize(67),
|
||||
child: Row(mainAxisAlignment: MainAxisAlignment.start, children: [
|
||||
const Spacer(),
|
||||
const SizedBox(width: 11),
|
||||
ScaledSizedBox(width: 11),
|
||||
IconButton(
|
||||
key: keyAppBarHome,
|
||||
iconSize: 55,
|
||||
iconSize: scaleSize(53),
|
||||
icon: const Icon(Icons.home_outlined),
|
||||
onPressed: () {
|
||||
searchProvider.reload();
|
||||
|
@ -48,7 +49,7 @@ class GeckoBottomAppBar extends StatelessWidget {
|
|||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
ScaledSizedBox(width: 12),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
key: keyAppBarQrcode,
|
||||
|
@ -58,7 +59,7 @@ class GeckoBottomAppBar extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
const Spacer(),
|
||||
const SizedBox(width: 15),
|
||||
ScaledSizedBox(width: 15),
|
||||
Stack(
|
||||
alignment: AlignmentDirectional.center,
|
||||
children: [
|
||||
|
@ -67,8 +68,8 @@ class GeckoBottomAppBar extends StatelessWidget {
|
|||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 0),
|
||||
child: Container(
|
||||
width: 75,
|
||||
height: 75,
|
||||
width: scaleSize(75),
|
||||
height: scaleSize(75),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border:
|
||||
|
@ -84,36 +85,38 @@ class GeckoBottomAppBar extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
key: keyAppBarChest,
|
||||
icon: const Image(image: AssetImage('assets/wallet.png')),
|
||||
onPressed: lockAction
|
||||
? null
|
||||
: () async {
|
||||
WalletData? defaultWallet =
|
||||
myWalletProvider.getDefaultWallet();
|
||||
String? pin;
|
||||
if (myWalletProvider.pinCode == '') {
|
||||
pin = await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (homeContext) {
|
||||
return UnlockingWallet(wallet: defaultWallet);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
if (pin != null || myWalletProvider.pinCode != '') {
|
||||
// log.d(
|
||||
// isRoutePresentInNavigator(context, '/mywallets'));
|
||||
Navigator.popUntil(context, ModalRoute.withName('/'));
|
||||
//FIXME: Should not have to wait 300 milliseconds when /mywallets exist in navigator...
|
||||
sleep(const Duration(milliseconds: 300));
|
||||
Navigator.pushNamed(context, '/mywallets');
|
||||
// Navigator.pushNamedAndRemoveUntil(
|
||||
// context, '/mywallets', ModalRoute.withName('/'));
|
||||
}
|
||||
},
|
||||
ScaledSizedBox(
|
||||
height: 53,
|
||||
child: IconButton(
|
||||
key: keyAppBarChest,
|
||||
icon: const Image(image: AssetImage('assets/wallet.png')),
|
||||
onPressed: lockAction
|
||||
? null
|
||||
: () async {
|
||||
WalletData? defaultWallet =
|
||||
myWalletProvider.getDefaultWallet();
|
||||
String? pin;
|
||||
if (myWalletProvider.pinCode == '') {
|
||||
pin = await Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (homeContext) {
|
||||
return UnlockingWallet(wallet: defaultWallet);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
if (pin != null || myWalletProvider.pinCode != '') {
|
||||
Navigator.popUntil(
|
||||
context, ModalRoute.withName('/'));
|
||||
//FIXME: Should not have to wait 300 milliseconds when /mywallets exist in navigator...
|
||||
sleep(const Duration(milliseconds: 300));
|
||||
Navigator.pushNamed(context, '/mywallets');
|
||||
// Navigator.pushNamedAndRemoveUntil(
|
||||
// context, '/mywallets', ModalRoute.withName('/'));
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -127,7 +130,6 @@ class GeckoBottomAppBar extends StatelessWidget {
|
|||
bool isRoutePresentInNavigator(BuildContext context, String routeName) {
|
||||
bool isPresent = false;
|
||||
Navigator.popUntil(context, (route) {
|
||||
log.d(route.settings.name);
|
||||
if (route.settings.name == routeName) {
|
||||
isPresent = true;
|
||||
}
|
||||
|
|
|
@ -1,33 +1,73 @@
|
|||
import 'package:bubble/bubble.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
|
||||
class BubbleSpeak extends StatelessWidget {
|
||||
const BubbleSpeak({
|
||||
required this.text,
|
||||
this.long,
|
||||
this.fontSize = 18,
|
||||
this.textKey,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
final String text;
|
||||
final double? long;
|
||||
final double fontSize;
|
||||
final Key? textKey;
|
||||
|
||||
@override
|
||||
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,
|
||||
child: Text(
|
||||
text,
|
||||
key: textKey,
|
||||
style: const TextStyle(
|
||||
color: Colors.black, fontSize: 21, fontWeight: FontWeight.w400),
|
||||
style: scaledTextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: fontSize,
|
||||
fontWeight: FontWeight.w400),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class BubbleSpeakWithTail extends StatelessWidget {
|
||||
const BubbleSpeakWithTail({
|
||||
required this.text,
|
||||
this.long,
|
||||
this.fontSize = 18,
|
||||
this.textKey,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
final String text;
|
||||
final double? long;
|
||||
final double fontSize;
|
||||
final Key? textKey;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
alignment: Alignment.bottomRight,
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
BubbleSpeak(
|
||||
text: text, fontSize: fontSize, textKey: textKey, long: long),
|
||||
Positioned(
|
||||
left: 15,
|
||||
bottom: -scaleSize(28),
|
||||
child: Image(
|
||||
image: const AssetImage('assets/home/bout_de_bulle.png'),
|
||||
height: scaleSize(30),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -21,7 +22,7 @@ class AddNewDerivationButton extends StatelessWidget {
|
|||
String newDerivationName =
|
||||
'${'wallet'.tr()} ${myWalletProvider.listWallets.last.number! + 2}';
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: EdgeInsets.all(scaleSize(11)),
|
||||
child: ClipRRect(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
child: Column(children: <Widget>[
|
||||
|
@ -55,20 +56,20 @@ class AddNewDerivationButton extends StatelessWidget {
|
|||
decoration: const BoxDecoration(color: floattingYellow),
|
||||
child: Center(
|
||||
child: myWalletProvider.isNewDerivationLoading
|
||||
? const SizedBox(
|
||||
height: 60,
|
||||
width: 60,
|
||||
child: CircularProgressIndicator(
|
||||
? ScaledSizedBox(
|
||||
height: 50,
|
||||
width: 50,
|
||||
child: const CircularProgressIndicator(
|
||||
color: orangeC,
|
||||
strokeWidth: 7,
|
||||
strokeWidth: 6,
|
||||
),
|
||||
)
|
||||
: const Text(
|
||||
: Text(
|
||||
'+',
|
||||
style: TextStyle(
|
||||
fontSize: 150,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 110,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Color(0xFFFCB437)),
|
||||
color: const Color(0xFFFCB437)),
|
||||
)),
|
||||
)),
|
||||
),
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/screens/myWallets/chest_options.dart';
|
||||
|
@ -17,18 +18,19 @@ class ChestOptionsButtons extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
final myWalletProvider = Provider.of<MyWalletsProvider>(context);
|
||||
return Column(children: [
|
||||
const SizedBox(height: 50),
|
||||
SizedBox(
|
||||
height: 80,
|
||||
width: 420,
|
||||
ScaledSizedBox(height: 50),
|
||||
ScaledSizedBox(
|
||||
height: 60,
|
||||
width: 300,
|
||||
child: ElevatedButton.icon(
|
||||
icon: Image.asset(
|
||||
'assets/chests/config.png',
|
||||
height: 60,
|
||||
height: scaleSize(40),
|
||||
),
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.black, elevation: 2,
|
||||
backgroundColor: floattingYellow, // foreground
|
||||
foregroundColor: Colors.black,
|
||||
elevation: 2,
|
||||
backgroundColor: floattingYellow,
|
||||
),
|
||||
onPressed: () => Navigator.push(
|
||||
context,
|
||||
|
@ -38,69 +40,68 @@ class ChestOptionsButtons extends StatelessWidget {
|
|||
),
|
||||
label: Text(
|
||||
" ${"manageChest".tr()}",
|
||||
style: const TextStyle(
|
||||
fontSize: 22,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Color(0xff8a3c0f),
|
||||
color: const 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,
|
||||
ScaledSizedBox(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: scaleSize(40),
|
||||
),
|
||||
ScaledSizedBox(
|
||||
width: 275,
|
||||
height: 60,
|
||||
child: Center(
|
||||
child: Text('importG1v1'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
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: 30)
|
||||
ScaledSizedBox(height: 20),
|
||||
// InkWell(
|
||||
// key: keyChangeChest,
|
||||
// onTap: () {
|
||||
// // Navigator.push(
|
||||
// // context,
|
||||
// // MaterialPageRoute(builder: (context) {
|
||||
// // return const ChooseChest();
|
||||
// // }),
|
||||
// // );
|
||||
// },
|
||||
// child: ScaledSizedBox(
|
||||
// width: 270,
|
||||
// height: 60,
|
||||
// child: Center(
|
||||
// child: Text('changeChest'.tr(),
|
||||
// style: const scaledTextStyle(
|
||||
// fontSize: 20,
|
||||
// color: Colors.grey, //orangeC
|
||||
// fontWeight: FontWeight.w500))),
|
||||
// ),
|
||||
// ),
|
||||
ScaledSizedBox(height: 30)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/home.dart';
|
||||
|
@ -38,14 +39,14 @@ class HomeButtons extends StatelessWidget {
|
|||
),
|
||||
child: ClipOval(
|
||||
child: Material(
|
||||
color: orangeC, // button color
|
||||
color: orangeC,
|
||||
child: InkWell(
|
||||
key: keyOpenSearch,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(18),
|
||||
padding: EdgeInsets.all(scaleSize(15)),
|
||||
child: Image(
|
||||
image: const AssetImage('assets/home/loupe.png'),
|
||||
height: 62 * ratio),
|
||||
height: scaleSize(58)),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
|
@ -58,17 +59,17 @@ class HomeButtons extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
ScaledSizedBox(height: 10),
|
||||
Text(
|
||||
"searchWallet".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
style: scaledTextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15 * ratio,
|
||||
fontSize: 13.5,
|
||||
fontWeight: FontWeight.w500),
|
||||
)
|
||||
]),
|
||||
const SizedBox(width: 120),
|
||||
ScaledSizedBox(width: 95),
|
||||
Column(children: <Widget>[
|
||||
Container(
|
||||
decoration: const BoxDecoration(
|
||||
|
@ -108,26 +109,26 @@ class HomeButtons extends StatelessWidget {
|
|||
}
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(18),
|
||||
padding: EdgeInsets.all(scaleSize(14.5)),
|
||||
child: Image(
|
||||
image: const AssetImage('assets/home/wallet.png'),
|
||||
height: 68 * ratio))),
|
||||
height: scaleSize(61)))),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
ScaledSizedBox(height: 10),
|
||||
Text(
|
||||
"manageWallets".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
style: scaledTextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15 * ratio,
|
||||
fontSize: 13.5,
|
||||
fontWeight: FontWeight.w500),
|
||||
)
|
||||
])
|
||||
]),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 35 * ratio),
|
||||
padding: EdgeInsets.only(top: scaleSize(30)),
|
||||
child:
|
||||
Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
|
||||
Column(children: <Widget>[
|
||||
|
@ -145,29 +146,29 @@ class HomeButtons extends StatelessWidget {
|
|||
color: orangeC, // button color
|
||||
child: InkWell(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(18),
|
||||
padding: EdgeInsets.all(scaleSize(14)),
|
||||
child: Image(
|
||||
image: const AssetImage('assets/home/qrcode.png'),
|
||||
height: 68 * ratio)),
|
||||
height: scaleSize(62))),
|
||||
onTap: () async {
|
||||
await historyProvider.scan(context);
|
||||
}),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
ScaledSizedBox(height: 10),
|
||||
Text(
|
||||
"scanQRCode".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
style: scaledTextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15 * ratio,
|
||||
fontSize: 13.5,
|
||||
fontWeight: FontWeight.w500),
|
||||
)
|
||||
])
|
||||
]),
|
||||
),
|
||||
SizedBox(height: isTall ? 80 : 40)
|
||||
ScaledSizedBox(height: isTall ? 60 : 30)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/wallet_options.dart';
|
||||
import 'package:gecko/screens/myWallets/manage_membership.dart';
|
||||
|
@ -26,16 +27,16 @@ class ManageMembershipButton extends StatelessWidget {
|
|||
}),
|
||||
);
|
||||
},
|
||||
child: SizedBox(
|
||||
child: ScaledSizedBox(
|
||||
height: 40,
|
||||
child: Row(children: <Widget>[
|
||||
const SizedBox(width: 32),
|
||||
ScaledSizedBox(width: 28),
|
||||
Image.asset(
|
||||
'assets/medal.png',
|
||||
height: 45,
|
||||
height: scaleSize(42),
|
||||
),
|
||||
const SizedBox(width: 22),
|
||||
Text('manageMembership'.tr(), style: const TextStyle(fontSize: 20)),
|
||||
ScaledSizedBox(width: 20),
|
||||
Text('manageMembership'.tr(), style: scaledTextStyle(fontSize: 18)),
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/cesium_plus.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
|
@ -16,7 +17,7 @@ class CertTile extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
int keyID = 0;
|
||||
const double avatarSize = 200;
|
||||
const double avatarSize = 40;
|
||||
|
||||
return Column(
|
||||
children: listCerts.map((repository) {
|
||||
|
@ -25,45 +26,49 @@ 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: EdgeInsets.only(
|
||||
left: 10, right: 0, top: scaleSize(3), bottom: scaleSize(3)),
|
||||
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: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
),
|
||||
subtitle: RichText(
|
||||
text: TextSpan(
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 15,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: repository['date'],
|
||||
style: scaledTextStyle(fontSize: 15),
|
||||
),
|
||||
if (repository[2] != '')
|
||||
TextSpan(
|
||||
text: ' · ',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 19,
|
||||
color: Colors.grey[550],
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: getShortPubkey(repository['address']),
|
||||
style: TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontStyle: FontStyle.italic,
|
||||
fontFamily: 'Monospace',
|
||||
color: Colors.grey[600],
|
||||
fontSize: 18),
|
||||
fontSize: 15),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
dense: false,
|
||||
dense: !isTall,
|
||||
isThreeLine: false,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
@ -24,18 +25,20 @@ class Certifications extends StatelessWidget {
|
|||
? Row(
|
||||
children: [
|
||||
Image.asset('assets/medal.png',
|
||||
color: color, height: 20),
|
||||
const SizedBox(width: 1),
|
||||
color: color, height: scaleSize(18)),
|
||||
ScaledSizedBox(width: 1),
|
||||
Text(certs.data?[0].toString() ?? '0',
|
||||
style: TextStyle(fontSize: size, color: color)),
|
||||
const SizedBox(width: 5),
|
||||
style:
|
||||
scaledTextStyle(fontSize: size, color: color)),
|
||||
ScaledSizedBox(width: 5),
|
||||
Text(
|
||||
"(${certs.data?[1].toString() ?? '0'})",
|
||||
style: TextStyle(fontSize: size * 0.7, color: color),
|
||||
style: scaledTextStyle(
|
||||
fontSize: size * 0.7, color: color),
|
||||
)
|
||||
],
|
||||
)
|
||||
: const Text('');
|
||||
: const SizedBox();
|
||||
});
|
||||
}),
|
||||
]);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
@ -11,7 +12,10 @@ class CertsCounter extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
return Text('(${sub.certsCounterCache[address]![isSent ? 1 : 0]})');
|
||||
return Text(
|
||||
'(${sub.certsCounterCache[address]![isSent ? 1 : 0]})',
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
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/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/widgets/cert_tile.dart';
|
||||
import 'package:graphql_flutter/graphql_flutter.dart';
|
||||
|
||||
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) {
|
||||
final screenHeight = MediaQuery.of(context).size.height;
|
||||
final appBarHeight = AppBar().preferredSize.height;
|
||||
final windowHeight = screenHeight - appBarHeight - (isTall ? 170 : 140);
|
||||
|
||||
final httpLink = HttpLink(
|
||||
'$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()),
|
||||
link: httpLink,
|
||||
),
|
||||
);
|
||||
return GraphQLProvider(
|
||||
client: client,
|
||||
child: Query(
|
||||
options: QueryOptions(
|
||||
document: gql(gertCertsReq),
|
||||
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>[
|
||||
ScaledSizedBox(height: 50),
|
||||
Text(
|
||||
"noNetworkNoHistory".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: scaledTextStyle(fontSize: 18),
|
||||
)
|
||||
]);
|
||||
} else if (result.data?['certification']?.isEmpty) {
|
||||
return Column(children: <Widget>[
|
||||
ScaledSizedBox(height: 50),
|
||||
Text(
|
||||
"noDataToDisplay".tr(),
|
||||
style: scaledTextStyle(fontSize: 18),
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
||||
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>[
|
||||
result.data == null
|
||||
? Column(children: <Widget>[
|
||||
ScaledSizedBox(height: 50),
|
||||
Text(
|
||||
"noTransactionToDisplay".tr(),
|
||||
style: scaledTextStyle(fontSize: 18),
|
||||
)
|
||||
])
|
||||
: Column(children: <Widget>[
|
||||
CertTile(listCerts: listCerts),
|
||||
])
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
enum CertDirection { received, sent }
|
|
@ -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),
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -1,105 +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 CertsSent extends StatelessWidget {
|
||||
const CertsSent({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(getCertsSent),
|
||||
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['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),
|
||||
]);
|
||||
}
|
||||
}
|
|
@ -13,7 +13,6 @@ class CesiumAvatar extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final csProvider = Provider.of<CesiumPlusProvider>(context, listen: false);
|
||||
log.d('tatata');
|
||||
|
||||
return ClipOval(
|
||||
child: FutureBuilder(
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
|
||||
class BuildImage extends StatelessWidget {
|
||||
const BuildImage({
|
||||
|
@ -15,10 +16,11 @@ class BuildImage extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ratio = isTall ? 1 : 0.95;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(0),
|
||||
width: 440,
|
||||
height: isTall ? boxHeight : boxHeight * 0.9,
|
||||
width: scaleSize(imageWidth * ratio),
|
||||
height: scaleSize(boxHeight * ratio),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
|
@ -29,6 +31,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'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:dots_indicator/dots_indicator.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
|
||||
class BuildProgressBar extends StatelessWidget {
|
||||
const BuildProgressBar({
|
||||
|
@ -16,8 +17,10 @@ class BuildProgressBar extends StatelessWidget {
|
|||
dotsCount: 10,
|
||||
position: pagePosition,
|
||||
decorator: DotsDecorator(
|
||||
spacing: const EdgeInsets.symmetric(horizontal: 10),
|
||||
color: Colors.grey[300]!, // Inactive color
|
||||
size: Size.square(scaleSize(7)),
|
||||
activeSize: Size.square(scaleSize(10)),
|
||||
spacing: EdgeInsets.symmetric(horizontal: scaleSize(10)),
|
||||
color: Colors.grey[400]!,
|
||||
activeColor: orangeC,
|
||||
),
|
||||
);
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
|
||||
class BuildText extends StatelessWidget {
|
||||
const BuildText({
|
||||
Key? key,
|
||||
required this.text,
|
||||
this.size = 20,
|
||||
this.size = 17,
|
||||
this.isMd = true,
|
||||
}) : super(key: key);
|
||||
|
||||
|
@ -16,25 +17,24 @@ class BuildText extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final double ratio = isTall ? 1 : 0.95;
|
||||
final mdStyle = MarkdownStyleSheet(
|
||||
p: TextStyle(
|
||||
fontSize: isTall ? size : size * 0.9,
|
||||
color: Colors.black,
|
||||
letterSpacing: 0.3),
|
||||
p: scaledTextStyle(
|
||||
fontSize: size * ratio, color: Colors.black, letterSpacing: 0.3),
|
||||
textAlign: WrapAlignment.spaceBetween,
|
||||
);
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
width: 440,
|
||||
width: scaleSize(350 * ratio),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, border: Border.all(color: Colors.grey[900]!)),
|
||||
child: isMd
|
||||
? MarkdownBody(data: text, styleSheet: mdStyle)
|
||||
: Text(text,
|
||||
textAlign: TextAlign.justify,
|
||||
style: TextStyle(
|
||||
fontSize: isTall ? size : size * 0.9,
|
||||
style: scaledTextStyle(
|
||||
fontSize: size * ratio,
|
||||
color: Colors.black,
|
||||
letterSpacing: 0.3)),
|
||||
);
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
|
||||
Future<bool?> confirmPopup(BuildContext context, String title) async {
|
||||
return showDialog<bool>(
|
||||
context: context,
|
||||
barrierDismissible: true, // user must tap button!
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
backgroundColor: backgroundColor,
|
||||
content: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
|
||||
style: scaledTextStyle(fontSize: 19, fontWeight: FontWeight.w500),
|
||||
),
|
||||
actions: <Widget>[
|
||||
Row(
|
||||
|
@ -23,26 +24,27 @@ Future<bool?> confirmPopup(BuildContext context, String title) async {
|
|||
key: keyConfirm,
|
||||
child: Text(
|
||||
"yes".tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 21,
|
||||
color: Color(0xffD80000),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 19,
|
||||
color: const Color(0xffD80000),
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, true);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
ScaledSizedBox(width: 20),
|
||||
TextButton(
|
||||
child: Text(
|
||||
"no".tr(),
|
||||
style: const TextStyle(fontSize: 21),
|
||||
style:
|
||||
scaledTextStyle(fontSize: 19, color: Colors.blueAccent),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, false);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 120)
|
||||
ScaledSizedBox(height: 70)
|
||||
],
|
||||
)
|
||||
],
|
||||
|
@ -58,45 +60,45 @@ Future<bool?> confirmPopupCertification(BuildContext context, String question1,
|
|||
barrierDismissible: true,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
// actionsPadding: const EdgeInsets.all(0.0),
|
||||
backgroundColor: backgroundColor,
|
||||
content: SizedBox(
|
||||
height: 240,
|
||||
content: ScaledSizedBox(
|
||||
height: 230,
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 15),
|
||||
ScaledSizedBox(height: 15),
|
||||
Text(
|
||||
question1,
|
||||
textAlign: TextAlign.center,
|
||||
style:
|
||||
const TextStyle(fontSize: 20, fontWeight: FontWeight.w400),
|
||||
scaledTextStyle(fontSize: 19, fontWeight: FontWeight.w400),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(height: 20),
|
||||
Text(
|
||||
username,
|
||||
textAlign: TextAlign.center,
|
||||
style:
|
||||
const TextStyle(fontSize: 24, fontWeight: FontWeight.w500),
|
||||
scaledTextStyle(fontSize: 22, fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(height: 20),
|
||||
Text(
|
||||
question2,
|
||||
textAlign: TextAlign.center,
|
||||
style:
|
||||
const TextStyle(fontSize: 20, fontWeight: FontWeight.w400),
|
||||
scaledTextStyle(fontSize: 19, fontWeight: FontWeight.w400),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(height: 20),
|
||||
Text(
|
||||
address,
|
||||
textAlign: TextAlign.center,
|
||||
style:
|
||||
const TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
|
||||
scaledTextStyle(fontSize: 19, fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const Text(
|
||||
ScaledSizedBox(height: 20),
|
||||
Text(
|
||||
'?',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w400),
|
||||
style:
|
||||
scaledTextStyle(fontSize: 19, fontWeight: FontWeight.w400),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -109,26 +111,26 @@ Future<bool?> confirmPopupCertification(BuildContext context, String question1,
|
|||
key: keyConfirm,
|
||||
child: Text(
|
||||
"yes".tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 25,
|
||||
color: Color(0xffD80000),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 20,
|
||||
color: const Color(0xffD80000),
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, true);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 35),
|
||||
ScaledSizedBox(width: 32),
|
||||
TextButton(
|
||||
child: Text(
|
||||
"no".tr(),
|
||||
style: const TextStyle(fontSize: 25),
|
||||
style: scaledTextStyle(fontSize: 20),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, false);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 120)
|
||||
ScaledSizedBox(height: 120)
|
||||
],
|
||||
)
|
||||
],
|
||||
|
@ -147,7 +149,7 @@ Future<void> infoPopup(BuildContext context, String title) async {
|
|||
content: Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
|
||||
style: scaledTextStyle(fontSize: 20, fontWeight: FontWeight.w500),
|
||||
),
|
||||
actions: <Widget>[
|
||||
Row(
|
||||
|
@ -159,9 +161,9 @@ Future<void> infoPopup(BuildContext context, String title) async {
|
|||
padding: const EdgeInsets.all(8),
|
||||
child: Text(
|
||||
"gotit".tr(),
|
||||
style: const TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: 21,
|
||||
color: Color(0xffD80000),
|
||||
color: const Color(0xffD80000),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -176,42 +178,3 @@ Future<void> infoPopup(BuildContext context, String title) async {
|
|||
},
|
||||
);
|
||||
}
|
||||
|
||||
bool isAddress(address) {
|
||||
final RegExp regExp = RegExp(
|
||||
r'^[a-zA-Z0-9]+$',
|
||||
caseSensitive: false,
|
||||
multiLine: false,
|
||||
);
|
||||
|
||||
if (regExp.hasMatch(address) == true &&
|
||||
address.length > 45 &&
|
||||
address.length < 52) {
|
||||
log.d("C'est une adresse !");
|
||||
|
||||
return true;
|
||||
} else {
|
||||
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);
|
||||
// }),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.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 +16,9 @@ class InfoIntro extends StatelessWidget {
|
|||
required this.pagePosition,
|
||||
this.isMd = false,
|
||||
this.isFast = false,
|
||||
this.boxHeight = 440,
|
||||
this.boxHeight = 340,
|
||||
this.imageWidth = 350,
|
||||
this.textSize = 20,
|
||||
this.textSize = 17,
|
||||
}) : super(key: key);
|
||||
|
||||
final String text;
|
||||
|
@ -34,12 +35,10 @@ class InfoIntro extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(children: <Widget>[
|
||||
SizedBox(height: isTall ? 40 : 20),
|
||||
ScaledSizedBox(height: isTall ? 25 : 5),
|
||||
BuildProgressBar(pagePosition: pagePosition),
|
||||
SizedBox(height: isTall ? 40 : 20),
|
||||
|
||||
ScaledSizedBox(height: isTall ? 25 : 5),
|
||||
BuildText(text: text, size: textSize, isMd: isMd),
|
||||
|
||||
BuildImage(
|
||||
assetName: assetName, boxHeight: boxHeight, imageWidth: imageWidth),
|
||||
Expanded(
|
||||
|
@ -49,8 +48,7 @@ class InfoIntro extends StatelessWidget {
|
|||
text: buttonText, nextScreen: nextScreen, isFast: false),
|
||||
),
|
||||
),
|
||||
// const SizedBox(height: 40),
|
||||
SizedBox(height: isTall ? 40 : 20),
|
||||
ScaledSizedBox(height: isTall ? 40 : 5),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/widgets/commons/fader_transition.dart';
|
||||
|
||||
|
@ -17,9 +18,9 @@ class NextButton extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: 380 * ratio,
|
||||
height: 60 * ratio,
|
||||
return ScaledSizedBox(
|
||||
width: 340,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyGoNext,
|
||||
style: ElevatedButton.styleFrom(
|
||||
|
@ -32,7 +33,8 @@ class NextButton extends StatelessWidget {
|
|||
},
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(fontSize: 23 * ratio, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 23, fontWeight: FontWeight.w600, color: Colors.white),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
|
||||
class GeckoAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
const GeckoAppBar(this.text, {Key? key}) : super(key: key);
|
||||
|
||||
final String text;
|
||||
|
||||
@override
|
||||
AppBar build(BuildContext context) {
|
||||
return AppBar(
|
||||
toolbarHeight: scaleSize(57),
|
||||
titleSpacing: 10,
|
||||
title: Text(
|
||||
text,
|
||||
style: scaledTextStyle(fontWeight: FontWeight.w600, fontSize: 18),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Size get preferredSize => Size.fromHeight(scaleSize(57));
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
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/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
|
@ -27,11 +29,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),
|
||||
ScaledSizedBox(height: 10, width: double.infinity),
|
||||
if (myContacts.isEmpty)
|
||||
Text('noContacts'.tr())
|
||||
else
|
||||
|
@ -42,14 +44,15 @@ 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:
|
||||
CesiumAvatar(address: g1Wallet.address, size: 55),
|
||||
dense: !isTall,
|
||||
leading: CesiumAvatar(
|
||||
address: g1Wallet.address, size: scaleSize(50)),
|
||||
title: Row(children: <Widget>[
|
||||
Text(getShortPubkey(g1Wallet.address),
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 16,
|
||||
fontFamily: 'Monospace',
|
||||
fontWeight: FontWeight.w500),
|
||||
textAlign: TextAlign.center),
|
||||
|
@ -57,7 +60,7 @@ class ContactsList extends StatelessWidget {
|
|||
trailing: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
ScaledSizedBox(
|
||||
width: 110,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
|
@ -68,16 +71,16 @@ class ContactsList extends StatelessWidget {
|
|||
children: [
|
||||
Balance(
|
||||
address: g1Wallet.address,
|
||||
size: 16),
|
||||
size: scaleSize(14)),
|
||||
]),
|
||||
]),
|
||||
),
|
||||
]),
|
||||
subtitle: Row(children: <Widget>[
|
||||
NameByAddress(
|
||||
size: scaleSize(17),
|
||||
wallet: WalletData(address: g1Wallet.address))
|
||||
]),
|
||||
dense: false,
|
||||
isThreeLine: false,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
|
@ -23,9 +24,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;
|
||||
|
@ -37,17 +36,15 @@ class DragTuleAction extends StatelessWidget {
|
|||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: orangeC,
|
||||
shape: const CircleBorder(),
|
||||
padding: const EdgeInsets.all(15),
|
||||
padding: EdgeInsets.all(scaleSize(14)),
|
||||
),
|
||||
child: const SizedBox(
|
||||
height: 35,
|
||||
child: Image(image: AssetImage('assets/vector_white.png')),
|
||||
child: SizedBox(
|
||||
height: scaleSize(33),
|
||||
child: const Image(image: AssetImage('assets/vector_white.png')),
|
||||
),
|
||||
),
|
||||
child: DragTarget<String>(
|
||||
onAccept: (senderAddress) async {
|
||||
log.d(
|
||||
'INTERPAY: sender: $senderAddress --- receiver: ${wallet.address}');
|
||||
final walletData =
|
||||
myWalletProvider.getWalletDataByAddress(senderAddress);
|
||||
await sub.setCurrentWallet(walletData!);
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
@ -27,19 +28,35 @@ class DragWalletsInfo extends StatelessWidget {
|
|||
|
||||
final toName =
|
||||
duniterIndexer.walletNameIndexer[lastFlyBy.address] ?? lastFlyBy.name;
|
||||
final mdStyle = MarkdownStyleSheet(
|
||||
p: scaledTextStyle(fontSize: 16, color: Colors.black, letterSpacing: 0.3),
|
||||
textAlign: WrapAlignment.spaceBetween,
|
||||
);
|
||||
|
||||
return Container(
|
||||
color: yellowC,
|
||||
width: screenWidth,
|
||||
height: 80,
|
||||
height: scaleSize(85),
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 2),
|
||||
Text('${'executeATransfer'.tr()}:'),
|
||||
MarkdownBody(data: '${'from'.tr()} **$fromName**'),
|
||||
if (isSameAddress) Text('chooseATargetWallet'.tr()),
|
||||
if (!isSameAddress) MarkdownBody(data: 'Vers: **$toName**'),
|
||||
ScaledSizedBox(height: 2),
|
||||
Text(
|
||||
'${'executeATransfer'.tr()}:',
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
MarkdownBody(
|
||||
data: '${'from'.tr(args: [''])} **$fromName**',
|
||||
styleSheet: mdStyle),
|
||||
if (isSameAddress)
|
||||
Text(
|
||||
'chooseATargetWallet'.tr(),
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
if (!isSameAddress)
|
||||
MarkdownBody(
|
||||
data: '${'to'.tr(args: [''])} **$toName**',
|
||||
styleSheet: mdStyle),
|
||||
],
|
||||
)),
|
||||
);
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter/foundation.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/wallets_profiles.dart';
|
||||
import 'package:gecko/screens/debug_screen.dart';
|
||||
|
@ -19,82 +20,122 @@ 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,
|
||||
final listStyle = scaledTextStyle(fontSize: 15);
|
||||
|
||||
return SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.67,
|
||||
child: Drawer(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
|
||||
DrawerHeader(
|
||||
decoration: const BoxDecoration(
|
||||
color: orangeC,
|
||||
),
|
||||
child: Column(children: <Widget>[
|
||||
Image(
|
||||
image: const AssetImage('assets/icon/gecko_final.png'),
|
||||
height: scaleSize(125)),
|
||||
]),
|
||||
),
|
||||
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();
|
||||
ScaledSizedBox(height: scaleSize(10)),
|
||||
Opacity(
|
||||
opacity: 0.8,
|
||||
child: ListTile(
|
||||
key: keyParameters,
|
||||
leading: Icon(Icons.settings, size: scaleSize(25)),
|
||||
dense: !isTall,
|
||||
// contentPadding:
|
||||
// EdgeInsets.symmetric(horizontal: scaleSize(12)),
|
||||
title: Text(
|
||||
'parameters'.tr(),
|
||||
style: listStyle,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return SettingsScreen();
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
ScaledSizedBox(height: scaleSize(4)),
|
||||
if (isWalletsExists)
|
||||
Opacity(
|
||||
opacity: 0.8,
|
||||
child: ListTile(
|
||||
key: keyContacts,
|
||||
leading: Icon(Icons.contacts_rounded, size: scaleSize(25)),
|
||||
dense: !isTall,
|
||||
title: Text(
|
||||
'contactsManagement'.tr(),
|
||||
style: listStyle,
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const ContactsScreen();
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
if (isWalletsExists) ScaledSizedBox(height: scaleSize(4)),
|
||||
if (kDebugMode)
|
||||
Opacity(
|
||||
opacity: 0.8,
|
||||
child: ListTile(
|
||||
key: keyDebugScreen,
|
||||
leading:
|
||||
Icon(Icons.developer_mode_rounded, size: scaleSize(25)),
|
||||
dense: !isTall,
|
||||
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: scaledTextStyle(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)
|
||||
],
|
||||
ScaledSizedBox(height: 15)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
|
@ -27,7 +28,7 @@ class HeaderProfile extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const double avatarSize = 140;
|
||||
final avatarSize = scaleSize(110);
|
||||
final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false);
|
||||
final walletOptions =
|
||||
Provider.of<WalletOptionsProvider>(context, listen: false);
|
||||
|
@ -37,7 +38,7 @@ class HeaderProfile extends StatelessWidget {
|
|||
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
||||
bool isAccountExist = walletOptions.balanceCache[address] != 0;
|
||||
return Container(
|
||||
height: 185,
|
||||
height: scaleSize(160),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
|
@ -50,13 +51,13 @@ class HeaderProfile extends StatelessWidget {
|
|||
));
|
||||
}),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 30, right: 30),
|
||||
padding: EdgeInsets.only(left: scaleSize(19), right: scaleSize(19)),
|
||||
child: Row(children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 10,
|
||||
height: 5,
|
||||
color: yellowC,
|
||||
),
|
||||
Row(children: [
|
||||
|
@ -68,16 +69,17 @@ class HeaderProfile extends StatelessWidget {
|
|||
},
|
||||
child: Text(
|
||||
getShortPubkey(address),
|
||||
style: const TextStyle(
|
||||
fontSize: 30,
|
||||
fontWeight: FontWeight.w800,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 23,
|
||||
fontFamily: 'Monospace',
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
),
|
||||
),
|
||||
]),
|
||||
const SizedBox(height: 18),
|
||||
Balance(address: address, size: 25),
|
||||
const SizedBox(height: 5),
|
||||
ScaledSizedBox(height: 15),
|
||||
Balance(address: address, size: 20),
|
||||
ScaledSizedBox(height: 5),
|
||||
InkWell(
|
||||
onTap: () => sub.certsCounterCache[address] != null
|
||||
? {
|
||||
|
@ -100,13 +102,15 @@ class HeaderProfile extends StatelessWidget {
|
|||
address: address,
|
||||
isOwner: false,
|
||||
color: Colors.black),
|
||||
Certifications(address: address, size: 19)
|
||||
Certifications(address: address, size: 18)
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
const Spacer(),
|
||||
// ScaledSizedBox(width: 20),
|
||||
Column(children: <Widget>[
|
||||
ScaledSizedBox(height: 15),
|
||||
CesiumAvatar(address: address, size: avatarSize),
|
||||
]),
|
||||
]),
|
||||
|
|
|
@ -2,6 +2,7 @@ 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/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
import 'package:gecko/widgets/history_view.dart';
|
||||
|
@ -24,11 +25,11 @@ class HistoryQuery extends StatelessWidget {
|
|||
|
||||
if (indexerEndpoint == '') {
|
||||
return Column(children: <Widget>[
|
||||
const SizedBox(height: 50),
|
||||
ScaledSizedBox(height: 50),
|
||||
Text(
|
||||
"noNetworkNoHistory".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 18),
|
||||
style: scaledTextStyle(fontSize: 18),
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
@ -72,20 +73,20 @@ class HistoryQuery extends StatelessWidget {
|
|||
if (result.hasException) {
|
||||
log.e('Error Indexer: ${result.exception}');
|
||||
return Column(children: <Widget>[
|
||||
const SizedBox(height: 50),
|
||||
ScaledSizedBox(height: 50),
|
||||
Text(
|
||||
"noNetworkNoHistory".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 18),
|
||||
style: scaledTextStyle(fontSize: 18),
|
||||
)
|
||||
]);
|
||||
} else if (result
|
||||
.data?['transaction_connection']?['edges'].isEmpty) {
|
||||
return Column(children: <Widget>[
|
||||
const SizedBox(height: 50),
|
||||
ScaledSizedBox(height: 50),
|
||||
Text(
|
||||
"noDataToDisplay".tr(),
|
||||
style: const TextStyle(fontSize: 18),
|
||||
style: scaledTextStyle(fontSize: 18),
|
||||
)
|
||||
]);
|
||||
}
|
||||
|
@ -93,8 +94,6 @@ class HistoryQuery extends StatelessWidget {
|
|||
if (result.isNotLoading) {
|
||||
if (duniterIndexer.fetchMoreCursor == null) nPage = 1;
|
||||
|
||||
// log.d('nPage: $nPage');
|
||||
|
||||
if (nPage <= 3) {
|
||||
nRepositories = 20;
|
||||
} else if (nPage <= 6) {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:gecko/screens/wallet_view.dart';
|
||||
|
@ -24,16 +25,16 @@ 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 = [];
|
||||
|
||||
return duniterIndexer.transBC == null
|
||||
? Column(children: <Widget>[
|
||||
const SizedBox(height: 50),
|
||||
ScaledSizedBox(height: 50),
|
||||
Text(
|
||||
"noTransactionToDisplay".tr(),
|
||||
style: const TextStyle(fontSize: 18),
|
||||
style: scaledTextStyle(fontSize: 18),
|
||||
)
|
||||
])
|
||||
: Column(children: <Widget>[
|
||||
|
@ -51,23 +52,23 @@ class HistoryView extends StatelessWidget {
|
|||
return Column(children: <Widget>[
|
||||
if (isMigrationTime)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 30),
|
||||
padding: EdgeInsets.symmetric(vertical: scaleSize(23)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
const Image(
|
||||
image: AssetImage('assets/party.png'), height: 40),
|
||||
const SizedBox(width: 40),
|
||||
Image(
|
||||
image: const AssetImage('assets/party.png'),
|
||||
height: scaleSize(32)),
|
||||
Text(
|
||||
'blockchainStart'.tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 25,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 20,
|
||||
color: Colors.blueAccent,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(width: 40),
|
||||
const Image(
|
||||
image: AssetImage('assets/party.png'), height: 40),
|
||||
Image(
|
||||
image: const AssetImage('assets/party.png'),
|
||||
height: scaleSize(32)),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -76,11 +77,11 @@ 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(
|
||||
fontSize: 23,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 20,
|
||||
color: orangeC,
|
||||
fontWeight: FontWeight.w300),
|
||||
),
|
||||
|
@ -117,30 +118,32 @@ 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: scaledTextStyle(
|
||||
fontSize: 20,
|
||||
color: Colors.green[700],
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
Text(
|
||||
'Ancienne adresse: ${getShortPubkey(sub.oldOwnerKeys[address]![0])}')
|
||||
'from'.tr(args: [
|
||||
' ${getShortPubkey(sub.oldOwnerKeys[address]![0])}'
|
||||
]),
|
||||
style: scaledTextStyle(fontSize: 17),
|
||||
),
|
||||
]),
|
||||
const SizedBox(width: 40),
|
||||
const Icon(
|
||||
Icon(
|
||||
Icons.account_circle,
|
||||
size: 40,
|
||||
color: Colors.blueAccent,
|
||||
size: scaleSize(32),
|
||||
color: Colors.green[700],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -149,11 +152,11 @@ class HistoryView extends StatelessWidget {
|
|||
if (!duniterIndexer.pageInfo!['hasNextPage'])
|
||||
Column(
|
||||
children: <Widget>[
|
||||
const SizedBox(height: 15),
|
||||
ScaledSizedBox(height: 15),
|
||||
Text("historyStart".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 20)),
|
||||
const SizedBox(height: 15)
|
||||
style: scaledTextStyle(fontSize: 20)),
|
||||
ScaledSizedBox(height: 15)
|
||||
],
|
||||
)
|
||||
]);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/providers/substrate_sdk.dart';
|
||||
import 'package:gecko/widgets/commons/animated_text.dart';
|
||||
|
@ -35,14 +36,14 @@ class IdentityStatus extends StatelessWidget {
|
|||
if (resStatus == IdtyStatus.confirmed) {
|
||||
return NameByAddress(
|
||||
wallet: WalletData(address: address),
|
||||
size: 20,
|
||||
size: 18,
|
||||
color: Colors.grey[700]!,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontStyle: FontStyle.italic);
|
||||
} else if (resStatus == IdtyStatus.validated) {
|
||||
return NameByAddress(
|
||||
wallet: WalletData(address: address),
|
||||
size: 22,
|
||||
size: 20,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontStyle: FontStyle.normal);
|
||||
|
@ -60,7 +61,7 @@ class IdentityStatus extends StatelessWidget {
|
|||
|
||||
return SizedBox(
|
||||
child: showText(statusText[resStatus]!,
|
||||
bold: resStatus == IdtyStatus.validated ? true : false),
|
||||
bold: resStatus == IdtyStatus.validated, size: scaleSize(17)),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -68,7 +69,6 @@ class IdentityStatus extends StatelessWidget {
|
|||
|
||||
AnimatedFadeOutIn showText(String text,
|
||||
{double size = 18, bool bold = false}) {
|
||||
// log.d('$address $text');
|
||||
return AnimatedFadeOutIn<String>(
|
||||
data: text,
|
||||
duration: const Duration(milliseconds: 150),
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/g1_wallets_list.dart';
|
||||
import 'package:gecko/models/queries_indexer.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
import 'package:gecko/widgets/wallet_name.dart';
|
||||
|
@ -87,7 +88,7 @@ class NameByAddress extends StatelessWidget {
|
|||
? '(${duniterIndexer.walletNameIndexer[wallet.address]!})'
|
||||
: truncate(
|
||||
duniterIndexer.walletNameIndexer[wallet.address]!, 20),
|
||||
style: TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: size,
|
||||
color: color,
|
||||
fontWeight: fontWeight,
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:easy_localization/easy_localization.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -43,13 +44,12 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
|
|||
),
|
||||
);
|
||||
}
|
||||
log.d(pin);
|
||||
if (pin != null || myWalletProvider.pinCode != '') {
|
||||
// Payment workflow !
|
||||
final sub = Provider.of<SubstrateSdk>(context, listen: false);
|
||||
final acc = sub.getCurrentWallet();
|
||||
log.d(
|
||||
"fromAddress: ${acc.address!},destAddress: $toAddress, amount: ${double.parse(walletViewProvider.payAmount.text)}, password: $pin");
|
||||
"fromAddress: ${acc.address!},destAddress: $toAddress, amount: ${double.parse(walletViewProvider.payAmount.text)}");
|
||||
sub.pay(
|
||||
fromAddress: acc.address!,
|
||||
destAddress: toAddress,
|
||||
|
@ -105,7 +105,7 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
|
|||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).viewInsets.bottom),
|
||||
child: Container(
|
||||
height: 420,
|
||||
height: scaleSize(400),
|
||||
decoration: const ShapeDecoration(
|
||||
color: Color(0xffffeed1),
|
||||
shape: RoundedRectangleBorder(
|
||||
|
@ -116,8 +116,11 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
|
|||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 24, bottom: 0, left: 24, right: 24),
|
||||
padding: EdgeInsets.only(
|
||||
top: scaleSize(14),
|
||||
bottom: 0,
|
||||
left: scaleSize(16),
|
||||
right: scaleSize(16)),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
@ -127,125 +130,137 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
|
|||
children: [
|
||||
Text(
|
||||
'executeATransfer'.tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 26, fontWeight: FontWeight.w700),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 20, fontWeight: FontWeight.w700),
|
||||
),
|
||||
IconButton(
|
||||
key: keyPopButton,
|
||||
iconSize: 40,
|
||||
iconSize: scaleSize(32),
|
||||
icon: const Icon(Icons.cancel_outlined),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
]),
|
||||
const SizedBox(height: 5),
|
||||
ScaledSizedBox(height: 5),
|
||||
Text(
|
||||
'from'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 19,
|
||||
'from'.tr(args: ['']),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.grey[600]),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
ScaledSizedBox(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)),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.all(0),
|
||||
child: DropdownButton(
|
||||
dropdownColor: const Color(0xffffeed1),
|
||||
elevation: 12,
|
||||
key: keyDropdownWallets,
|
||||
value: defaultWallet,
|
||||
menuMaxHeight: scaleSize(270),
|
||||
onTap: () {
|
||||
FocusScope.of(context)
|
||||
.requestFocus(amountFocus);
|
||||
},
|
||||
selectedItemBuilder: (_) {
|
||||
return myWalletProvider.listWallets
|
||||
.map((WalletData wallet) {
|
||||
return Container(
|
||||
width: scaleSize(isTall ? 315 : 310),
|
||||
padding: EdgeInsets.all(scaleSize(7)),
|
||||
child: Visibility(
|
||||
visible: wallet.address ==
|
||||
defaultWallet.address,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
NameByAddress(
|
||||
wallet: wallet,
|
||||
fontStyle: FontStyle.normal,
|
||||
size: 18,
|
||||
),
|
||||
const Spacer(),
|
||||
// const Text('data')
|
||||
Balance(
|
||||
address: wallet.address,
|
||||
size: 18),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}).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,
|
||||
child: Row(children: [
|
||||
NameByAddress(
|
||||
wallet: wallet,
|
||||
fontStyle: FontStyle.normal),
|
||||
const Spacer(),
|
||||
Balance(
|
||||
address: wallet.address, size: 20),
|
||||
]),
|
||||
return DropdownMenuItem(
|
||||
value: wallet,
|
||||
key: keySelectThisWallet(wallet.address),
|
||||
child: Container(
|
||||
color: const Color(0xffffeed1),
|
||||
width: scaleSize(isTall ? 315 : 310),
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
NameByAddress(
|
||||
wallet: wallet,
|
||||
fontStyle: FontStyle.normal,
|
||||
size: 18,
|
||||
),
|
||||
const Spacer(),
|
||||
Balance(
|
||||
address: wallet.address,
|
||||
size: 18),
|
||||
]),
|
||||
),
|
||||
);
|
||||
}).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),
|
||||
ScaledSizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'to'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 19,
|
||||
'to'.tr(args: ['']),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 16,
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
ScaledSizedBox(width: 10),
|
||||
Text(
|
||||
username ?? getShortPubkey(toAddress),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 7),
|
||||
ScaledSizedBox(height: 7),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'amount'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 19,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.grey[600]),
|
||||
),
|
||||
|
@ -254,24 +269,25 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
|
|||
onTap: () => infoFeesPopup(context),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.info_outlined, color: orangeC),
|
||||
const SizedBox(width: 5),
|
||||
Icon(Icons.info_outlined,
|
||||
color: orangeC, size: scaleSize(21)),
|
||||
ScaledSizedBox(width: 5),
|
||||
Text(
|
||||
'fees'.tr(
|
||||
args: [fees.toString(), currencyName]),
|
||||
style: const TextStyle(
|
||||
style: scaledTextStyle(
|
||||
color: orangeC,
|
||||
fontSize: 17,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
ScaledSizedBox(width: 10),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
ScaledSizedBox(height: 10),
|
||||
Focus(
|
||||
onFocusChange: (focused) {
|
||||
setState(() {
|
||||
|
@ -299,7 +315,6 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
|
|||
walletViewProvider.payAmount.text == ''
|
||||
? '0'
|
||||
: walletViewProvider.payAmount.text));
|
||||
log.d(fees);
|
||||
setState(() {});
|
||||
},
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
|
@ -310,9 +325,8 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
|
|||
],
|
||||
decoration: InputDecoration(
|
||||
hintText: '0.00',
|
||||
suffix: Text(isUdUnit
|
||||
? 'ud'.tr(args: [''])
|
||||
: currencyName), // udUnitDisplay(40),
|
||||
suffix: Text(
|
||||
isUdUnit ? 'ud'.tr(args: ['']) : currencyName),
|
||||
filled: true,
|
||||
fillColor: Colors.transparent,
|
||||
focusedBorder: OutlineInputBorder(
|
||||
|
@ -320,24 +334,25 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
|
|||
color: Colors.grey[500]!, width: 2),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
contentPadding: const EdgeInsets.all(15),
|
||||
contentPadding: EdgeInsets.all(scaleSize(9)),
|
||||
),
|
||||
style: const TextStyle(
|
||||
fontSize: 33,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 25,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
SizedBox(
|
||||
ScaledSizedBox(
|
||||
width: double.infinity,
|
||||
height: 60,
|
||||
height: 55,
|
||||
child: ElevatedButton(
|
||||
key: keyConfirmPayment,
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.white, elevation: 4,
|
||||
backgroundColor: orangeC, // foreground
|
||||
foregroundColor: Colors.white,
|
||||
elevation: 4,
|
||||
backgroundColor: orangeC,
|
||||
),
|
||||
onPressed: canValidate
|
||||
? () async {
|
||||
|
@ -347,8 +362,8 @@ void paymentPopup(BuildContext context, String toAddress, String? username) {
|
|||
: null,
|
||||
child: Text(
|
||||
'executeTheTransfer'.tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 20, fontWeight: FontWeight.w600),
|
||||
style: scaledTextStyle(
|
||||
fontSize: 18, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -373,19 +388,19 @@ Future<void> infoFeesPopup(BuildContext context) async {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(Icons.info_outlined, color: orangeC, size: 40),
|
||||
const SizedBox(height: 20),
|
||||
ScaledSizedBox(height: 20),
|
||||
Text(
|
||||
'feesExplanation'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
|
||||
style: scaledTextStyle(fontSize: 20, fontWeight: FontWeight.w500),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
ScaledSizedBox(height: 30),
|
||||
Text(
|
||||
'feesExplanationDetails'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w300),
|
||||
style: scaledTextStyle(fontSize: 18, fontWeight: FontWeight.w300),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
ScaledSizedBox(height: 5),
|
||||
InkWell(
|
||||
onTap: () async => await _launchUrl('https://duniter.org'),
|
||||
child: Container(
|
||||
|
@ -401,7 +416,7 @@ Future<void> infoFeesPopup(BuildContext context) async {
|
|||
child: Text(
|
||||
'moreInfo'.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w300,
|
||||
color: Colors.blueAccent,
|
||||
|
@ -422,9 +437,9 @@ Future<void> infoFeesPopup(BuildContext context) async {
|
|||
padding: const EdgeInsets.all(8),
|
||||
child: Text(
|
||||
'gotit'.tr(),
|
||||
style: const TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: 21,
|
||||
color: Color(0xffD80000),
|
||||
color: const Color(0xffD80000),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/providers/generate_wallets.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
|
@ -22,24 +23,33 @@ class ScanDerivationsInfo extends StatelessWidget {
|
|||
children: [
|
||||
if (generateWalletProvider.scanStatus ==
|
||||
ScanDerivationsStatus.rootScanning)
|
||||
Text('scanRootDerivationInProgress'.tr()),
|
||||
Text(
|
||||
'scanRootDerivationInProgress'.tr(),
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
if (generateWalletProvider.scanStatus ==
|
||||
ScanDerivationsStatus.scanning)
|
||||
Text('derivationsScanProgress'
|
||||
.tr(args: [generateWalletProvider.numberScan.toString()])),
|
||||
Text(
|
||||
'derivationsScanProgress'
|
||||
.tr(args: [generateWalletProvider.numberScan.toString()]),
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
if (generateWalletProvider.scanStatus ==
|
||||
ScanDerivationsStatus.import)
|
||||
Text("importDerivationsInProgress".tr(args: [
|
||||
'${generateWalletProvider.scanedWalletNumber}',
|
||||
'${generateWalletProvider.scanedValidWalletNumber}'
|
||||
])),
|
||||
const SizedBox(width: 10),
|
||||
const SizedBox(
|
||||
Text(
|
||||
"importDerivationsInProgress".tr(args: [
|
||||
'${generateWalletProvider.scanedWalletNumber}',
|
||||
'${generateWalletProvider.scanedValidWalletNumber}'
|
||||
]),
|
||||
style: scaledTextStyle(fontSize: 16),
|
||||
),
|
||||
ScaledSizedBox(width: 10),
|
||||
ScaledSizedBox(
|
||||
height: 22,
|
||||
width: 22,
|
||||
child: CircularProgressIndicator(
|
||||
color: orangeC,
|
||||
strokeWidth: 3,
|
||||
strokeWidth: scaleSize(3),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:flutter/foundation.dart';
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/queries_indexer.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
import 'package:gecko/providers/search.dart';
|
||||
|
@ -28,7 +29,6 @@ class SearchIdentityQuery extends StatelessWidget {
|
|||
return Text('noResult'.tr());
|
||||
}
|
||||
|
||||
log.d(indexerEndpoint);
|
||||
final httpLink = HttpLink(
|
||||
'$indexerEndpoint/v1/graphql',
|
||||
);
|
||||
|
@ -44,12 +44,10 @@ class SearchIdentityQuery extends StatelessWidget {
|
|||
client: client,
|
||||
child: Query(
|
||||
options: QueryOptions(
|
||||
document: gql(
|
||||
searchAddressByNameQ), // this is the query string you just created
|
||||
document: gql(searchAddressByNameQ),
|
||||
variables: {
|
||||
'name': name,
|
||||
},
|
||||
// pollInterval: const Duration(seconds: 10),
|
||||
),
|
||||
builder: (QueryResult result,
|
||||
{VoidCallback? refetch, FetchMore? fetchMore}) {
|
||||
|
@ -76,61 +74,58 @@ class SearchIdentityQuery extends StatelessWidget {
|
|||
|
||||
searchProvider.resultLenght = identities.length;
|
||||
|
||||
double avatarSize = 55;
|
||||
final avatarSize = scaleSize(45);
|
||||
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: 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: 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'],
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
),
|
||||
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: scaledTextStyle(
|
||||
fontSize: 16,
|
||||
fontFamily: 'Monospace',
|
||||
fontWeight: FontWeight.w500),
|
||||
textAlign: TextAlign.center),
|
||||
]),
|
||||
trailing: ScaledSizedBox(
|
||||
width: 120,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Balance(
|
||||
address: profile['pubkey'], size: 15),
|
||||
]),
|
||||
]),
|
||||
),
|
||||
subtitle: Row(children: <Widget>[
|
||||
Text(profile['name'] ?? '',
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17, fontWeight: FontWeight.w500),
|
||||
textAlign: TextAlign.center),
|
||||
]),
|
||||
dense: !isTall,
|
||||
isThreeLine: false,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
walletsProfiles.address = profile['pubkey'];
|
||||
return WalletViewScreen(
|
||||
address: profile['pubkey'],
|
||||
username: profile['name'],
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
]),
|
||||
);
|
||||
}),
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/g1_wallets_list.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
|
@ -36,12 +37,11 @@ class SearchResult extends StatelessWidget {
|
|||
if (snapshot.data?.isEmpty ?? true) {
|
||||
return SearchIdentityQuery(
|
||||
name: searchProvider.searchController.text);
|
||||
// const Text('Aucun résultat');
|
||||
} else {
|
||||
return Expanded(
|
||||
child: ListView(children: <Widget>[
|
||||
for (G1WalletsList g1Wallet in snapshot.data ?? [])
|
||||
resultTile(g1Wallet, context),
|
||||
resultTileAddressSearch(g1Wallet, context),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
@ -58,53 +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: 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:
|
||||
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: scaledTextStyle(
|
||||
fontSize: 18,
|
||||
fontFamily: 'Monospace',
|
||||
fontWeight: FontWeight.w500),
|
||||
textAlign: TextAlign.center),
|
||||
]),
|
||||
trailing:
|
||||
Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
ScaledSizedBox(
|
||||
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: 15),
|
||||
]),
|
||||
),
|
||||
]),
|
||||
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,
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
);
|
||||
]),
|
||||
),
|
||||
]),
|
||||
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,
|
||||
);
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/cesium_plus.dart';
|
||||
import 'package:gecko/providers/duniter_indexer.dart';
|
||||
|
@ -36,52 +38,50 @@ 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),
|
||||
),
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 5),
|
||||
child: Text(getShortPubkey(repository[1]),
|
||||
style: const TextStyle(fontSize: 18, fontFamily: 'Monospace')),
|
||||
style: scaledTextStyle(fontSize: 17, fontFamily: 'Monospace')),
|
||||
),
|
||||
subtitle: RichText(
|
||||
text: TextSpan(
|
||||
style: TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
color: Colors.grey[700],
|
||||
),
|
||||
children: <TextSpan>[
|
||||
TextSpan(
|
||||
text: dateForm,
|
||||
),
|
||||
TextSpan(text: dateForm, style: scaledTextStyle(fontSize: 16)),
|
||||
if (username != null)
|
||||
TextSpan(
|
||||
text: ' · ',
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 21,
|
||||
color: Colors.grey[550],
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: username,
|
||||
style: TextStyle(
|
||||
style: scaledTextStyle(
|
||||
fontStyle: FontStyle.italic,
|
||||
color: Colors.grey[600],
|
||||
fontSize: 19),
|
||||
fontSize: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
trailing: Text(finalAmount,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
style: scaledTextStyle(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: repository[4] == 'RECEIVED'
|
||||
? Colors.green[700]
|
||||
: Colors.blue[700]),
|
||||
textAlign: TextAlign.justify),
|
||||
dense: false,
|
||||
dense: !isTall,
|
||||
isThreeLine: false,
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
|
@ -93,7 +93,6 @@ class TransactionTile extends StatelessWidget {
|
|||
);
|
||||
}),
|
||||
);
|
||||
// Navigator.pop(context);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:truncate/truncate.dart';
|
||||
|
||||
|
@ -16,14 +16,12 @@ class WalletName extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double newSize = (wallet.name?.length ?? 0) <= 15 ? size : size - 2;
|
||||
|
||||
return Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[
|
||||
Text(
|
||||
truncate(wallet.name ?? '', 20),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: isTall ? newSize : newSize * 0.9,
|
||||
style: scaledTextStyle(
|
||||
fontSize: size,
|
||||
color: color,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontStyle: FontStyle.italic,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -24,7 +25,7 @@ class WalletTile extends StatelessWidget {
|
|||
final defaultWallet = myWalletProvider.getDefaultWallet();
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: EdgeInsets.all(scaleSize(11)),
|
||||
child: GestureDetector(
|
||||
key: keyOpenWallet(repository.address),
|
||||
onTap: () {
|
||||
|
@ -37,7 +38,7 @@ class WalletTile extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
},
|
||||
child: SizedBox(
|
||||
child: ScaledSizedBox(
|
||||
key: repository.number == 1 ? keyDragAndDrop : const Key('nothing'),
|
||||
child: ClipOvalShadow(
|
||||
shadow: const Shadow(
|
||||
|
@ -91,12 +92,12 @@ class WalletTile extends StatelessWidget {
|
|||
children: [
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(height: 7),
|
||||
ScaledSizedBox(height: 5),
|
||||
Opacity(
|
||||
opacity: 0.7,
|
||||
child: NameByAddress(
|
||||
wallet: repository,
|
||||
size: 20,
|
||||
size: 16,
|
||||
color:
|
||||
defaultWallet.address == repository.address
|
||||
? Colors.white
|
||||
|
@ -135,7 +136,7 @@ class BalanceBuilder extends StatelessWidget {
|
|||
color: isDefault ? orangeC : yellowC,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 5, right: 5, top: 38, bottom: 10),
|
||||
EdgeInsets.only(left: 5, right: 5, top: scaleSize(28), bottom: 6),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
@ -143,7 +144,7 @@ class BalanceBuilder extends StatelessWidget {
|
|||
opacity: 0.7,
|
||||
child: Balance(
|
||||
address: address,
|
||||
size: 16,
|
||||
size: 14,
|
||||
color: isDefault ? Colors.white : Colors.black,
|
||||
loadingColor: isDefault ? yellowC : orangeC),
|
||||
)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gecko/globals.dart';
|
||||
import 'package:gecko/models/scale_functions.dart';
|
||||
import 'package:gecko/models/wallet_data.dart';
|
||||
import 'package:gecko/models/widgets_keys.dart';
|
||||
import 'package:gecko/providers/my_wallets.dart';
|
||||
|
@ -22,7 +23,8 @@ 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: EdgeInsets.symmetric(
|
||||
horizontal: scaleSize(52), vertical: scaleSize(15)),
|
||||
child: GestureDetector(
|
||||
key: keyOpenWallet(repository.address),
|
||||
onTap: () {
|
||||
|
@ -35,9 +37,9 @@ class WalletTileMembre extends StatelessWidget {
|
|||
),
|
||||
);
|
||||
},
|
||||
child: SizedBox(
|
||||
child: ScaledSizedBox(
|
||||
key: repository.number == 1 ? keyDragAndDrop : const Key('nothing'),
|
||||
height: 240,
|
||||
height: 180,
|
||||
child: ClipOvalShadow(
|
||||
shadow: const Shadow(
|
||||
color: Colors.transparent,
|
||||
|
@ -84,12 +86,12 @@ class WalletTileMembre extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 25,
|
||||
top: 25,
|
||||
left: 20,
|
||||
top: 20,
|
||||
child: Opacity(
|
||||
opacity: 0.6,
|
||||
opacity: 0.8,
|
||||
child: Image.asset('assets/medal.png',
|
||||
color: Colors.black, height: 40),
|
||||
color: orangeC, height: scaleSize(33)),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -101,12 +103,12 @@ class WalletTileMembre extends StatelessWidget {
|
|||
isDefault: repository.address == defaultWallet.address),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Column(children: [
|
||||
const SizedBox(height: 10),
|
||||
ScaledSizedBox(height: 5),
|
||||
Opacity(
|
||||
opacity: 0.7,
|
||||
child: NameByAddress(
|
||||
wallet: repository,
|
||||
size: 20,
|
||||
size: 18,
|
||||
color: defaultWallet.address == repository.address
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
|
@ -116,8 +118,8 @@ class WalletTileMembre extends StatelessWidget {
|
|||
]),
|
||||
]),
|
||||
Positioned(
|
||||
right: 25,
|
||||
top: 25,
|
||||
right: scaleSize(12),
|
||||
top: scaleSize(18),
|
||||
child: Opacity(
|
||||
opacity: 0.7,
|
||||
child: Certifications(
|
||||
|
@ -125,7 +127,7 @@ class WalletTileMembre extends StatelessWidget {
|
|||
color: defaultWallet.address == repository.address
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
size: 18),
|
||||
size: 15),
|
||||
),
|
||||
),
|
||||
]),
|
||||
|
@ -154,8 +156,8 @@ class BalanceBuilder extends StatelessWidget {
|
|||
width: double.infinity,
|
||||
color: isDefault ? orangeC : yellowC,
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(left: 5, right: 5, top: 45, bottom: 15),
|
||||
padding: EdgeInsets.only(
|
||||
left: 5, right: 5, top: scaleSize(27), bottom: scaleSize(11)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
@ -163,7 +165,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),
|
||||
)
|
||||
|
|
52
pubspec.lock
|
@ -1298,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:
|
||||
|
@ -1310,6 +1310,54 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.27.7"
|
||||
screen_brightness:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: screen_brightness
|
||||
sha256: ed8da4a4511e79422fc1aa88138e920e4008cd312b72cdaa15ccb426c0faaedd
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.2+1"
|
||||
screen_brightness_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: screen_brightness_android
|
||||
sha256: "3df10961e3a9e968a5e076fe27e7f4741fa8a1d3950bdeb48cf121ed529d0caf"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.0+2"
|
||||
screen_brightness_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: screen_brightness_ios
|
||||
sha256: "99adc3ca5490b8294284aad5fcc87f061ad685050e03cf45d3d018fe398fd9a2"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.0"
|
||||
screen_brightness_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: screen_brightness_macos
|
||||
sha256: "64b34e7e3f4900d7687c8e8fb514246845a73ecec05ab53483ed025bd4a899fd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.0+1"
|
||||
screen_brightness_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: screen_brightness_platform_interface
|
||||
sha256: b211d07f0c96637a15fb06f6168617e18030d5d74ad03795dd8547a52717c171
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.0"
|
||||
screen_brightness_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: screen_brightness_windows
|
||||
sha256: "9261bf33d0fc2707d8cf16339ce25768100a65e70af0fcabaf032fc12408ba86"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
scroll_to_index:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|