mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
CWA-204 | applied new design to welcome and new wallet pages; created new wallet type page and select button; changed loading primary button
This commit is contained in:
@@ -98,10 +98,7 @@ class AccountFormState extends State<AccountForm> {
|
||||
.primaryTextTheme
|
||||
.button
|
||||
.backgroundColor,
|
||||
borderColor: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.button
|
||||
.decorationColor,
|
||||
textColor: Theme.of(context).primaryTextTheme.button.color,
|
||||
isLoading: accountListStore.isAccountCreating,
|
||||
))
|
||||
],
|
||||
|
||||
@@ -255,10 +255,7 @@ class ExchangeFormState extends State<ExchangeForm> {
|
||||
.primaryTextTheme
|
||||
.button
|
||||
.backgroundColor,
|
||||
borderColor: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.button
|
||||
.decorationColor,
|
||||
textColor: Theme.of(context).primaryTextTheme.button.color,
|
||||
isLoading: exchangeStore.tradeState is TradeIsCreating,
|
||||
)),
|
||||
Observer(builder: (_) {
|
||||
|
||||
@@ -315,10 +315,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
|
||||
.primaryTextTheme
|
||||
.button
|
||||
.backgroundColor,
|
||||
borderColor: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.button
|
||||
.decorationColor),
|
||||
textColor: Theme.of(context).primaryTextTheme.button.color),
|
||||
)
|
||||
: Offstage()),
|
||||
);
|
||||
|
||||
@@ -14,7 +14,7 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
|
||||
import 'package:cake_wallet/src/screens/seed_language/widgets/seed_language_picker.dart';
|
||||
import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart';
|
||||
|
||||
class NewWalletPage extends BasePage {
|
||||
NewWalletPage(
|
||||
@@ -29,6 +29,9 @@ class NewWalletPage extends BasePage {
|
||||
@override
|
||||
String get title => S.current.new_wallet;
|
||||
|
||||
@override
|
||||
Color get backgroundColor => PaletteDark.historyPanel;
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) => WalletNameForm();
|
||||
}
|
||||
@@ -39,8 +42,47 @@ class WalletNameForm extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _WalletNameFormState extends State<WalletNameForm> {
|
||||
static const aspectRatioImage = 1.22;
|
||||
|
||||
final List<String> seedLocales = [
|
||||
S.current.seed_language_english,
|
||||
S.current.seed_language_chinese,
|
||||
S.current.seed_language_dutch,
|
||||
S.current.seed_language_german,
|
||||
S.current.seed_language_japanese,
|
||||
S.current.seed_language_portuguese,
|
||||
S.current.seed_language_russian,
|
||||
S.current.seed_language_spanish
|
||||
];
|
||||
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
final nameController = TextEditingController();
|
||||
final walletNameImage = Image.asset('assets/images/wallet_name.png');
|
||||
|
||||
bool isDisabledButton;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
isDisabledButton = true;
|
||||
|
||||
nameController.addListener(() {
|
||||
if (nameController.text.isNotEmpty) {
|
||||
isDisabledButton = false;
|
||||
} else {
|
||||
isDisabledButton = true;
|
||||
}
|
||||
|
||||
setState(() {});
|
||||
});
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
nameController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -52,7 +94,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
||||
Navigator.of(context).popUntil((route) => route.isFirst);
|
||||
}
|
||||
|
||||
if (state is WalletCreationFailure) {
|
||||
if (state is WalletCreationFailure) { // FIXME: apply new alert dialog
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
@@ -71,66 +113,92 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
||||
}
|
||||
});
|
||||
|
||||
return ScrollableWithBottomSection(
|
||||
content: Column(children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 10),
|
||||
child: Image.asset('assets/images/bitmap.png',
|
||||
height: 224, width: 400),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 20, right: 20, bottom: 20),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: TextFormField(
|
||||
style: TextStyle(
|
||||
fontSize: 24.0,
|
||||
color: Theme.of(context).accentTextTheme.subtitle.color),
|
||||
controller: nameController,
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 24.0, color: Theme.of(context).hintColor),
|
||||
hintText: S.of(context).wallet_name,
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(color: Palette.cakeGreen, width: 2.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Theme.of(context).focusColor,
|
||||
width: 1.0))),
|
||||
validator: (value) {
|
||||
walletCreationStore.validateWalletName(value);
|
||||
return walletCreationStore.errorMessage;
|
||||
},
|
||||
)),
|
||||
),
|
||||
Padding(padding: EdgeInsets.only(bottom: 20),
|
||||
child: Text(
|
||||
S.of(context).seed_language_choose,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 16.0),
|
||||
return Container(
|
||||
color: PaletteDark.historyPanel,
|
||||
padding: EdgeInsets.only(top: 24),
|
||||
child: ScrollableWithBottomSection(
|
||||
contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
|
||||
content: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 12, right: 12),
|
||||
child: AspectRatio(
|
||||
aspectRatio: aspectRatioImage,
|
||||
child: FittedBox(child: walletNameImage, fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 24),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
child: TextFormField(
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white),
|
||||
controller: nameController,
|
||||
decoration: InputDecoration(
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 16.0,
|
||||
color: PaletteDark.walletCardText),
|
||||
hintText: S.of(context).wallet_name,
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
borderSide:
|
||||
BorderSide(
|
||||
color: PaletteDark.walletCardSubAddressField,
|
||||
width: 1.0)),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: PaletteDark.walletCardSubAddressField,
|
||||
width: 1.0))),
|
||||
validator: (value) {
|
||||
walletCreationStore.validateWalletName(value);
|
||||
return walletCreationStore.errorMessage;
|
||||
},
|
||||
)),
|
||||
),
|
||||
),
|
||||
Padding(padding: EdgeInsets.only(left: 20, right: 20, bottom: 20),
|
||||
child: SeedLanguagePicker(),
|
||||
)
|
||||
]),
|
||||
bottomSection: Observer(
|
||||
builder: (context) {
|
||||
return LoadingPrimaryButton(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
walletCreationStore.create(name: nameController.text,
|
||||
language: seedLanguageStore.selectedSeedLanguage);
|
||||
}
|
||||
},
|
||||
text: S.of(context).continue_text,
|
||||
color: Theme.of(context).primaryTextTheme.button.backgroundColor,
|
||||
borderColor:
|
||||
Theme.of(context).primaryTextTheme.button.decorationColor,
|
||||
isLoading: walletCreationStore.state is WalletIsCreating,
|
||||
);
|
||||
},
|
||||
));
|
||||
Padding(padding: EdgeInsets.only(top: 40),
|
||||
child: Text(
|
||||
S.of(context).seed_language_choose,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(padding: EdgeInsets.only(top: 24),
|
||||
child: Observer(
|
||||
builder: (_) => SelectButton(
|
||||
image: null,
|
||||
text: seedLocales[seedLanguages.indexOf(seedLanguageStore.selectedSeedLanguage)],
|
||||
color: PaletteDark.menuList,
|
||||
textColor: Colors.white,
|
||||
onTap: () {} // FIXME: apply picker
|
||||
)
|
||||
),
|
||||
)
|
||||
]),
|
||||
bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
|
||||
bottomSection: Observer(
|
||||
builder: (context) {
|
||||
return LoadingPrimaryButton(
|
||||
onPressed: () {
|
||||
if (_formKey.currentState.validate()) {
|
||||
walletCreationStore.create(name: nameController.text,
|
||||
language: seedLanguageStore.selectedSeedLanguage);
|
||||
}
|
||||
},
|
||||
text: S.of(context).continue_text,
|
||||
color: Colors.green,
|
||||
textColor: Colors.white,
|
||||
isLoading: walletCreationStore.state is WalletIsCreating,
|
||||
isDisabled: isDisabledButton,
|
||||
);
|
||||
},
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
|
||||
class NewWalletTypePage extends BasePage {
|
||||
@override
|
||||
String get title => S.current.new_wallet;
|
||||
|
||||
@override
|
||||
Color get backgroundColor => PaletteDark.historyPanel;
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) => WalletTypeForm();
|
||||
}
|
||||
|
||||
class WalletTypeForm extends StatefulWidget {
|
||||
@override
|
||||
WalletTypeFormState createState() => WalletTypeFormState();
|
||||
}
|
||||
|
||||
class WalletTypeFormState extends State<WalletTypeForm> {
|
||||
static const aspectRatioImage = 1.22;
|
||||
|
||||
final moneroIcon = Image.asset('assets/images/monero.png', height: 24, width: 24);
|
||||
final bitcoinIcon = Image.asset('assets/images/bitcoin.png', height: 24, width: 24);
|
||||
final walletTypeImage = Image.asset('assets/images/wallet_type.png');
|
||||
|
||||
bool isDisabledButton;
|
||||
bool isMoneroSelected;
|
||||
bool isBitcoinSelected;
|
||||
|
||||
Color moneroBackgroundColor;
|
||||
Color moneroTextColor;
|
||||
Color bitcoinBackgroundColor;
|
||||
Color bitcoinTextColor;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
isDisabledButton = true;
|
||||
isMoneroSelected = false;
|
||||
isBitcoinSelected = false;
|
||||
|
||||
moneroBackgroundColor = PaletteDark.menuList;
|
||||
moneroTextColor = Colors.white;
|
||||
bitcoinBackgroundColor = PaletteDark.menuList;
|
||||
bitcoinTextColor = Colors.white;
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: PaletteDark.historyPanel,
|
||||
padding: EdgeInsets.only(top: 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: walletTypeImage, fit: BoxFit.fill)),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 48),
|
||||
child: Text(
|
||||
'Please choose wallet currency:',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.white
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 24),
|
||||
child: SelectButton(
|
||||
image: bitcoinIcon,
|
||||
text: 'Bitcoin',
|
||||
color: bitcoinBackgroundColor,
|
||||
textColor: bitcoinTextColor,
|
||||
onTap: () => onSelectBitcoinButton()),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: SelectButton(
|
||||
image: moneroIcon,
|
||||
text: 'Monero',
|
||||
color: moneroBackgroundColor,
|
||||
textColor: moneroTextColor,
|
||||
onTap: () => onSelectMoneroButton()),
|
||||
)
|
||||
],
|
||||
),
|
||||
bottomSectionPadding: EdgeInsets.only(
|
||||
left: 24,
|
||||
right: 24,
|
||||
bottom: 24
|
||||
),
|
||||
bottomSection: PrimaryButton(
|
||||
onPressed: () => Navigator.of(context).pushNamed(Routes.newWallet),
|
||||
text: S.of(context).seed_language_next,
|
||||
color: Colors.green,
|
||||
textColor: Colors.white,
|
||||
isDisabled: isDisabledButton,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void onSelectMoneroButton() {
|
||||
isMoneroSelected = true;
|
||||
isBitcoinSelected = false;
|
||||
isDisabledButton = false;
|
||||
|
||||
moneroBackgroundColor = Colors.white;
|
||||
moneroTextColor = PaletteDark.selectButtonText;
|
||||
bitcoinBackgroundColor = PaletteDark.menuList;
|
||||
bitcoinTextColor = Colors.white;
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
void onSelectBitcoinButton() {
|
||||
isMoneroSelected = false;
|
||||
isBitcoinSelected = true;
|
||||
isDisabledButton = false;
|
||||
|
||||
moneroBackgroundColor = PaletteDark.menuList;
|
||||
moneroTextColor = Colors.white;
|
||||
bitcoinBackgroundColor = Colors.white;
|
||||
bitcoinTextColor = PaletteDark.selectButtonText;
|
||||
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SelectButton extends StatelessWidget {
|
||||
SelectButton({
|
||||
@required this.image,
|
||||
@required this.text,
|
||||
@required this.color,
|
||||
@required this.textColor,
|
||||
@required this.onTap,
|
||||
});
|
||||
|
||||
final Image image;
|
||||
final String text;
|
||||
final Color color;
|
||||
final Color textColor;
|
||||
final VoidCallback onTap;
|
||||
|
||||
final selectArrowImage = Image.asset('assets/images/select_arrow.png');
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 60,
|
||||
padding: EdgeInsets.only(left: 30, right: 30),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
color: color
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
image != null
|
||||
? image
|
||||
: Offstage(),
|
||||
Padding(
|
||||
padding: image != null
|
||||
? EdgeInsets.only(left: 15)
|
||||
: EdgeInsets.only(left: 0),
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: textColor
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
selectArrowImage
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -33,8 +33,7 @@ class RescanPage extends BasePage {
|
||||
},
|
||||
color:
|
||||
Theme.of(context).primaryTextTheme.button.backgroundColor,
|
||||
borderColor:
|
||||
Theme.of(context).primaryTextTheme.button.decorationColor))
|
||||
textColor: Theme.of(context).primaryTextTheme.button.color,))
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -217,8 +217,7 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
|
||||
},
|
||||
text: S.of(context).restore_recover,
|
||||
color: Theme.of(context).primaryTextTheme.button.backgroundColor,
|
||||
borderColor:
|
||||
Theme.of(context).primaryTextTheme.button.decorationColor);
|
||||
textColor: Theme.of(context).primaryTextTheme.button.color,);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -118,8 +118,7 @@ class _RestoreFromSeedDetailsFormState
|
||||
isLoading: walletRestorationStore.state is WalletIsRestoring,
|
||||
text: S.of(context).restore_recover,
|
||||
color: Theme.of(context).primaryTextTheme.button.backgroundColor,
|
||||
borderColor:
|
||||
Theme.of(context).primaryTextTheme.button.decorationColor);
|
||||
textColor: Theme.of(context).primaryTextTheme.button.color,);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -436,8 +436,7 @@ class SendFormState extends State<SendForm> {
|
||||
: null,
|
||||
text: S.of(context).send,
|
||||
color: Theme.of(context).accentTextTheme.button.backgroundColor,
|
||||
borderColor:
|
||||
Theme.of(context).accentTextTheme.button.decorationColor,
|
||||
textColor: Theme.of(context).primaryTextTheme.button.color,
|
||||
isLoading: sendStore.state is CreatingTransaction ||
|
||||
sendStore.state is TransactionCommiting);
|
||||
}));
|
||||
|
||||
@@ -89,10 +89,7 @@ class NewSubaddressFormState extends State<NewSubaddressForm> {
|
||||
.accentTextTheme
|
||||
.button
|
||||
.backgroundColor,
|
||||
borderColor: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.button
|
||||
.decorationColor,
|
||||
textColor: Theme.of(context).primaryTextTheme.button.color,
|
||||
isLoading:
|
||||
subaddressCreationStore.state is SubaddressIsCreating),
|
||||
))
|
||||
|
||||
@@ -4,12 +4,16 @@ import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
||||
|
||||
class WelcomePage extends BasePage {
|
||||
static const _aspectRatioImage = 1.26;
|
||||
static const _baseWidth = 411.43;
|
||||
final _image = Image.asset('assets/images/welcomeImg.png');
|
||||
final _cakeLogo = Image.asset('assets/images/cake_logo.png');
|
||||
static const aspectRatioImage = 1.25;
|
||||
final welcomeImage = Image.asset('assets/images/welcome.png');
|
||||
final newWalletImage = Image.asset('assets/images/new_wallet.png', height: 12, width: 12, color: PaletteDark.historyPanel);
|
||||
final restoreWalletImage = Image.asset('assets/images/restore_wallet.png', height: 12, width: 12, color: Colors.white);
|
||||
|
||||
@override
|
||||
Color get backgroundColor => PaletteDark.historyPanel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -21,75 +25,89 @@ class WelcomePage extends BasePage {
|
||||
|
||||
@override
|
||||
Widget body(BuildContext context) {
|
||||
final _screenWidth = MediaQuery.of(context).size.width;
|
||||
final textScaleFactor = _screenWidth < _baseWidth ? 0.76 : 1.0;
|
||||
|
||||
return Column(children: <Widget>[
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
AspectRatio(
|
||||
aspectRatio: _aspectRatioImage,
|
||||
child: FittedBox(child: _image, fit: BoxFit.fill)),
|
||||
Positioned(bottom: 0.0, child: _cakeLogo)
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).welcome,
|
||||
style: TextStyle(
|
||||
fontSize: 30.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
textScaleFactor: textScaleFactor,
|
||||
textAlign: TextAlign.center,
|
||||
return Container(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
color: PaletteDark.historyPanel,
|
||||
child: ScrollableWithBottomSection(
|
||||
contentPadding: EdgeInsets.only(bottom: 20),
|
||||
content: Column(
|
||||
children: <Widget>[
|
||||
AspectRatio(
|
||||
aspectRatio: aspectRatioImage,
|
||||
child: FittedBox(child: welcomeImage, fit: BoxFit.fill)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(left: 24, right: 24, top: 40),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
S.of(context).welcome,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: PaletteDark.walletCardText,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: Text(
|
||||
S.of(context).cake_wallet,
|
||||
style: TextStyle(
|
||||
fontSize: 36,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 14),
|
||||
child: Text(
|
||||
S.of(context).first_wallet_text,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: PaletteDark.walletCardText,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
S.of(context).first_wallet_text,
|
||||
style: TextStyle(
|
||||
fontSize: 22.0,
|
||||
color: Palette.lightBlue,
|
||||
),
|
||||
textScaleFactor: textScaleFactor,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Text(
|
||||
S.of(context).please_make_selection,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
color: Palette.lightBlue,
|
||||
),
|
||||
textScaleFactor: textScaleFactor,
|
||||
textAlign: TextAlign.center,
|
||||
)
|
||||
]),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
|
||||
child: Column(children: <Widget>[
|
||||
PrimaryButton(
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(context, Routes.newWalletFromWelcome);
|
||||
},
|
||||
text: S.of(context).create_new,
|
||||
color:
|
||||
Theme.of(context).primaryTextTheme.button.backgroundColor,
|
||||
textColor:
|
||||
Theme.of(context).primaryTextTheme.button.color),
|
||||
SizedBox(height: 10),
|
||||
PrimaryButton(
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(context, Routes.restoreOptions);
|
||||
},
|
||||
color: Theme.of(context).accentTextTheme.caption.backgroundColor,
|
||||
textColor:
|
||||
Theme.of(context).primaryTextTheme.button.color,
|
||||
text: S.of(context).restore_wallet,
|
||||
)
|
||||
]))
|
||||
]);
|
||||
],
|
||||
),
|
||||
bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 20),
|
||||
bottomSection: Column(children: <Widget>[
|
||||
Text(
|
||||
S.of(context).please_make_selection,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: PaletteDark.walletCardText,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 24),
|
||||
child: PrimaryImageButton(
|
||||
onPressed: () => Navigator.pushNamed(context, Routes.newWalletFromWelcome),
|
||||
image: newWalletImage,
|
||||
text: S.of(context).create_new,
|
||||
color: Colors.white,
|
||||
textColor: PaletteDark.historyPanel),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 10),
|
||||
child: PrimaryImageButton(
|
||||
onPressed: () => Navigator.pushNamed(context, Routes.restoreOptions),
|
||||
image: restoreWalletImage,
|
||||
text: S.of(context).restore_wallet,
|
||||
color: PaletteDark.historyPanelButton,
|
||||
textColor: Colors.white),
|
||||
)
|
||||
]),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/palette.dart';
|
||||
|
||||
class PrimaryButton extends StatelessWidget {
|
||||
const PrimaryButton(
|
||||
@@ -27,7 +26,8 @@ class PrimaryButton extends StatelessWidget {
|
||||
onPressed: isDisabled
|
||||
? (onDisabledPressed != null ? onDisabledPressed : null)
|
||||
: onPressed,
|
||||
color: isDisabled ? Colors.transparent : color,
|
||||
color: color,
|
||||
disabledColor: color.withOpacity(0.5),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(26.0)),
|
||||
child: Text(text,
|
||||
@@ -35,8 +35,9 @@ class PrimaryButton extends StatelessWidget {
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isDisabled
|
||||
? Palette.darkGrey
|
||||
: textColor)),
|
||||
? Colors.grey.withOpacity(0.5)
|
||||
: textColor
|
||||
)),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -46,13 +47,13 @@ class LoadingPrimaryButton extends StatelessWidget {
|
||||
{@required this.onPressed,
|
||||
@required this.text,
|
||||
@required this.color,
|
||||
@required this.borderColor,
|
||||
@required this.textColor,
|
||||
this.isDisabled = false,
|
||||
this.isLoading = false});
|
||||
|
||||
final VoidCallback onPressed;
|
||||
final Color color;
|
||||
final Color borderColor;
|
||||
final Color textColor;
|
||||
final bool isLoading;
|
||||
final bool isDisabled;
|
||||
final String text;
|
||||
@@ -61,19 +62,23 @@ class LoadingPrimaryButton extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return ButtonTheme(
|
||||
minWidth: double.infinity,
|
||||
height: 56.0,
|
||||
height: 52.0,
|
||||
child: FlatButton(
|
||||
onPressed: (isLoading || isDisabled) ? null : onPressed,
|
||||
color: color,
|
||||
disabledColor: color.withOpacity(0.5),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(color: borderColor),
|
||||
borderRadius: BorderRadius.circular(10.0)),
|
||||
borderRadius: BorderRadius.circular(26.0)),
|
||||
child: isLoading
|
||||
? CupertinoActivityIndicator(animating: true)
|
||||
: Text(text,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
color: Theme.of(context).primaryTextTheme.button.color)),
|
||||
style: TextStyle(
|
||||
fontSize: 15.0,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: isDisabled
|
||||
? Colors.grey.withOpacity(0.5)
|
||||
: textColor
|
||||
)),
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -179,34 +184,6 @@ class PrimaryImageButton extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
)
|
||||
/*Row(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
width: 28.0,
|
||||
height: 56.0,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle, color: Colors.transparent),
|
||||
child: image,
|
||||
),
|
||||
Expanded(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 56.0,
|
||||
child: Center(
|
||||
child: Text(text,
|
||||
style: TextStyle(
|
||||
fontSize: 18.0,
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.button
|
||||
.color)),
|
||||
),
|
||||
)
|
||||
]))
|
||||
],
|
||||
),*/
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user