diff --git a/assets/medal.png b/assets/medal.png new file mode 100755 index 0000000..b3745ee Binary files /dev/null and b/assets/medal.png differ diff --git a/lib/providers/home.dart b/lib/providers/home.dart index 854d1ae..15ef425 100644 --- a/lib/providers/home.dart +++ b/lib/providers/home.dart @@ -139,7 +139,10 @@ class HomeProvider with ChangeNotifier { // // size: Size(size.width, 110), // // painter: CustomRoundedButton(), // // ), - Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ + Row(mainAxisAlignment: MainAxisAlignment.start, children: [ + // SizedBox(width: 0), + const Spacer(), + const SizedBox(width: 11), IconButton( iconSize: 40, icon: const Image(image: AssetImage('assets/loupe-noire.png')), @@ -156,6 +159,8 @@ class HomeProvider with ChangeNotifier { ); }, ), + const SizedBox(width: 22), + const Spacer(), IconButton( iconSize: 70, icon: const Image(image: AssetImage('assets/qrcode-scan.png')), @@ -167,6 +172,8 @@ class HomeProvider with ChangeNotifier { _historyProvider.scan(homeContext); }, ), + const Spacer(), + const SizedBox(width: 15), IconButton( iconSize: 60, icon: const Image(image: AssetImage('assets/wallet.png')), @@ -198,6 +205,7 @@ class HomeProvider with ChangeNotifier { } }, ), + const Spacer(), ]), ), ); diff --git a/lib/providers/substrate_sdk.dart b/lib/providers/substrate_sdk.dart index 6510e87..8856ce0 100644 --- a/lib/providers/substrate_sdk.dart +++ b/lib/providers/substrate_sdk.dart @@ -222,12 +222,12 @@ class SubstrateSdk with ChangeNotifier { return [_certsReceiver['receivedCount'], _certsReceiver['issuedCount']]; } - Future isAccountExit(String address) async { - final _accountInfo = await sdk.webView! - .evalJavascript('api.query.system.account("$address")'); - final _randomId = _accountInfo['data']['randomId']; - return _randomId == null ? false : true; - } + // Future isAccountExit(String address) async { + // final _accountInfo = await sdk.webView! + // .evalJavascript('api.query.system.account("$address")'); + // final _randomId = _accountInfo['data']['randomId']; + // return _randomId == null ? false : true; + // } Future getBalance(String address, {bool isUd = false}) async { double balance = 0.0; diff --git a/lib/providers/wallet_options.dart b/lib/providers/wallet_options.dart index a163d01..b05ebc2 100644 --- a/lib/providers/wallet_options.dart +++ b/lib/providers/wallet_options.dart @@ -312,19 +312,15 @@ Widget getCerts(BuildContext context, String address, double size, return _certs.data?[0] != 0 ? Row( children: [ - const Icon( - Icons.arrow_drop_down, - color: Colors.green, - size: 30, - ), - Text(_certs.data?[0].toString() ?? '0'), - const SizedBox(width: 15), - const Icon( - Icons.arrow_drop_up, - color: Colors.blue, - size: 30, - ), - Text(_certs.data?[1].toString() ?? '0') + Image.asset('assets/medal.png', height: 20), + const SizedBox(width: 1), + Text(_certs.data?[0].toString() ?? '0', + style: const TextStyle(fontSize: 20)), + const SizedBox(width: 5), + Text( + "(${_certs.data?[1].toString() ?? '0'})", + style: const TextStyle(fontSize: 14), + ) ], ) : const Text(''); diff --git a/lib/screens/myWallets/wallet_options.dart b/lib/screens/myWallets/wallet_options.dart index a589487..2578e6a 100644 --- a/lib/screens/myWallets/wallet_options.dart +++ b/lib/screens/myWallets/wallet_options.dart @@ -88,29 +88,30 @@ class WalletOptions extends StatelessWidget { ], )), child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceAround, + // mainAxisAlignment: MainAxisAlignment.end, children: [ const Spacer(flex: 1), avatar(walletProvider), const Spacer(flex: 1), - Column(children: [ - walletName(walletProvider, _walletOptions), - SizedBox(height: isTall ? 5 : 0), - // SizedBox(height: isTall ? 5 : 0), - balance(context, walletProvider.address.text, 21), - const SizedBox(width: 30), - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - _walletOptions.idtyStatus( - context, _walletOptions.address.text, - isOwner: true), - getCerts( - context, walletProvider.address.text, 15), - ]), - SizedBox(height: 10 * ratio), - ]), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + walletName(walletProvider, _walletOptions), + SizedBox(height: isTall ? 5 : 0), + // SizedBox(height: isTall ? 5 : 0), + balance(context, walletProvider.address.text, 21), + const SizedBox(width: 30), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + _walletOptions.idtyStatus( + context, _walletOptions.address.text, + isOwner: true), + getCerts(context, + walletProvider.address.text, 15), + ]), + SizedBox(height: 10 * ratio), + ]), const Spacer(flex: 2), ]), ); diff --git a/lib/screens/wallet_view.dart b/lib/screens/wallet_view.dart index e97e3e6..92b6455 100644 --- a/lib/screens/wallet_view.dart +++ b/lib/screens/wallet_view.dart @@ -381,21 +381,14 @@ class WalletViewScreen extends StatelessWidget { }, child: Container( width: double.infinity, - // height: 25, decoration: BoxDecoration( - // border: OutlineInputBorder( - // borderSide: - // BorderSide(color: Colors.grey[500], width: 2), - // borderRadius: BorderRadius.circular(8)), border: Border.all( - color: Colors.blueAccent - .shade200, // Set border color - width: 2), // Set border width + color: Colors.blueAccent.shade200, + width: 2), borderRadius: const BorderRadius.all( - Radius.circular(10.0)), // Set ro + Radius.circular(10.0)), ), padding: const EdgeInsets.all(10), - child: Row(children: [ Text(defaultWallet.name!), const Spacer(), @@ -570,28 +563,25 @@ class WalletViewScreen extends StatelessWidget { WalletOptionsProvider _walletOptions = Provider.of(context, listen: false); - SubstrateSdk _sub = Provider.of(context, listen: false); + // SubstrateSdk _sub = Provider.of(context, listen: false); - // AsyncSnapshot isAccountExist; + bool isAccountExist = balanceCache[pubkey] != '0.0 $currencyName'; return Stack(children: [ - FutureBuilder( - future: _sub.isAccountExit(pubkey!), - builder: (BuildContext context, AsyncSnapshot isAccountExist) { - final bool _isExit = isAccountExist.data ?? false; - return Container( - height: 180, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - _isExit ? yellowC : Colors.grey[400]!, - _isExit ? const Color(0xFFE7811A) : Colors.grey[600]!, - ], - ), - )); - }), + Consumer(builder: (context, _sub, _) { + return Container( + height: 180, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + isAccountExist ? yellowC : Colors.grey[400]!, + isAccountExist ? const Color(0xFFE7811A) : Colors.grey[600]!, + ], + ), + )); + }), Padding( padding: const EdgeInsets.only(left: 30, right: 40), child: Row(children: [