2022-08-06 02:22:41 +02:00
|
|
|
// ignore_for_file: use_build_context_synchronously
|
2022-06-17 01:13:14 +02:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
2021-11-29 04:05:08 +01:00
|
|
|
import 'package:flutter/services.dart';
|
2022-11-30 05:22:37 +01:00
|
|
|
|
2021-11-29 04:05:08 +01:00
|
|
|
import 'package:gecko/globals.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
2022-08-14 20:02:02 +02:00
|
|
|
import 'package:gecko/models/g1_wallets_list.dart';
|
2022-08-23 00:25:16 +02:00
|
|
|
import 'package:gecko/models/widgets_keys.dart';
|
2021-12-23 15:13:58 +01:00
|
|
|
import 'package:gecko/providers/cesium_plus.dart';
|
2022-12-04 23:18:30 +01:00
|
|
|
import 'package:gecko/providers/duniter_indexer.dart';
|
2022-05-25 20:40:55 +02:00
|
|
|
import 'package:gecko/providers/substrate_sdk.dart';
|
2021-12-23 15:13:58 +01:00
|
|
|
import 'package:gecko/providers/my_wallets.dart';
|
2021-12-03 10:25:36 +01:00
|
|
|
import 'package:gecko/models/wallet_data.dart';
|
2021-12-23 15:13:58 +01:00
|
|
|
import 'package:gecko/providers/wallets_profiles.dart';
|
2022-06-16 19:45:34 +02:00
|
|
|
import 'package:gecko/screens/activity.dart';
|
2022-12-10 08:16:38 +01:00
|
|
|
import 'package:gecko/widgets/commons/common_elements.dart';
|
2021-12-03 10:25:36 +01:00
|
|
|
import 'package:gecko/screens/myWallets/unlocking_wallet.dart';
|
2022-06-05 02:22:22 +02:00
|
|
|
import 'package:gecko/screens/qrcode_fullscreen.dart';
|
2022-05-31 18:23:56 +02:00
|
|
|
import 'package:gecko/screens/transaction_in_progress.dart';
|
2022-12-07 23:10:28 +01:00
|
|
|
import 'package:gecko/widgets/bottom_app_bar.dart';
|
2022-12-02 02:11:22 +01:00
|
|
|
import 'package:gecko/widgets/header_profile.dart';
|
2022-12-02 05:57:24 +01:00
|
|
|
import 'package:gecko/widgets/page_route_no_transition.dart';
|
2023-05-24 16:27:13 +02:00
|
|
|
import 'package:gecko/widgets/payment_popup.dart';
|
2021-11-29 04:05:08 +01:00
|
|
|
import 'package:provider/provider.dart';
|
2022-06-05 02:22:22 +02:00
|
|
|
import 'package:qr_flutter/qr_flutter.dart';
|
2021-11-29 04:05:08 +01:00
|
|
|
|
|
|
|
class WalletViewScreen extends StatelessWidget {
|
2021-12-01 08:14:07 +01:00
|
|
|
const WalletViewScreen(
|
2022-12-05 04:03:53 +01:00
|
|
|
{required this.address, required this.username, this.avatar, Key? key})
|
2021-11-30 01:25:48 +01:00
|
|
|
: super(key: key);
|
2022-09-12 11:22:26 +02:00
|
|
|
final String address;
|
2022-12-05 04:03:53 +01:00
|
|
|
final String username;
|
2021-12-23 12:36:09 +01:00
|
|
|
final Image? avatar;
|
2021-12-01 08:14:07 +01:00
|
|
|
final double buttonSize = 100;
|
|
|
|
final double buttonFontSize = 18;
|
2021-11-29 04:05:08 +01:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-08-06 02:22:41 +02:00
|
|
|
WalletsProfilesProvider walletProfile =
|
2021-11-30 10:28:13 +01:00
|
|
|
Provider.of<WalletsProfilesProvider>(context, listen: false);
|
2022-11-30 05:42:08 +01:00
|
|
|
final sub = Provider.of<SubstrateSdk>(context, listen: false);
|
|
|
|
final myWalletProvider =
|
2022-05-27 08:54:29 +02:00
|
|
|
Provider.of<MyWalletsProvider>(context, listen: false);
|
2022-12-05 04:03:53 +01:00
|
|
|
final duniterIndexer = Provider.of<DuniterIndexer>(context, listen: false);
|
2022-08-06 02:22:41 +02:00
|
|
|
WalletData? defaultWallet = myWalletProvider.getDefaultWallet();
|
2022-08-28 05:08:41 +02:00
|
|
|
|
2022-12-08 01:18:09 +01:00
|
|
|
walletProfile.address = address;
|
2022-08-06 02:22:41 +02:00
|
|
|
sub.setCurrentWallet(defaultWallet);
|
2021-12-30 00:51:04 +01:00
|
|
|
|
2023-04-12 03:10:02 +02:00
|
|
|
log.d("username: $username");
|
|
|
|
|
2021-11-29 04:05:08 +01:00
|
|
|
return Scaffold(
|
2022-05-29 00:00:57 +02:00
|
|
|
backgroundColor: backgroundColor,
|
2021-12-03 10:25:36 +01:00
|
|
|
resizeToAvoidBottomInset: true,
|
2021-11-29 04:05:08 +01:00
|
|
|
appBar: AppBar(
|
2021-11-30 01:25:48 +01:00
|
|
|
elevation: 0,
|
|
|
|
toolbarHeight: 60 * ratio,
|
2022-06-05 02:22:22 +02:00
|
|
|
actions: [
|
2022-08-14 20:02:02 +02:00
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Consumer<WalletsProfilesProvider>(
|
|
|
|
builder: (context, walletProfile, _) {
|
|
|
|
return IconButton(
|
2022-08-14 22:16:46 +02:00
|
|
|
onPressed: () async {
|
|
|
|
G1WalletsList? newContact;
|
|
|
|
g1WalletsBox.toMap().forEach((key, value) {
|
2022-09-12 04:52:34 +02:00
|
|
|
if (key == address) newContact = value;
|
2022-08-14 22:16:46 +02:00
|
|
|
});
|
|
|
|
// G1WalletsList(pubkey: pubkey!, username: username);
|
|
|
|
await walletProfile.addContact(
|
2022-09-12 11:22:26 +02:00
|
|
|
newContact ?? G1WalletsList(address: address));
|
2022-08-14 20:02:02 +02:00
|
|
|
},
|
|
|
|
icon: Icon(
|
2022-09-12 11:22:26 +02:00
|
|
|
walletProfile.isContact(address)
|
2022-08-14 20:02:02 +02:00
|
|
|
? Icons.add_reaction_rounded
|
|
|
|
: Icons.add_reaction_outlined,
|
|
|
|
size: 35,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
const SizedBox(width: 10),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(builder: (context) {
|
|
|
|
return QrCodeFullscreen(
|
2022-09-12 11:22:26 +02:00
|
|
|
walletProfile.address,
|
2022-08-14 20:02:02 +02:00
|
|
|
);
|
|
|
|
}),
|
2022-06-05 02:22:22 +02:00
|
|
|
);
|
2022-08-14 20:02:02 +02:00
|
|
|
},
|
|
|
|
child: QrImageWidget(
|
2022-09-12 11:22:26 +02:00
|
|
|
data: walletProfile.address,
|
2022-08-14 20:02:02 +02:00
|
|
|
version: QrVersions.auto,
|
|
|
|
size: 80,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
2022-06-05 02:22:22 +02:00
|
|
|
],
|
2022-06-18 01:50:06 +02:00
|
|
|
title: SizedBox(
|
2022-12-05 04:03:53 +01:00
|
|
|
height: 22,
|
2022-12-05 04:34:01 +01:00
|
|
|
child: Text(duniterIndexer
|
|
|
|
.walletNameIndexer[walletProfile.address] ==
|
|
|
|
null
|
|
|
|
? 'seeAWallet'.tr()
|
|
|
|
: 'memberAccountOf'.tr(args: [
|
|
|
|
duniterIndexer.walletNameIndexer[walletProfile.address] ??
|
|
|
|
'?'
|
|
|
|
]))),
|
2021-11-30 01:25:48 +01:00
|
|
|
),
|
2022-12-07 23:10:28 +01:00
|
|
|
bottomNavigationBar: const GeckoBottomAppBar(),
|
2021-11-29 04:05:08 +01:00
|
|
|
body: SafeArea(
|
|
|
|
child: Column(children: <Widget>[
|
2022-12-02 02:11:22 +01:00
|
|
|
HeaderProfile(address: address, username: username),
|
2022-12-04 03:24:23 +01:00
|
|
|
SizedBox(height: isTall ? 30 : 15),
|
2021-11-29 04:05:08 +01:00
|
|
|
Row(mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
|
|
|
|
Column(children: <Widget>[
|
|
|
|
SizedBox(
|
2021-12-01 08:14:07 +01:00
|
|
|
height: buttonSize,
|
2021-11-29 04:05:08 +01:00
|
|
|
child: ClipOval(
|
|
|
|
child: Material(
|
2022-09-12 08:28:19 +02:00
|
|
|
color: yellowC,
|
2021-11-29 04:05:08 +01:00
|
|
|
child: InkWell(
|
2022-08-23 00:25:16 +02:00
|
|
|
key: keyViewActivity,
|
2021-11-29 04:05:08 +01:00
|
|
|
splashColor: orangeC, // inkwell color
|
|
|
|
child: const Padding(
|
2021-12-01 08:14:07 +01:00
|
|
|
padding: EdgeInsets.all(13),
|
2021-11-29 04:05:08 +01:00
|
|
|
child: Image(
|
|
|
|
image: AssetImage(
|
|
|
|
'assets/walletOptions/clock.png'),
|
|
|
|
height: 90)),
|
|
|
|
onTap: () {
|
2022-06-16 19:45:34 +02:00
|
|
|
Navigator.push(
|
|
|
|
context,
|
2022-12-02 05:57:24 +01:00
|
|
|
PageNoTransit(builder: (context) {
|
2022-06-16 19:45:34 +02:00
|
|
|
return ActivityScreen(
|
2022-09-12 04:52:34 +02:00
|
|
|
address: address,
|
2022-12-02 03:22:53 +01:00
|
|
|
avatar: defaultAvatar(50));
|
2022-06-16 19:45:34 +02:00
|
|
|
}),
|
|
|
|
);
|
2021-11-29 04:05:08 +01:00
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 9),
|
2021-12-01 08:14:07 +01:00
|
|
|
Text(
|
2022-06-18 03:01:22 +02:00
|
|
|
"displayNActivity".tr(),
|
2021-11-29 04:05:08 +01:00
|
|
|
textAlign: TextAlign.center,
|
2021-12-01 08:14:07 +01:00
|
|
|
style: TextStyle(
|
|
|
|
fontSize: buttonFontSize, fontWeight: FontWeight.w500),
|
2021-11-29 04:05:08 +01:00
|
|
|
),
|
|
|
|
]),
|
2022-08-06 02:22:41 +02:00
|
|
|
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
|
|
|
WalletData? defaultWallet = myWalletProvider.getDefaultWallet();
|
2022-05-27 08:54:29 +02:00
|
|
|
return FutureBuilder(
|
2022-12-06 22:33:42 +01:00
|
|
|
future: sub.certState(defaultWallet.address, address),
|
2022-06-05 19:58:04 +02:00
|
|
|
builder: (context, AsyncSnapshot<Map<String, int>> snapshot) {
|
|
|
|
if (snapshot.data == null) return const SizedBox();
|
2022-08-06 02:22:41 +02:00
|
|
|
String duration = '';
|
2022-12-09 06:23:47 +01:00
|
|
|
log.d(
|
|
|
|
'${getShortPubkey(address)} --- certDelay ${snapshot.data!['certDelay']} --- certRenewable ${snapshot.data!['certRenewable']}');
|
2022-08-08 17:03:34 +02:00
|
|
|
|
2022-06-05 19:58:04 +02:00
|
|
|
if (snapshot.data!['certDelay'] != null ||
|
|
|
|
snapshot.data!['certRenewable'] != null) {
|
2022-08-06 02:22:41 +02:00
|
|
|
final Duration durationSeconds = Duration(
|
2022-06-05 19:58:04 +02:00
|
|
|
seconds: snapshot.data!['certDelay'] ??
|
|
|
|
snapshot.data!['certRenewable']!);
|
2022-12-02 10:23:21 +01:00
|
|
|
final seconds = durationSeconds.inSeconds;
|
|
|
|
final minutes = durationSeconds.inMinutes;
|
2022-06-05 19:58:04 +02:00
|
|
|
|
2022-08-06 02:22:41 +02:00
|
|
|
if (seconds <= 0) {
|
|
|
|
duration = 'seconds'.tr(args: ['0']);
|
|
|
|
} else if (seconds <= 60) {
|
|
|
|
duration = 'seconds'.tr(args: [seconds.toString()]);
|
|
|
|
} else if (seconds <= 3600) {
|
|
|
|
duration = 'minutes'.tr(args: [minutes.toString()]);
|
|
|
|
} else if (seconds <= 86400) {
|
2022-12-02 10:23:21 +01:00
|
|
|
final hours = durationSeconds.inHours;
|
|
|
|
final minutesLeft = minutes - hours * 60;
|
2022-08-06 02:22:41 +02:00
|
|
|
String showMinutes = '';
|
|
|
|
if (minutesLeft < 60) {}
|
|
|
|
showMinutes =
|
|
|
|
'minutes'.tr(args: [minutesLeft.toString()]);
|
|
|
|
duration =
|
|
|
|
'hours'.tr(args: [hours.toString(), showMinutes]);
|
|
|
|
} else if (seconds <= 2592000) {
|
2022-12-02 10:23:21 +01:00
|
|
|
final days = durationSeconds.inDays;
|
2022-08-06 02:22:41 +02:00
|
|
|
duration = 'days'.tr(args: [days.toString()]);
|
2022-06-05 19:58:04 +02:00
|
|
|
} else {
|
2022-12-02 10:23:21 +01:00
|
|
|
final months = (durationSeconds.inDays / 30).round();
|
2022-08-06 02:22:41 +02:00
|
|
|
duration = 'months'.tr(args: [months.toString()]);
|
2022-06-05 19:58:04 +02:00
|
|
|
}
|
|
|
|
}
|
2022-08-08 15:03:22 +02:00
|
|
|
|
2023-11-24 16:31:34 +01:00
|
|
|
final toStatus = snapshot.data!['toStatus'];
|
2022-08-17 23:28:19 +02:00
|
|
|
|
2022-05-27 08:54:29 +02:00
|
|
|
return Visibility(
|
2022-06-05 19:58:04 +02:00
|
|
|
visible: (snapshot.data != {}),
|
2022-05-27 08:54:29 +02:00
|
|
|
child: Column(children: <Widget>[
|
2022-06-09 23:42:20 +02:00
|
|
|
if (snapshot.data!['canCert'] != null ||
|
2022-08-06 02:22:41 +02:00
|
|
|
duration == 'seconds'.tr(args: ['0']))
|
2022-06-05 19:58:04 +02:00
|
|
|
Column(children: <Widget>[
|
|
|
|
SizedBox(
|
|
|
|
height: buttonSize,
|
|
|
|
child: ClipOval(
|
|
|
|
child: Material(
|
2022-09-12 08:28:19 +02:00
|
|
|
color: const Color(0xffFFD58D),
|
2022-06-05 19:58:04 +02:00
|
|
|
child: InkWell(
|
2022-08-23 00:25:16 +02:00
|
|
|
key: keyCertify,
|
2022-09-12 08:28:19 +02:00
|
|
|
splashColor: orangeC,
|
2022-06-05 19:58:04 +02:00
|
|
|
child: const Padding(
|
|
|
|
padding: EdgeInsets.only(bottom: 0),
|
|
|
|
child: Image(
|
|
|
|
image: AssetImage(
|
|
|
|
'assets/gecko_certify.png')),
|
|
|
|
),
|
|
|
|
onTap: () async {
|
2022-12-04 23:18:30 +01:00
|
|
|
final bool? result =
|
|
|
|
await confirmPopupCertification(
|
|
|
|
context,
|
|
|
|
'areYouSureYouWantToCertify1'
|
|
|
|
.tr(),
|
|
|
|
duniterIndexer
|
|
|
|
.walletNameIndexer[
|
|
|
|
address] ??
|
|
|
|
"noIdentity".tr(),
|
|
|
|
'areYouSureYouWantToCertify2'
|
|
|
|
.tr(),
|
|
|
|
getShortPubkey(address));
|
2022-06-05 19:58:04 +02:00
|
|
|
|
2022-08-06 02:22:41 +02:00
|
|
|
if (result ?? false) {
|
|
|
|
String? pin;
|
|
|
|
if (myWalletProvider.pinCode == '') {
|
|
|
|
pin = await Navigator.push(
|
2022-06-05 19:58:04 +02:00
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (homeContext) {
|
|
|
|
return UnlockingWallet(
|
|
|
|
wallet: defaultWallet);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2022-08-06 02:22:41 +02:00
|
|
|
if (pin != null ||
|
|
|
|
myWalletProvider.pinCode != '') {
|
2022-06-05 19:58:04 +02:00
|
|
|
WalletsProfilesProvider
|
2022-08-06 02:22:41 +02:00
|
|
|
walletViewProvider = Provider
|
2022-06-05 19:58:04 +02:00
|
|
|
.of<WalletsProfilesProvider>(
|
|
|
|
context,
|
|
|
|
listen: false);
|
2022-08-06 02:22:41 +02:00
|
|
|
final acc = sub.getCurrentWallet();
|
|
|
|
sub.certify(
|
2022-06-05 19:58:04 +02:00
|
|
|
acc.address!,
|
2022-09-12 11:22:26 +02:00
|
|
|
walletViewProvider.address,
|
2022-08-27 05:43:43 +02:00
|
|
|
pin ??
|
|
|
|
myWalletProvider.pinCode);
|
2022-06-05 19:58:04 +02:00
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (context) {
|
|
|
|
return const TransactionInProgress(
|
|
|
|
transType: 'cert');
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 9),
|
|
|
|
Text(
|
2023-11-24 16:31:34 +01:00
|
|
|
toStatus == null
|
2022-12-04 23:18:30 +01:00
|
|
|
? "certify".tr()
|
|
|
|
: "createIdentity".tr(),
|
2022-06-05 19:58:04 +02:00
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: buttonFontSize,
|
|
|
|
fontWeight: FontWeight.w500),
|
|
|
|
),
|
2022-08-20 22:46:21 +02:00
|
|
|
])
|
|
|
|
else if (toStatus == 1)
|
2022-08-17 23:28:19 +02:00
|
|
|
waitToCert('mustConfirmHisIdentity', duration)
|
|
|
|
else if (snapshot.data!['certRenewable'] != null &&
|
2022-08-06 02:22:41 +02:00
|
|
|
duration != 'seconds'.tr(args: ['0']))
|
2022-08-17 23:28:19 +02:00
|
|
|
waitToCert('canRenewCertInX', duration)
|
|
|
|
else if (snapshot.data!['certDelay'] != null)
|
|
|
|
waitToCert('mustWaitXBeforeCertify', duration)
|
2022-05-27 08:54:29 +02:00
|
|
|
]),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}),
|
2021-11-29 04:05:08 +01:00
|
|
|
Column(children: <Widget>[
|
|
|
|
SizedBox(
|
2021-12-01 08:14:07 +01:00
|
|
|
height: buttonSize,
|
2021-11-29 04:05:08 +01:00
|
|
|
child: ClipOval(
|
|
|
|
child: Material(
|
2022-09-12 08:28:19 +02:00
|
|
|
color: const Color(0xffFFD58D),
|
2021-11-29 04:05:08 +01:00
|
|
|
child: InkWell(
|
2022-08-23 00:25:16 +02:00
|
|
|
key: keyCopyAddress,
|
2022-09-12 08:28:19 +02:00
|
|
|
splashColor: orangeC,
|
2021-11-29 04:05:08 +01:00
|
|
|
child: const Padding(
|
|
|
|
padding: EdgeInsets.all(20),
|
|
|
|
child: Image(
|
|
|
|
image: AssetImage('assets/copy_key.png'),
|
|
|
|
height: 90)),
|
|
|
|
onTap: () {
|
2022-09-12 04:52:34 +02:00
|
|
|
Clipboard.setData(ClipboardData(text: address));
|
2022-05-21 06:47:26 +02:00
|
|
|
snackCopyKey(context);
|
2021-11-29 04:05:08 +01:00
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 9),
|
2021-12-01 08:14:07 +01:00
|
|
|
Text(
|
2022-06-17 01:13:14 +02:00
|
|
|
"copyAddress".tr(),
|
2021-11-29 04:05:08 +01:00
|
|
|
textAlign: TextAlign.center,
|
2021-12-01 08:14:07 +01:00
|
|
|
style: TextStyle(
|
|
|
|
fontSize: buttonFontSize, fontWeight: FontWeight.w500),
|
2021-11-29 04:05:08 +01:00
|
|
|
),
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
const Spacer(),
|
2022-08-06 02:22:41 +02:00
|
|
|
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
2022-06-12 19:56:43 +02:00
|
|
|
return Opacity(
|
2022-08-06 02:22:41 +02:00
|
|
|
opacity: sub.nodeConnected ? 1 : 0.5,
|
2022-06-12 19:56:43 +02:00
|
|
|
child: Container(
|
|
|
|
height: buttonSize,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: const Color(0xff7c94b6),
|
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(100)),
|
|
|
|
border: Border.all(
|
|
|
|
color: const Color(0xFF6c4204),
|
|
|
|
width: 4,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: ClipOval(
|
|
|
|
child: Material(
|
2022-09-12 08:28:19 +02:00
|
|
|
color: orangeC,
|
2022-06-12 19:56:43 +02:00
|
|
|
child: InkWell(
|
2022-08-23 00:25:16 +02:00
|
|
|
key: keyPay,
|
2022-08-06 02:22:41 +02:00
|
|
|
splashColor: yellowC,
|
|
|
|
onTap: sub.nodeConnected
|
2023-05-24 18:27:40 +02:00
|
|
|
? () async {
|
|
|
|
String? pin;
|
|
|
|
if (myWalletProvider.pinCode == '') {
|
|
|
|
pin = await Navigator.push(
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (homeContext) {
|
|
|
|
return UnlockingWallet(
|
|
|
|
wallet: defaultWallet);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
if (pin != null ||
|
|
|
|
myWalletProvider.pinCode != '') {
|
|
|
|
paymentPopup(context, address, username);
|
|
|
|
}
|
2022-08-06 02:22:41 +02:00
|
|
|
}
|
2022-09-12 08:28:19 +02:00
|
|
|
: null,
|
2022-06-12 19:56:43 +02:00
|
|
|
child: const Padding(
|
2022-09-12 04:52:34 +02:00
|
|
|
padding: EdgeInsets.all(14),
|
|
|
|
child: Image(
|
|
|
|
image: AssetImage('assets/vector_white.png')),
|
|
|
|
)),
|
2022-06-12 19:56:43 +02:00
|
|
|
),
|
|
|
|
),
|
2021-11-29 04:05:08 +01:00
|
|
|
),
|
2022-06-12 19:56:43 +02:00
|
|
|
);
|
|
|
|
}),
|
2021-11-29 04:05:08 +01:00
|
|
|
const SizedBox(height: 9),
|
2022-08-06 02:22:41 +02:00
|
|
|
Consumer<SubstrateSdk>(builder: (context, sub, _) {
|
2022-06-12 19:56:43 +02:00
|
|
|
return Text(
|
2022-06-18 03:01:22 +02:00
|
|
|
'doATransfer'.tr(),
|
2022-06-12 19:56:43 +02:00
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
2022-08-06 02:22:41 +02:00
|
|
|
color: sub.nodeConnected ? Colors.black : Colors.grey[500],
|
2022-06-12 19:56:43 +02:00
|
|
|
fontSize: buttonFontSize,
|
|
|
|
fontWeight: FontWeight.w500),
|
|
|
|
);
|
|
|
|
}),
|
2022-05-27 16:58:03 +02:00
|
|
|
SizedBox(height: isTall ? 50 : 20)
|
2021-11-29 04:05:08 +01:00
|
|
|
]),
|
|
|
|
));
|
|
|
|
}
|
2021-11-30 10:28:13 +01:00
|
|
|
|
2022-08-17 23:28:19 +02:00
|
|
|
Widget waitToCert(String status, String duration) {
|
|
|
|
return Column(children: <Widget>[
|
|
|
|
SizedBox(
|
|
|
|
height: buttonSize,
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 0),
|
|
|
|
child: Container(
|
|
|
|
foregroundDecoration: const BoxDecoration(
|
|
|
|
color: Colors.grey,
|
|
|
|
backgroundBlendMode: BlendMode.saturation,
|
|
|
|
),
|
|
|
|
child: const Opacity(
|
|
|
|
opacity: 0.5,
|
|
|
|
child: Image(image: AssetImage('assets/gecko_certify.png')),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
status.tr(args: [duration]),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: buttonFontSize - 4,
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
color: Colors.grey[600]),
|
|
|
|
),
|
|
|
|
]);
|
|
|
|
}
|
2022-09-12 04:52:34 +02:00
|
|
|
}
|