Skip to content
Snippets Groups Projects
Commit bd822912 authored by poka's avatar poka
Browse files

improve progress tx screen

parent ac3be881
No related branches found
No related tags found
No related merge requests found
...@@ -482,7 +482,7 @@ class WalletOptions extends StatelessWidget { ...@@ -482,7 +482,7 @@ class WalletOptions extends StatelessWidget {
sub.currencyParameters['membershipRenewalPeriod']!, sub.currencyParameters['membershipRenewalPeriod']!,
); );
if (!info.canRenew) return const SizedBox.shrink(); if (info.canRenew) return const SizedBox.shrink();
return Column(children: [ return Column(children: [
ScaledSizedBox( ScaledSizedBox(
......
...@@ -75,10 +75,11 @@ class _TransactionInProgressState extends State<TransactionInProgress> { ...@@ -75,10 +75,11 @@ class _TransactionInProgressState extends State<TransactionInProgress> {
final sub = Provider.of<SubstrateSdk>(context, listen: true); final sub = Provider.of<SubstrateSdk>(context, listen: true);
if (txContent == null) { if (txContent == null) {
return const Scaffold( return Scaffold(
backgroundColor: Colors.white,
body: Center( body: Center(
child: Loading( child: Loading(
size: 25, size: 30,
), ),
), ),
); );
...@@ -102,123 +103,139 @@ class _TransactionInProgressState extends State<TransactionInProgress> { ...@@ -102,123 +103,139 @@ class _TransactionInProgressState extends State<TransactionInProgress> {
resultText = statusStatusMap[txContent!.status] ?? 'Unknown status: ${txContent!.status}'; resultText = statusStatusMap[txContent!.status] ?? 'Unknown status: ${txContent!.status}';
} }
Widget buildTransactionStatus() { return Scaffold(
return Column( backgroundColor: Colors.white,
children: [
TransactionStatusIcon(txContent!.status),
ScaledSizedBox(height: 7),
if (txContent!.status != TransactionStatus.none)
SizedBox(
width: scaleSize(300),
child: Text(
resultText,
textAlign: TextAlign.center,
style: scaledTextStyle(fontSize: 16),
),
)
],
);
}
return PopScope(
child: Scaffold(
backgroundColor: backgroundColor,
appBar: AppBar( appBar: AppBar(
toolbarHeight: scaleSize(57), backgroundColor: const Color(0xFFFFF3E0),
elevation: 0, elevation: 0,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
title: Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ centerTitle: true,
Text( title: Text(
'extrinsicInProgress'.tr(args: [actionMap[widget.transType] ?? 'strangeTransaction'.tr()]), 'extrinsicInProgress'.tr(args: [actionMap[widget.transType] ?? 'strangeTransaction'.tr()]),
style: scaledTextStyle(fontSize: 19), style: scaledTextStyle(
) fontSize: 16,
])), color: Colors.black87,
body: SafeArea( fontWeight: FontWeight.w500,
child: Align( ),
alignment: FractionalOffset.bottomCenter, ),
child: Column(children: <Widget>[ ),
body: Column(
children: [
Container( Container(
width: double.infinity, width: double.infinity,
decoration: const BoxDecoration( color: const Color(0xFFFFF3E0),
gradient: LinearGradient( padding: EdgeInsets.symmetric(
begin: Alignment.topCenter, horizontal: scaleSize(24),
end: Alignment.bottomCenter, vertical: scaleSize(16),
colors: [
yellowC,
backgroundColor,
],
)),
child: Column(children: <Widget>[
ScaledSizedBox(height: 10),
if (widget.transType == 'pay')
Text(
isUdUnit ? 'ud'.tr(args: ['$amount ']) : '$amount $currencyName',
textAlign: TextAlign.center,
style: scaledTextStyle(fontSize: 16, fontWeight: FontWeight.w500),
), ),
if (widget.transType == 'pay') ScaledSizedBox(height: 10), child: Column(
children: [
Text( Text(
'fromMinus'.tr(), 'fromMinus'.tr(),
textAlign: TextAlign.center, style: scaledTextStyle(
style: scaledTextStyle(fontSize: 15), fontSize: 13,
color: Colors.black54,
),
), ),
ScaledSizedBox(height: 4),
Text( Text(
fromAddressFormat, fromAddressFormat,
textAlign: TextAlign.center, style: scaledTextStyle(
style: scaledTextStyle(fontSize: 16, fontWeight: FontWeight.w500), fontSize: 15,
fontWeight: FontWeight.w500,
),
),
if (fromAddressFormat != toAddressFormat) ...[
Padding(
padding: EdgeInsets.symmetric(vertical: scaleSize(8)),
child: Container(
height: 1,
color: Colors.black.withOpacity(0.06),
),
), ),
Visibility(
visible: fromAddressFormat != toAddressFormat,
child: Column(
children: [
ScaledSizedBox(height: 10),
Text( Text(
'toMinus'.tr(), 'toMinus'.tr(),
textAlign: TextAlign.center, style: scaledTextStyle(
style: scaledTextStyle(fontSize: 15), fontSize: 13,
color: Colors.black54,
), ),
),
ScaledSizedBox(height: 4),
Text( Text(
toUsernameFormat, toUsernameFormat,
textAlign: TextAlign.center, style: scaledTextStyle(
style: scaledTextStyle(fontSize: 16, fontWeight: FontWeight.w500), fontSize: 15,
fontWeight: FontWeight.w500,
), ),
],
), ),
],
],
), ),
ScaledSizedBox(height: 20),
]),
), ),
const Spacer(),
buildTransactionStatus(),
const Spacer(),
Expanded( Expanded(
child: Align( child: Column(
alignment: Alignment.bottomCenter, mainAxisAlignment: MainAxisAlignment.center,
child: ScaledSizedBox( children: [
width: 300, Container(
height: 55, width: scaleSize(52),
height: scaleSize(52),
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(
color: Colors.black12,
width: 1,
),
),
child: Center(
child: TransactionStatusIcon(txContent!.status),
),
),
if (txContent!.status != TransactionStatus.none) ...[
ScaledSizedBox(height: 24),
Padding(
padding: EdgeInsets.symmetric(horizontal: scaleSize(32)),
child: Text(
resultText,
textAlign: TextAlign.center,
style: scaledTextStyle(
fontSize: 15,
height: 1.4,
color: Colors.black87,
),
),
),
],
],
),
),
Padding(
padding: EdgeInsets.all(scaleSize(24)),
child: SizedBox(
width: double.infinity,
height: scaleSize(48),
child: ElevatedButton( child: ElevatedButton(
key: keyCloseTransactionScreen, key: keyCloseTransactionScreen,
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFFE65100),
foregroundColor: Colors.white, foregroundColor: Colors.white,
elevation: 4, elevation: 0,
backgroundColor: orangeC, shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
), ),
onPressed: () { onPressed: () => Navigator.pop(context),
Navigator.pop(context);
},
child: Text( child: Text(
'close'.tr(), 'close'.tr(),
style: scaledTextStyle(fontSize: 18, fontWeight: FontWeight.w600), style: scaledTextStyle(
fontSize: 16,
color: Colors.white,
fontWeight: FontWeight.w500,
), ),
), ),
), ),
), ),
), ),
ScaledSizedBox(height: 80) ],
]),
),
),
), ),
); );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment