Compare commits

..

3 Commits
master ... tmp

Author SHA1 Message Date
poka d3582c1da3 tmp commit 2022-11-17 15:44:41 +01:00
guenoel 2bf5adf049 refacto: walletname and bottomappbar 2022-11-16 18:10:38 +01:00
poka 57f5b5ddda refacto: widget choose_currency_unit 2022-11-16 16:57:33 +01:00
25 changed files with 867 additions and 430 deletions

View File

@ -125,7 +125,7 @@
"yesterday": "Yesterday",
"thisWeek": "This week",
"chestNotCompatibleMustReinstallGecko": "The version of your safes is no longer compatible with this version of Ğecko.\nAll your safes will be forgotten, you must import them again.",
"notConnectedToInternet": "You are not connected to internet",
"notConnectedToInternet": "You are note connected to internet",
"researchResults": "Results of your research",
"resultsFor": "Results for ",
"forgetAllMyChests": "Forget all my chests",
@ -137,7 +137,7 @@
"sending": "Sending...",
"propagating": "Propagating...",
"validating": "Validating...",
"anErrorOccurred": "An error occurred",
"anErrorOccured": "An error occured",
"24hbetweenCerts": "You have to wait 24h between certs",
"canNotCertifySelf": "You can not certify yourself",
"nameAlreadyExist": "This name is already taken",

View File

