From 6443e041915b6d44132fa6158cf0d69bb376c578 Mon Sep 17 00:00:00 2001 From: poka Date: Mon, 12 Sep 2022 12:38:32 +0200 Subject: [PATCH] apply const colors --- lib/globals.dart | 12 ++++++------ lib/providers/substrate_sdk.dart | 2 ++ lib/screens/activity.dart | 3 +-- lib/screens/home.dart | 6 +++--- lib/screens/myWallets/chest_options.dart | 2 +- lib/screens/myWallets/choose_chest.dart | 6 +++--- lib/screens/myWallets/custom_derivations.dart | 2 +- lib/screens/myWallets/import_g1_v1.dart | 2 +- lib/screens/myWallets/migrate_identity.dart | 2 +- lib/screens/myWallets/show_seed.dart | 2 +- lib/screens/myWallets/unlocking_wallet.dart | 2 +- lib/screens/myWallets/wallet_options.dart | 2 +- lib/screens/myWallets/wallets_home.dart | 6 +++--- lib/screens/onBoarding/10.dart | 2 +- lib/screens/qrcode_fullscreen.dart | 4 ++-- lib/screens/search_result.dart | 2 +- lib/screens/settings.dart | 4 ++-- lib/screens/transaction_in_progress.dart | 4 ++-- 18 files changed, 33 insertions(+), 32 deletions(-) diff --git a/lib/globals.dart b/lib/globals.dart index 542ed8e..012c6a5 100644 --- a/lib/globals.dart +++ b/lib/globals.dart @@ -33,16 +33,16 @@ late double ratio; late BuildContext homeContext; // Logger -var log = Logger(); +final log = Logger(); // Colors -Color orangeC = const Color(0xffd07316); -Color yellowC = const Color(0xffFFD68E); -Color floattingYellow = const Color(0xffEFEFBF); -Color backgroundColor = const Color(0xFFF5F5F5); +const Color orangeC = Color(0xffd07316); +const Color yellowC = Color(0xffFFD68E); +const Color floattingYellow = Color(0xffEFEFBF); +const Color backgroundColor = Color(0xFFF5F5F5); // Substrate settings -String currencyName = 'ĞD'; +const String currencyName = 'ĞD'; // Debug const debugPin = true; diff --git a/lib/providers/substrate_sdk.dart b/lib/providers/substrate_sdk.dart index b4ed980..9696018 100644 --- a/lib/providers/substrate_sdk.dart +++ b/lib/providers/substrate_sdk.dart @@ -718,10 +718,12 @@ class SubstrateSdk with ChangeNotifier { if (isUdUnit) { palette = 'universalDividend'; call = 'transferUd'; + // amount is milliUds amountUnit = (amount * 1000).toInt(); } else { palette = 'balances'; call = 'transferKeepAlive'; + // amount is double at 2 decimals amountUnit = (amount * 100).toInt(); } txOptions = [destAddress, amountUnit]; diff --git a/lib/screens/activity.dart b/lib/screens/activity.dart index 8f0736a..29051ba 100644 --- a/lib/screens/activity.dart +++ b/lib/screens/activity.dart @@ -195,7 +195,6 @@ class ActivityScreen extends StatelessWidget with ChangeNotifier { BuildContext context, DuniterIndexer duniterIndexer) { CesiumPlusProvider cesiumPlusProvider = Provider.of(context, listen: false); - SubstrateSdk sub = Provider.of(context, listen: false); int keyID = 0; String? dateDelimiter; @@ -293,7 +292,7 @@ class ActivityScreen extends StatelessWidget with ChangeNotifier { padding: const EdgeInsets.symmetric(vertical: 30), child: Text( dateDelimiter!, - style: TextStyle( + style: const TextStyle( fontSize: 23, color: orangeC, fontWeight: FontWeight.w300), ), ), diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 9bd8638..f3aa880 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -54,7 +54,7 @@ class HomeScreen extends StatelessWidget { Expanded( child: ListView(padding: EdgeInsets.zero, children: [ DrawerHeader( - decoration: BoxDecoration( + decoration: const BoxDecoration( color: orangeC, ), child: Column(children: const [ @@ -568,7 +568,7 @@ Widget welcomeHome(context) { child: OutlinedButton( key: keyRestoreChest, style: OutlinedButton.styleFrom( - side: BorderSide(width: 4, color: orangeC)), + side: const BorderSide(width: 4, color: orangeC)), onPressed: () { Navigator.push( context, @@ -581,7 +581,7 @@ Widget welcomeHome(context) { }, child: Text( "restoreWallet".tr(), - style: TextStyle( + style: const TextStyle( fontSize: 24, color: orangeC, fontWeight: FontWeight.w600), diff --git a/lib/screens/myWallets/chest_options.dart b/lib/screens/myWallets/chest_options.dart index 7b5e59c..0d9fb7f 100644 --- a/lib/screens/myWallets/chest_options.dart +++ b/lib/screens/myWallets/chest_options.dart @@ -98,7 +98,7 @@ class ChestOptions extends StatelessWidget { const SizedBox(width: 15), Text( 'displayMnemonic'.tr(), - style: TextStyle( + style: const TextStyle( fontSize: 20, color: orangeC, ), diff --git a/lib/screens/myWallets/choose_chest.dart b/lib/screens/myWallets/choose_chest.dart index 1571362..ae71d6d 100644 --- a/lib/screens/myWallets/choose_chest.dart +++ b/lib/screens/myWallets/choose_chest.dart @@ -144,7 +144,7 @@ class _ChooseChestState extends State { }, child: Text( 'openThisChest'.tr(), - style: TextStyle( + style: const TextStyle( fontSize: 22, color: backgroundColor, fontWeight: FontWeight.w600), @@ -170,7 +170,7 @@ class _ChooseChestState extends State { height: 50, child: Center( child: Text('createChest'.tr(), - style: TextStyle( + style: const TextStyle( fontSize: 22, color: orangeC, fontWeight: FontWeight.w600))), @@ -193,7 +193,7 @@ class _ChooseChestState extends State { height: 50, child: Center( child: Text('importChest'.tr(), - style: TextStyle( + style: const TextStyle( fontSize: 22, color: orangeC, fontWeight: FontWeight.w600))), diff --git a/lib/screens/myWallets/custom_derivations.dart b/lib/screens/myWallets/custom_derivations.dart index be97443..dde15ad 100644 --- a/lib/screens/myWallets/custom_derivations.dart +++ b/lib/screens/myWallets/custom_derivations.dart @@ -72,7 +72,7 @@ class _CustomDerivationState extends State { menuMaxHeight: 300, icon: const Icon(Icons.arrow_downward), elevation: 16, - style: TextStyle(color: orangeC), + style: const TextStyle(color: orangeC), underline: Container( height: 2, color: orangeC, diff --git a/lib/screens/myWallets/import_g1_v1.dart b/lib/screens/myWallets/import_g1_v1.dart index ca70bc2..b94e4d3 100644 --- a/lib/screens/myWallets/import_g1_v1.dart +++ b/lib/screens/myWallets/import_g1_v1.dart @@ -66,7 +66,7 @@ class ImportG1v1 extends StatelessWidget { const SizedBox(height: 80), Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: const [ SizedBox( height: 35, width: 35, diff --git a/lib/screens/myWallets/migrate_identity.dart b/lib/screens/myWallets/migrate_identity.dart index 92dd423..5c622d4 100644 --- a/lib/screens/myWallets/migrate_identity.dart +++ b/lib/screens/myWallets/migrate_identity.dart @@ -82,7 +82,7 @@ class MigrateIdentityScreen extends StatelessWidget { if (status.data == null) { return Column(children: [ const SizedBox(height: 80), - Row(mainAxisAlignment: MainAxisAlignment.center, children: [ + Row(mainAxisAlignment: MainAxisAlignment.center, children: const [ SizedBox( height: 35, width: 35, diff --git a/lib/screens/myWallets/show_seed.dart b/lib/screens/myWallets/show_seed.dart index 1bd1433..7a7c338 100644 --- a/lib/screens/myWallets/show_seed.dart +++ b/lib/screens/myWallets/show_seed.dart @@ -49,7 +49,7 @@ class ShowSeed extends StatelessWidget { builder: (BuildContext context, AsyncSnapshot seed) { if (seed.connectionState != ConnectionState.done || seed.hasError) { - return SizedBox( + return const SizedBox( height: 15, width: 15, child: CircularProgressIndicator( diff --git a/lib/screens/myWallets/unlocking_wallet.dart b/lib/screens/myWallets/unlocking_wallet.dart index 08d5b9c..a5898f4 100644 --- a/lib/screens/myWallets/unlocking_wallet.dart +++ b/lib/screens/myWallets/unlocking_wallet.dart @@ -144,7 +144,7 @@ class UnlockingWallet extends StatelessWidget { child: Center( child: Text( 'changeChest'.tr(), - style: TextStyle( + style: const TextStyle( fontSize: 22, color: orangeC, fontWeight: FontWeight.w600), diff --git a/lib/screens/myWallets/wallet_options.dart b/lib/screens/myWallets/wallet_options.dart index 087e523..a3c0470 100644 --- a/lib/screens/myWallets/wallet_options.dart +++ b/lib/screens/myWallets/wallet_options.dart @@ -111,7 +111,7 @@ class WalletOptions extends StatelessWidget { Consumer( builder: (context, walletProvider, _) { return Container( - decoration: BoxDecoration( + decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, diff --git a/lib/screens/myWallets/wallets_home.dart b/lib/screens/myWallets/wallets_home.dart index 2d8912e..236b104 100644 --- a/lib/screens/myWallets/wallets_home.dart +++ b/lib/screens/myWallets/wallets_home.dart @@ -178,7 +178,7 @@ class WalletsHome extends StatelessWidget { height: 60, child: Center( child: Text('changeChest'.tr(), - style: TextStyle( + style: const TextStyle( fontSize: 22, color: orangeC, fontWeight: FontWeight.w500))), @@ -468,10 +468,10 @@ class WalletsHome extends StatelessWidget { child: Container( width: double.infinity, height: double.infinity, - decoration: BoxDecoration(color: floattingYellow), + decoration: const BoxDecoration(color: floattingYellow), child: Center( child: myWalletProvider.isNewDerivationLoading - ? SizedBox( + ? const SizedBox( height: 60, width: 60, child: CircularProgressIndicator( diff --git a/lib/screens/onBoarding/10.dart b/lib/screens/onBoarding/10.dart index 6abbf79..936442a 100644 --- a/lib/screens/onBoarding/10.dart +++ b/lib/screens/onBoarding/10.dart @@ -70,7 +70,7 @@ class OnboardingStepTen extends StatelessWidget { '${generateWalletProvider.numberScan + 1}' ])), const SizedBox(width: 10), - SizedBox( + const SizedBox( height: 22, width: 22, child: CircularProgressIndicator( diff --git a/lib/screens/qrcode_fullscreen.dart b/lib/screens/qrcode_fullscreen.dart index 4ad6e6d..bdb508d 100644 --- a/lib/screens/qrcode_fullscreen.dart +++ b/lib/screens/qrcode_fullscreen.dart @@ -24,7 +24,7 @@ class QrCodeFullscreen extends StatelessWidget { backgroundColor: color ?? Colors.black, toolbarHeight: 60 * ratio, leading: IconButton( - icon: Icon(Icons.arrow_back, color: orangeC), + icon:const Icon(Icons.arrow_back, color: orangeC), onPressed: () { Navigator.pop(context); }), @@ -32,7 +32,7 @@ class QrCodeFullscreen extends StatelessWidget { height: 22, child: Text( 'QR Code de ${getShortPubkey(address)}', - style: TextStyle(color: orangeC), + style: const TextStyle(color: orangeC), ), )), body: SafeArea( diff --git a/lib/screens/search_result.dart b/lib/screens/search_result.dart index 133d02a..23b338e 100644 --- a/lib/screens/search_result.dart +++ b/lib/screens/search_result.dart @@ -160,7 +160,7 @@ class SearchResultScreen extends StatelessWidget { ); } } - return Center( + return const Center( heightFactor: 5, child: CircularProgressIndicator( strokeWidth: 3, diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart index 4cb9f90..83957b8 100644 --- a/lib/screens/settings.dart +++ b/lib/screens/settings.dart @@ -188,7 +188,7 @@ class SettingsScreen extends StatelessWidget { ), const Spacer(flex: 5), sub.isLoadingEndpoint - ? CircularProgressIndicator(color: orangeC) + ? const CircularProgressIndicator(color: orangeC) : Consumer(builder: (context, set, _) { return IconButton( key: keyConnectToEndpoint, @@ -331,7 +331,7 @@ class SettingsScreen extends StatelessWidget { ), const Spacer(flex: 5), indexer.isLoadingIndexer - ? CircularProgressIndicator(color: orangeC) + ? const CircularProgressIndicator(color: orangeC) : Consumer(builder: (context, set, _) { return IconButton( icon: Icon( diff --git a/lib/screens/transaction_in_progress.dart b/lib/screens/transaction_in_progress.dart index e619925..d89c3aa 100644 --- a/lib/screens/transaction_in_progress.dart +++ b/lib/screens/transaction_in_progress.dart @@ -184,7 +184,7 @@ class TransactionInProgress extends StatelessWidget { child: Column(children: [ Container( width: double.infinity, - decoration: BoxDecoration( + decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, end: Alignment.bottomCenter, @@ -236,7 +236,7 @@ class TransactionInProgress extends StatelessWidget { Column(children: [ Visibility( visible: isLoading, - child: SizedBox( + child: const SizedBox( height: 18, width: 18, child: CircularProgressIndicator(