Merge pull request #77 from cake-tech/CAKE-252-UI-fixes-for-buttons

Cake 252 UI fixes for buttons
This commit is contained in:
M 2021-02-09 20:14:48 +02:00
commit 95424541b7
11 changed files with 84 additions and 79 deletions

View file

@ -39,7 +39,7 @@ class BackupPage extends BasePage {
children: [
Center(
child: Container(
padding: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 24, right: 24),
height: 300,
child: Column(children: [
Text(
@ -82,9 +82,9 @@ class BackupPage extends BasePage {
text: S.of(context).export_backup,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white)),
bottom: 30,
left: 20,
right: 20,
bottom: 24,
left: 24,
right: 24,
)
],
);

View file

@ -25,7 +25,7 @@ class EditBackupPasswordPage extends BasePage {
@override
Widget body(BuildContext context) {
return Padding(
padding: EdgeInsets.only(left: 20, right: 20),
padding: EdgeInsets.only(left: 24, right: 24),
child: Stack(
fit: StackFit.expand,
children: [
@ -48,7 +48,7 @@ class EditBackupPasswordPage extends BasePage {
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white,
isDisabled: !editBackupPasswordViewModel.canSave)),
bottom: 30,
bottom: 24,
left: 0,
right: 0)
],

View file

@ -22,6 +22,7 @@ class NewWalletPage extends BasePage {
final WalletNewVM _walletNewVM;
final walletNameImage = Image.asset('assets/images/wallet_name.png');
final walletNameLightImage =
Image.asset('assets/images/wallet_name_light.png');

View file

@ -75,49 +75,46 @@ class WalletTypeFormState extends State<WalletTypeForm> {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 24, bottom: 24),
child: ScrollableWithBottomSection(
contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
content: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 12, right: 12),
child: AspectRatio(
aspectRatio: aspectRatioImage,
child:
FittedBox(child: widget.walletImage, fit: BoxFit.fill)),
return ScrollableWithBottomSection(
contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
content: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: 12, right: 12),
child: AspectRatio(
aspectRatio: aspectRatioImage,
child:
FittedBox(child: widget.walletImage, fit: BoxFit.fill)),
),
Padding(
padding: EdgeInsets.only(top: 48),
child: Text(
S.of(context).choose_wallet_currency,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryTextTheme.title.color),
),
Padding(
padding: EdgeInsets.only(top: 48),
child: Text(
S.of(context).choose_wallet_currency,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).primaryTextTheme.title.color),
),
),
...types.map((type) => Padding(
padding: EdgeInsets.only(top: 24),
child: SelectButton(
image: _iconFor(type),
text: walletTypeToDisplayName(type),
isSelected: selected == type,
onTap: () => setState(() => selected = type)),
))
],
),
bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
bottomSection: PrimaryButton(
onPressed: () => onTypeSelected(),
text: S.of(context).seed_language_next,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white,
isDisabled: selected == null,
),
),
...types.map((type) => Padding(
padding: EdgeInsets.only(top: 24),
child: SelectButton(
image: _iconFor(type),
text: walletTypeToDisplayName(type),
isSelected: selected == type,
onTap: () => setState(() => selected = type)),
))
],
),
bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
bottomSection: PrimaryButton(
onPressed: () => onTypeSelected(),
text: S.of(context).seed_language_next,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white,
isDisabled: selected == null,
),
);
}

View file