@ -1,6 +1,6 @@
{
"searchWallet": "Buscar\nbilletera",
"manageWallets": "Gestionar\nbilleteras",
"searchWallet": "Search\nwallet",
"manageWallets": "Manage\nwallets",
"scanQRCode": "Escanear un\ncódigo QR",
"wellConnectedToNode": "Estas bien conectada al nodo\n{}",
"networkLost": "Se ha perdido la red...",
@ -13,20 +13,20 @@
"fastAppDescription": "La aplicación de pago {}\nmás rápida que un reptil de Vietnam",
"createWallet": "Crear una billetera",
"restoreWallet": "Restaurar mis billeteras",
"parameters": "Parámetros",
"parameters": "Parameters",
"chooseAnotherMnemonic": "Choose an other\nmnemonic sentence",
"iNotedMyMnemonic": "He escrito mi frase",
"iNotedMyMnemonic": "I wrote down my sentence",
"printMyMnemonic": "Print my mnemonic sentence",
"manageChest": "Configure this chest",
"changeChest": "Change chest",
"geckoChest": "Ğecko chest",
"toUnlockEnterPassword": "To unlock your safe, enter your secret code, away from prying lizards:",
"rememberPassword": "Keep this code in memory for 15 minutes",
"myRootWallet": "Mi billetera principal",
"myRootWallet": "My root wallet",
"currentWallet": "My current chest",
"wallet": "Billetera",
"wallet": "Wallet",
"displayMnemonic": "Display my mnemonic sentence",
"changePassword": "Cambiar mi contraseña",
"changePassword": "Change my password",
"createDerivation": "Create a new derivation",
"createCustomDerivation": "Create a new custom derivation",
"deleteChest": "Delete this chest",
@ -36,21 +36,21 @@
"selectMyChest": "Select my chest",
"accessMyChest": "Access my chest",
"manageMembership": "Manage my membership",
"chooseThisWallet": "Elegir esta billetera",
"chooseThisWallet": "Choose this wallet",
"thisWalletIsDefault": "This wallet is the default one",
"defineWalletAsDefault": "Define this as the default one",
"displayActivity": "Display activity",
"displayNActivity": "Display\nactivity",
"memberValidated": "Miembro validado!",
"copyAddress": "Copiar\ndirección",
"copy": "Copiar",
"thisAddressHasBeenCopiedToClipboard": "Esta dirección se ha copiado al cortapapeles",
"memberValidated": "Validated member!",
"copyAddress": "Copy\naddress",
"copy": "Copy",
"thisAddressHasBeenCopiedToClipboard": "This address has been copied to clipboard",
"chooseWalletName": "Choose a new name\nfor your wallet:",
"choosePassword": "Choose a random password:",
"chooseDerivation": "Choose a derivation:",
"validate": "Validar",
"confirm": "Confirmar",
"confirmPayment": "Confirmar pago",
"validate": "Validate",
"confirm": "Confirm",
"confirmPayment": "Confirm payment",
"geckoGenerateYourWalletFromMnemonic": "Ğecko builds your wallet from a **restoration sentence**. It is a bit like the blueprint that builds your wallet.",
"keepThisMnemonicSecure": "Keep this sentence carefully, because without it Ğecko will not be able to rebuild your wallets the day you change your phone.",
"geckoGeneratedYourMnemonicKeepItSecret": "Ğecko generated your mnemonic successfully! Keep it secret, because anyone who knows it can access all your wallets.",
@ -63,7 +63,7 @@
"myPassword": "My password",
"thisPasswordProtectsYourWalletsInASecureChest": "This secret code protects your wallets in a safe **which only you have the code for**, so that your wallets cannot be used by others.",
"hereIsThePasswordKeepIt": "And here is your password!\n\nMemorize it or write it down, because you will be asked **every time** you want to make a payment on this device.",
"chooseAnotherPassword": "Elige otra contraseña",
"chooseAnotherPassword": "Choose an other password",
"iNotedMyPassword": "I noted my password",
"geckoWillCheckPassword": "Gecko will check with you if you have remembered your secret code.\n\n Type your secret code in the field below to check that you have written it down correctly.",
"yourChestAndWalletWereCreatedSuccessfully": "Super!\n\nYour chest and your first portfolio have been created with great success.\n\nCongratulations!",
@ -72,7 +72,7 @@
"areYouSureForgetAllChests": "Are you sure you want to forget all your chests?",
"areYouSureToForgetWallet": "Are you sure you wan to forget the wallet \"{}\"?",
"areYouSureYouWantToCertify": "Are you sure you want to certify the address:\n\n{}",
"yes": "Si",
"yes": "Yes",
"no": "No",
"keepYourMnemonicSecret": "Try to keep this phrase a secret, as it allows anyone who knows it to access all your wallets.",
"iGeneratedYourMnemonicKeepItSecret": "I've generated your restoration phrase!\n Try to keep it a secret, as it allows anyone who knows it to access all your portfolios.",
@ -82,96 +82,96 @@
"pasteFromClipboard": "Paste from\nclipboard",
"restoreAChest": "Restore a chest",
"restoreThisChest": "Restore this chest",
"continue": "Continuar",
"continue": "Continue",
"itsTheGoodWord": "It's the good word!",
"nthMnemonicWord": "word of your mnemonic",
"1th": "Primera",
"2th": "Segunda",
"3th": "Tercera",
"4th": "Cuarta",
"5th": "Quinta",
"6th": "Sexta",
"7th": "Séptima",
"8th": "Octava",
"9th": "Novena",
"10th": "Décima",
"11th": "Undécima",
"12th": "Duodécima",
"yourPasswordLengthIsX": "La longitud de tu contraseña es {}",
"1th": "First",
"2th": "Second",
"3th": "Third",
"4th": "Fourth",
"5th": "Fifth",
"6th": "Sixth",
"7th": "Seventh",
"8th": "Eighth",
"9th": "Ninth",
"10th": "Tenth",
"11th": "Eleventh",
"12th": "Twelfth",
"yourPasswordLengthIsX": "Your password length is {}",
"noIdentity": "No identity",
"identityCreated": "Identidad creada",
"identityConfirmed": "Identidad confirmada",
"identityExpired": "Identitdad caducada",
"confirmYourIdentity": "Confirma tu identidad",
"identityCreated": "Identity created",
"identityConfirmed": "Identity confirmed",
"identityExpired": "Identity expired",
"confirmYourIdentity": "Confirm your identity",
"noDuniterNodeAvailableTryLater": "No Duniter node available, please try again later",
"youAreConnectedToNode": "You are connected to node",
"accountActivity": "Actividad de la cuenta",
"accountActivity": "Account activity",
"noNetworkNoHistory": "Network state does not allow\nto display account history",
"noDataToDisplay": "No data to be displayed.",
"noTransactionToDisplay": "No transaction to display",
"month1": "Enero",
"month2": "Febrero",
"month3": "Marzo",
"month4": "Abril",
"month5": "Mayo",
"month6": "Junio",
"month7": "Julio",
"month8": "Agosto",
"month9": "Septiembre",
"month10": "Octubre",
"month11": "Noviembre",
"month12": "Diciembre",
"today": "Hoy",
"yesterday": "Ayer",
"thisWeek": "Esta semana",
"month1": "January",
"month2": "February",
"month3": "March",
"month4": "April",
"month5": "May",
"month6": "June",
"month7": "July",
"month8": "August",
"month9": "September",
"month10": "October",
"month11": "November",
"month12": "December",
"today": "Today",
"yesterday": "Yesterday",
"thisWeek": "This week",
"chestNotCompatibleMustReinstallGecko": "The version of your safes is no longer compatible with this version of Ğecko.\nAll your safes will be forgotten, you must import them again.",
"notConnectedToInternet": "No estas conectado a internet",
"notConnectedToInternet": "You are note connected to internet",
"researchResults": "Results of your research",
"resultsFor": "Results for ",
"forgetAllMyChests": "Forget all my chests",
"transaction": "Transaccion",
"certification": "Certificacion",
"transaction": "Transaction",
"certification": "Certification",
"identityConfirm": "Identity confirmation",
"revokeAdhesion": "Adhesion revocation",
"strangeTransaction": "Strange transaction",
"sending": "Enviando...",
"propagating": "Propagando...",
"validating": "Validando...",
"anErrorOccurred": "Ocurrió un error",
"sending": "Sending...",
"propagating": "Propagating...",
"validating": "Validating...",
"anErrorOccured": "An error occured",
"24hbetweenCerts": "You have to wait 24h between certs",
"canNotCertifySelf": "You can not certify yourself",
"nameAlreadyExist": "This name is already taken",
"2GDtoKeepAlive": "You have to keep at least 2ĞD to keep your account alive",
"youHaveToFeedThisAccountBeforeUsing": "You have to feed this account\nbefore using it.",
"execTimeoutOver": "Execution timeout is over",
"seeAWallet": "Ver una billetera",
"mustWaitXBeforeCertify": "Tienes que esperar\n{} antes de\nvolver a certificar",
"seeAWallet": "See a wallet",
"mustWaitXBeforeCertify": "You have to wait\n{} before\ncertifying again",
"mustConfirmHisIdentity": "This person must confirm\nhis identity before can be\ncertified",
"canRenewCertInX": "You can renew\nthis certification\nin {}",
"executeATransfer": "Execute a transfer",
"executeTheTransfer": "Execute the transfer",
"doATransfer" : "Execute a\ntransfer",
"seconds": "{} segundos",
"minutes": "{} minutos",
"hours": "{} horas {}",
"days": "{} dias",
"months": "{} meses",
"seconds": "{} seconds",
"minutes": "{} minutes",
"hours": "{} hours {}",
"days": "{} days",
"months": "{} months",
"certify": "Certify",
"from": "De:",
"to": "A:",
"amount": "Importe:",
"from": "From:",
"to": "To:",
"amount": "Amount:",
"choiceOfSourceWallet": "Choose a source wallet",
"extrinsicInProgress": "{} en progreso",
"extrinsicValidated": "{} validado !",
"fromMinus": "de",
"toMinus": "a",
"extrinsicInProgress": "{} in progress",
"extrinsicValidated": "{} validated !",
"fromMinus": "from",
"toMinus": "to",
"deleteThisWallet": "Delete this wallet",
"cancel": "Cancelar",
"cancel": "Cancel",
"inBlockchainResult": "In {} blockchain",
"search": "Buscar",
"currencyNode": "{} nodo :",
"contactsManagementWithNbr": "Mis contactos ({})",
"contactsManagement": "Mis contactos",
"search": "Search",
"currencyNode": "{} node :",
"contactsManagementWithNbr": "My contacts ({})",
"contactsManagement": "My contacts",
"noContacts": "You don't have any contact",
"addContact": "Add\nto contacts",
"removeContact": "Remove\nthis contact",
@ -183,17 +183,17 @@
"thisAccountIsEmpty": "This account is empty",
"youCannotMigrateIdentityToExistingIdentity": "You cannot migrate an identity\nto an account that already has an identity",
"importOldAccount": "Import your old account",
"enterCesiumId": "Ingrese su ID de Cesium",
"enterCesiumPassword": "Ingrese su contraseña de Cesium",
"enterCesiumId": "Enter your Cesium ID",
"enterCesiumPassword": "Enter your Cesium password",
"migrateAccount": "Migrate account",
"migrateIdentity": "Migrate identity",
"identityMigration": "Identity migration",
"areYouSureMigrateIdentity": "Are you sure you want to permanently migrate identity **{}** with balance of **{}** ?",
"someoneCreatedYourIdentity": "Someone created your {} identity !",
"confirmMyIdentity": "Confirmar mi identidad",
"revokeMyIdentity": "Revocar mi identidad",
"confirmMyIdentity": "Confirm my identity",
"revokeMyIdentity": "Revoke my identity",
"youCannotRevokeThisIdentity": "You cannot revoke this identity while\nit is member of the blacksmiths web",
"showUdAmounts": "Show amounts in UD",
"ud": "{}UD",
"chooseATargetWallet": "Elija una billetera de destino"
}
"chooseATargetWallet": "Choose a target wallet"
}

View File

