From d275ffe72b210cbc365fda48cf28a158cceee7ae Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Tue, 26 Jan 2021 19:43:43 +0200 Subject: [PATCH 1/2] CAKE-248 | displayed address as multiline text and changed insets in the qr_widget.dart; wrapped QRWidget by Observer in the address_page.dart --- lib/src/screens/dashboard/widgets/address_page.dart | 4 ++-- lib/src/screens/receive/widgets/qr_widget.dart | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/src/screens/dashboard/widgets/address_page.dart b/lib/src/screens/dashboard/widgets/address_page.dart index 060d71b09..2522d6e87 100644 --- a/lib/src/screens/dashboard/widgets/address_page.dart +++ b/lib/src/screens/dashboard/widgets/address_page.dart @@ -40,10 +40,10 @@ class AddressPage extends StatelessWidget { children: [ Expanded( child: Center( - child: QRWidget( + child: Observer(builder: (_) => QRWidget( addressListViewModel: addressListViewModel, amountTextFieldFocusNode: _cryptoAmountFocus, - isAmountFieldShow: !addressListViewModel.hasAccounts), + isAmountFieldShow: !addressListViewModel.hasAccounts)), )), Observer(builder: (_) { return addressListViewModel.hasAddressList diff --git a/lib/src/screens/receive/widgets/qr_widget.dart b/lib/src/screens/receive/widgets/qr_widget.dart index 8551c9746..3918d0fa2 100644 --- a/lib/src/screens/receive/widgets/qr_widget.dart +++ b/lib/src/screens/receive/widgets/qr_widget.dart @@ -30,7 +30,6 @@ class QRWidget extends StatelessWidget { Widget build(BuildContext context) { final copyImage = Image.asset('assets/images/copy_address.png', color: Theme.of(context).textTheme.subhead.decorationColor); - final addressTopOffset = isAmountFieldShow ? 60.0 : 40.0; return Column( mainAxisSize: MainAxisSize.min, @@ -54,7 +53,7 @@ class QRWidget extends StatelessWidget { ]), isAmountFieldShow ? Padding( - padding: EdgeInsets.only(top: 40), + padding: EdgeInsets.only(top: 20), child: Row( children: [ Expanded( @@ -90,7 +89,7 @@ class QRWidget extends StatelessWidget { ) : Offstage(), Padding( - padding: EdgeInsets.only(top: addressTopOffset), + padding: EdgeInsets.only(top: 20), child: Builder( builder: (context) => Observer( builder: (context) => GestureDetector( @@ -102,12 +101,12 @@ class QRWidget extends StatelessWidget { }, child: Row( mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: Text( addressListViewModel.address.address, - maxLines: 1, - overflow: TextOverflow.ellipsis, + textAlign: TextAlign.justify, style: TextStyle( fontSize: 15, fontWeight: FontWeight.w500, From b67cb785e4b0de7692afa35fb61fc0f2c87fae60 Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Tue, 26 Jan 2021 21:10:31 +0200 Subject: [PATCH 2/2] CAKE-248 | changed spaces between widgets (QRWWidget) --- lib/src/screens/dashboard/widgets/address_page.dart | 11 +++++------ lib/src/screens/receive/receive_page.dart | 2 +- lib/src/screens/receive/widgets/qr_widget.dart | 12 ++++++------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/src/screens/dashboard/widgets/address_page.dart b/lib/src/screens/dashboard/widgets/address_page.dart index 2522d6e87..7e4fb1c73 100644 --- a/lib/src/screens/dashboard/widgets/address_page.dart +++ b/lib/src/screens/dashboard/widgets/address_page.dart @@ -39,12 +39,11 @@ class AddressPage extends StatelessWidget { child: Column( children: [ Expanded( - child: Center( - child: Observer(builder: (_) => QRWidget( - addressListViewModel: addressListViewModel, - amountTextFieldFocusNode: _cryptoAmountFocus, - isAmountFieldShow: !addressListViewModel.hasAccounts)), - )), + child: Observer(builder: (_) => QRWidget( + addressListViewModel: addressListViewModel, + amountTextFieldFocusNode: _cryptoAmountFocus, + isAmountFieldShow: !addressListViewModel.hasAccounts)) + ), Observer(builder: (_) { return addressListViewModel.hasAddressList ? GestureDetector( diff --git a/lib/src/screens/receive/receive_page.dart b/lib/src/screens/receive/receive_page.dart index c441bd380..9201b9805 100644 --- a/lib/src/screens/receive/receive_page.dart +++ b/lib/src/screens/receive/receive_page.dart @@ -120,7 +120,7 @@ class ReceivePage extends BasePage { child: Column( children: [ Padding( - padding: EdgeInsets.fromLTRB(24, 80, 24, 40), + padding: EdgeInsets.fromLTRB(24, 80, 24, 24), child: QRWidget( addressListViewModel: addressListViewModel, isAmountFieldShow: true, diff --git a/lib/src/screens/receive/widgets/qr_widget.dart b/lib/src/screens/receive/widgets/qr_widget.dart index 3918d0fa2..0a4551ae6 100644 --- a/lib/src/screens/receive/widgets/qr_widget.dart +++ b/lib/src/screens/receive/widgets/qr_widget.dart @@ -33,6 +33,7 @@ class QRWidget extends StatelessWidget { return Column( mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ Row(children: [ @@ -51,8 +52,8 @@ class QRWidget extends StatelessWidget { ))))), Spacer(flex: 3) ]), - isAmountFieldShow - ? Padding( + if (isAmountFieldShow) + Padding( padding: EdgeInsets.only(top: 20), child: Row( children: [ @@ -86,10 +87,9 @@ class QRWidget extends StatelessWidget { fontWeight: FontWeight.w500)))) ], ), - ) - : Offstage(), + ), Padding( - padding: EdgeInsets.only(top: 20), + padding: EdgeInsets.only(top: 20, bottom: 20), child: Builder( builder: (context) => Observer( builder: (context) => GestureDetector( @@ -106,7 +106,7 @@ class QRWidget extends StatelessWidget { Expanded( child: Text( addressListViewModel.address.address, - textAlign: TextAlign.justify, + textAlign: TextAlign.center, style: TextStyle( fontSize: 15, fontWeight: FontWeight.w500,