mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 09:47:35 +00:00
Merge pull request #77 from cake-tech/CAKE-252-UI-fixes-for-buttons
Cake 252 UI fixes for buttons
This commit is contained in:
commit
95424541b7
11 changed files with 84 additions and 79 deletions
|
@ -39,7 +39,7 @@ class BackupPage extends BasePage {
|
||||||
children: [
|
children: [
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.only(left: 20, right: 20),
|
padding: EdgeInsets.only(left: 24, right: 24),
|
||||||
height: 300,
|
height: 300,
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Text(
|
Text(
|
||||||
|
@ -82,9 +82,9 @@ class BackupPage extends BasePage {
|
||||||
text: S.of(context).export_backup,
|
text: S.of(context).export_backup,
|
||||||
color: Theme.of(context).accentTextTheme.body2.color,
|
color: Theme.of(context).accentTextTheme.body2.color,
|
||||||
textColor: Colors.white)),
|
textColor: Colors.white)),
|
||||||
bottom: 30,
|
bottom: 24,
|
||||||
left: 20,
|
left: 24,
|
||||||
right: 20,
|
right: 24,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -25,7 +25,7 @@ class EditBackupPasswordPage extends BasePage {
|
||||||
@override
|
@override
|
||||||
Widget body(BuildContext context) {
|
Widget body(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(left: 20, right: 20),
|
padding: EdgeInsets.only(left: 24, right: 24),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
fit: StackFit.expand,
|
fit: StackFit.expand,
|
||||||
children: [
|
children: [
|
||||||
|
@ -48,7 +48,7 @@ class EditBackupPasswordPage extends BasePage {
|
||||||
color: Theme.of(context).accentTextTheme.body2.color,
|
color: Theme.of(context).accentTextTheme.body2.color,
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
isDisabled: !editBackupPasswordViewModel.canSave)),
|
isDisabled: !editBackupPasswordViewModel.canSave)),
|
||||||
bottom: 30,
|
bottom: 24,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0)
|
right: 0)
|
||||||
],
|
],
|
||||||
|
|
|
@ -22,6 +22,7 @@ class NewWalletPage extends BasePage {
|
||||||
final WalletNewVM _walletNewVM;
|
final WalletNewVM _walletNewVM;
|
||||||
|
|
||||||
final walletNameImage = Image.asset('assets/images/wallet_name.png');
|
final walletNameImage = Image.asset('assets/images/wallet_name.png');
|
||||||
|
|
||||||
final walletNameLightImage =
|
final walletNameLightImage =
|
||||||
Image.asset('assets/images/wallet_name_light.png');
|
Image.asset('assets/images/wallet_name_light.png');
|
||||||
|
|
||||||
|
|
|
@ -75,9 +75,7 @@ class WalletTypeFormState extends State<WalletTypeForm> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return ScrollableWithBottomSection(
|
||||||
padding: EdgeInsets.only(top: 24, bottom: 24),
|
|
||||||
child: ScrollableWithBottomSection(
|
|
||||||
contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
|
contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
|
||||||
content: Column(
|
content: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
@ -118,7 +116,6 @@ class WalletTypeFormState extends State<WalletTypeForm> {
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
isDisabled: selected == null,
|
isDisabled: selected == null,
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class RestoreFromBackupPage extends BasePage {
|
||||||
});
|
});
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.only(bottom: 30, left: 25, right: 25),
|
padding: EdgeInsets.only(bottom: 24, left: 24, right: 24),
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
|
@ -82,7 +82,7 @@ class RestoreWalletFromSeedPage extends BasePage {
|
||||||
activeDotColor: Theme.of(context).hintColor),
|
activeDotColor: Theme.of(context).hintColor),
|
||||||
)),
|
)),
|
||||||
Padding(
|
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(
|
child: PrimaryButton(
|
||||||
text: S.of(context).restore_recover,
|
text: S.of(context).restore_recover,
|
||||||
isDisabled: false,
|
isDisabled: false,
|
||||||
|
@ -158,7 +158,7 @@ class _RestoreFromSeedFormState extends State<RestoreFromSeedForm> {
|
||||||
onTap: () =>
|
onTap: () =>
|
||||||
SystemChannels.textInput.invokeMethod<void>('TextInput.hide'),
|
SystemChannels.textInput.invokeMethod<void>('TextInput.hide'),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.only(left: 25, right: 25),
|
padding: EdgeInsets.only(left: 24, right: 24),
|
||||||
// color: Colors.blue,
|
// color: Colors.blue,
|
||||||
// height: 300,
|
// height: 300,
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
|
|
|
@ -44,7 +44,7 @@ class WalletRestoreFromKeysFromState extends State<WalletRestoreFromKeysFrom> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.only(left: 25, right: 25),
|
padding: EdgeInsets.only(left: 24, right: 24),
|
||||||
child: Form(
|
child: Form(
|
||||||
key: formKey,
|
key: formKey,
|
||||||
child: Column(children: <Widget>[
|
child: Column(children: <Widget>[
|
||||||
|
|
|
@ -49,7 +49,7 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.only(left: 25, right: 25),
|
padding: EdgeInsets.only(left: 24, right: 24),
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
SeedWidget(
|
SeedWidget(
|
||||||
key: seedWidgetStateKey, language: language, type: widget.type),
|
key: seedWidgetStateKey, language: language, type: widget.type),
|
||||||
|
|
|
@ -130,7 +130,7 @@ class WalletRestorePage extends BasePage {
|
||||||
activeDotColor: Theme.of(context).hintColor),
|
activeDotColor: Theme.of(context).hintColor),
|
||||||
)),
|
)),
|
||||||
Padding(
|
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(
|
child: Observer(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return LoadingPrimaryButton(
|
return LoadingPrimaryButton(
|
||||||
|
|
|
@ -47,16 +47,13 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final newWalletImage = Image.asset('assets/images/new_wallet.png',
|
final newWalletImage = Image.asset('assets/images/new_wallet.png',
|
||||||
height: 12,
|
height: 12, width: 12, color: Colors.white);
|
||||||
width: 12,
|
|
||||||
color: Colors.white);
|
|
||||||
final restoreWalletImage = Image.asset('assets/images/restore_wallet.png',
|
final restoreWalletImage = Image.asset('assets/images/restore_wallet.png',
|
||||||
height: 12,
|
height: 12,
|
||||||
width: 12,
|
width: 12,
|
||||||
color: Theme.of(context).primaryTextTheme.title.color);
|
color: Theme.of(context).primaryTextTheme.title.color);
|
||||||
|
|
||||||
return SafeArea(
|
return Container(
|
||||||
child: Container(
|
|
||||||
padding: EdgeInsets.only(top: 16),
|
padding: EdgeInsets.only(top: 16),
|
||||||
child: ScrollableWithBottomSection(
|
child: ScrollableWithBottomSection(
|
||||||
contentPadding: EdgeInsets.only(bottom: 20),
|
contentPadding: EdgeInsets.only(bottom: 20),
|
||||||
|
@ -86,15 +83,21 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
context: context,
|
context: context,
|
||||||
builder: (dialogContext) {
|
builder: (dialogContext) {
|
||||||
return AlertWithTwoActions(
|
return AlertWithTwoActions(
|
||||||
alertTitle: S.of(context).change_wallet_alert_title,
|
alertTitle: S
|
||||||
alertContent: S.of(context).change_wallet_alert_content(wallet.name),
|
.of(context)
|
||||||
|
.change_wallet_alert_title,
|
||||||
|
alertContent: S
|
||||||
|
.of(context)
|
||||||
|
.change_wallet_alert_content(
|
||||||
|
wallet.name),
|
||||||
leftButtonText: S.of(context).cancel,
|
leftButtonText: S.of(context).cancel,
|
||||||
rightButtonText: S.of(context).change,
|
rightButtonText: S.of(context).change,
|
||||||
actionLeftButton: () =>
|
actionLeftButton: () =>
|
||||||
Navigator.of(context).pop(false),
|
Navigator.of(context).pop(false),
|
||||||
actionRightButton: () =>
|
actionRightButton: () =>
|
||||||
Navigator.of(context).pop(true));
|
Navigator.of(context).pop(true));
|
||||||
}) ?? false;
|
}) ??
|
||||||
|
false;
|
||||||
|
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
await _loadWallet(wallet);
|
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>[
|
bottomSection: Column(children: <Widget>[
|
||||||
PrimaryImageButton(
|
PrimaryImageButton(
|
||||||
onPressed: () => Navigator.of(context).pushNamed(Routes.newWalletType),
|
onPressed: () =>
|
||||||
|
Navigator.of(context).pushNamed(Routes.newWalletType),
|
||||||
image: newWalletImage,
|
image: newWalletImage,
|
||||||
text: S.of(context).wallet_list_create_new_wallet,
|
text: S.of(context).wallet_list_create_new_wallet,
|
||||||
color: Theme.of(context).accentTextTheme.body2.color,
|
color: Theme.of(context).accentTextTheme.body2.color,
|
||||||
|
@ -178,7 +184,7 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
color: Theme.of(context).accentTextTheme.caption.color,
|
color: Theme.of(context).accentTextTheme.caption.color,
|
||||||
textColor: Theme.of(context).primaryTextTheme.title.color)
|
textColor: Theme.of(context).primaryTextTheme.title.color)
|
||||||
])),
|
])),
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Image _imageFor({WalletType type}) {
|
Image _imageFor({WalletType type}) {
|
||||||
|
@ -238,7 +244,8 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
Future<void> _generateNewWallet() async {
|
Future<void> _generateNewWallet() async {
|
||||||
try {
|
try {
|
||||||
changeProcessText(S.of(context).creating_new_wallet);
|
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();
|
hideProgressText();
|
||||||
await Navigator.of(context).pushNamed(Routes.preSeed);
|
await Navigator.of(context).pushNamed(Routes.preSeed);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -247,8 +254,7 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void changeProcessText(String text) {
|
void changeProcessText(String text) {
|
||||||
_progressBar = createBar<void>(text, duration: null)
|
_progressBar = createBar<void>(text, duration: null)..show(context);
|
||||||
..show(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void hideProgressText() {
|
void hideProgressText() {
|
||||||
|
|
|
@ -17,7 +17,7 @@ class WelcomePage extends BasePage {
|
||||||
.of(context)
|
.of(context)
|
||||||
.backgroundColor,
|
.backgroundColor,
|
||||||
resizeToAvoidBottomPadding: false,
|
resizeToAvoidBottomPadding: false,
|
||||||
body: SafeArea(child: body(context)));
|
body: body(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -43,8 +43,9 @@ class WelcomePage extends BasePage {
|
||||||
.color);
|
.color);
|
||||||
|
|
||||||
return WillPopScope(onWillPop: () async => false, child: Container(
|
return WillPopScope(onWillPop: () async => false, child: Container(
|
||||||
padding: EdgeInsets.all(24),
|
padding: EdgeInsets.only(top: 64, bottom: 24, left: 24, right: 24),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Flexible(
|
Flexible(
|
||||||
flex: 2,
|
flex: 2,
|
||||||
|
|
Loading…
Reference in a new issue