@ -138,7 +138,7 @@
"sending": "Envoi en cours...",
"propagating": "En cours de propagation...",
"validating": "En cours de validation...",
"anErrorOccurred": "Une erreur s'est produite",
"anErrorOccured": "Une erreur s'est produite",
"24hbetweenCerts": "Vous devez attendre 24h entre chaque certification",
"canNotCertifySelf": "Vous ne pouvez pas vous certifier\nvous même ...",
"nameAlreadyExist": "Ce nom est déjà pris",

View File

@ -1,4 +1,3 @@
[
"wss://gdev.p2p.legal/ws",
"wss://gdev.librelois.fr/ws"
]

View File

@ -1,5 +1,4 @@
[
"https://gdev-indexer.p2p.legal",
"https://idx.gdev.cgeek.fr",
"https://duniter-indexer.coinduf.eu",
"http://192.168.1.72:8080"

View File

@ -1,10 +1,9 @@
const String getNameByAddressQ = r'''
query ($address: String!) {
account_by_pk(pubkey: $address) {
account_by_pk(id: $address) {
identity {
name
}
pubkey
}
}
''';
@ -12,7 +11,7 @@ query ($address: String!) {
const String searchAddressByNameQ = r'''
query ($name: String!) {
search_identity(args: {name: $name}) {
pubkey
id
name
}
}
@ -22,8 +21,8 @@ const String getHistoryByAddressQ = r'''
query ($address: String!, $number: Int!, $cursor: String) {
transaction_connection(where:
{_or: [
{issuer_pubkey: {_eq: $address}},
{receiver_pubkey: {_eq: $address}}
{issuer_id: {_eq: $address}},
{receiver_id: {_eq: $address}}
]},
order_by: {created_at: desc},
first: $number,
@ -32,8 +31,8 @@ query ($address: String!, $number: Int!, $cursor: String) {
node {
amount
created_at
issuer_pubkey
receiver_pubkey
issuer_id
receiver_id
issuer {
identity {
name

View File

@ -14,6 +14,7 @@ import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/wallet_options.dart';
import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/screens/wallet_view.dart';
import 'package:gecko/widgets/wallet_name.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:provider/provider.dart';
import 'package:truncate/truncate.dart';
@ -169,7 +170,8 @@ class DuniterIndexer with ChangeNotifier {
return const SizedBox();
} else {
if (canEdit) {
return walletOptions.walletName(context, wallet, size, color);
return WalletName(
context: context, wallet: wallet, size: size, color: color);
} else {
return walletOptions.walletNameController(context, wallet, size);
}
@ -221,7 +223,11 @@ class DuniterIndexer with ChangeNotifier {
return const SizedBox();
} else {
if (canEdit) {
return walletOptions.walletName(context, wallet, size, color);
return WalletName(
context: context,
wallet: wallet,
size: size,
color: color);
} else {
return walletOptions.walletNameController(
context, wallet, size);
@ -244,6 +250,58 @@ class DuniterIndexer with ChangeNotifier {
);
}
Widget balance(BuildContext context, String address, double size,
[Color color = Colors.black,
Color loadingColor = const Color(0xffd07316)]) {
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 (balanceCache[address] != null &&
balanceCache[address] != -1) {
return Row(children: [
Text(balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9, color: color)),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return SizedBox(
height: 15,
width: 15,
child: CircularProgressIndicator(
color: loadingColor,
strokeWidth: 2,
),
);
}
}
balanceCache[address] = globalBalance.data!['transferableBalance']!;
if (balanceCache[address] != -1) {
return Row(children: [
Text(
balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9,
color: color,
),
),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return const Text('');
}
});
}),
]);
}
Widget searchIdentity(BuildContext context, String name) {
// WalletOptionsProvider _walletOptions =
// Provider.of<WalletOptionsProvider>(context, listen: false);
@ -301,12 +359,12 @@ class DuniterIndexer with ChangeNotifier {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 5),
child: ListTile(
key: keySearchResult(profile['pubkey']),
key: keySearchResult(profile['id']),
horizontalTitleGap: 40,
contentPadding: const EdgeInsets.all(5),
leading: cesiumPlusProvider.defaultAvatar(avatarSize),
title: Row(children: <Widget>[
Text(getShortPubkey(profile['pubkey']),
Text(getShortPubkey(profile['id']),
style: const TextStyle(
fontSize: 18,
fontFamily: 'Monospace',
@ -321,7 +379,7 @@ class DuniterIndexer with ChangeNotifier {
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
balance(context, profile['pubkey'], 16),
balance(context, profile['id'], 16),
]),
]),
),
@ -337,15 +395,14 @@ class DuniterIndexer with ChangeNotifier {
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
walletsProfiles.address = profile['pubkey'];
walletsProfiles.address = profile['id'];
return WalletViewScreen(
address: profile['pubkey'],
address: profile['id'],
username: g1WalletsBox
.get(profile['pubkey'])
.get(profile['id'])
?.id
?.username,
avatar:
g1WalletsBox.get(profile['pubkey'])?.avatar,
avatar: g1WalletsBox.get(profile['id'])?.avatar,
);
}),
);
@ -364,7 +421,7 @@ class DuniterIndexer with ChangeNotifier {
for (final trans in blockchainTX) {
final transaction = trans['node'];
final direction =
transaction['issuer_pubkey'] != pubkey ? 'RECEIVED' : 'SENT';
transaction['issuer_id'] != pubkey ? 'RECEIVED' : 'SENT';
transBC.add(i);
transBC[i] = [];
@ -372,10 +429,10 @@ class DuniterIndexer with ChangeNotifier {
final int amountBrut = transaction['amount'];
final double amount = removeDecimalZero(amountBrut / 100);
if (direction == "RECEIVED") {
transBC[i].add(transaction['issuer_pubkey']);
transBC[i].add(transaction['issuer_id']);
transBC[i].add(transaction['issuer']['identity']?['name'] ?? '');
} else if (direction == "SENT") {
transBC[i].add(transaction['receiver_pubkey']);
transBC[i].add(transaction['receiver_id']);
transBC[i].add(transaction['receiver']['identity']?['name'] ?? '');
}
transBC[i].add(amount);

View File

@ -10,15 +10,8 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'dart:async';
import 'package:gecko/globals.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/wallet_options.dart';
import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
import 'package:gecko/screens/myWallets/wallets_home.dart';
import 'package:gecko/screens/search.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:flutter/foundation.dart' show kDebugMode, kIsWeb;
import 'package:path_provider/path_provider.dart' as pp;
@ -132,104 +125,6 @@ class HomeProvider with ChangeNotifier {
// volume: volume, mode: PlayerMode.LOW_LATENCY, stayAwake: false);
// }
Widget bottomAppBar(BuildContext context) {
MyWalletsProvider myWalletProvider =
Provider.of<MyWalletsProvider>(context, listen: false);
WalletsProfilesProvider historyProvider =
Provider.of<WalletsProfilesProvider>(context, listen: false);
final size = MediaQuery.of(context).size;
const bool showBottomBar = true;
return Visibility(
visible: showBottomBar,
child: Container(
color: yellowC,
width: size.width,
height: 80,
child:
// Stack(
// children: [
// // CustomPaint(
// // size: Size(size.width, 110),
// // painter: CustomRoundedButton(),
// // ),
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
// SizedBox(width: 0),
const Spacer(),
const SizedBox(width: 11),
IconButton(
key: keyAppBarSearch,
iconSize: 40,
icon: const Image(image: AssetImage('assets/loupe-noire.png')),
onPressed: () {
Navigator.popUntil(
context,
ModalRoute.withName('/'),
);
Navigator.push(
context,
MaterialPageRoute(builder: (homeContext) {
return const SearchScreen();
}),
);
},
),
const SizedBox(width: 22),
const Spacer(),
IconButton(
key: keyAppBarQrcode,
iconSize: 70,
icon: const Image(image: AssetImage('assets/qrcode-scan.png')),
onPressed: () async {
Navigator.popUntil(
context,
ModalRoute.withName('/'),
);
historyProvider.scan(homeContext);
},
),
const Spacer(),
const SizedBox(width: 15),
IconButton(
key: keyAppBarChest,
iconSize: 60,
icon: const Image(image: AssetImage('assets/wallet.png')),
onPressed: () 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('/'),
);
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return const WalletsHome();
}),
);
}
},
),
const Spacer(),
]),
),
);
}
void reload() {
notifyListeners();
}

View File

@ -18,7 +18,6 @@ import 'package:gecko/screens/transaction_in_progress.dart';
import 'package:image_picker/image_picker.dart';
import 'package:provider/provider.dart';
import 'package:image_cropper/image_cropper.dart';
import 'package:truncate/truncate.dart';
class WalletOptionsProvider with ChangeNotifier {
TextEditingController address = TextEditingController();
@ -504,81 +503,11 @@ class WalletOptionsProvider with ChangeNotifier {
]),
);
}
Widget walletName(BuildContext context, WalletData wallet,
[double size = 20, Color color = Colors.black]) {
double newSize = wallet.name!.length <= 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,
color: color,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.italic,
),
softWrap: false,
overflow: TextOverflow.ellipsis,
),
]);
}
}
Map<String, double> balanceCache = {};
Widget balance(BuildContext context, String address, double size,
[Color color = Colors.black,
Color loadingColor = const Color(0xffd07316)]) {
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 (balanceCache[address] != null &&
balanceCache[address] != -1) {
return Row(children: [
Text(balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9, color: color)),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return SizedBox(
height: 15,
width: 15,
child: CircularProgressIndicator(
color: loadingColor,
strokeWidth: 2,
),
);
}
}
balanceCache[address] = globalBalance.data!['transferableBalance']!;
if (balanceCache[address] != -1) {
return Row(children: [
Text(
balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9,
color: color,
),
),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return const Text('');
}
});
}),
]);
}
Widget getCerts(BuildContext context, String address, double size,
[Color color = Colors.black]) {

View File

@ -129,6 +129,58 @@ class WalletsProfilesProvider with ChangeNotifier {
return _balance;
}
Widget balance(BuildContext context, String address, double size,
[Color color = Colors.black,
Color loadingColor = const Color(0xffd07316)]) {
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 (balanceCache[address] != null &&
balanceCache[address] != -1) {
return Row(children: [
Text(balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9, color: color)),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return SizedBox(
height: 15,
width: 15,
child: CircularProgressIndicator(
color: loadingColor,
strokeWidth: 2,
),
);
}
}
balanceCache[address] = globalBalance.data!['transferableBalance']!;
if (balanceCache[address] != -1) {
return Row(children: [
Text(
balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9,
color: color,
),
),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return const Text('');
}
});
}),
]);
}
Widget headerProfileView(
BuildContext context, String address, String? username) {
const double avatarSize = 140;

View File

@ -7,11 +7,11 @@ import 'package:gecko/models/queries_indexer.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/home.dart';
import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/wallets_profiles.dart';
import 'package:flutter/material.dart';
import 'package:gecko/screens/wallet_view.dart';
import 'package:gecko/widgets/bottom_app_bar.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:provider/provider.dart';
@ -34,8 +34,6 @@ class ActivityScreen extends StatelessWidget with ChangeNotifier {
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
WalletsProfilesProvider walletProfile =
Provider.of<WalletsProfilesProvider>(context, listen: false);
HomeProvider homeProvider =
Provider.of<HomeProvider>(context, listen: false);
return Scaffold(
key: _scaffoldKey,
@ -47,7 +45,7 @@ class ActivityScreen extends StatelessWidget with ChangeNotifier {
child: Text('accountActivity'.tr()),
),
),
bottomNavigationBar: homeProvider.bottomAppBar(context),
bottomNavigationBar: BottomAppBarCustom(context: context),
body: Column(children: <Widget>[
walletProfile.headerProfileView(context, address, username),
historyQuery(context),

View File

@ -8,7 +8,6 @@ import 'package:flutter/services.dart';
import 'package:gecko/models/wallet_data.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/chest_provider.dart';
import 'package:gecko/providers/home.dart';
import 'package:gecko/providers/my_wallets.dart';
import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/screens/common_elements.dart';
@ -16,6 +15,7 @@ import 'package:gecko/screens/myWallets/change_pin.dart';
import 'package:gecko/screens/myWallets/custom_derivations.dart';
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:provider/provider.dart';
class ChestOptions extends StatelessWidget {
@ -28,8 +28,6 @@ class ChestOptions extends StatelessWidget {
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
ChestProvider chestProvider =
Provider.of<ChestProvider>(context, listen: false);
HomeProvider homeProvider =
Provider.of<HomeProvider>(context, listen: false);
ChestData currentChest = chestBox.get(configBox.get('currentChest'))!;
@ -52,7 +50,7 @@ class ChestOptions extends StatelessWidget {
height: 22,
child: Text(currentChest.name!),
)),
bottomNavigationBar: homeProvider.bottomAppBar(context),
bottomNavigationBar: BottomAppBarCustom(context: context),
body: Stack(children: [
Builder(
builder: (ctx) => SafeArea(

View File

@ -211,6 +211,58 @@ class ChooseWalletScreen extends StatelessWidget {
]);
}
Widget balance(BuildContext context, String address, double size,
[Color color = Colors.black,
Color loadingColor = const Color(0xffd07316)]) {
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 (balanceCache[address] != null &&
balanceCache[address] != -1) {
return Row(children: [
Text(balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9, color: color)),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return SizedBox(
height: 15,
width: 15,
child: CircularProgressIndicator(
color: loadingColor,
strokeWidth: 2,
),
);
}
}
balanceCache[address] = globalBalance.data!['transferableBalance']!;
if (balanceCache[address] != -1) {
return Row(children: [
Text(
balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9,
color: color,
),
),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return const Text('');
}
});
}),
]);
}
Widget balanceBuilder(context, String address, bool isDefault) {
return Container(
width: double.infinity,

View File

@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/home.dart';
import 'package:gecko/providers/my_wallets.dart';
import 'package:gecko/models/wallet_data.dart';
import 'package:gecko/providers/substrate_sdk.dart';
@ -15,6 +14,7 @@ import 'package:gecko/screens/common_elements.dart';
import 'package:gecko/screens/activity.dart';
import 'package:gecko/screens/myWallets/manage_membership.dart';
import 'package:gecko/screens/qrcode_fullscreen.dart';
import 'package:gecko/widgets/bottom_app_bar.dart';
import 'package:provider/provider.dart';
import 'package:flutter/services.dart';
import 'package:qr_flutter/qr_flutter.dart';
@ -33,8 +33,6 @@ class WalletOptions extends StatelessWidget {
Provider.of<WalletsProfilesProvider>(context, listen: false);
MyWalletsProvider myWalletProvider =
Provider.of<MyWalletsProvider>(context, listen: false);
HomeProvider homeProvider =
Provider.of<HomeProvider>(context, listen: false);
DuniterIndexer duniterIndexer =
Provider.of<DuniterIndexer>(context, listen: false);
@ -99,7 +97,7 @@ class WalletOptions extends StatelessWidget {
),
],
),
bottomNavigationBar: homeProvider.bottomAppBar(context),
bottomNavigationBar: BottomAppBarCustom(context: context),
body: Stack(children: [
Builder(
builder: (ctx) => SafeArea(
@ -576,4 +574,58 @@ class WalletOptions extends StatelessWidget {
);
});
}
Widget balance(BuildContext context, String address, double size,
[Color color = Colors.black,
Color loadingColor = const Color(0xffd07316)]) {
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 (balanceCache[address] != null &&
balanceCache[address] != -1) {
return Row(children: [
Text(balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9, color: color)),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return SizedBox(
height: 15,
width: 15,
child: CircularProgressIndicator(
color: loadingColor,
strokeWidth: 2,
),
);
}
}
balanceCache[address] = globalBalance.data!['transferableBalance']!;
if (balanceCache[address] != -1) {
return Row(children: [
Text(
balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9,
color: color,
),
),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return const Text('');
}
});
}),
]);
}
}

