diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba3bce31a5d020114da6f89d253a728db50aa7c5..d8130ec232616b751c75cce61a04aa6aeaec5e67 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ stages: - package .env: - image: axiomteam/gecko-ci:v0.0.11 + image: ghcr.io/cirruslabs/flutter:3.24.3 tags: - docker @@ -18,7 +18,7 @@ format: - when: manual stage: format script: - - flutter format --set-exit-if-changed lib + - dart format --set-exit-if-changed lib build_and_test: extends: .env diff --git a/lib/main.dart b/lib/main.dart index 4cc8b17bef4741c1834edf9b5970f67a2d851d38..35e8c05c0ac3ae407f9f23bb12a0c9ff24e6768a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -76,11 +76,18 @@ Future<void> main() async { if (kReleaseMode && enableSentry) { await SentryFlutter.init((options) { - options.dsn = 'https://c09587b46eaa42e8b9fda28d838ed180@o496840.ingest.sentry.io/5572110'; + options.dsn = + 'https://c09587b46eaa42e8b9fda28d838ed180@o496840.ingest.sentry.io/5572110'; }, - appRunner: () => SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then((_) { + appRunner: () => SystemChrome.setPreferredOrientations( + [DeviceOrientation.portraitUp]).then((_) { runApp(EasyLocalization( - supportedLocales: const [Locale('en'), Locale('fr'), Locale('es'), Locale('it')], + supportedLocales: const [ + Locale('en'), + Locale('fr'), + Locale('es'), + Locale('it') + ], path: 'assets/translations', fallbackLocale: const Locale('en'), child: const Gecko(), @@ -89,10 +96,16 @@ Future<void> main() async { } else { log.i('Debug mode enabled: No sentry alert'); - SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then((_) { + SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]) + .then((_) { runApp(EasyLocalization( // test, force locale :: startLocale: Locale.fromSubtags(languageCode: 'it'), - supportedLocales: const [Locale('en'), Locale('fr'), Locale('es'), Locale('it')], + supportedLocales: const [ + Locale('en'), + Locale('fr'), + Locale('es'), + Locale('it') + ], path: 'assets/translations', fallbackLocale: const Locale('en'), child: const Gecko(), @@ -150,7 +163,8 @@ class Gecko extends StatelessWidget { // ).apply( // bodyColor: const Color(0xFF000000), // ), - colorScheme: ColorScheme.fromSwatch().copyWith(secondary: Colors.grey[850]), + colorScheme: + ColorScheme.fromSwatch().copyWith(secondary: Colors.grey[850]), ), initialRoute: "/", routes: { @@ -168,6 +182,8 @@ class Gecko extends StatelessWidget { class MyHttpOverrides extends HttpOverrides { @override HttpClient createHttpClient(SecurityContext? context) { - return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true; + return super.createHttpClient(context) + ..badCertificateCallback = + (X509Certificate cert, String host, int port) => true; } } diff --git a/lib/providers/generate_wallets.dart b/lib/providers/generate_wallets.dart index f352a39a6fb7f19c7941618275700f21ef30e2dd..1e20d78c34fbf3ec9a87ae56033c48b5cb16ffa4 100644 --- a/lib/providers/generate_wallets.dart +++ b/lib/providers/generate_wallets.dart @@ -84,7 +84,8 @@ class GenerateWalletsProvider with ChangeNotifier { final expectedWord = mnemo.split(' ')[nbrWord]; final normInputWord = unorm.nfkd(inputWord); - if (expectedWord == normInputWord || (kDebugMode && inputWord == 'triche')) { + if (expectedWord == normInputWord || + (kDebugMode && inputWord == 'triche')) { isAskedWordValid = true; askedWordColor = Colors.green[600]; notifyListeners(); @@ -94,8 +95,10 @@ class GenerateWalletsProvider with ChangeNotifier { } String removeDiacritics(String str) { - var withDia = 'ÀÃÂÃÄÅà áâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÃÃŒÃÃŽÃìÃîïÙÚÛÜùúûüÑñŠšŸÿýŽž'; - var withoutDia = 'AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz'; + var withDia = + 'ÀÃÂÃÄÅà áâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÃÃŒÃÃŽÃìÃîïÙÚÛÜùúûüÑñŠšŸÿýŽž'; + var withoutDia = + 'AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz'; for (int i = 0; i < withDia.length; i++) { str = str.replaceAll(withDia[i], withoutDia[i]); @@ -133,7 +136,8 @@ class GenerateWalletsProvider with ChangeNotifier { notifyListeners(); } - Future<void> generateCesiumWalletPubkey(String cesiumID, String cesiumPWD) async { + Future<void> generateCesiumWalletPubkey( + String cesiumID, String cesiumPWD) async { cesiumWallet = durt.CesiumWallet(cesiumID, cesiumPWD); String walletPubkey = cesiumWallet.pubkey; @@ -201,8 +205,11 @@ class GenerateWalletsProvider with ChangeNotifier { } void resetImportView() { - cellController0.text = cellController1.text = cellController2.text = cellController3.text = cellController4.text = cellController5.text = - cellController6.text = cellController7.text = cellController8.text = cellController9.text = cellController10.text = cellController11.text = ''; + cellController0.text = cellController1.text = cellController2.text = + cellController3.text = cellController4.text = cellController5.text = + cellController6.text = cellController7.text = cellController8.text = + cellController9.text = + cellController10.text = cellController11.text = ''; isFirstTimeSentenceComplete = true; notifyListeners(); } @@ -288,15 +295,19 @@ class GenerateWalletsProvider with ChangeNotifier { scanStatus = ScanDerivationsStatus.scanning; for (int derivationNbr in [for (var i = 0; i < numberScan; i += 1) i]) { - final addressData = await sub.sdk.api.keyring - .addressFromMnemonic(sub.currencyParameters['ss58']!, cryptoType: CryptoType.sr25519, mnemonic: generatedMnemonic!, derivePath: '//$derivationNbr'); + final addressData = await sub.sdk.api.keyring.addressFromMnemonic( + sub.currencyParameters['ss58']!, + cryptoType: CryptoType.sr25519, + mnemonic: generatedMnemonic!, + derivePath: '//$derivationNbr'); addressToScan.putIfAbsent(addressData.address!, () => derivationNbr); } - final balanceList = await sub.getBalanceMulti(addressToScan.keys.toList()).timeout( - const Duration(seconds: 20), - onTimeout: () => {}, - ); + final balanceList = + await sub.getBalanceMulti(addressToScan.keys.toList()).timeout( + const Duration(seconds: 20), + onTimeout: () => {}, + ); // Remove unused wallets balanceList.removeWhere((key, value) => value['transferableBalance'] == 0); @@ -305,8 +316,13 @@ class GenerateWalletsProvider with ChangeNotifier { scanStatus = ScanDerivationsStatus.import; for (String scannedWallet in balanceList.keys) { isAlive = true; - String walletName = scanedWalletNumber == 0 ? 'currentWallet'.tr() : '${'wallet'.tr()} ${scanedWalletNumber + 1}'; - await sub.importAccount(mnemonic: generatedMnemonic!, derivePath: "//${addressToScan[scannedWallet]}", password: pinCode); + String walletName = scanedWalletNumber == 0 + ? 'currentWallet'.tr() + : '${'wallet'.tr()} ${scanedWalletNumber + 1}'; + await sub.importAccount( + mnemonic: generatedMnemonic!, + derivePath: "//${addressToScan[scannedWallet]}", + password: pinCode); WalletData myWallet = WalletData( chest: currentChestNumber, @@ -327,9 +343,12 @@ class GenerateWalletsProvider with ChangeNotifier { return isAlive; } - Future<bool> scanRootBalance(SubstrateSdk sub, int currentChestNumber, String pinCode) async { - final addressData = - await sub.sdk.api.keyring.addressFromMnemonic(sub.currencyParameters['ss58']!, cryptoType: CryptoType.sr25519, mnemonic: generatedMnemonic!); + Future<bool> scanRootBalance( + SubstrateSdk sub, int currentChestNumber, String pinCode) async { + final addressData = await sub.sdk.api.keyring.addressFromMnemonic( + sub.currencyParameters['ss58']!, + cryptoType: CryptoType.sr25519, + mnemonic: generatedMnemonic!); final balance = await sub.getBalance(addressData.address!).timeout( const Duration(seconds: 1), @@ -341,7 +360,13 @@ class GenerateWalletsProvider with ChangeNotifier { await sub.importAccount(mnemonic: generatedMnemonic!, password: pinCode); WalletData myWallet = WalletData( - chest: currentChestNumber, address: addressData.address!, number: 0, name: walletName, derivation: -1, imageDefaultPath: '0.png', isOwned: true); + chest: currentChestNumber, + address: addressData.address!, + number: 0, + name: walletName, + derivation: -1, + imageDefaultPath: '0.png', + isOwned: true); await walletBox.put(myWallet.address, myWallet); scanedWalletNumber++; return true; diff --git a/lib/providers/wallet_options.dart b/lib/providers/wallet_options.dart index 024249acd1f3313f190a4c4e0e090663e86fefb8..ae285c59d2b5a725875fe77535b8d70ad19124fe 100644 --- a/lib/providers/wallet_options.dart +++ b/lib/providers/wallet_options.dart @@ -36,7 +36,8 @@ class WalletOptionsProvider with ChangeNotifier { return pinLength; } - void _renameWallet(List<int?> walletID, String newName, {required bool isCesium}) async { + void _renameWallet(List<int?> walletID, String newName, + {required bool isCesium}) async { MyWalletsProvider myWalletClass = MyWalletsProvider(); WalletData walletTarget = myWalletClass.getWalletDataById(walletID)!; @@ -49,14 +50,20 @@ class WalletOptionsProvider with ChangeNotifier { Future<int> deleteWallet(context, WalletData wallet) async { final sub = Provider.of<SubstrateSdk>(context, listen: false); final datapod = Provider.of<V2sDatapodProvider>(context, listen: false); - final bool? answer = await (confirmPopup(context, 'areYouSureToForgetWallet'.tr(args: [wallet.name!]))); + final bool? answer = await (confirmPopup( + context, 'areYouSureToForgetWallet'.tr(args: [wallet.name!]))); if (answer ?? false) { //Check if balance is null if (balanceCache[wallet.address] != 0) { - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); final defaultWallet = myWalletProvider.getDefaultWallet(); - sub.pay(fromAddress: wallet.address, destAddress: defaultWallet.address, amount: -1, password: myWalletProvider.pinCode); + sub.pay( + fromAddress: wallet.address, + destAddress: defaultWallet.address, + amount: -1, + password: myWalletProvider.pinCode); } await walletBox.delete(wallet.address); @@ -125,7 +132,8 @@ class WalletOptionsProvider with ChangeNotifier { await File(croppedFile.path).rename(newPath); - final walletData = MyWalletsProvider().getWalletDataByAddress(address.text); + final walletData = + MyWalletsProvider().getWalletDataByAddress(address.text); if (walletData!.imageCustomPath != null) { final avatarFile = File(walletData.imageCustomPath!); @@ -149,8 +157,10 @@ class WalletOptionsProvider with ChangeNotifier { Future<String?> confirmIdentityPopup(BuildContext context) async { final idtyName = TextEditingController(); final sub = Provider.of<SubstrateSdk>(context, listen: false); - final walletOptions = Provider.of<WalletOptionsProvider>(context, listen: false); - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); + final walletOptions = + Provider.of<WalletOptionsProvider>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false); bool canValidate = false; @@ -174,7 +184,10 @@ class WalletOptionsProvider with ChangeNotifier { key: keyEnterIdentityUsername, onChanged: (_) async { idtyExist = await duniterIndexer.isIdtyExist(idtyName.text); - canValidate = !idtyExist && !await duniterIndexer.isIdtyExist(idtyName.text) && idtyName.text.length >= 2 && idtyName.text.length <= 32; + canValidate = !idtyExist && + !await duniterIndexer.isIdtyExist(idtyName.text) && + idtyName.text.length >= 2 && + idtyName.text.length <= 32; notifyListeners(); }, @@ -190,7 +203,8 @@ class WalletOptionsProvider with ChangeNotifier { ), const SizedBox(height: 10), Consumer<WalletOptionsProvider>(builder: (context, wOptions, _) { - return Text(idtyExist ? "thisIdentityAlreadyExist".tr() : '', style: TextStyle(color: Colors.red[500])); + return Text(idtyExist ? "thisIdentityAlreadyExist".tr() : '', + style: TextStyle(color: Colors.red[500])); }) ]), ), @@ -198,22 +212,29 @@ class WalletOptionsProvider with ChangeNotifier { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Consumer<WalletOptionsProvider>(builder: (context, wOptions, _) { + Consumer<WalletOptionsProvider>( + builder: (context, wOptions, _) { return TextButton( key: keyConfirm, onPressed: canValidate ? () async { - idtyName.text = idtyName.text.trim().replaceAll(' ', ''); + idtyName.text = + idtyName.text.trim().replaceAll(' ', ''); - if (idtyName.text.length.clamp(3, 32) != idtyName.text.length) { + if (idtyName.text.length.clamp(3, 32) != + idtyName.text.length) { return; } if (!await myWalletProvider.askPinCode()) return; - final wallet = myWalletProvider.getWalletDataByAddress(address.text); + final wallet = myWalletProvider + .getWalletDataByAddress(address.text); await sub.setCurrentWallet(wallet!); - final transactionId = await sub.confirmIdentity(walletOptions.address.text, idtyName.text, myWalletProvider.pinCode); + final transactionId = await sub.confirmIdentity( + walletOptions.address.text, + idtyName.text, + myWalletProvider.pinCode); Navigator.pop(context); Navigator.push( @@ -231,7 +252,11 @@ class WalletOptionsProvider with ChangeNotifier { : null, child: Text( "validate".tr(), - style: TextStyle(fontSize: 20, color: canValidate ? const Color(0xffD80000) : Colors.grey[500]), + style: TextStyle( + fontSize: 20, + color: canValidate + ? const Color(0xffD80000) + : Colors.grey[500]), ), ); }) @@ -275,14 +300,17 @@ class WalletOptionsProvider with ChangeNotifier { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Consumer<WalletOptionsProvider>(builder: (context, wOptions, _) { + Consumer<WalletOptionsProvider>( + builder: (context, wOptions, _) { return TextButton( key: keyInfoPopup, child: Text( "validate".tr(), style: TextStyle( fontSize: 20, - color: canValidateNameBool ? const Color(0xffD80000) : Colors.grey, + color: canValidateNameBool + ? const Color(0xffD80000) + : Colors.grey, fontWeight: FontWeight.w600, ), ), @@ -305,7 +333,10 @@ class WalletOptionsProvider with ChangeNotifier { key: keyCancel, child: Text( "cancel".tr(), - style: TextStyle(fontSize: 17, color: Colors.grey[800], fontWeight: FontWeight.w300), + style: TextStyle( + fontSize: 17, + color: Colors.grey[800], + fontWeight: FontWeight.w300), ), onPressed: () async { Navigator.pop(context); @@ -321,9 +352,12 @@ class WalletOptionsProvider with ChangeNotifier { } bool canValidateName(BuildContext context, final walletName) { - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); - bool isNameValid = walletName.text.length >= 2 && !walletName.text.contains(':') && walletName.text.length <= 39; + bool isNameValid = walletName.text.length >= 2 && + !walletName.text.contains(':') && + walletName.text.length <= 39; if (isNameValid) { for (var wallet in myWalletProvider.listWallets) { diff --git a/lib/screens/activity.dart b/lib/screens/activity.dart index 9d7a5f6d35943eb155024dc8297fc26efdcf3087..53a51ce39a7af1225de68d4beb52da3f970ce9d2 100644 --- a/lib/screens/activity.dart +++ b/lib/screens/activity.dart @@ -36,7 +36,7 @@ class _ActivityScreenState extends State<ActivityScreen> { return PopScope( onPopInvokedWithResult: (_, __) { - duniterIndexer.refetch = duniterIndexer.transBC = null; + duniterIndexer.refetch = duniterIndexer.transBC = null; }, child: Scaffold( appBar: AppBar( diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 4d633ab6e8b11204e181c11590ee1c60b0793935..f589db00d14ab4885c0d535e23c1c6fa0f784d2d 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -37,8 +37,10 @@ class _HomeScreenState extends State<HomeScreen> { WidgetsBinding.instance.addPostFrameCallback((_) async { final homeProvider = Provider.of<HomeProvider>(context, listen: false); final sub = Provider.of<SubstrateSdk>(context, listen: false); - final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false); - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); + final duniterIndexer = + Provider.of<DuniterIndexer>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); final datapod = Provider.of<V2sDatapodProvider>(context, listen: false); final bool isWalletsExists = myWalletProvider.isWalletsExists(); @@ -102,7 +104,8 @@ class _HomeScreenState extends State<HomeScreen> { configBox.put('isCacheChecked', false); } - Future<void> updateConnectionStatus(List<ConnectivityResult> result) async { + Future<void> updateConnectionStatus( + List<ConnectivityResult> result) async { log.i('Network changed: $result'); if (result.contains(ConnectivityResult.none)) { sub.nodeConnected = false; @@ -132,7 +135,9 @@ class _HomeScreenState extends State<HomeScreen> { Provider.of<ChestProvider>(context); final isWalletsExists = myWalletProvider.isWalletsExists(); - isTall = (MediaQuery.of(context).size.height / MediaQuery.of(context).size.width) > 1.75; + isTall = (MediaQuery.of(context).size.height / + MediaQuery.of(context).size.width) > + 1.75; return Scaffold( resizeToAvoidBottomInset: false, @@ -153,7 +158,8 @@ Widget geckHome(context) { fit: BoxFit.cover, ), ), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Stack(children: <Widget>[ Positioned( top: statusBarHeight + scaleSize(10), @@ -171,12 +177,15 @@ Widget geckHome(context) { ), ), Align( - child: Image(image: const AssetImage('assets/home/header.png'), height: scaleSize(165)), + child: Image( + image: const AssetImage('assets/home/header.png'), + height: scaleSize(165)), ), ]), Padding( padding: const EdgeInsets.only(top: 15), - child: Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ + child: + Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ DefaultTextStyle( textAlign: TextAlign.center, style: scaledTextStyle( @@ -237,7 +246,8 @@ Widget welcomeHome(context) { fit: BoxFit.cover, ), ), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Stack(children: <Widget>[ Positioned( top: statusBarHeight + scaleSize(10), @@ -255,12 +265,15 @@ Widget welcomeHome(context) { ), ), Align( - child: Image(image: const AssetImage('assets/home/header.png'), height: scaleSize(165)), + child: Image( + image: const AssetImage('assets/home/header.png'), + height: scaleSize(165)), ), ]), Padding( padding: const EdgeInsets.only(top: 1), - child: Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ + child: + Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text( "fastAppDescription".tr(args: [currencyName]), textAlign: TextAlign.center, @@ -308,7 +321,8 @@ Widget welcomeHome(context) { Padding( padding: EdgeInsets.only(top: scaleSize(55)), child: Image( - image: const AssetImage('assets/home/gecko-bienvenue.png'), + image: const AssetImage( + 'assets/home/gecko-bienvenue.png'), height: scaleSize(180), ), ), @@ -342,7 +356,10 @@ Widget welcomeHome(context) { }, child: Text( 'createWallet'.tr(), - style: scaledTextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Colors.white), + style: scaledTextStyle( + fontSize: 20, + fontWeight: FontWeight.w600, + color: Colors.white), ), ), ), @@ -352,7 +369,8 @@ Widget welcomeHome(context) { height: 60, child: OutlinedButton( key: keyRestoreChest, - style: OutlinedButton.styleFrom(side: BorderSide(width: scaleSize(4), color: orangeC)), + style: OutlinedButton.styleFrom( + side: BorderSide(width: scaleSize(4), color: orangeC)), onPressed: () { Navigator.push( context, @@ -365,7 +383,10 @@ Widget welcomeHome(context) { }, child: Text( "restoreWallet".tr(), - style: scaledTextStyle(fontSize: 20, color: orangeC, fontWeight: FontWeight.w600), + style: scaledTextStyle( + fontSize: 20, + color: orangeC, + fontWeight: FontWeight.w600), ), ), ), diff --git a/lib/screens/myWallets/change_pin.dart b/lib/screens/myWallets/change_pin.dart index 984c1551257f2e732bed5b990764db67c6139558..007d435bf259329ffa70290283848b8a1337ba78 100644 --- a/lib/screens/myWallets/change_pin.dart +++ b/lib/screens/myWallets/change_pin.dart @@ -10,7 +10,11 @@ import 'package:gecko/widgets/commons/top_appbar.dart'; import 'package:provider/provider.dart'; class ChangePinScreen extends StatefulWidget with ChangeNotifier { - ChangePinScreen({Key? keyMyWallets, required this.walletName, required this.walletProvider}) : super(key: keyMyWallets); + ChangePinScreen( + {Key? keyMyWallets, + required this.walletName, + required this.walletProvider}) + : super(key: keyMyWallets); final String? walletName; final MyWalletsProvider walletProvider; @@ -30,7 +34,8 @@ class _ChangePinScreenState extends State<ChangePinScreen> { @override Widget build(BuildContext context) { final sub = Provider.of<SubstrateSdk>(context, listen: false); - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); return PopScope( onPopInvokedWithResult: (_, __) { @@ -46,7 +51,10 @@ class _ChangePinScreenState extends State<ChangePinScreen> { Text( 'choosePassword'.tr(), textAlign: TextAlign.center, - style: TextStyle(fontSize: 16.0, color: Colors.grey[600], fontWeight: FontWeight.w400), + style: TextStyle( + fontSize: 16.0, + color: Colors.grey[600], + fontWeight: FontWeight.w400), ), const SizedBox(height: 30), Stack( @@ -58,7 +66,10 @@ class _ChangePinScreenState extends State<ChangePinScreen> { maxLines: 1, textAlign: TextAlign.center, decoration: const InputDecoration(), - style: const TextStyle(fontSize: 29.0, color: Colors.black, fontWeight: FontWeight.bold)), + style: const TextStyle( + fontSize: 29.0, + color: Colors.black, + fontWeight: FontWeight.bold)), IconButton( icon: const Icon(Icons.replay), color: orangeC, @@ -83,7 +94,8 @@ class _ChangePinScreenState extends State<ChangePinScreen> { if (!await myWalletProvider.askPinCode()) return; - await sub.changePassword(context, defaultWallet.address, widget.walletProvider.pinCode, newPin.text); + await sub.changePassword(context, defaultWallet.address, + widget.walletProvider.pinCode, newPin.text); widget.walletProvider.pinCode = newPin.text; newPin.text = ''; Navigator.pop(context); diff --git a/lib/screens/myWallets/choose_chest.dart b/lib/screens/myWallets/choose_chest.dart index b76ffb79e47c39d3982b24be1e185e5dafb66c4f..04275b2f23e784a47c0a382633fc051a8635a44e 100644 --- a/lib/screens/myWallets/choose_chest.dart +++ b/lib/screens/myWallets/choose_chest.dart @@ -31,7 +31,8 @@ class _ChooseChestState extends State<ChooseChest> { return Scaffold( backgroundColor: backgroundColor, - appBar: AppBar(toolbarHeight: scaleSize(57), title: Text('selectMyChest'.tr())), + appBar: AppBar( + toolbarHeight: scaleSize(57), title: Text('selectMyChest'.tr())), body: SafeArea( child: Column(children: <Widget>[ const SizedBox(height: 160), @@ -76,15 +77,21 @@ class _ChooseChestState extends State<ChooseChest> { mainAxisAlignment: MainAxisAlignment.center, children: chestBox.toMap().entries.map((entry) { return GestureDetector( - onTap: () => buttonCarouselController.animateToPage(entry.key), + onTap: () => + buttonCarouselController.animateToPage(entry.key), child: Container( width: 12.0, height: 12.0, - margin: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 4.0), + margin: const EdgeInsets.symmetric( + vertical: 8.0, horizontal: 4.0), decoration: BoxDecoration( shape: BoxShape.circle, - color: (Theme.of(context).brightness == Brightness.dark ? Colors.white : Colors.black) - .withOpacity(currentChest == entry.key ? 0.9 : 0.4)), + color: + (Theme.of(context).brightness == Brightness.dark + ? Colors.white + : Colors.black) + .withOpacity( + currentChest == entry.key ? 0.9 : 0.4)), ), ); }).toList(), @@ -111,7 +118,10 @@ class _ChooseChestState extends State<ChooseChest> { }, child: Text( 'openThisChest'.tr(), - style: const TextStyle(fontSize: 21, color: backgroundColor, fontWeight: FontWeight.w600), + style: const TextStyle( + fontSize: 21, + color: backgroundColor, + fontWeight: FontWeight.w600), ), ), ), @@ -132,7 +142,12 @@ class _ChooseChestState extends State<ChooseChest> { child: SizedBox( width: 400, height: 50, - child: Center(child: Text('createChest'.tr(), style: const TextStyle(fontSize: 21, color: orangeC, fontWeight: FontWeight.w600))), + child: Center( + child: Text('createChest'.tr(), + style: const TextStyle( + fontSize: 21, + color: orangeC, + fontWeight: FontWeight.w600))), ), ), ), @@ -150,7 +165,12 @@ class _ChooseChestState extends State<ChooseChest> { child: SizedBox( width: 400, height: 50, - child: Center(child: Text('importChest'.tr(), style: const TextStyle(fontSize: 21, color: orangeC, fontWeight: FontWeight.w600))), + child: Center( + child: Text('importChest'.tr(), + style: const TextStyle( + fontSize: 21, + color: orangeC, + fontWeight: FontWeight.w600))), )), const SizedBox(height: 20), ]), diff --git a/lib/screens/myWallets/import_g1_v1.dart b/lib/screens/myWallets/import_g1_v1.dart index 7b40cb1f4fb7c55429b4c63da12db61ccf325272..430f866485c4fe199c6831ac4b8f02379ccf07e3 100644 --- a/lib/screens/myWallets/import_g1_v1.dart +++ b/lib/screens/myWallets/import_g1_v1.dart @@ -25,7 +25,8 @@ class ImportG1v1 extends StatelessWidget { @override Widget build(BuildContext context) { - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); Timer? debounce; WalletData selectedWallet = myWalletProvider.getDefaultWallet(); @@ -40,21 +41,25 @@ class ImportG1v1 extends StatelessWidget { body: SafeArea( child: Consumer<SubstrateSdk>(builder: (context, sub, _) { return FutureBuilder( - future: sub.getBalanceAndIdtyStatus(sub.g1V1NewAddress, selectedWallet.address), - builder: (BuildContext context, AsyncSnapshot<MigrateWalletChecks> status) { + future: sub.getBalanceAndIdtyStatus( + sub.g1V1NewAddress, selectedWallet.address), + builder: (BuildContext context, + AsyncSnapshot<MigrateWalletChecks> status) { if (status.data == null) { return Column(children: [ ScaledSizedBox(height: 80), - Row(mainAxisAlignment: MainAxisAlignment.center, children: [ - ScaledSizedBox( - height: 35, - width: 35, - child: const CircularProgressIndicator( - color: orangeC, - strokeWidth: 4, - ), - ), - ]), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ScaledSizedBox( + height: 35, + width: 35, + child: const CircularProgressIndicator( + color: orangeC, + strokeWidth: 4, + ), + ), + ]), ]); } @@ -73,10 +78,13 @@ class ImportG1v1 extends StatelessWidget { if (debounce?.isActive ?? false) { debounce!.cancel(); } - debounce = Timer(const Duration(milliseconds: debouneTime), () { - if (sub.csSalt.text != '' && sub.csPassword.text != '') { + debounce = Timer( + const Duration(milliseconds: debouneTime), () { + if (sub.csSalt.text != '' && + sub.csPassword.text != '') { sub.reload(); - sub.csToV2Address(sub.csSalt.text, sub.csPassword.text); + sub.csToV2Address( + sub.csSalt.text, sub.csPassword.text); } }); }, @@ -90,7 +98,9 @@ class ImportG1v1 extends StatelessWidget { suffixIcon: IconButton( key: keyCesiumIdVisible, icon: Icon( - sub.isCesiumIDVisible ? Icons.visibility_off : Icons.visibility, + sub.isCesiumIDVisible + ? Icons.visibility_off + : Icons.visibility, color: Colors.black, size: scaleSize(22), ), @@ -109,11 +119,14 @@ class ImportG1v1 extends StatelessWidget { if (debounce?.isActive ?? false) { debounce!.cancel(); } - debounce = Timer(const Duration(milliseconds: debouneTime), () { + debounce = Timer( + const Duration(milliseconds: debouneTime), () { sub.g1V1NewAddress = ''; - if (sub.csSalt.text != '' && sub.csPassword.text != '') { + if (sub.csSalt.text != '' && + sub.csPassword.text != '') { sub.reload(); - sub.csToV2Address(sub.csSalt.text, sub.csPassword.text); + sub.csToV2Address( + sub.csSalt.text, sub.csPassword.text); } }); }, @@ -126,7 +139,9 @@ class ImportG1v1 extends StatelessWidget { hintStyle: scaledTextStyle(fontSize: 13), suffixIcon: IconButton( icon: Icon( - sub.isCesiumIDVisible ? Icons.visibility_off : Icons.visibility, + sub.isCesiumIDVisible + ? Icons.visibility_off + : Icons.visibility, color: Colors.black, size: scaleSize(22), ), @@ -147,24 +162,32 @@ class ImportG1v1 extends StatelessWidget { GestureDetector( key: keyCopyPubkey, onTap: () { - Clipboard.setData(ClipboardData(text: sub.g1V1OldPubkey)); + Clipboard.setData( + ClipboardData(text: sub.g1V1OldPubkey)); snackCopyKey(context); }, child: Text( 'v1: ${getShortPubkey(sub.g1V1OldPubkey)}', - style: scaledTextStyle(fontSize: 15, fontWeight: FontWeight.w600, fontFamily: 'Monospace'), + style: scaledTextStyle( + fontSize: 15, + fontWeight: FontWeight.w600, + fontFamily: 'Monospace'), ), ), ScaledSizedBox(height: 5), GestureDetector( key: keyCopyAddress, onTap: () { - Clipboard.setData(ClipboardData(text: sub.g1V1OldPubkey)); + Clipboard.setData( + ClipboardData(text: sub.g1V1OldPubkey)); snackCopyKey(context); }, child: Text( 'v2: ${getShortPubkey(sub.g1V1NewAddress)}', - style: scaledTextStyle(fontSize: 15, fontWeight: FontWeight.w600, fontFamily: 'Monospace'), + style: scaledTextStyle( + fontSize: 15, + fontWeight: FontWeight.w600, + fontFamily: 'Monospace'), ), ), ], @@ -176,9 +199,13 @@ class ImportG1v1 extends StatelessWidget { '${statusData.fromBalance['transferableBalance']} $unit', style: scaledTextStyle(fontSize: 15), ), - IdentityStatus(address: sub.g1V1NewAddress, isOwner: false, color: Colors.black), + IdentityStatus( + address: sub.g1V1NewAddress, + isOwner: false, + color: Colors.black), ScaledSizedBox(width: 10), - Certifications(address: sub.g1V1NewAddress, size: 14) + Certifications( + address: sub.g1V1NewAddress, size: 14) ], ), ], @@ -224,7 +251,8 @@ class ImportG1v1 extends StatelessWidget { ), onPressed: statusData.canValidate ? () async { - WalletData? defaultWallet = myWalletProvider.getDefaultWallet(); + WalletData? defaultWallet = + myWalletProvider.getDefaultWallet(); String? pin; if (myWalletProvider.pinCode == '') { @@ -232,7 +260,8 @@ class ImportG1v1 extends StatelessWidget { context, MaterialPageRoute( builder: (homeContext) { - return UnlockingWallet(wallet: defaultWallet); + return UnlockingWallet( + wallet: defaultWallet); }, ), ); @@ -254,8 +283,10 @@ class ImportG1v1 extends StatelessWidget { return TransactionInProgress( transactionId: transactionId, transType: 'identityMigration', - fromAddress: getShortPubkey(sub.g1V1NewAddress), - toAddress: getShortPubkey(selectedWallet.address)); + fromAddress: + getShortPubkey(sub.g1V1NewAddress), + toAddress: getShortPubkey( + selectedWallet.address)); }), ); resetScreen(); @@ -263,7 +294,8 @@ class ImportG1v1 extends StatelessWidget { : null, child: Text( 'migrateAccount'.tr(), - style: scaledTextStyle(fontSize: 18, fontWeight: FontWeight.w600), + style: scaledTextStyle( + fontSize: 18, fontWeight: FontWeight.w600), ), ), ), @@ -271,7 +303,8 @@ class ImportG1v1 extends StatelessWidget { Text( statusData.validationStatus, textAlign: TextAlign.center, - style: scaledTextStyle(fontSize: 11, color: Colors.grey[600]), + style: scaledTextStyle( + fontSize: 11, color: Colors.grey[600]), ) ]); }); diff --git a/lib/screens/myWallets/restore_chest.dart b/lib/screens/myWallets/restore_chest.dart index 44b7035010c89ba309b1843a2bd942699533aaaa..6359c3c4478ac820eeb130a56a6894e4424f01e5 100644 --- a/lib/screens/myWallets/restore_chest.dart +++ b/lib/screens/myWallets/restore_chest.dart @@ -45,26 +45,32 @@ class RestoreChest extends StatelessWidget { bubbleSpeak('toRestoreEnterMnemonic'.tr()), ScaledSizedBox(height: isTall ? 20 : 5), Column(children: <Widget>[ - Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[ - arrayCell(context, genW.cellController0), - arrayCell(context, genW.cellController1), - arrayCell(context, genW.cellController2), - arrayCell(context, genW.cellController3), - ]), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: <Widget>[ + arrayCell(context, genW.cellController0), + arrayCell(context, genW.cellController1), + arrayCell(context, genW.cellController2), + arrayCell(context, genW.cellController3), + ]), ScaledSizedBox(height: isTall ? 10 : 3), - Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[ - arrayCell(context, genW.cellController4), - arrayCell(context, genW.cellController5), - arrayCell(context, genW.cellController6), - arrayCell(context, genW.cellController7), - ]), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: <Widget>[ + arrayCell(context, genW.cellController4), + arrayCell(context, genW.cellController5), + arrayCell(context, genW.cellController6), + arrayCell(context, genW.cellController7), + ]), ScaledSizedBox(height: isTall ? 10 : 3), - Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[ - arrayCell(context, genW.cellController8), - arrayCell(context, genW.cellController9), - arrayCell(context, genW.cellController10), - arrayCell(context, genW.cellController11), - ]), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: <Widget>[ + arrayCell(context, genW.cellController8), + arrayCell(context, genW.cellController9), + arrayCell(context, genW.cellController10), + arrayCell(context, genW.cellController11), + ]), ]), // const Spacer(), if (genW.isSentenceComplete(context)) @@ -82,12 +88,17 @@ class RestoreChest extends StatelessWidget { backgroundColor: orangeC, ), onPressed: () async { - if (await sub.isMnemonicValid(genW.generatedMnemonic!)) { + if (await sub + .isMnemonicValid(genW.generatedMnemonic!)) { genW.resetImportView(); await Navigator.push( context, FaderTransition( - page: skipIntro ? const OnboardingStepNine(scanDerivation: true) : const OnboardingStepSeven(scanDerivation: true), + page: skipIntro + ? const OnboardingStepNine( + scanDerivation: true) + : const OnboardingStepSeven( + scanDerivation: true), isFast: true), ); } else { @@ -96,7 +107,10 @@ class RestoreChest extends StatelessWidget { }, child: Text( 'restoreThisChest'.tr(), - style: scaledTextStyle(fontSize: 18, fontWeight: FontWeight.w600, color: Colors.white), + style: scaledTextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + color: Colors.white), ), ), ), @@ -128,7 +142,8 @@ class RestoreChest extends StatelessWidget { Text( 'pasteFromClipboard'.tr(), textAlign: TextAlign.center, - style: scaledTextStyle(fontSize: 15, fontWeight: FontWeight.w400), + style: scaledTextStyle( + fontSize: 15, fontWeight: FontWeight.w400), ), ], )), @@ -154,13 +169,15 @@ class RestoreChest extends StatelessWidget { text, key: keyBubbleSpeak, textAlign: TextAlign.justify, - style: scaledTextStyle(color: Colors.black, fontSize: 16, fontWeight: FontWeight.w400), + style: scaledTextStyle( + color: Colors.black, fontSize: 16, fontWeight: FontWeight.w400), ), ); } Widget arrayCell(BuildContext context, final cellCtl) { - final generateWalletProvider = Provider.of<GenerateWalletsProvider>(context); + final generateWalletProvider = + Provider.of<GenerateWalletsProvider>(context); return Container( width: scaleSize(87), @@ -207,7 +224,8 @@ class RestoreChest extends StatelessWidget { builder: (BuildContext context) { return AlertDialog( title: const Text('Phrase incorrecte'), - content: const Text('Votre phrase de restauration semble incorrecte, les mots ne sont pas dans le bon ordre.\nVeuillez la corriger.'), + content: const Text( + 'Votre phrase de restauration semble incorrecte, les mots ne sont pas dans le bon ordre.\nVeuillez la corriger.'), actions: <Widget>[ TextButton( child: const Text("OK"), diff --git a/lib/screens/myWallets/unlocking_wallet.dart b/lib/screens/myWallets/unlocking_wallet.dart index 8825ceef599ae803975c24ba141f8d49e773f1da..42e71639a64408399066f5e38f255890204d6c26 100644 --- a/lib/screens/myWallets/unlocking_wallet.dart +++ b/lib/screens/myWallets/unlocking_wallet.dart @@ -44,8 +44,10 @@ class _UnlockingWalletState extends State<UnlockingWallet> { @override Widget build(BuildContext context) { - final walletOptions = Provider.of<WalletOptionsProvider>(context, listen: false); - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); + final walletOptions = + Provider.of<WalletOptionsProvider>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); int pinLenght = walletOptions.getPinLenght(widget.wallet.number); errorController = StreamController<ErrorAnimationType>(); @@ -60,117 +62,135 @@ class _UnlockingWalletState extends State<UnlockingWallet> { child: Scaffold( backgroundColor: backgroundColor, body: SafeArea( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ - Stack(children: <Widget>[ - Positioned( - top: 10, - left: 15, - child: Builder( - builder: (context) => IconButton( - key: keyPopButton, - icon: Icon( - Icons.arrow_back, - color: Colors.black, - size: scaleSize(28), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: <Widget>[ + Stack(children: <Widget>[ + Positioned( + top: 10, + left: 15, + child: Builder( + builder: (context) => IconButton( + key: keyPopButton, + icon: Icon( + Icons.arrow_back, + color: Colors.black, + size: scaleSize(28), + ), + onPressed: () { + myWalletProvider.isPinValid = false; + myWalletProvider.isPinLoading = true; + Navigator.pop(context); + }, + ), ), - onPressed: () { - myWalletProvider.isPinValid = false; - myWalletProvider.isPinLoading = true; - Navigator.pop(context); - }, ), - ), - ), - Column(children: <Widget>[ - ScaledSizedBox(height: isTall ? 80 : 65), - Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ - currentChest.imageFile == null - ? Image.asset( - 'assets/chests/${currentChest.imageName}', - width: scaleSize(95), - ) - : Image.file( - currentChest.imageFile!, - width: scaleSize(127), - ), - ScaledSizedBox(width: 5), - ScaledSizedBox( - width: 250, - child: Text( - currentChest.name!, - textAlign: TextAlign.center, - style: scaledTextStyle(fontSize: 21, color: Colors.black, fontWeight: FontWeight.w700), - )), + Column(children: <Widget>[ + ScaledSizedBox(height: isTall ? 80 : 65), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: <Widget>[ + currentChest.imageFile == null + ? Image.asset( + 'assets/chests/${currentChest.imageName}', + width: scaleSize(95), + ) + : Image.file( + currentChest.imageFile!, + width: scaleSize(127), + ), + ScaledSizedBox(width: 5), + ScaledSizedBox( + width: 250, + child: Text( + currentChest.name!, + textAlign: TextAlign.center, + style: scaledTextStyle( + fontSize: 21, + color: Colors.black, + fontWeight: FontWeight.w700), + )), + ]), + ScaledSizedBox(height: isTall ? 30 : 15), + ScaledSizedBox( + width: 350, + child: Text( + 'toUnlockEnterPassword'.tr(), + textAlign: TextAlign.center, + style: scaledTextStyle( + fontSize: 15, + color: Colors.black, + fontWeight: FontWeight.w400), + )), + ScaledSizedBox(height: isTall ? 30 : 15), + if (!myWalletProvider.isPinValid && + !myWalletProvider.isPinLoading) + Text( + "thisIsNotAGoodCode".tr(), + style: scaledTextStyle( + color: Colors.red, + fontWeight: FontWeight.w500, + fontSize: 15), + ), + ScaledSizedBox(height: isTall ? 8 : 0), + pinForm(context, pinLenght), + ScaledSizedBox(height: 8), + if (canUnlock) + Consumer<WalletOptionsProvider>( + builder: (context, sub, _) { + return InkWell( + key: keyCachePassword, + onTap: () { + walletOptions.changePinCacheChoice(); + }, + child: Row(children: [ + ScaledSizedBox(height: 30), + const Spacer(), + Icon( + configBox.get('isCacheChecked') + ? Icons.check_box + : Icons.check_box_outline_blank, + color: orangeC, + size: scaleSize(22), + ), + ScaledSizedBox(width: 8), + Text( + 'rememberPassword'.tr(), + style: scaledTextStyle( + fontSize: 14, color: Colors.grey[700]), + ), + const Spacer() + ]), + ); + }), + // const ScaledSizedBox(height: 10), + // if (canUnlock) + // 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: 21, + // color: Colors.grey, // orangeC + // fontWeight: FontWeight.w600), + // ), + // ), + // )), + ]), ]), - ScaledSizedBox(height: isTall ? 30 : 15), - ScaledSizedBox( - width: 350, - child: Text( - 'toUnlockEnterPassword'.tr(), - textAlign: TextAlign.center, - style: scaledTextStyle(fontSize: 15, color: Colors.black, fontWeight: FontWeight.w400), - )), - ScaledSizedBox(height: isTall ? 30 : 15), - if (!myWalletProvider.isPinValid && !myWalletProvider.isPinLoading) - Text( - "thisIsNotAGoodCode".tr(), - style: scaledTextStyle(color: Colors.red, fontWeight: FontWeight.w500, fontSize: 15), - ), - ScaledSizedBox(height: isTall ? 8 : 0), - pinForm(context, pinLenght), - ScaledSizedBox(height: 8), - if (canUnlock) - Consumer<WalletOptionsProvider>(builder: (context, sub, _) { - return InkWell( - key: keyCachePassword, - onTap: () { - walletOptions.changePinCacheChoice(); - }, - child: Row(children: [ - ScaledSizedBox(height: 30), - const Spacer(), - Icon( - configBox.get('isCacheChecked') ? Icons.check_box : Icons.check_box_outline_blank, - color: orangeC, - size: scaleSize(22), - ), - ScaledSizedBox(width: 8), - Text( - 'rememberPassword'.tr(), - style: scaledTextStyle(fontSize: 14, color: Colors.grey[700]), - ), - const Spacer() - ]), - ); - }), - // const ScaledSizedBox(height: 10), - // if (canUnlock) - // 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: 21, - // color: Colors.grey, // orangeC - // fontWeight: FontWeight.w600), - // ), - // ), - // )), ]), - ]), - ]), )), ); } @@ -193,7 +213,8 @@ class _UnlockingWalletState extends State<UnlockingWallet> { return Form( child: Padding( - padding: EdgeInsets.symmetric(vertical: scaleSize(3), horizontal: scaleSize(isTall ? 40 : 20)), + padding: EdgeInsets.symmetric( + vertical: scaleSize(3), horizontal: scaleSize(isTall ? 40 : 20)), child: PinCodeTextField( key: keyPinForm, textCapitalization: TextCapitalization.characters, @@ -244,7 +265,8 @@ class _UnlockingWalletState extends State<UnlockingWallet> { onCompleted: (pin) async { myWalletProvider.isPinLoading = true; myWalletProvider.pinCode = pin.toUpperCase(); - final isValid = await sub.checkPassword(defaultWallet.address, pin.toUpperCase()); + final isValid = await sub.checkPassword( + defaultWallet.address, pin.toUpperCase()); if (!isValid) { await Future.delayed(const Duration(milliseconds: 20)); pinColor = Colors.red[600]; diff --git a/lib/screens/myWallets/wallet_options.dart b/lib/screens/myWallets/wallet_options.dart index d55fcca407e6c6cc13d738578e0aefa382228409..21dd5097a54ad84c011207efcdef53ea6b2bf448 100644 --- a/lib/screens/myWallets/wallet_options.dart +++ b/lib/screens/myWallets/wallet_options.dart @@ -27,14 +27,18 @@ import 'package:provider/provider.dart'; import 'package:qr_flutter/qr_flutter.dart'; class WalletOptions extends StatelessWidget { - const WalletOptions({Key? keyMyWallets, required this.wallet}) : super(key: keyMyWallets); + const WalletOptions({Key? keyMyWallets, required this.wallet}) + : super(key: keyMyWallets); final WalletData wallet; @override Widget build(BuildContext context) { - final walletOptions = Provider.of<WalletOptionsProvider>(context, listen: false); - WalletsProfilesProvider historyProvider = Provider.of<WalletsProfilesProvider>(context, listen: false); - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); + final walletOptions = + Provider.of<WalletOptionsProvider>(context, listen: false); + WalletsProfilesProvider historyProvider = + Provider.of<WalletsProfilesProvider>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false); final sub = Provider.of<SubstrateSdk>(context, listen: false); @@ -42,7 +46,8 @@ class WalletOptions extends StatelessWidget { walletOptions.address.text = wallet.address; final currentChest = myWalletProvider.getCurrentChest(); - final isWalletNameIndexed = duniterIndexer.walletNameIndexer[walletOptions.address.text] != null; + final isWalletNameIndexed = + duniterIndexer.walletNameIndexer[walletOptions.address.text] != null; // StreamSubscription<QueryResult>? subscription; // final stream = duniterIndexer.subscribeHistoryIssued(wallet.address); @@ -74,9 +79,13 @@ class WalletOptions extends StatelessWidget { appBar: AppBar( toolbarHeight: scaleSize(57), elevation: 0, - title: Consumer<WalletOptionsProvider>(builder: (context, walletProvider, _) { + title: Consumer<WalletOptionsProvider>( + builder: (context, walletProvider, _) { return Text( - isWalletNameIndexed ? duniterIndexer.walletNameIndexer[walletOptions.address.text]! : wallet.name!, + isWalletNameIndexed + ? duniterIndexer + .walletNameIndexer[walletOptions.address.text]! + : wallet.name!, style: scaledTextStyle(fontSize: 18), ); }), @@ -109,7 +118,8 @@ class WalletOptions extends StatelessWidget { height: 5, color: yellowC, ), - Consumer<WalletOptionsProvider>(builder: (context, walletProvider, _) { + Consumer<WalletOptionsProvider>( + builder: (context, walletProvider, _) { return Container( decoration: const BoxDecoration( gradient: LinearGradient( @@ -125,89 +135,135 @@ class WalletOptions extends StatelessWidget { ScaledSizedBox(width: 15), avatar(walletProvider), const Spacer(flex: 1), - Column(crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[ - Stack(children: [ - ScaledSizedBox( - width: 230, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Consumer<WalletOptionsProvider>(builder: (context, walletProvider, _) { - return NameByAddress( - wallet: wallet, - size: 24, - color: Colors.black, - fontWeight: wallet.identityStatus == IdtyStatus.member ? FontWeight.w500 : FontWeight.w400, - fontStyle: FontStyle.normal); - }) - ], - ), - ), - ScaledSizedBox(width: 10), - if (duniterIndexer.walletNameIndexer[wallet.address] == null) - Positioned( - right: 0, - child: InkWell( - key: keyRenameWallet, - onTap: () async { - await walletOptions.editWalletName(context, wallet.id()); - await Future.delayed(const Duration(milliseconds: 30)); - }, - child: ClipRRect( - child: Image.asset(walletOptions.isEditing ? 'assets/walletOptions/android-checkmark.png' : 'assets/walletOptions/edit.png', - width: scaleSize(23), height: scaleSize(23)), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: <Widget>[ + Stack(children: [ + ScaledSizedBox( + width: 230, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Consumer<WalletOptionsProvider>( + builder: (context, walletProvider, _) { + return NameByAddress( + wallet: wallet, + size: 24, + color: Colors.black, + fontWeight: wallet.identityStatus == + IdtyStatus.member + ? FontWeight.w500 + : FontWeight.w400, + fontStyle: FontStyle.normal); + }) + ], ), ), - ), - ]), - ScaledSizedBox(height: 5), - Balance(address: walletProvider.address.text, size: 20), - ScaledSizedBox(width: 30), - InkWell( - onTap: () => sub.certsCounterCache[walletProvider.address.text] != null - ? { - Navigator.push( - context, - PageNoTransit(builder: (context) { - return CertificationsScreen( - address: walletProvider.address.text, username: duniterIndexer.walletNameIndexer[walletProvider.address.text] ?? ''); - }), + ScaledSizedBox(width: 10), + if (duniterIndexer + .walletNameIndexer[wallet.address] == + null) + Positioned( + right: 0, + child: InkWell( + key: keyRenameWallet, + onTap: () async { + await walletOptions.editWalletName( + context, wallet.id()); + await Future.delayed( + const Duration(milliseconds: 30)); + }, + child: ClipRRect( + child: Image.asset( + walletOptions.isEditing + ? 'assets/walletOptions/android-checkmark.png' + : 'assets/walletOptions/edit.png', + width: scaleSize(23), + height: scaleSize(23)), + ), ), - } - : null, - child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [ - IdentityStatus(address: walletOptions.address.text, isOwner: true, color: orangeC), - Certifications(address: walletProvider.address.text, size: 17) + ), + ]), + ScaledSizedBox(height: 5), + Balance( + address: walletProvider.address.text, size: 20), + ScaledSizedBox(width: 30), + InkWell( + onTap: () => sub.certsCounterCache[ + walletProvider.address.text] != + null + ? { + Navigator.push( + context, + PageNoTransit(builder: (context) { + return CertificationsScreen( + address: + walletProvider.address.text, + username: duniterIndexer + .walletNameIndexer[ + walletProvider + .address.text] ?? + ''); + }), + ), + } + : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + IdentityStatus( + address: walletOptions.address.text, + isOwner: true, + color: orangeC), + Certifications( + address: walletProvider.address.text, + size: 17) + ]), + ), + ScaledSizedBox(height: 10), ]), - ), - ScaledSizedBox(height: 10), - ]), const Spacer(flex: 2), ]), ); }), Expanded( child: SingleChildScrollView( - child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[ - ScaledSizedBox(height: 25), - Consumer<WalletOptionsProvider>(builder: (context, walletProvider, _) { - final defaultWallet = myWalletProvider.getDefaultWallet(); - walletProvider.isDefaultWallet = walletOptions.address.text == defaultWallet.address; - return Column(children: [ - confirmIdentityButton(walletProvider), - pubkeyWidget(walletProvider, ctx), - ScaledSizedBox(height: 11), - activityWidget(context, historyProvider, walletProvider), - ScaledSizedBox(height: 11), - setDefaultWalletWidget(context, walletProvider, myWalletProvider, walletOptions, currentChest), - ScaledSizedBox(height: 11), - Column(children: [ - if (!walletProvider.isDefaultWallet && !wallet.isMembre()) deleteWallet(context, walletProvider, currentChest), - if (wallet.isMembre()) const ManageMembershipButton() - ]) - ]); - }), - ]), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: <Widget>[ + ScaledSizedBox(height: 25), + Consumer<WalletOptionsProvider>( + builder: (context, walletProvider, _) { + final defaultWallet = + myWalletProvider.getDefaultWallet(); + walletProvider.isDefaultWallet = + walletOptions.address.text == + defaultWallet.address; + return Column(children: [ + confirmIdentityButton(walletProvider), + pubkeyWidget(walletProvider, ctx), + ScaledSizedBox(height: 11), + activityWidget( + context, historyProvider, walletProvider), + ScaledSizedBox(height: 11), + setDefaultWalletWidget( + context, + walletProvider, + myWalletProvider, + walletOptions, + currentChest), + ScaledSizedBox(height: 11), + Column(children: [ + if (!walletProvider.isDefaultWallet && + !wallet.isMembre()) + deleteWallet( + context, walletProvider, currentChest), + if (wallet.isMembre()) + const ManageMembershipButton() + ]) + ]); + }), + ]), ), ), ]), @@ -269,7 +325,8 @@ class WalletOptions extends StatelessWidget { return FutureBuilder( future: sub.idtyStatus([walletProvider.address.text]), initialData: const [IdtyStatus.unknown], - builder: (BuildContext context, AsyncSnapshot<List<IdtyStatus>> snapshot) { + builder: + (BuildContext context, AsyncSnapshot<List<IdtyStatus>> snapshot) { if (!snapshot.hasData || snapshot.hasError) { return const SizedBox.shrink(); } @@ -290,7 +347,8 @@ class WalletOptions extends StatelessWidget { }, child: Text( 'confirmMyIdentity'.tr(), - style: scaledTextStyle(fontSize: 20, fontWeight: FontWeight.w600), + style: scaledTextStyle( + fontSize: 20, fontWeight: FontWeight.w600), ), ), ), @@ -329,7 +387,12 @@ class WalletOptions extends StatelessWidget { height: scaleSize(42), ), ScaledSizedBox(width: 19), - Text(shortPubkey, style: scaledTextStyle(fontSize: 18, fontWeight: FontWeight.w800, fontFamily: 'Monospace', color: Colors.black)), + Text(shortPubkey, + style: scaledTextStyle( + fontSize: 18, + fontWeight: FontWeight.w800, + fontFamily: 'Monospace', + color: Colors.black)), const Spacer(), ScaledSizedBox( height: 35, @@ -343,7 +406,8 @@ class WalletOptions extends StatelessWidget { elevation: 1, ), onPressed: () { - Clipboard.setData(ClipboardData(text: walletProvider.address.text)); + Clipboard.setData( + ClipboardData(text: walletProvider.address.text)); snackCopyKey(ctx); }, child: Row(children: <Widget>[ @@ -360,7 +424,10 @@ class WalletOptions extends StatelessWidget { ); } - Widget activityWidget(BuildContext context, WalletsProfilesProvider historyProvider, WalletOptionsProvider walletProvider) { + Widget activityWidget( + BuildContext context, + WalletsProfilesProvider historyProvider, + WalletOptionsProvider walletProvider) { return InkWell( key: keyOpenActivity, onTap: () { @@ -386,7 +453,12 @@ class WalletOptions extends StatelessWidget { ); } - Widget setDefaultWalletWidget(BuildContext context, WalletOptionsProvider walletProvider, final myWalletProvider, final walletOptions, int currentChest) { + Widget setDefaultWalletWidget( + BuildContext context, + WalletOptionsProvider walletProvider, + final myWalletProvider, + final walletOptions, + int currentChest) { return Consumer<MyWalletsProvider>(builder: (context, myWalletProvider, _) { WalletData defaultWallet = myWalletProvider.getDefaultWallet(); walletOptions.isDefaultWallet = (defaultWallet.number == wallet.id()[1]); @@ -404,7 +476,8 @@ class WalletOptions extends StatelessWidget { ScaledSizedBox( height: 42, child: CircleAvatar( - backgroundColor: Colors.grey[walletProvider.isDefaultWallet ? 300 : 500], + backgroundColor: + Colors.grey[walletProvider.isDefaultWallet ? 300 : 500], child: Image.asset( 'assets/walletOptions/android-checkmark.png', height: scaleSize(23), @@ -414,8 +487,15 @@ class WalletOptions extends StatelessWidget { ScaledSizedBox(width: isTall ? 21 : 18), ScaledSizedBox( width: 250, - child: Text(walletProvider.isDefaultWallet ? 'thisWalletIsDefault'.tr() : 'defineWalletAsDefault'.tr(), - style: scaledTextStyle(fontSize: 17, color: walletProvider.isDefaultWallet ? Colors.grey[500] : Colors.black)), + child: Text( + walletProvider.isDefaultWallet + ? 'thisWalletIsDefault'.tr() + : 'defineWalletAsDefault'.tr(), + style: scaledTextStyle( + fontSize: 17, + color: walletProvider.isDefaultWallet + ? Colors.grey[500] + : Colors.black)), ), ]), ), @@ -425,8 +505,10 @@ class WalletOptions extends StatelessWidget { Future setDefaultWallet(BuildContext context, int currentChest) async { final sub = Provider.of<SubstrateSdk>(context, listen: false); - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); - final walletOptions = Provider.of<WalletOptionsProvider>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); + final walletOptions = + Provider.of<WalletOptionsProvider>(context, listen: false); await sub.setCurrentWallet(wallet); await myWalletProvider.readAllWallets(currentChest); @@ -434,27 +516,37 @@ class WalletOptions extends StatelessWidget { walletOptions.reload(); } - Widget deleteWallet(BuildContext context, WalletOptionsProvider walletOptions, int currentChest) { + Widget deleteWallet(BuildContext context, WalletOptionsProvider walletOptions, + int currentChest) { final sub = Provider.of<SubstrateSdk>(context, listen: false); - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); final defaultWallet = myWalletProvider.getDefaultWallet(); - final bool isDefaultWallet = walletOptions.address.text == defaultWallet.address; + final bool isDefaultWallet = + walletOptions.address.text == defaultWallet.address; return FutureBuilder( future: sub.hasAccountConsumers(wallet.address), builder: (BuildContext context, AsyncSnapshot<bool> hasConsumers) { - if (hasConsumers.connectionState != ConnectionState.done || hasConsumers.hasError || !hasConsumers.hasData) { + if (hasConsumers.connectionState != ConnectionState.done || + hasConsumers.hasError || + !hasConsumers.hasData) { return const Text(''); } - final double balance = walletOptions.balanceCache[walletOptions.address.text] ?? -1; - final bool canDelete = !isDefaultWallet && !hasConsumers.data! && (balance > 2 || balance == 0) && !wallet.hasIdentity(); + final double balance = + walletOptions.balanceCache[walletOptions.address.text] ?? -1; + final bool canDelete = !isDefaultWallet && + !hasConsumers.data! && + (balance > 2 || balance == 0) && + !wallet.hasIdentity(); return InkWell( key: keyDeleteWallet, onTap: canDelete ? () async { await walletOptions.deleteWallet(context, wallet); WidgetsBinding.instance.addPostFrameCallback((_) async { - myWalletProvider.listWallets = await myWalletProvider.readAllWallets(currentChest); + myWalletProvider.listWallets = + await myWalletProvider.readAllWallets(currentChest); myWalletProvider.reload(); }); } @@ -467,7 +559,9 @@ class WalletOptions extends StatelessWidget { height: scaleSize(42), ), ScaledSizedBox(width: 19), - Text('deleteThisWallet'.tr(), style: scaledTextStyle(fontSize: 17, color: const Color(0xffD80000))), + Text('deleteThisWallet'.tr(), + style: scaledTextStyle( + fontSize: 17, color: const Color(0xffD80000))), ]) : ScaledSizedBox(width: 30), ); diff --git a/lib/screens/onBoarding/10.dart b/lib/screens/onBoarding/10.dart index 977b7613532eb290716f2048becdbfd954ffd090..c009733848d7649f7169ff2eba788a1e820eeeef 100644 --- a/lib/screens/onBoarding/10.dart +++ b/lib/screens/onBoarding/10.dart @@ -54,7 +54,8 @@ class _OnboardingStepTenState extends State<OnboardingStepTen> { Widget build(BuildContext context) { final walletOptions = Provider.of<WalletOptionsProvider>(context); final sub = Provider.of<SubstrateSdk>(context); - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); final pinLenght = widget.pinCode.length; return PopScope( @@ -76,10 +77,14 @@ class _OnboardingStepTenState extends State<OnboardingStepTen> { const ScanDerivationsInfo(), Consumer<MyWalletsProvider>(builder: (context, mw, _) { return Visibility( - visible: !myWalletProvider.isPinValid && !myWalletProvider.isPinLoading, + visible: !myWalletProvider.isPinValid && + !myWalletProvider.isPinLoading, child: Text( "thisIsNotAGoodCode".tr(), - style: scaledTextStyle(fontSize: 15, color: Colors.red, fontWeight: FontWeight.w500), + style: scaledTextStyle( + fontSize: 15, + color: Colors.red, + fontWeight: FontWeight.w500), ), ); }), @@ -87,19 +92,22 @@ class _OnboardingStepTenState extends State<OnboardingStepTen> { Consumer<SubstrateSdk>(builder: (context, sub, _) { return sub.nodeConnected ? pinForm(context, walletOptions, pinLenght, 1, 2) - : Row(mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - "youHaveToBeConnectedToValidateChest".tr(), - style: scaledTextStyle( - fontSize: 16, - color: Colors.redAccent, - fontWeight: FontWeight.w500, - ), - textAlign: TextAlign.center, - ), - ]); + : Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "youHaveToBeConnectedToValidateChest".tr(), + style: scaledTextStyle( + fontSize: 16, + color: Colors.redAccent, + fontWeight: FontWeight.w500, + ), + textAlign: TextAlign.center, + ), + ]); }), - Consumer<WalletOptionsProvider>(builder: (context, walletOptions, _) { + Consumer<WalletOptionsProvider>( + builder: (context, walletOptions, _) { return sub.nodeConnected ? InkWell( key: keyCachePassword, @@ -110,14 +118,17 @@ class _OnboardingStepTenState extends State<OnboardingStepTen> { ScaledSizedBox(height: isTall ? 30 : 0), const Spacer(), Icon( - configBox.get('isCacheChecked') ?? false ? Icons.check_box : Icons.check_box_outline_blank, + configBox.get('isCacheChecked') ?? false + ? Icons.check_box + : Icons.check_box_outline_blank, color: orangeC, size: scaleSize(22), ), ScaledSizedBox(width: 8), Text( 'rememberPassword'.tr(), - style: scaledTextStyle(fontSize: 14, color: Colors.grey[700]), + style: scaledTextStyle( + fontSize: 14, color: Colors.grey[700]), ), const Spacer() ])) @@ -130,9 +141,11 @@ class _OnboardingStepTenState extends State<OnboardingStepTen> { ); } - Widget pinForm(context, final walletOptions, pinLenght, int walletNbr, int derivation) { + Widget pinForm( + context, final walletOptions, pinLenght, int walletNbr, int derivation) { final myWalletProvider = Provider.of<MyWalletsProvider>(context); - final generateWalletProvider = Provider.of<GenerateWalletsProvider>(context); + final generateWalletProvider = + Provider.of<GenerateWalletsProvider>(context); final sub = Provider.of<SubstrateSdk>(context, listen: false); final currentChest = myWalletProvider.getCurrentChest(); @@ -203,10 +216,14 @@ class _OnboardingStepTenState extends State<OnboardingStepTen> { await generateWalletProvider.storeHDWChest(context); bool isAlive = false; if (widget.scanDerivation) { - isAlive = await generateWalletProvider.scanDerivations(context, widget.pinCode); + isAlive = await generateWalletProvider.scanDerivations( + context, widget.pinCode); } if (!isAlive) { - final address = await sub.importAccount(mnemonic: generateWalletProvider.generatedMnemonic!, derivePath: '//2', password: widget.pinCode); + final address = await sub.importAccount( + mnemonic: generateWalletProvider.generatedMnemonic!, + derivePath: '//2', + password: widget.pinCode); WalletData myWallet = WalletData( chest: configBox.get('currentChest'), address: address, @@ -224,7 +241,8 @@ class _OnboardingStepTenState extends State<OnboardingStepTen> { myWalletProvider.debounceResetPinCode(); Navigator.push( context, - FaderTransition(page: const OnboardingStepEleven(), isFast: false), + FaderTransition( + page: const OnboardingStepEleven(), isFast: false), ); } else { hasError = true; diff --git a/lib/screens/onBoarding/6.dart b/lib/screens/onBoarding/6.dart index c748d38714e0c03ea8e2a22fcd01f650f6dce5b1..1f81e9a7a76153d3ef8958f6a2fbb1468092dea9 100644 --- a/lib/screens/onBoarding/6.dart +++ b/lib/screens/onBoarding/6.dart @@ -17,7 +17,8 @@ import 'package:gecko/widgets/commons/top_appbar.dart'; import 'package:provider/provider.dart'; class OnboardingStepSix extends StatelessWidget { - OnboardingStepSix({super.key, required this.skipIntro, required this.generatedMnemonic}); + OnboardingStepSix( + {super.key, required this.skipIntro, required this.generatedMnemonic}); final bool skipIntro; String? generatedMnemonic; @@ -26,7 +27,8 @@ class OnboardingStepSix extends StatelessWidget { @override Widget build(BuildContext context) { - final generateWalletProvider = Provider.of<GenerateWalletsProvider>(context, listen: true); + final generateWalletProvider = + Provider.of<GenerateWalletsProvider>(context, listen: true); _mnemonicController.text = generatedMnemonic!; @@ -47,11 +49,19 @@ class OnboardingStepSix extends StatelessWidget { ScaledSizedBox(height: isTall ? 25 : 5), const BuildProgressBar(pagePosition: 5), ScaledSizedBox(height: isTall ? 25 : 5), - BuildText(text: "didYouNoteMnemonicToBeSureTypeWord".tr(args: [(generateWalletProvider.nbrWord + 1).toString()]), isMd: true), + BuildText( + text: "didYouNoteMnemonicToBeSureTypeWord".tr(args: [ + (generateWalletProvider.nbrWord + 1).toString() + ]), + isMd: true), ScaledSizedBox(height: isTall ? 40 : 5), if (isTall) Text('${generateWalletProvider.nbrWord + 1}', - key: keyAskedWord, style: scaledTextStyle(fontSize: 19, color: orangeC, fontWeight: FontWeight.w500)), + key: keyAskedWord, + style: scaledTextStyle( + fontSize: 19, + color: orangeC, + fontWeight: FontWeight.w500)), if (isTall) ScaledSizedBox(height: 5), Container( decoration: BoxDecoration( @@ -68,12 +78,16 @@ class OnboardingStepSix extends StatelessWidget { controller: wordController, textInputAction: TextInputAction.next, onChanged: (value) { - generateWalletProvider.checkAskedWord(value, _mnemonicController.text); + generateWalletProvider.checkAskedWord( + value, _mnemonicController.text); }, maxLines: 1, textAlign: TextAlign.center, decoration: InputDecoration( - labelStyle: scaledTextStyle(fontSize: 18, color: Colors.grey[500], fontWeight: FontWeight.w500), + labelStyle: scaledTextStyle( + fontSize: 18, + color: Colors.grey[500], + fontWeight: FontWeight.w500), labelText: generateWalletProvider.isAskedWordValid ? "itsTheGoodWord".tr() : "${generateWalletProvider.nbrWordAlpha} ${"nthMnemonicWord".tr()}", @@ -81,13 +95,22 @@ class OnboardingStepSix extends StatelessWidget { filled: true, contentPadding: const EdgeInsets.all(10), ), - style: scaledTextStyle(fontSize: 25, color: generateWalletProvider.askedWordColor, fontWeight: FontWeight.w500))), + style: scaledTextStyle( + fontSize: 25, + color: generateWalletProvider.askedWordColor, + fontWeight: FontWeight.w500))), Visibility( visible: generateWalletProvider.isAskedWordValid, child: Expanded( child: Align( alignment: Alignment.bottomCenter, - child: nextButton(context, 'continue'.tr(), skipIntro ? const OnboardingStepNine() : const OnboardingStepSeven(), false), + child: nextButton( + context, + 'continue'.tr(), + skipIntro + ? const OnboardingStepNine() + : const OnboardingStepSeven(), + false), ), ), ), @@ -112,7 +135,8 @@ class OnboardingStepSix extends StatelessWidget { } Widget nextButton(BuildContext context, String text, nextScreen, bool isFast) { - final generateWalletProvider = Provider.of<GenerateWalletsProvider>(context, listen: false); + final generateWalletProvider = + Provider.of<GenerateWalletsProvider>(context, listen: false); generateWalletProvider.isAskedWordValid = false; generateWalletProvider.askedWordColor = Colors.black; @@ -128,11 +152,13 @@ Widget nextButton(BuildContext context, String text, nextScreen, bool isFast) { backgroundColor: orangeC, ), onPressed: () { - Navigator.push(context, FaderTransition(page: nextScreen, isFast: isFast)); + Navigator.push( + context, FaderTransition(page: nextScreen, isFast: isFast)); }, child: Text( text, - style: scaledTextStyle(fontSize: 21, fontWeight: FontWeight.w600, color: Colors.white), + style: scaledTextStyle( + fontSize: 21, fontWeight: FontWeight.w600, color: Colors.white), ), ), ); diff --git a/lib/screens/onBoarding/9.dart b/lib/screens/onBoarding/9.dart index cf4de94d6c91aaee289983bd280acf681b1f3ca5..3551a6c78ef00b96ab2701eb47d8a055bb7676d2 100644 --- a/lib/screens/onBoarding/9.dart +++ b/lib/screens/onBoarding/9.dart @@ -119,7 +119,11 @@ class _OnboardingStepNineState extends State<OnboardingStepNine> { if (isPinComplex(pin)) { Navigator.push( context, - FaderTransition(page: OnboardingStepTen(scanDerivation: widget.scanDerivation, pinCode: enterPin.text), isFast: false), + FaderTransition( + page: OnboardingStepTen( + scanDerivation: widget.scanDerivation, + pinCode: enterPin.text), + isFast: false), ); } else { hasError = true; @@ -144,7 +148,22 @@ bool isPinComplex(String pin) { if (RegExp(r'^(\d)\1{3}$').hasMatch(pin)) return false; // Check for common sequences - List<String> sequences = ['0123', '1234', '2345', '3456', '4567', '5678', '6789', '9876', '8765', '7654', '6543', '5432', '4321', '3210']; + List<String> sequences = [ + '0123', + '1234', + '2345', + '3456', + '4567', + '5678', + '6789', + '9876', + '8765', + '7654', + '6543', + '5432', + '4321', + '3210' + ]; if (sequences.contains(pin)) return false; // Check if digits are too close to each other diff --git a/lib/screens/search.dart b/lib/screens/search.dart index 938cbffb1b791400b16a5c1fc78058b62147a72b..c38c73e769647753ba05c109aedab6bbd4c9671c 100644 --- a/lib/screens/search.dart +++ b/lib/screens/search.dart @@ -49,7 +49,8 @@ class _SearchScreenState extends State<SearchScreen> { checkAndUpdateClipboard(); // Set up the periodic clipboard checking - clipboardPollingTimer = Timer.periodic(const Duration(milliseconds: 500), (_) async { + clipboardPollingTimer = + Timer.periodic(const Duration(milliseconds: 500), (_) async { await checkAndUpdateClipboard(); }); } @@ -138,9 +139,13 @@ class _SearchScreenState extends State<SearchScreen> { height: scaleSize(10), ), ), - border: OutlineInputBorder(borderSide: BorderSide(color: Colors.grey[500]!, width: 2), borderRadius: BorderRadius.circular(8)), + border: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.grey[500]!, width: 2), + borderRadius: BorderRadius.circular(8)), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey[500]!, width: 2.5), + borderSide: + BorderSide(color: Colors.grey[500]!, width: 2.5), borderRadius: BorderRadius.circular(8), ), contentPadding: const EdgeInsets.all(13), @@ -177,7 +182,8 @@ class _SearchScreenState extends State<SearchScreen> { Navigator.push( context, MaterialPageRoute(builder: (context) { - return WalletViewScreen(address: pastedAddress, username: null); + return WalletViewScreen( + address: pastedAddress, username: null); }), ); } @@ -189,7 +195,10 @@ class _SearchScreenState extends State<SearchScreen> { ? 'pasteAddress'.tr() : 'search'.tr(), textAlign: TextAlign.center, - style: scaledTextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: Colors.white), + style: scaledTextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Colors.white), ), ), ), diff --git a/lib/widgets/cert_tile.dart b/lib/widgets/cert_tile.dart index 266282b9f7d2779eb82343d1a1fdf7dcba98b959..95c2dc549c952137160832d82cc9a041e83de2f7 100644 --- a/lib/widgets/cert_tile.dart +++ b/lib/widgets/cert_tile.dart @@ -29,7 +29,7 @@ class CertTile extends StatelessWidget { contentPadding: EdgeInsets.only( left: 10, right: 0, top: scaleSize(3), bottom: scaleSize(3)), leading: DatapodAvatar( - address: repository['address'], size: avatarSize), + address: repository['address'], size: avatarSize), title: Padding( padding: const EdgeInsets.only(bottom: 2), child: Text( diff --git a/lib/widgets/page_route_no_transition.dart b/lib/widgets/page_route_no_transition.dart index 02029cb517e9a5c2ecf8c7645cf11e5072956c49..8aa2c8e843156364e7fa2a9faa12aa0f6c829f05 100644 --- a/lib/widgets/page_route_no_transition.dart +++ b/lib/widgets/page_route_no_transition.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; class PageNoTransit extends MaterialPageRoute { - PageNoTransit({builder}) : super(builder: builder); + PageNoTransit({required super.builder}); @override Duration get transitionDuration => const Duration(milliseconds: 0); diff --git a/lib/widgets/payment_popup.dart b/lib/widgets/payment_popup.dart index 7d165c1f2d45ea526230dcc7a2104b59a11d8532..552dab2b3e9eabd67e8b2704874ef4a6cb352868 100644 --- a/lib/widgets/payment_popup.dart +++ b/lib/widgets/payment_popup.dart @@ -18,8 +18,10 @@ import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; void paymentPopup(BuildContext context, String toAddress, String? username) { - final walletViewProvider = Provider.of<WalletsProfilesProvider>(context, listen: false); - final myWalletProvider = Provider.of<MyWalletsProvider>(context, listen: false); + final walletViewProvider = + Provider.of<WalletsProfilesProvider>(context, listen: false); + final myWalletProvider = + Provider.of<MyWalletsProvider>(context, listen: false); double fees = 0; const double shapeSize = 20; @@ -55,15 +57,18 @@ void paymentPopup(BuildContext context, String toAddress, String? username) { if (payAmount.isEmpty) { return false; } - final walletOptions = Provider.of<WalletOptionsProvider>(context, listen: false); - final defaultWalletBalance = walletOptions.balanceCache[defaultWallet.address] ?? 0; + final walletOptions = + Provider.of<WalletOptionsProvider>(context, listen: false); + final defaultWalletBalance = + walletOptions.balanceCache[defaultWallet.address] ?? 0; const existentialDeposit = 2; final double payAmountValue = double.parse(payAmount); final double toAddressBalance = walletOptions.balanceCache[toAddress] ?? 0; // Prevent sending more than the balance with existential deposit - if (payAmountValue / balanceRatio > defaultWalletBalance - existentialDeposit) { + if (payAmountValue / balanceRatio > + defaultWalletBalance - existentialDeposit) { return false; } @@ -73,14 +78,16 @@ void paymentPopup(BuildContext context, String toAddress, String? username) { } // Prevent sending to an empty wallet with less than 2 (existential deposit) - if (toAddressBalance == 0 && payAmountValue < existentialDeposit / balanceRatio) { + if (toAddressBalance == 0 && + payAmountValue < existentialDeposit / balanceRatio) { return false; } return true; } - myWalletProvider.readAllWallets().then((value) => myWalletProvider.listWallets.sort((a, b) => a.derivation!.compareTo(b.derivation!))); + myWalletProvider.readAllWallets().then((value) => myWalletProvider.listWallets + .sort((a, b) => a.derivation!.compareTo(b.derivation!))); showModalBottomSheet<void>( shape: const RoundedRectangleBorder( @@ -94,11 +101,13 @@ void paymentPopup(BuildContext context, String toAddress, String? username) { builder: (BuildContext context) { final sub = Provider.of<SubstrateSdk>(homeContext, listen: false); - return StatefulBuilder(builder: (BuildContext context, StateSetter setState) { + return StatefulBuilder( + builder: (BuildContext context, StateSetter setState) { canValidate = canValidatePayment(); final bool isUdUnit = configBox.get('isUdUnit') ?? false; return Padding( - padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).viewInsets.bottom), child: Container( height: scaleSize(400), decoration: const ShapeDecoration( @@ -111,210 +120,259 @@ void paymentPopup(BuildContext context, String toAddress, String? username) { ), ), child: Padding( - padding: EdgeInsets.only(top: scaleSize(14), bottom: 0, left: scaleSize(16), right: scaleSize(16)), - child: Column(mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ - Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( - 'executeATransfer'.tr(), - style: scaledTextStyle(fontSize: 18, fontWeight: FontWeight.w700), - ), - IconButton( - key: keyPopButton, - iconSize: scaleSize(32), - icon: const Icon(Icons.cancel_outlined), - onPressed: () { - Navigator.pop(context); - }, - ), - ]), - ScaledSizedBox(height: 5), - Text( - 'from'.tr(args: ['']), - style: scaledTextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: Colors.grey[600]), - ), - ScaledSizedBox(height: 5), - Consumer<SubstrateSdk>(builder: (context, sub, _) { - 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 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()), - ); - }), - ScaledSizedBox(height: 12), - Row( - children: [ - Text( - 'to'.tr(args: ['']), - style: scaledTextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: Colors.grey[600]), - ), - ScaledSizedBox(width: 10), + padding: EdgeInsets.only( + top: scaleSize(14), + bottom: 0, + left: scaleSize(16), + right: scaleSize(16)), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: <Widget>[ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'executeATransfer'.tr(), + style: scaledTextStyle( + fontSize: 18, fontWeight: FontWeight.w700), + ), + IconButton( + key: keyPopButton, + iconSize: scaleSize(32), + icon: const Icon(Icons.cancel_outlined), + onPressed: () { + Navigator.pop(context); + }, + ), + ]), + ScaledSizedBox(height: 5), Text( - username ?? getShortPubkey(toAddress), + 'from'.tr(args: ['']), style: scaledTextStyle( - fontSize: 17, - fontWeight: FontWeight.w600, - ), + fontSize: 15, + fontWeight: FontWeight.w500, + color: Colors.grey[600]), ), - ], - ), - ScaledSizedBox(height: 7), - Row( - children: [ - Text( - 'amount'.tr(), - style: scaledTextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: Colors.grey[600]), + ScaledSizedBox(height: 5), + Consumer<SubstrateSdk>(builder: (context, sub, _) { + 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 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()), + ); + }), + ScaledSizedBox(height: 12), + Row( + children: [ + Text( + 'to'.tr(args: ['']), + style: scaledTextStyle( + fontSize: 15, + fontWeight: FontWeight.w500, + color: Colors.grey[600]), + ), + ScaledSizedBox(width: 10), + Text( + username ?? getShortPubkey(toAddress), + style: scaledTextStyle( + fontSize: 17, + fontWeight: FontWeight.w600, + ), + ), + ], ), - const Spacer(), - InkWell( - onTap: () => infoFeesPopup(context), - child: Row( - children: [ - Icon(Icons.info_outlined, color: orangeC, size: scaleSize(21)), - ScaledSizedBox(width: 5), - Text( - 'fees'.tr(args: [fees.toString(), currencyName]), - style: scaledTextStyle( - color: orangeC, - fontSize: 13, + ScaledSizedBox(height: 7), + Row( + children: [ + Text( + 'amount'.tr(), + style: scaledTextStyle( + fontSize: 15, fontWeight: FontWeight.w500, - ), + color: Colors.grey[600]), + ), + const Spacer(), + InkWell( + onTap: () => infoFeesPopup(context), + child: Row( + children: [ + Icon(Icons.info_outlined, + color: orangeC, size: scaleSize(21)), + ScaledSizedBox(width: 5), + Text( + 'fees'.tr( + args: [fees.toString(), currencyName]), + style: scaledTextStyle( + color: orangeC, + fontSize: 13, + fontWeight: FontWeight.w500, + ), + ), + ], ), + ), + ScaledSizedBox(width: 10), + ], + ), + ScaledSizedBox(height: 10), + Focus( + onFocusChange: (focused) { + setState(() { + FocusScope.of(context).requestFocus(amountFocus); + }); + }, + child: TextField( + textInputAction: TextInputAction.done, + onEditingComplete: () async => + canValidate ? await executeTransfert() : null, + key: keyAmountField, + controller: walletViewProvider.payAmount, + autofocus: true, + focusNode: amountFocus, + maxLines: 1, + textAlign: TextAlign.center, + autocorrect: false, + keyboardType: const TextInputType.numberWithOptions( + decimal: true), + onChanged: (_) async { + fees = await sub.txFees( + defaultWallet.address, + toAddress, + double.parse( + walletViewProvider.payAmount.text == '' + ? '0' + : walletViewProvider.payAmount.text)); + setState(() {}); + }, + inputFormatters: <TextInputFormatter>[ + FilteringTextInputFormatter.deny(',', + replacementString: '.'), + FilteringTextInputFormatter.allow( + RegExp(r'(^\d+\.?\d{0,2})')), ], + decoration: InputDecoration( + hintText: '0.00', + suffix: Text( + isUdUnit ? 'ud'.tr(args: ['']) : currencyName), + filled: true, + fillColor: Colors.transparent, + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Colors.grey[500]!, width: 2), + borderRadius: BorderRadius.circular(8), + ), + contentPadding: EdgeInsets.all(scaleSize(9)), + ), + style: scaledTextStyle( + fontSize: 24, + color: Colors.black, + fontWeight: FontWeight.w600, + ), ), ), - ScaledSizedBox(width: 10), - ], - ), - ScaledSizedBox(height: 10), - Focus( - onFocusChange: (focused) { - setState(() { - FocusScope.of(context).requestFocus(amountFocus); - }); - }, - child: TextField( - textInputAction: TextInputAction.done, - onEditingComplete: () async => canValidate ? await executeTransfert() : null, - key: keyAmountField, - controller: walletViewProvider.payAmount, - autofocus: true, - focusNode: amountFocus, - maxLines: 1, - textAlign: TextAlign.center, - autocorrect: false, - keyboardType: const TextInputType.numberWithOptions(decimal: true), - onChanged: (_) async { - fees = await sub.txFees( - defaultWallet.address, toAddress, double.parse(walletViewProvider.payAmount.text == '' ? '0' : walletViewProvider.payAmount.text)); - setState(() {}); - }, - inputFormatters: <TextInputFormatter>[ - FilteringTextInputFormatter.deny(',', replacementString: '.'), - FilteringTextInputFormatter.allow(RegExp(r'(^\d+\.?\d{0,2})')), - ], - decoration: InputDecoration( - hintText: '0.00', - suffix: Text(isUdUnit ? 'ud'.tr(args: ['']) : currencyName), - filled: true, - fillColor: Colors.transparent, - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey[500]!, width: 2), - borderRadius: BorderRadius.circular(8), + const Spacer(), + ScaledSizedBox( + width: double.infinity, + height: 55, + child: ElevatedButton( + key: keyConfirmPayment, + style: ElevatedButton.styleFrom( + foregroundColor: Colors.white, + elevation: 4, + backgroundColor: orangeC, + ), + onPressed: canValidate + ? () async { + Navigator.pop(context); + await executeTransfert(); + } + : null, + child: Text( + 'executeTheTransfer'.tr(), + style: scaledTextStyle( + fontSize: 17, fontWeight: FontWeight.w600), + ), ), - contentPadding: EdgeInsets.all(scaleSize(9)), ), - style: scaledTextStyle( - fontSize: 24, - color: Colors.black, - fontWeight: FontWeight.w600, - ), - ), - ), - const Spacer(), - ScaledSizedBox( - width: double.infinity, - height: 55, - child: ElevatedButton( - key: keyConfirmPayment, - style: ElevatedButton.styleFrom( - foregroundColor: Colors.white, - elevation: 4, - backgroundColor: orangeC, - ), - onPressed: canValidate - ? () async { - Navigator.pop(context); - await executeTransfert(); - } - : null, - child: Text( - 'executeTheTransfer'.tr(), - style: scaledTextStyle(fontSize: 17, fontWeight: FontWeight.w600), - ), - ), - ), - const Spacer(), - ]), + const Spacer(), + ]), ), ), ); diff --git a/lib/widgets/transaction_status.dart b/lib/widgets/transaction_status.dart index f5e6a781ab29e97dcd0a8bce44368e959fafa01a..fbb4c695ee436e28ed7b27da7e0b2f6f9d378c7f 100644 --- a/lib/widgets/transaction_status.dart +++ b/lib/widgets/transaction_status.dart @@ -39,4 +39,4 @@ Map<String, String> errorTransactionMap = { '1010: Invalid Transaction: Inability to pay some fees , e.g. account balance too low': 'youHaveToFeedThisAccountBeforeUsing'.tr(), 'Token.FundsUnavailable': 'fundsUnavailable'.tr(), -}; \ No newline at end of file +}; diff --git a/lib/widgets/wallet_tile.dart b/lib/widgets/wallet_tile.dart index a836ed6748d45a24347c1506ce3789091c7f5719..8f800e83a0b067d73ea325180891e26db2934c7b 100644 --- a/lib/widgets/wallet_tile.dart +++ b/lib/widgets/wallet_tile.dart @@ -148,10 +148,10 @@ class BalanceBuilder extends StatelessWidget { Opacity( opacity: 0.7, child: Balance( - address: address, - size: 14, - color: isDefault ? Colors.white : Colors.black, - ), + address: address, + size: 14, + color: isDefault ? Colors.white : Colors.black, + ), ) ], )), diff --git a/pubspec.lock b/pubspec.lock index 9769718ac15d85940be88306d2c5bb7ecdc6cfae..830fda7f4d9b0cb3f4ba084c08286fb5bb0dfa7f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -446,9 +446,11 @@ packages: flutter_aes_ecb_pkcs5: dependency: transitive description: - path: "../flutter_aes_ecb_pkcs5" - relative: true - source: path + path: "." + ref: fab174e5eb4c793cc0b023324b2884ec9105db8e + resolved-ref: fab174e5eb4c793cc0b023324b2884ec9105db8e + url: "https://github.com/poka-IT/flutter_aes_ecb_pkcs5.git" + source: git version: "0.1.3" flutter_driver: dependency: transitive @@ -1187,9 +1189,11 @@ packages: polkawallet_sdk: dependency: "direct main" description: - path: "../substrate_sdk" - relative: true - source: path + path: "." + ref: "31c741d092852cf8bad0478eadd5d897f25dc7d6" + resolved-ref: "31c741d092852cf8bad0478eadd5d897f25dc7d6" + url: "https://github.com/poka-IT/sdk.git" + source: git version: "0.5.9+4" pool: dependency: transitive diff --git a/pubspec.yaml b/pubspec.yaml index 9ee2393759ed3adc081988729f0b80bb7ecaca56..23ff55a4663376b87dd9cabb91ad8110f9df6306 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,13 +33,13 @@ dependencies: durt: ^0.1.9 package_info_plus: ^8.0.2 polkawallet_sdk: #^0.5.2 - path: ../substrate_sdk - # git: + # path: ../substrate_sdk + git: # # url: https://github.com/polkawallet-io/sdk.git # # ref: develop - # url: https://github.com/poka-IT/sdk.git + url: https://github.com/poka-IT/sdk.git # # ref: gecko-fixes-3 - # ref: 31c741d092852cf8bad0478eadd5d897f25dc7d6 + ref: 31c741d092852cf8bad0478eadd5d897f25dc7d6 dots_indicator: ^3.0.0 connectivity_plus: ^6.0.5 image_cropper: ^8.0.2 diff --git a/release/android/build-apk.sh b/release/android/build-apk.sh index 2cebc0cef76cc338cc137f4d842e1275c736344c..f91e7572efb789fcc48cb2b515da11c4a13a98f3 100755 --- a/release/android/build-apk.sh +++ b/release/android/build-apk.sh @@ -8,7 +8,7 @@ fi APPNAME="gecko" VERSION=$(awk -F '+' '{ print $1 }' <<<${1}) BUILD=$(awk -F '+' '{ print $2 }' <<<${1}) -ORI_APP="app-release.apk" +ORI_APP="app-arm64-v8a-release.apk" APK_FILENAME="${APPNAME}-${VERSION}+${BUILD}.apk" echo "artifact name: ${APK_FILENAME}"