CWA-209 | applied scroll to all receive page; reduced height of header tiles and address field; reduced font of address

wownero
Oleksandr Sobol 4 years ago
parent e1de337ab1
commit 0ca1cd7157

@ -75,7 +75,7 @@ class ReceiveBodyState extends State<ReceiveBody> {
final copyImage = Image.asset('assets/images/copy_content.png'); final copyImage = Image.asset('assets/images/copy_content.png');
final currentColor = PaletteDark.menuList; final currentColor = PaletteDark.menuList;
final notCurrentColor = Colors.transparent; final notCurrentColor = PaletteDark.historyPanel;
amountController.addListener(() { amountController.addListener(() {
if (_formKey.currentState.validate()) { if (_formKey.currentState.validate()) {
@ -90,11 +90,10 @@ class ReceiveBodyState extends State<ReceiveBody> {
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
color: PaletteDark.mainBackgroundColor, color: PaletteDark.mainBackgroundColor,
padding: EdgeInsets.only(top: 24), padding: EdgeInsets.only(top: 24),
child: Column( child: SingleChildScrollView(
children: <Widget>[ child: Column(
Flexible( children: <Widget>[
flex: 2, Observer(builder: (_) {
child: Observer(builder: (_) {
return Row( return Row(
children: <Widget>[ children: <Widget>[
Spacer( Spacer(
@ -119,193 +118,192 @@ class ReceiveBodyState extends State<ReceiveBody> {
], ],
); );
}), }),
), Padding(
Padding( padding: EdgeInsets.all(24),
padding: EdgeInsets.all(24), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Form(
child: Form( key: _formKey,
key: _formKey, child: BaseTextFormField(
child: BaseTextFormField( controller: amountController,
controller: amountController, keyboardType: TextInputType.numberWithOptions(decimal: true),
keyboardType: TextInputType.numberWithOptions(decimal: true), inputFormatters: [
inputFormatters: [ BlacklistingTextInputFormatter(
BlacklistingTextInputFormatter( RegExp('[\\-|\\ |\\,]'))
RegExp('[\\-|\\ |\\,]')) ],
], textAlign: TextAlign.center,
textAlign: TextAlign.center, hintText: S.of(context).receive_amount,
hintText: S.of(context).receive_amount, borderColor: PaletteDark.walletCardText,
borderColor: PaletteDark.walletCardText, validator: (value) {
validator: (value) { walletStore.validateAmount(value);
walletStore.validateAmount(value); return walletStore.errorMessage;
return walletStore.errorMessage; },
}, autovalidate: true,
autovalidate: true, )
) )
) )
) ],
], ),
), ),
), Padding(
Padding( padding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
padding: EdgeInsets.only(left: 24, right: 24, bottom: 24), child: Observer(
child: Observer( builder: (_) => GestureDetector(
builder: (_) => GestureDetector( onTap: () {
onTap: () { Clipboard.setData(ClipboardData(
Clipboard.setData(ClipboardData( text: walletStore.subaddress.address));
text: walletStore.subaddress.address)); Scaffold.of(context).showSnackBar(SnackBar(
Scaffold.of(context).showSnackBar(SnackBar( content: Text(
content: Text( S.of(context).copied_to_clipboard,
S.of(context).copied_to_clipboard, style: TextStyle(color: Colors.white),
style: TextStyle(color: Colors.white), ),
backgroundColor: Colors.green,
duration: Duration(milliseconds: 500),
));
},
child: Container(
height: 48,
padding: EdgeInsets.only(left: 24, right: 24),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(27)),
color: PaletteDark.walletCardSubAddressField
), ),
backgroundColor: Colors.green, child: Row(
duration: Duration(milliseconds: 500), mainAxisSize: MainAxisSize.max,
)); children: <Widget>[
}, Expanded(
child: Container( child: Text(
height: 54, walletStore.subaddress.address,
padding: EdgeInsets.only(left: 24, right: 24), maxLines: 1,
decoration: BoxDecoration( overflow: TextOverflow.ellipsis,
borderRadius: BorderRadius.all(Radius.circular(27)), style: TextStyle(
color: PaletteDark.walletCardSubAddressField fontSize: 14,
), fontWeight: FontWeight.w600,
child: Row( color: Colors.white
mainAxisSize: MainAxisSize.max, ),
children: <Widget>[
Expanded(
child: Text(
walletStore.subaddress.address,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Colors.white
), ),
), ),
), Padding(
Padding( padding: EdgeInsets.only(left: 12),
padding: EdgeInsets.only(left: 12), child: copyImage,
child: copyImage, )
) ],
], ),
), ),
), )
) ),
), ),
), Container(
Flexible( decoration: BoxDecoration(
flex: 3,
child: ClipRRect(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(24), topLeft: Radius.circular(24),
topRight: Radius.circular(24), topRight: Radius.circular(24),
), ),
child: Container( color: PaletteDark.historyPanel,
color: PaletteDark.historyPanel, ),
child: Observer( child: Observer(
builder: (_) => ListView.separated( builder: (_) => ListView.separated(
separatorBuilder: (context, index) => Divider( separatorBuilder: (context, index) => Divider(
height: 1, height: 1,
color: PaletteDark.menuList, color: PaletteDark.menuList,
), ),
itemCount: subaddressListStore.subaddresses.length + 2, shrinkWrap: true,
itemBuilder: (context, index) { physics: NeverScrollableScrollPhysics(),
itemCount: subaddressListStore.subaddresses.length + 2,
itemBuilder: (context, index) {
if (index == 0) { if (index == 0) {
return HeaderTile( return HeaderTile(
onTap: () async { onTap: () async {
await showDialog<void>( await showDialog<void>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AccountListPage(accountListStore: accountListStore); return AccountListPage(accountListStore: accountListStore);
} }
); );
}, },
title: walletStore.account.label, title: walletStore.account.label,
icon: Icon( icon: Icon(
Icons.arrow_forward_ios, Icons.arrow_forward_ios,
size: 14, size: 14,
color: Colors.white, color: Colors.white,
) )
); );
} }
if (index == 1) { if (index == 1) {
return HeaderTile( return HeaderTile(
onTap: () => Navigator.of(context) onTap: () => Navigator.of(context)
.pushNamed(Routes.newSubaddress), .pushNamed(Routes.newSubaddress),
title: S.of(context).subaddresses, title: S.of(context).subaddresses,
icon: Icon( icon: Icon(
Icons.add, Icons.add,
size: 20, size: 20,
color: Colors.white, color: Colors.white,
) )
); );
} }
index -= 2; index -= 2;
return Observer( return Observer(
builder: (_) { builder: (_) {
final subaddress = subaddressListStore.subaddresses[index]; final subaddress = subaddressListStore.subaddresses[index];
final isCurrent = final isCurrent =
walletStore.subaddress.address == subaddress.address; walletStore.subaddress.address == subaddress.address;
final label = subaddress.label; final label = subaddress.label;
final address = subaddress.address; final address = subaddress.address;
return InkWell( return InkWell(
onTap: () => walletStore.setSubaddress(subaddress), onTap: () => walletStore.setSubaddress(subaddress),
child: Container( child: Container(
color: isCurrent ? currentColor : notCurrentColor, color: isCurrent ? currentColor : notCurrentColor,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 24, left: 24,
right: 24, right: 24,
top: 32, top: 32,
bottom: 32 bottom: 32
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
label.isNotEmpty label.isNotEmpty
? Text( ? Text(
label, label,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: PaletteDark.walletCardText color: PaletteDark.walletCardText
), ),
) )
: Offstage(), : Offstage(),
Padding( Padding(
padding: label.isNotEmpty padding: label.isNotEmpty
? EdgeInsets.only(top: 10) ? EdgeInsets.only(top: 10)
: EdgeInsets.only(top: 0), : EdgeInsets.only(top: 0),
child: Text( child: Text(
address, address,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Colors.white color: Colors.white
), ),
), ),
) )
]), ]),
), ),
); );
} }
); );
} }
) )
), ),
), ),
) ],
) ),
], )
),
); );
} }
} }

@ -20,8 +20,8 @@ class HeaderTile extends StatelessWidget {
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 24, left: 24,
right: 24, right: 24,
top: 32, top: 24,
bottom: 32 bottom: 24
), ),
color: Colors.transparent, color: Colors.transparent,
child: Row( child: Row(

Loading…
Cancel
Save