View File

@ -9,7 +9,6 @@ import 'package:gecko/globals.dart';
import 'package:gecko/models/chest_data.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/home.dart';
import 'package:gecko/providers/my_wallets.dart';
import 'package:gecko/models/wallet_data.dart';
import 'package:flutter/material.dart';
@ -22,6 +21,7 @@ import 'package:gecko/screens/myWallets/import_g1_v1.dart';
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
import 'package:gecko/screens/myWallets/wallet_options.dart';
import 'package:gecko/screens/wallet_view.dart';
import 'package:gecko/widgets/bottom_app_bar.dart';
import 'package:provider/provider.dart';
class WalletsHome extends StatelessWidget {
@ -32,8 +32,6 @@ class WalletsHome extends StatelessWidget {
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
MyWalletsProvider myWalletProvider =
Provider.of<MyWalletsProvider>(context);
HomeProvider homeProvider =
Provider.of<HomeProvider>(context, listen: false);
final int currentChestNumber = myWalletProvider.getCurrentChest();
final ChestData currentChest = chestBox.get(currentChestNumber)!;
@ -66,7 +64,7 @@ class WalletsHome extends StatelessWidget {
backgroundColor: const Color(0xffFFD58D),
),
bottomNavigationBar: myWalletProvider.lastFlyBy == ''
? homeProvider.bottomAppBar(context)
? BottomAppBarCustom(context: context)
: dragInfo(context),
body: SafeArea(
child: Stack(children: [
@ -375,6 +373,58 @@ class WalletsHome extends StatelessWidget {
]);
}
Widget balance(BuildContext context, String address, double size,
[Color color = Colors.black,
Color loadingColor = const Color(0xffd07316)]) {
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 (balanceCache[address] != null &&
balanceCache[address] != -1) {
return Row(children: [
Text(balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9, color: color)),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return SizedBox(
height: 15,
width: 15,
child: CircularProgressIndicator(
color: loadingColor,
strokeWidth: 2,
),
);
}
}
balanceCache[address] = globalBalance.data!['transferableBalance']!;
if (balanceCache[address] != -1) {
return Row(children: [
Text(
balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9,
color: color,
),
),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return const Text('');
}
});
}),
]);
}
Widget balanceBuilder(context, String address, bool isDefault) {
return Container(
width: double.infinity,

View File

@ -6,12 +6,12 @@ import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/models/g1_wallets_list.dart';
import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/home.dart';
import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/wallet_options.dart';
import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/screens/common_elements.dart';
import 'package:gecko/screens/wallet_view.dart';
import 'package:gecko/widgets/bottom_app_bar.dart';
import 'package:provider/provider.dart';
class ContactsScreen extends StatelessWidget {
@ -24,8 +24,6 @@ class ContactsScreen extends StatelessWidget {
Provider.of<CesiumPlusProvider>(context, listen: false);
WalletsProfilesProvider walletsProfilesClass =
Provider.of<WalletsProfilesProvider>(context, listen: true);
HomeProvider homeProvider =
Provider.of<HomeProvider>(context, listen: false);
DuniterIndexer duniterIndexer =
Provider.of<DuniterIndexer>(context, listen: false);
@ -42,6 +40,58 @@ class ContactsScreen extends StatelessWidget {
p2.username?.toLowerCase() ?? 'zz');
});
Widget balance(BuildContext context, String address, double size,
[Color color = Colors.black,
Color loadingColor = const Color(0xffd07316)]) {
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 (balanceCache[address] != null &&
balanceCache[address] != -1) {
return Row(children: [
Text(balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9, color: color)),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return SizedBox(
height: 15,
width: 15,
child: CircularProgressIndicator(
color: loadingColor,
strokeWidth: 2,
),
);
}
}
balanceCache[address] = globalBalance.data!['transferableBalance']!;
if (balanceCache[address] != -1) {
return Row(children: [
Text(
balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9,
color: color,
),
),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return const Text('');
}
});
}),
]);
}
return Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar(
@ -53,7 +103,7 @@ class ContactsScreen extends StatelessWidget {
'contactsManagementWithNbr'.tr(args: ['${myContacts.length}'])),
),
),
bottomNavigationBar: homeProvider.bottomAppBar(context),
bottomNavigationBar: BottomAppBarCustom(context: context),
body: SafeArea(
child: Stack(children: [
Padding(

View File

@ -6,18 +6,70 @@ import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/models/g1_wallets_list.dart';
import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/home.dart';
import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/wallet_options.dart';
import 'package:gecko/providers/wallets_profiles.dart';
import 'package:gecko/providers/search.dart';
import 'package:gecko/screens/common_elements.dart';
import 'package:gecko/screens/wallet_view.dart';
import 'package:gecko/widgets/bottom_app_bar.dart';
import 'package:provider/provider.dart';
class SearchResultScreen extends StatelessWidget {
const SearchResultScreen({Key? key}) : super(key: key);
Widget balance(BuildContext context, String address, double size,
[Color color = Colors.black,
Color loadingColor = const Color(0xffd07316)]) {
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 (balanceCache[address] != null &&
balanceCache[address] != -1) {
return Row(children: [
Text(balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9, color: color)),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return SizedBox(
height: 15,
width: 15,
child: CircularProgressIndicator(
color: loadingColor,
strokeWidth: 2,
),
);
}
}
balanceCache[address] = globalBalance.data!['transferableBalance']!;
if (balanceCache[address] != -1) {
return Row(children: [
Text(
balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9,
color: color,
),
),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return const Text('');
}
});
}),
]);
}
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
@ -27,8 +79,6 @@ class SearchResultScreen extends StatelessWidget {
Provider.of<CesiumPlusProvider>(context, listen: false);
WalletsProfilesProvider walletsProfilesClass =
Provider.of<WalletsProfilesProvider>(context, listen: false);
HomeProvider homeProvider =
Provider.of<HomeProvider>(context, listen: false);
DuniterIndexer duniterIndexer =
Provider.of<DuniterIndexer>(context, listen: false);
@ -44,7 +94,7 @@ class SearchResultScreen extends StatelessWidget {
child: Text('researchResults'.tr()),
),
),
bottomNavigationBar: homeProvider.bottomAppBar(context),
bottomNavigationBar: BottomAppBarCustom(context: context),
body: SafeArea(
child: Stack(children: [
Padding(

View File

@ -3,11 +3,11 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/home.dart';
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/choose_currency_unit.dart';
import 'package:polkawallet_sdk/api/types/networkParams.dart';
import 'package:provider/provider.dart';
@ -48,7 +48,7 @@ class SettingsScreen extends StatelessWidget {
style: TextStyle(color: Colors.grey[500], fontSize: 22),
),
const SizedBox(height: 20),
chooseCurrencyUnit(context),
ChooseCurrencyUnit(context: context),
// SizedBox(height: isTall ? 80 : 120),
const Spacer(),
@ -79,36 +79,6 @@ class SettingsScreen extends StatelessWidget {
);
}
Widget chooseCurrencyUnit(BuildContext context) {
HomeProvider homeProvider =
Provider.of<HomeProvider>(context, listen: false);
return InkWell(
key: keyUdUnit,
onTap: () async {
await homeProvider.changeCurrencyUnit(context);
},
child: SizedBox(
height: 50,
child: Row(
children: [
const SizedBox(width: 12),
Text('showUdAmounts'.tr()),
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,
);
}),
const SizedBox(width: 30),
],
),
),
);
}
Widget duniterEndpointSelection(BuildContext context) {
SubstrateSdk sub = Provider.of<SubstrateSdk>(context, listen: false);
String? selectedDuniterEndpoint;

View File

@ -103,7 +103,7 @@ class TransactionInProgress extends StatelessWidget {
'g1migration Bloc of last transaction: ${sub.blocNumber} --- $result');
} else {
isValid = false;
resultText = "${"anErrorOccurred".tr()}:\n";
resultText = "${"anErrorOccured".tr()}:\n";
final List exceptionSplit = result.split('Exception: ');
String exception;
if (exceptionSplit.length > 1) {

View File

@ -7,7 +7,6 @@ import 'package:flutter/material.dart';
import 'package:gecko/models/g1_wallets_list.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/cesium_plus.dart';
import 'package:gecko/providers/home.dart';
import 'package:gecko/providers/substrate_sdk.dart';
import 'package:gecko/providers/wallet_options.dart';
import 'package:gecko/providers/my_wallets.dart';
@ -19,6 +18,7 @@ import 'package:gecko/screens/myWallets/choose_wallet.dart';
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
import 'package:gecko/screens/qrcode_fullscreen.dart';
import 'package:gecko/screens/transaction_in_progress.dart';
import 'package:gecko/widgets/bottom_app_bar.dart';
import 'package:provider/provider.dart';
import 'package:qr_flutter/qr_flutter.dart';
@ -41,8 +41,6 @@ class WalletViewScreen extends StatelessWidget {
Provider.of<CesiumPlusProvider>(context, listen: false);
walletProfile.address = address;
SubstrateSdk sub = Provider.of<SubstrateSdk>(context, listen: false);
HomeProvider homeProvider =
Provider.of<HomeProvider>(context, listen: false);
MyWalletsProvider myWalletProvider =
Provider.of<MyWalletsProvider>(context, listen: false);
WalletData? defaultWallet = myWalletProvider.getDefaultWallet();
@ -104,7 +102,7 @@ class WalletViewScreen extends StatelessWidget {
child: Text('seeAWallet'.tr()),
),
),
bottomNavigationBar: homeProvider.bottomAppBar(context),
bottomNavigationBar: BottomAppBarCustom(context: context),
body: SafeArea(
child: Column(children: <Widget>[
walletProfile.headerProfileView(context, address, username),
@ -362,6 +360,8 @@ class WalletViewScreen extends StatelessWidget {
));
}
Widget waitToCert(String status, String duration) {
return Column(children: <Widget>[
SizedBox(
@ -442,6 +442,58 @@ void paymentPopup(BuildContext context, String toAddress) {
}
}
Widget balance(BuildContext context, String address, double size,
[Color color = Colors.black,
Color loadingColor = const Color(0xffd07316)]) {
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 (balanceCache[address] != null &&
balanceCache[address] != -1) {
return Row(children: [
Text(balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9, color: color)),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return SizedBox(
height: 15,
width: 15,
child: CircularProgressIndicator(
color: loadingColor,
strokeWidth: 2,
),
);
}
}
balanceCache[address] = globalBalance.data!['transferableBalance']!;
if (balanceCache[address] != -1) {
return Row(children: [
Text(
balanceCache[address]!.toString(),
style: TextStyle(
fontSize: isTall ? size : size * 0.9,
color: color,
),
),
const SizedBox(width: 5),
udUnitDisplay(size, color),
]);
} else {
return const Text('');
}
});
}),
]);
}
showModalBottomSheet<void>(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.only(
@ -686,4 +738,6 @@ void paymentPopup(BuildContext context, String toAddress) {
);
});
}).then((value) => walletViewProvider.payAmount.text = '');
}

View File

@ -0,0 +1,120 @@
// ignore_for_file: use_build_context_synchronously
import 'package:flutter/material.dart';
import 'package:gecko/globals.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/wallets_profiles.dart';
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
import 'package:gecko/screens/myWallets/wallets_home.dart';
import 'package:gecko/screens/search.dart';
import 'package:provider/provider.dart';
class BottomAppBarCustom extends StatelessWidget {
const BottomAppBarCustom({
Key? key,
required this.context,
}) : super(key: key);
final BuildContext context;
@override
Widget build(BuildContext context) {
MyWalletsProvider myWalletProvider =
Provider.of<MyWalletsProvider>(context, listen: false);
WalletsProfilesProvider historyProvider =
Provider.of<WalletsProfilesProvider>(context, listen: false);
final size = MediaQuery.of(context).size;
const bool showBottomBar = true;
return Visibility(
visible: showBottomBar,
child: Container(
color: yellowC,
width: size.width,
height: 80,
child:
// Stack(
// children: [
// // CustomPaint(
// // size: Size(size.width, 110),
// // painter: CustomRoundedButton(),
// // ),
Row(mainAxisAlignment: MainAxisAlignment.start, children: [
// SizedBox(width: 0),
const Spacer(),
const SizedBox(width: 11),
IconButton(
key: keyAppBarSearch,
iconSize: 40,
icon: const Image(image: AssetImage('assets/loupe-noire.png')),
onPressed: () {
Navigator.popUntil(
context,
ModalRoute.withName('/'),
);
Navigator.push(
context,
MaterialPageRoute(builder: (homeContext) {
return const SearchScreen();
}),
);
},
),
const SizedBox(width: 22),
const Spacer(),
IconButton(
key: keyAppBarQrcode,
iconSize: 70,
icon: const Image(image: AssetImage('assets/qrcode-scan.png')),
onPressed: () async {
Navigator.popUntil(
context,
ModalRoute.withName('/'),
);
historyProvider.scan(homeContext);
},
),
const Spacer(),
const SizedBox(width: 15),
IconButton(
key: keyAppBarChest,
iconSize: 60,
icon: const Image(image: AssetImage('assets/wallet.png')),
onPressed: () 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('/'),
);
Navigator.push(
context,
MaterialPageRoute(builder: (context) {
return const WalletsHome();
}),
);
}
},
),
const Spacer(),
]),
),
);
}
}

View File

@ -0,0 +1,46 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/home.dart';
import 'package:provider/provider.dart';
class ChooseCurrencyUnit extends StatelessWidget {
const ChooseCurrencyUnit({
Key? key,
required this.context,
}) : super(key: key);
final BuildContext context;
@override
Widget build(BuildContext context) {
HomeProvider homeProvider =
Provider.of<HomeProvider>(context, listen: false);
return InkWell(
key: keyUdUnit,
onTap: () async {
await homeProvider.changeCurrencyUnit(context);
},
child: SizedBox(
height: 50,
child: Row(
children: [
const SizedBox(width: 12),
Text('showUdAmounts'.tr()),
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,
);
}),
const SizedBox(width: 30),
],
),
),
);
}
}

View File

@ -0,0 +1,39 @@
import 'package:gecko/globals.dart';
import 'package:flutter/material.dart';
import 'package:gecko/models/wallet_data.dart';
import 'package:truncate/truncate.dart';
class WalletName extends StatelessWidget {
const WalletName({
Key? key,
required this.context,
required this.wallet,
required this.size,
required this.color,
}) : super(key: key);
final BuildContext context;
final WalletData wallet;
final double size;
final Color color;
@override
Widget build(BuildContext context) {
double newSize = wallet.name!.length <= 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,
color: color,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.italic,
),
softWrap: false,
overflow: TextOverflow.ellipsis,
),
]);
}
}

View File

@ -7,21 +7,21 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "50.0.0"
version: "46.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.0"
version: "4.6.0"
analyzer_plugin:
dependency: transitive
description:
name: analyzer_plugin
url: "https://pub.dartlang.org"
source: hosted
version: "0.11.2"
version: "0.10.0"
ansicolor:
dependency: transitive
description:
@ -105,14 +105,14 @@ packages:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.1"
version: "2.3.0"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
version: "1.1.0"
build_daemon:
dependency: transitive
description:
@ -126,21 +126,21 @@ packages:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.0.9"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.2"
version: "2.2.0"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "7.2.7"
version: "7.2.3"
built_collection:
dependency: transitive
description:
@ -154,7 +154,7 @@ packages:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "8.4.2"
version: "8.4.1"
carousel_slider:
dependency: "direct main"
description:
@ -169,6 +169,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
checked_yaml:
dependency: transitive
description:
@ -189,7 +196,7 @@ packages:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "4.3.0"
version: "4.2.0"
collection:
dependency: transitive
description:
@ -203,7 +210,7 @@ packages:
name: connectivity_plus
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.9"
version: "2.3.6+1"
connectivity_plus_linux:
dependency: transitive
description:
@ -217,21 +224,21 @@ packages:
name: connectivity_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.6"
version: "1.2.4"
connectivity_plus_platform_interface:
dependency: transitive
description:
name: connectivity_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.3"
version: "1.2.1"
connectivity_plus_web:
dependency: transitive
description:
name: connectivity_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.5"
version: "1.2.3"
connectivity_plus_windows:
dependency: transitive
description:
@ -245,14 +252,14 @@ packages:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
version: "3.0.2"
cross_file:
dependency: transitive
description:
name: cross_file
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.3+2"
version: "0.3.3+1"
crypto:
dependency: transitive
description:
@ -273,14 +280,14 @@ packages:
name: dart_code_metrics
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.1"
version: "4.17.1"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.4"
version: "2.2.3"
dbus:
dependency: transitive
description:
@ -414,7 +421,7 @@ packages:
name: flutter_markdown
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.13"
version: "0.6.10+5"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
@ -438,7 +445,7 @@ packages:
name: frontend_server_client
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.0"
version: "2.1.3"
fuchsia_remote_debug_protocol:
dependency: transitive
description: flutter
@ -471,56 +478,56 @@ packages:
name: gql
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0"
version: "0.13.1"
gql_dedupe_link:
dependency: transitive
description:
name: gql_dedupe_link
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.3+1"
version: "2.0.2"
gql_error_link:
dependency: transitive
description:
name: gql_error_link
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.3+1"
version: "0.2.2"
gql_exec:
dependency: transitive
description:
name: gql_exec
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.3"
version: "0.4.0"
gql_http_link:
dependency: transitive
description:
name: gql_http_link
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.5"
version: "0.4.2"
gql_link:
dependency: transitive
description:
name: gql_link
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.0+1"
version: "0.4.2"
gql_transform_link:
dependency: transitive
description:
name: gql_transform_link
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.2+1"
version: "0.2.2"
graphql:
dependency: transitive
description:
name: graphql
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.2-beta.5"
version: "5.1.2-beta.4"
graphql_flutter:
dependency: "direct main"
description:
@ -534,7 +541,7 @@ packages:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
version: "2.1.0"
hex:
dependency: "direct main"
description:
@ -562,7 +569,7 @@ packages:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.15.1"
version: "0.15.0"
http:
dependency: transitive
description:
@ -583,7 +590,7 @@ packages:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.2"
version: "4.0.1"
http_server:
dependency: transitive
description:
@ -597,42 +604,42 @@ packages:
name: icons_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
version: "2.0.5"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.2"
version: "3.2.0"
image_cropper:
dependency: "direct main"
description:
name: image_cropper
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
version: "3.0.0"
image_cropper_for_web:
dependency: transitive
description:
name: image_cropper_for_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "1.0.2"
image_cropper_platform_interface:
dependency: transitive
description:
name: image_cropper_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.3"
version: "3.0.2"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.6"
version: "0.8.5+3"
image_picker_android:
dependency: transitive
description:
@ -646,21 +653,21 @@ packages:
name: image_picker_for_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.10"
version: "2.1.8"
image_picker_ios:
dependency: transitive
description:
name: image_picker_ios
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.6+1"
version: "0.8.6"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.2"
version: "2.6.1"
integration_test:
dependency: "direct dev"
description: flutter
@ -721,14 +728,14 @@ packages:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "4.7.0"
version: "4.6.0"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.0"
logger:
dependency: "direct main"
description:
@ -742,14 +749,14 @@ packages:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.0.2"
markdown:
dependency: transitive
description:
name: markdown
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.1"
version: "5.0.0"
matcher:
dependency: transitive
description:
@ -784,7 +791,7 @@ packages:
name: mobx
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.0.7+5"
nested:
dependency: transitive
description:
@ -805,7 +812,7 @@ packages:
name: normalize
url: "https://pub.dartlang.org"
source: hosted
version: "0.7.2"
version: "0.6.0+1"
package_config:
dependency: transitive
description:
@ -819,14 +826,42 @@ packages:
name: package_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
version: "1.4.3+1"
package_info_plus_linux:
dependency: transitive
description:
name: package_info_plus_linux
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
package_info_plus_macos:
dependency: transitive
description:
name: package_info_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "1.0.2"
package_info_plus_web:
dependency: transitive
description:
name: package_info_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
package_info_plus_windows:
dependency: transitive
description:
name: package_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
path:
dependency: transitive
description:
@ -854,7 +889,7 @@ packages:
name: path_provider_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.22"
version: "2.0.20"
path_provider_ios:
dependency: transitive
description:
@ -882,7 +917,7 @@ packages:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.5"
version: "2.0.4"
path_provider_windows:
dependency: transitive
description:
@ -903,49 +938,49 @@ packages:
name: pdf
url: "https://pub.dartlang.org"
source: hosted
version: "3.8.4"
version: "3.8.3"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
url: "https://pub.dartlang.org"
source: hosted
version: "10.2.0"
version: "10.0.0"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
url: "https://pub.dartlang.org"
source: hosted
version: "10.2.0"
version: "10.0.0"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
url: "https://pub.dartlang.org"
source: hosted
version: "9.0.7"
version: "9.0.4"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "3.9.0"
version: "3.7.0"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
version: "0.1.0"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.0"
version: "5.0.0"
pin_code_fields:
dependency: "direct main"
description:
@ -973,7 +1008,7 @@ packages:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.1.2"
pointycastle:
dependency: "direct main"
description:
@ -1024,21 +1059,14 @@ packages:
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.4"
version: "6.0.3"
pub_semver:
dependency: transitive
description:
name: pub_semver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
pub_updater:
dependency: transitive
description:
name: pub_updater
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.3"
version: "2.1.1"
pubspec_parse:
dependency: transitive
description:
@ -1075,21 +1103,21 @@ packages:
name: rxdart
url: "https://pub.dartlang.org"
source: hosted
version: "0.27.7"
version: "0.27.5"
sentry:
dependency: transitive
description:
name: sentry
url: "https://pub.dartlang.org"
source: hosted
version: "6.16.1"
version: "6.9.1"
sentry_flutter:
dependency: "direct main"
description:
name: sentry_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "6.16.1"
version: "6.9.1"
shared_preferences:
dependency: "direct main"
description:
@ -1103,7 +1131,7 @@ packages:
name: shared_preferences_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.14"
version: "2.0.13"
shared_preferences_ios:
dependency: transitive
description:
@ -1152,14 +1180,14 @@ packages:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.0"
version: "1.3.2"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "1.0.2"
sky_engine:
dependency: transitive
description: flutter
@ -1192,7 +1220,7 @@ packages:
name: stream_transform
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.0.0"
string_scanner:
dependency: transitive
description:
@ -1262,7 +1290,7 @@ packages:
name: uuid
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.7"
version: "3.0.6"
vector_math:
dependency: transitive
description:
@ -1283,7 +1311,7 @@ packages:
name: watcher
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
version: "1.0.1"
web_socket_channel:
dependency: transitive
description:
@ -1311,28 +1339,28 @@ packages:
name: webview_flutter_android
url: "https://pub.dartlang.org"
source: hosted
version: "2.10.4"
version: "2.10.0"
webview_flutter_platform_interface:
dependency: transitive
description:
name: webview_flutter_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.5"
version: "1.9.3"
webview_flutter_wkwebview:
dependency: transitive
description:
name: webview_flutter_wkwebview
url: "https://pub.dartlang.org"
source: hosted
version: "2.9.5"
version: "2.9.3"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.2"
version: "3.0.0"
xdg_directories:
dependency: transitive
description:
@ -1355,5 +1383,5 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.18.0 <3.0.0"
dart: ">=2.17.1 <3.0.0"
flutter: ">=3.0.0"

View File

@ -5,7 +5,7 @@ description: Pay with G1.
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 0.0.12+33
version: 0.0.11+32
environment:
sdk: '>=2.12.0 <3.0.0'
@ -41,7 +41,7 @@ dependencies:
unorm_dart: ^0.2.0
dio: ^4.0.4
durt: ^0.1.6
package_info_plus: ^3.0.2
package_info_plus: ^1.4.2
polkawallet_sdk: #^0.4.9
git:
# url: https://github.com/polkawallet-io/sdk.git
@ -67,7 +67,7 @@ dev_dependencies:
sdk: flutter
integration_test:
sdk: flutter
dart_code_metrics: ^5.0.1
dart_code_metrics: ^4.17.1
flutter_icons:
android: true