CWA-205 | applied new design to restore button, restore options page and restore wallet options page; deleted base restore widget and image widget
BIN
assets/images/2.0x/backup.png
Normal file
After Width: | Height: | Size: 5 KiB |
BIN
assets/images/2.0x/restore_keys.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
assets/images/2.0x/restore_seed.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
assets/images/2.0x/restore_wallet_image.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
assets/images/3.0x/backup.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
assets/images/3.0x/restore_keys.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
assets/images/3.0x/restore_seed.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
assets/images/3.0x/restore_wallet_image.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
assets/images/backup.png
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
assets/images/restore_keys.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
assets/images/restore_seed.png
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
assets/images/restore_wallet_image.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
|
@ -63,7 +63,7 @@ abstract class BasePage extends StatelessWidget {
|
||||||
: Text(
|
: Text(
|
||||||
title,
|
title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22.0,
|
fontSize: 18.0,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: Colors.white),
|
color: Colors.white),
|
||||||
//color: Theme.of(context).primaryTextTheme.title.color),
|
//color: Theme.of(context).primaryTextTheme.title.color),
|
||||||
|
|
|
@ -3,57 +3,47 @@ import 'package:cake_wallet/palette.dart';
|
||||||
import 'package:cake_wallet/routes.dart';
|
import 'package:cake_wallet/routes.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:cake_wallet/src/screens/restore/widgets/restore_button.dart';
|
import 'package:cake_wallet/src/screens/restore/widgets/restore_button.dart';
|
||||||
import 'package:cake_wallet/src/screens/restore/widgets/image_widget.dart';
|
|
||||||
import 'package:cake_wallet/src/screens/restore/widgets/base_restore_widget.dart';
|
|
||||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||||
import 'package:cake_wallet/generated/i18n.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
|
|
||||||
class RestoreOptionsPage extends BasePage {
|
class RestoreOptionsPage extends BasePage {
|
||||||
static const _aspectRatioImage = 2.086;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get title => S.current.restore_restore_wallet;
|
String get title => S.current.restore_restore_wallet;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Color get backgroundColor => Palette.creamyGrey;
|
Color get backgroundColor => PaletteDark.historyPanel;
|
||||||
|
|
||||||
final _imageSeedKeys = Image.asset('assets/images/seedKeys.png');
|
final imageSeedKeys = Image.asset('assets/images/restore_wallet_image.png');
|
||||||
final _imageRestoreSeed = Image.asset('assets/images/restoreSeed.png');
|
final imageBackup = Image.asset('assets/images/backup.png');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget body(BuildContext context) {
|
Widget body(BuildContext context) {
|
||||||
final isLargeScreen = MediaQuery.of(context).size.height > largeHeight;
|
return Container(
|
||||||
|
padding: EdgeInsets.all(24),
|
||||||
return BaseRestoreWidget(
|
child: SingleChildScrollView(
|
||||||
firstRestoreButton: RestoreButton(
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
RestoreButton(
|
||||||
onPressed: () =>
|
onPressed: () =>
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, Routes.restoreWalletOptionsFromWelcome),
|
context, Routes.restoreWalletOptionsFromWelcome),
|
||||||
imageWidget: ImageWidget(
|
image: imageSeedKeys,
|
||||||
image: _imageSeedKeys,
|
|
||||||
aspectRatioImage: _aspectRatioImage,
|
|
||||||
isLargeScreen: isLargeScreen,
|
|
||||||
),
|
|
||||||
titleColor: Palette.lightViolet,
|
|
||||||
color: Palette.lightViolet,
|
|
||||||
title: S.of(context).restore_title_from_seed_keys,
|
title: S.of(context).restore_title_from_seed_keys,
|
||||||
description: S.of(context).restore_description_from_seed_keys,
|
description: S.of(context).restore_description_from_seed_keys
|
||||||
textButton: S.of(context).restore_next,
|
|
||||||
),
|
),
|
||||||
secondRestoreButton: RestoreButton(
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 24),
|
||||||
|
child: RestoreButton(
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
imageWidget: ImageWidget(
|
image: imageBackup,
|
||||||
image: _imageRestoreSeed,
|
|
||||||
aspectRatioImage: _aspectRatioImage,
|
|
||||||
isLargeScreen: isLargeScreen,
|
|
||||||
),
|
|
||||||
titleColor: Palette.cakeGreen,
|
|
||||||
color: Palette.cakeGreen,
|
|
||||||
title: S.of(context).restore_title_from_backup,
|
title: S.of(context).restore_title_from_backup,
|
||||||
description: S.of(context).restore_description_from_backup,
|
description: S.of(context).restore_description_from_backup
|
||||||
textButton: S.of(context).restore_next,
|
|
||||||
),
|
),
|
||||||
isLargeScreen: isLargeScreen,
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,31 +3,59 @@ import 'package:flutter/cupertino.dart';
|
||||||
import 'package:cake_wallet/routes.dart';
|
import 'package:cake_wallet/routes.dart';
|
||||||
import 'package:cake_wallet/palette.dart';
|
import 'package:cake_wallet/palette.dart';
|
||||||
import 'package:cake_wallet/src/screens/restore/widgets/restore_button.dart';
|
import 'package:cake_wallet/src/screens/restore/widgets/restore_button.dart';
|
||||||
import 'package:cake_wallet/src/screens/restore/widgets/image_widget.dart';
|
|
||||||
import 'package:cake_wallet/src/screens/restore/widgets/base_restore_widget.dart';
|
|
||||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||||
import 'package:cake_wallet/generated/i18n.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
|
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class RestoreWalletOptionsPage extends BasePage {
|
class RestoreWalletOptionsPage extends BasePage {
|
||||||
static const _aspectRatioImage = 2.086;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get title => S.current.restore_seed_keys_restore;
|
String get title => S.current.restore_seed_keys_restore;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Color get backgroundColor => Palette.creamyGrey;
|
Color get backgroundColor => PaletteDark.historyPanel;
|
||||||
|
|
||||||
final _imageSeed = Image.asset('assets/images/seedIco.png');
|
final imageSeed = Image.asset('assets/images/restore_seed.png');
|
||||||
final _imageKeys = Image.asset('assets/images/keysIco.png');
|
final imageKeys = Image.asset('assets/images/restore_keys.png');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget body(BuildContext context) {
|
Widget body(BuildContext context) {
|
||||||
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
|
final seedLanguageStore = Provider.of<SeedLanguageStore>(context);
|
||||||
final isLargeScreen = MediaQuery.of(context).size.height > largeHeight;
|
|
||||||
|
|
||||||
return BaseRestoreWidget(
|
return Container(
|
||||||
|
padding: EdgeInsets.all(24),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
RestoreButton(
|
||||||
|
onPressed: () {
|
||||||
|
seedLanguageStore.setCurrentRoute(Routes.restoreWalletFromSeed);
|
||||||
|
Navigator.pushNamed(context, Routes.seedLanguage);
|
||||||
|
},
|
||||||
|
image: imageSeed,
|
||||||
|
title: S.of(context).restore_title_from_seed,
|
||||||
|
description: S.of(context).restore_description_from_seed
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 24),
|
||||||
|
child: RestoreButton(
|
||||||
|
onPressed: () {
|
||||||
|
seedLanguageStore.setCurrentRoute(Routes.restoreWalletFromKeys);
|
||||||
|
Navigator.pushNamed(context, Routes.seedLanguage);
|
||||||
|
},
|
||||||
|
image: imageKeys,
|
||||||
|
title: S.of(context).restore_title_from_keys,
|
||||||
|
description: S.of(context).restore_description_from_keys
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/*BaseRestoreWidget(
|
||||||
firstRestoreButton: RestoreButton(
|
firstRestoreButton: RestoreButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
seedLanguageStore.setCurrentRoute(Routes.restoreWalletFromSeed);
|
seedLanguageStore.setCurrentRoute(Routes.restoreWalletFromSeed);
|
||||||
|
@ -59,6 +87,6 @@ class RestoreWalletOptionsPage extends BasePage {
|
||||||
textButton: S.of(context).restore_next,
|
textButton: S.of(context).restore_next,
|
||||||
),
|
),
|
||||||
isLargeScreen: isLargeScreen,
|
isLargeScreen: isLargeScreen,
|
||||||
);
|
);*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
const largeHeight = 700;
|
|
||||||
|
|
||||||
class BaseRestoreWidget extends StatelessWidget {
|
|
||||||
BaseRestoreWidget({
|
|
||||||
@required this.firstRestoreButton,
|
|
||||||
@required this.secondRestoreButton,
|
|
||||||
this.isLargeScreen = false
|
|
||||||
});
|
|
||||||
|
|
||||||
final Widget firstRestoreButton;
|
|
||||||
final Widget secondRestoreButton;
|
|
||||||
final bool isLargeScreen;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Container(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
left: 20.0,
|
|
||||||
right: 20.0,
|
|
||||||
),
|
|
||||||
child: isLargeScreen
|
|
||||||
? Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Flexible(
|
|
||||||
child: firstRestoreButton
|
|
||||||
),
|
|
||||||
Flexible(
|
|
||||||
child: secondRestoreButton
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
firstRestoreButton,
|
|
||||||
secondRestoreButton
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class ImageWidget extends StatelessWidget {
|
|
||||||
ImageWidget({
|
|
||||||
@required this.image,
|
|
||||||
@required this.aspectRatioImage,
|
|
||||||
this.isLargeScreen = false});
|
|
||||||
|
|
||||||
final Image image;
|
|
||||||
final double aspectRatioImage;
|
|
||||||
final bool isLargeScreen;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return isLargeScreen
|
|
||||||
? Flexible(
|
|
||||||
child: Container(
|
|
||||||
child: AspectRatio(
|
|
||||||
aspectRatio: aspectRatioImage,
|
|
||||||
child: FittedBox(
|
|
||||||
fit: BoxFit.contain,
|
|
||||||
child: image,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: image;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,101 +1,71 @@
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:cake_wallet/palette.dart';
|
import 'package:cake_wallet/palette.dart';
|
||||||
import 'package:auto_size_text/auto_size_text.dart';
|
|
||||||
|
|
||||||
class RestoreButton extends StatelessWidget {
|
class RestoreButton extends StatelessWidget {
|
||||||
const RestoreButton(
|
const RestoreButton({
|
||||||
{@required this.onPressed,
|
@required this.onPressed,
|
||||||
@required this.imageWidget,
|
@required this.image,
|
||||||
@required this.color,
|
@required this.title,
|
||||||
@required this.titleColor,
|
@required this.description});
|
||||||
this.title = '',
|
|
||||||
this.description = '',
|
|
||||||
this.textButton = ''});
|
|
||||||
|
|
||||||
final VoidCallback onPressed;
|
final VoidCallback onPressed;
|
||||||
final Widget imageWidget;
|
final Image image;
|
||||||
final Color color;
|
|
||||||
final Color titleColor;
|
|
||||||
final String title;
|
final String title;
|
||||||
final String description;
|
final String description;
|
||||||
final String textButton;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return GestureDetector(
|
||||||
margin: EdgeInsets.only(top: 20.0, bottom: 20.0),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Theme.of(context).accentTextTheme.headline.backgroundColor,
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20.0)),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Palette.buttonShadow,
|
|
||||||
blurRadius: 10,
|
|
||||||
offset: Offset(
|
|
||||||
0,
|
|
||||||
12,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
]),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: onPressed,
|
onTap: onPressed,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20.0)),
|
child: Container(
|
||||||
child: Column(
|
width: double.infinity,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
height: 140,
|
||||||
children: <Widget>[
|
padding: EdgeInsets.all(24),
|
||||||
imageWidget,
|
alignment: Alignment.topLeft,
|
||||||
Column(
|
|
||||||
children: <Widget>[
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(left: 20, right: 20),
|
|
||||||
child: AutoSizeText(
|
|
||||||
title,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
color: titleColor,
|
|
||||||
fontWeight: FontWeight.bold),
|
|
||||||
maxLines: 2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(left: 20, right: 20, top: 10),
|
|
||||||
child: AutoSizeText(
|
|
||||||
description,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).accentTextTheme.subhead.color,
|
|
||||||
),
|
|
||||||
maxLines: 2,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 56.0,
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(
|
borderRadius: BorderRadius.all(Radius.circular(12)),
|
||||||
top: BorderSide(
|
color: PaletteDark.menuList
|
||||||
color: Theme.of(context)
|
|
||||||
.accentTextTheme
|
|
||||||
.headline
|
|
||||||
.decorationColor,
|
|
||||||
width: 1.15)),
|
|
||||||
color: Colors.transparent,
|
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Row(
|
||||||
child: Text(
|
mainAxisSize: MainAxisSize.max,
|
||||||
textButton,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
image,
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(left: 16),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: color,
|
fontSize: 16,
|
||||||
fontSize: 16.0,
|
fontWeight: FontWeight.w600,
|
||||||
fontWeight: FontWeight.bold),
|
color: Colors.white
|
||||||
),
|
),
|
||||||
))
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 5),
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14,
|
||||||
|
color: PaletteDark.walletCardText
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|