@ -40,7 +40,7 @@ class RestoreFromBackupPage extends BasePage {
});
return Container(
padding: EdgeInsets.only(bottom: 30, left: 25, right: 25),
padding: EdgeInsets.only(bottom: 24, left: 24, right: 24),
child: Column(children: [
Expanded(
child: Container(

View file

@ -82,7 +82,7 @@ class RestoreWalletFromSeedPage extends BasePage {
activeDotColor: Theme.of(context).hintColor),
)),
Padding(
padding: EdgeInsets.only(top: 20, bottom: 40, left: 25, right: 25),
padding: EdgeInsets.only(top: 20, bottom: 24, left: 24, right: 24),
child: PrimaryButton(
text: S.of(context).restore_recover,
isDisabled: false,
@ -158,7 +158,7 @@ class _RestoreFromSeedFormState extends State<RestoreFromSeedForm> {
onTap: () =>
SystemChannels.textInput.invokeMethod<void>('TextInput.hide'),
child: Container(
padding: EdgeInsets.only(left: 25, right: 25),
padding: EdgeInsets.only(left: 24, right: 24),
// color: Colors.blue,
// height: 300,
child: Column(children: [

View file

@ -44,7 +44,7 @@ class WalletRestoreFromKeysFromState extends State<WalletRestoreFromKeysFrom> {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 25, right: 25),
padding: EdgeInsets.only(left: 24, right: 24),
child: Form(
key: formKey,
child: Column(children: <Widget>[

View file

@ -49,7 +49,7 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 25, right: 25),
padding: EdgeInsets.only(left: 24, right: 24),
child: Column(children: [
SeedWidget(
key: seedWidgetStateKey, language: language, type: widget.type),

View file

@ -130,7 +130,7 @@ class WalletRestorePage extends BasePage {
activeDotColor: Theme.of(context).hintColor),
)),
Padding(
padding: EdgeInsets.only(top: 20, bottom: 40, left: 25, right: 25),
padding: EdgeInsets.only(top: 20, bottom: 24, left: 24, right: 24),
child: Observer(
builder: (context) {
return LoadingPrimaryButton(

View file

@ -47,16 +47,13 @@ class WalletListBodyState extends State<WalletListBody> {
@override
Widget build(BuildContext context) {
final newWalletImage = Image.asset('assets/images/new_wallet.png',
height: 12,
width: 12,
color: Colors.white);
height: 12, width: 12, color: Colors.white);
final restoreWalletImage = Image.asset('assets/images/restore_wallet.png',
height: 12,
width: 12,
color: Theme.of(context).primaryTextTheme.title.color);
return SafeArea(
child: Container(
return Container(
padding: EdgeInsets.only(top: 16),
child: ScrollableWithBottomSection(
contentPadding: EdgeInsets.only(bottom: 20),
@ -83,18 +80,24 @@ class WalletListBodyState extends State<WalletListBody> {
}
final confirmed = await showPopUp<bool>(
context: context,
builder: (dialogContext) {
return AlertWithTwoActions(
alertTitle: S.of(context).change_wallet_alert_title,
alertContent: S.of(context).change_wallet_alert_content(wallet.name),
leftButtonText: S.of(context).cancel,
rightButtonText: S.of(context).change,
actionLeftButton: () =>
Navigator.of(context).pop(false),
actionRightButton: () =>
Navigator.of(context).pop(true));
}) ?? false;
context: context,
builder: (dialogContext) {
return AlertWithTwoActions(
alertTitle: S
.of(context)
.change_wallet_alert_title,
alertContent: S
.of(context)
.change_wallet_alert_content(
wallet.name),
leftButtonText: S.of(context).cancel,
rightButtonText: S.of(context).change,
actionLeftButton: () =>
Navigator.of(context).pop(false),
actionRightButton: () =>
Navigator.of(context).pop(true));
}) ??
false;
if (confirmed) {
await _loadWallet(wallet);
@ -161,9 +164,12 @@ class WalletListBodyState extends State<WalletListBody> {
}),
),
),
bottomSectionPadding:
EdgeInsets.only(bottom: 24, right: 24, left: 24),
bottomSection: Column(children: <Widget>[
PrimaryImageButton(
onPressed: () => Navigator.of(context).pushNamed(Routes.newWalletType),
onPressed: () =>
Navigator.of(context).pushNamed(Routes.newWalletType),
image: newWalletImage,
text: S.of(context).wallet_list_create_new_wallet,
color: Theme.of(context).accentTextTheme.body2.color,
@ -178,7 +184,7 @@ class WalletListBodyState extends State<WalletListBody> {
color: Theme.of(context).accentTextTheme.caption.color,
textColor: Theme.of(context).primaryTextTheme.title.color)
])),
));
);
}
Image _imageFor({WalletType type}) {
@ -238,17 +244,17 @@ class WalletListBodyState extends State<WalletListBody> {
Future<void> _generateNewWallet() async {
try {
changeProcessText(S.of(context).creating_new_wallet);
await widget.walletListViewModel.walletNewVM.create(options: 'English'); // FIXME: Unnamed constant
await widget.walletListViewModel.walletNewVM
.create(options: 'English'); // FIXME: Unnamed constant
hideProgressText();
await Navigator.of(context).pushNamed(Routes.preSeed);
} catch(e) {
} catch (e) {
changeProcessText(S.of(context).creating_new_wallet_error(e.toString()));
}
}
void changeProcessText(String text) {
_progressBar = createBar<void>(text, duration: null)
..show(context);
_progressBar = createBar<void>(text, duration: null)..show(context);
}
void hideProgressText() {

View file

@ -17,7 +17,7 @@ class WelcomePage extends BasePage {
.of(context)
.backgroundColor,
resizeToAvoidBottomPadding: false,
body: SafeArea(child: body(context)));
body: body(context));
}
@override
@ -43,8 +43,9 @@ class WelcomePage extends BasePage {
.color);
return WillPopScope(onWillPop: () async => false, child: Container(
padding: EdgeInsets.all(24),
padding: EdgeInsets.only(top: 64, bottom: 24, left: 24, right: 24),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Flexible(
flex: 2,