Merge branch 'dev' of github.com:cake-tech/cake_wallet_private into new-world

This commit is contained in:
M
2020-09-15 23:52:00 +03:00
45 changed files with 1209 additions and 1741 deletions
+1
View File
@@ -73,6 +73,7 @@ abstract class BasePage extends StatelessWidget {
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: titleColor ??
Theme.of(context).primaryTextTheme.title.color),
);
@@ -197,7 +197,7 @@ class ContactListPage extends BasePage {
Image image;
switch (currency) {
case CryptoCurrency.xmr:
image = Image.asset('assets/images/monero.png', height: 24, width: 24);
image = Image.asset('assets/images/monero_logo.png', height: 24, width: 24);
break;
case CryptoCurrency.ada:
image = Image.asset('assets/images/ada.png', height: 24, width: 24);
@@ -252,10 +252,10 @@ class ContactListPage extends BasePage {
return AlertWithTwoActions(
alertTitle: S.of(context).address_remove_contact,
alertContent: S.of(context).address_remove_content,
leftButtonText: S.of(context).remove,
rightButtonText: S.of(context).cancel,
actionLeftButton: () => Navigator.of(context).pop(true),
actionRightButton: () => Navigator.of(context).pop(false));
rightButtonText: S.of(context).remove,
leftButtonText: S.of(context).cancel,
actionRightButton: () => Navigator.of(context).pop(true),
actionLeftButton: () => Navigator.of(context).pop(false));
});
}
@@ -267,10 +267,10 @@ class ContactListPage extends BasePage {
return AlertWithTwoActions(
alertTitle: name,
alertContent: address,
leftButtonText: S.of(context).copy,
rightButtonText: S.of(context).cancel,
actionLeftButton: () => Navigator.of(context).pop(true),
actionRightButton: () => Navigator.of(context).pop(false));
rightButtonText: S.of(context).copy,
leftButtonText: S.of(context).cancel,
actionRightButton: () => Navigator.of(context).pop(true),
actionLeftButton: () => Navigator.of(context).pop(false));
});
}
}
+2 -2
View File
@@ -115,7 +115,7 @@ class ContactPage extends BasePage {
_addressController.text = '';
},
text: S.of(context).reset,
color: Colors.red,
color: Colors.orange,
textColor: Colors.white),
),
SizedBox(width: 20),
@@ -130,7 +130,7 @@ class ContactPage extends BasePage {
await contactViewModel.save();
},
text: S.of(context).save,
color: Palette.blueCraiola,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white,
isDisabled: !contactViewModel.isReady)))
],
+15 -3
View File
@@ -104,9 +104,12 @@ class DashboardPage extends BasePage {
)),
Container(
width: double.infinity,
padding: EdgeInsets.only(left: 44, right: 0, bottom: 24),
padding: EdgeInsets.only(
left: 45,
right: 45,
bottom: 24
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Flexible(
child: ActionButton(
@@ -120,7 +123,16 @@ class DashboardPage extends BasePage {
child: ActionButton(
image: exchangeImage,
title: S.of(context).exchange,
route: Routes.exchange),
route: Routes.exchange
),
),
Flexible(
child: ActionButton(
image: receiveImage,
title: S.of(context).receive,
route: Routes.receive,
alignment: Alignment.centerRight,
),
)
],
),
+5 -5
View File
@@ -49,7 +49,7 @@ class WalletMenu {
Navigator.of(context).pushNamed(Routes.auth,
arguments: (bool isAuthenticatedSuccessfully, AuthPageState auth) =>
isAuthenticatedSuccessfully
? Navigator.of(auth.context).popAndPushNamed(Routes.seed)
? Navigator.of(auth.context).popAndPushNamed(Routes.seed, arguments: false)
: null);
break;
@@ -79,13 +79,13 @@ class WalletMenu {
return AlertWithTwoActions(
alertTitle: S.of(context).reconnection,
alertContent: S.of(context).reconnect_alert_text,
leftButtonText: S.of(context).ok,
rightButtonText: S.of(context).cancel,
actionLeftButton: () async {
rightButtonText: S.of(context).ok,
leftButtonText: S.of(context).cancel,
actionRightButton: () async {
await reconnect?.call();
Navigator.of(context).pop();
},
actionRightButton: () => Navigator.of(context).pop());
actionLeftButton: () => Navigator.of(context).pop());
});
}
}
@@ -1,5 +1,4 @@
import 'dart:ui';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/src/domain/exchange/exchange_template.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/src/widgets/template_tile.dart';
@@ -39,12 +38,14 @@ class BaseExchangeWidget extends StatefulWidget {
final bool isTemplate;
@override
BaseExchangeWidgetState createState() => BaseExchangeWidgetState(
exchangeViewModel: exchangeViewModel,
leading: leading,
middle: middle,
trailing: trailing,
isTemplate: isTemplate);
BaseExchangeWidgetState createState() =>
BaseExchangeWidgetState(
exchangeViewModel: exchangeViewModel,
leading: leading,
middle: middle,
trailing: trailing,
isTemplate: isTemplate
);
}
class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
@@ -82,16 +83,16 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
);
final depositWalletName =
exchangeViewModel.depositCurrency == CryptoCurrency.xmr
? exchangeViewModel.wallet.name
: null;
exchangeViewModel.depositCurrency == CryptoCurrency.xmr
? exchangeViewModel.wallet.name
: null;
final receiveWalletName =
exchangeViewModel.receiveCurrency == CryptoCurrency.xmr
? exchangeViewModel.wallet.name
: null;
exchangeViewModel.receiveCurrency == CryptoCurrency.xmr
? exchangeViewModel.wallet.name
: null;
WidgetsBinding.instance
.addPostFrameCallback((_) => _setReactions(context, exchangeViewModel));
WidgetsBinding.instance.addPostFrameCallback(
(_) => _setReactions(context, exchangeViewModel));
return Form(
key: _formKey,
@@ -103,28 +104,21 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
gradient: LinearGradient(colors: [
Theme.of(context).primaryTextTheme.body1.color,
Theme.of(context).primaryTextTheme.body1.decorationColor,
], stops: [
0.35,
1.0
], begin: Alignment.topLeft, end: Alignment.bottomRight),
],
stops: [0.35, 1.0],
begin: Alignment.topLeft,
end: Alignment.bottomRight),
edgeInsets: EdgeInsets.only(bottom: 32),
widget: Column(
children: <Widget>[
TopPanel(
edgeInsets: EdgeInsets.all(0),
gradient: LinearGradient(
colors: [
Theme.of(context)
.primaryTextTheme
.subtitle
.color,
Theme.of(context)
.primaryTextTheme
.subtitle
.decorationColor,
],
begin: Alignment.topLeft,
end: Alignment.bottomRight),
gradient: LinearGradient(colors: [
Theme.of(context).primaryTextTheme.subtitle.color,
Theme.of(context).primaryTextTheme.subtitle.decorationColor,
],
begin: Alignment.topLeft,
end: Alignment.bottomRight),
widget: Column(
children: <Widget>[
CupertinoNavigationBar(
@@ -307,33 +301,19 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
context: context,
builder: (dialogContext) {
return AlertWithTwoActions(
alertTitle:
S.of(context).template,
alertContent: S
.of(context)
.confirm_delete_template,
leftButtonText:
S.of(context).delete,
rightButtonText:
S.of(context).cancel,
actionLeftButton: () {
Navigator.of(
dialogContext)
.pop();
exchangeViewModel
.exchangeTemplateStore
.remove(
template:
template);
exchangeViewModel
.exchangeTemplateStore
.update();
alertTitle: S.of(context).template,
alertContent: S.of(context).confirm_delete_template,
rightButtonText: S.of(context).delete,
leftButtonText: S.of(context).cancel,
actionRightButton: () {
Navigator.of(dialogContext).pop();
exchangeViewModel.exchangeTemplateStore.remove(template: template);
exchangeViewModel.exchangeTemplateStore.update();
},
actionRightButton: () =>
Navigator.of(
dialogContext)
.pop());
});
actionLeftButton: () => Navigator.of(dialogContext).pop()
);
}
);
},
);
});
@@ -387,24 +367,23 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> {
color: Colors.green,
textColor: Colors.white)
: Observer(
builder: (_) => LoadingPrimaryButton(
text: S.of(context).exchange,
onPressed: () {
if (_formKey.currentState.validate()) {
exchangeViewModel.createTrade();
}
},
color: Palette.blueCraiola,
textColor: Colors.white,
isLoading:
exchangeViewModel.tradeState is TradeIsCreating,
)),
builder: (_) => LoadingPrimaryButton(
text: S.of(context).exchange,
onPressed: () {
if (_formKey.currentState.validate()) {
exchangeViewModel.createTrade();
}
},
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white,
isLoading: exchangeViewModel.tradeState is TradeIsCreating,
)),
]),
));
}
void applyTemplate(
ExchangeViewModel exchangeViewModel, ExchangeTemplate template) {
void applyTemplate(ExchangeViewModel exchangeViewModel,
ExchangeTemplate template) {
exchangeViewModel.changeDepositCurrency(
currency: CryptoCurrency.fromString(template.depositCurrency));
exchangeViewModel.changeReceiveCurrency(
@@ -7,7 +7,6 @@ import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/domain/exchange/trade.dart';
import 'package:cake_wallet/palette.dart';
class ExchangeConfirmPage extends BasePage {
ExchangeConfirmPage({@required this.tradesStore}) : trade = tradesStore.trade;
@@ -115,7 +114,7 @@ class ExchangeConfirmPage extends BasePage {
onPressed: () => Navigator.of(context)
.pushReplacementNamed(Routes.exchangeTrade),
text: S.of(context).saved_the_trade_id,
color: Palette.blueCraiola,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white)
],
),
@@ -220,7 +220,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
bottomSection: PrimaryButton(
onPressed: () {},
text: S.of(context).confirm,
color: Palette.blueCraiola,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white
)
/*Observer(
@@ -53,6 +53,7 @@ class MoneroAccountListPage extends StatelessWidget {
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
decoration: TextDecoration.none,
color: Colors.white
),
@@ -123,7 +124,7 @@ class MoneroAccountListPage extends StatelessWidget {
.pushNamed(Routes.accountCreation),
child: Container(
height: 62,
color: Theme.of(context).textTheme.subtitle.decorationColor,
color: Theme.of(context).cardColor,
padding: EdgeInsets.only(left: 24, right: 24),
child: Center(
child: Row(
@@ -140,6 +141,7 @@ class MoneroAccountListPage extends StatelessWidget {
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
color: Colors.white,
decoration: TextDecoration.none,
),
@@ -32,6 +32,7 @@ class AccountTile extends StatelessWidget {
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins',
color: textColor,
decoration: TextDecoration.none,
),
@@ -1,4 +1,5 @@
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:mobx/mobx.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -53,7 +54,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
_stateReaction ??=
reaction((_) => _walletNewVM.state, (WalletCreationState state) {
if (state is WalletCreatedSuccessfully) {
Navigator.of(context).popUntil((route) => route.isFirst);
Navigator.of(context).popAndPushNamed(Routes.seed, arguments: true);
}
if (state is WalletCreationFailure) {
@@ -38,7 +38,7 @@ class WalletTypeFormState extends State<WalletTypeForm> {
static const aspectRatioImage = 1.22;
final moneroIcon =
Image.asset('assets/images/monero.png', height: 24, width: 24);
Image.asset('assets/images/monero_logo.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');
@@ -1,4 +1,3 @@
import 'package:cake_wallet/palette.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -137,7 +136,7 @@ class NodeCreateOrEditPage extends BasePage {
child: PrimaryButton(
onPressed: () => nodeCreateOrEditViewModel.reset(),
text: S.of(context).reset,
color: Colors.red,
color: Colors.orange,
textColor: Colors.white),
)),
Flexible(
@@ -153,7 +152,7 @@ class NodeCreateOrEditPage extends BasePage {
Navigator.of(context).pop();
},
text: S.of(context).save,
color: Palette.blueCraiola,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white,
isDisabled: !nodeCreateOrEditViewModel.isReady,
),
+8 -8
View File
@@ -36,13 +36,13 @@ class NodeListPage extends BasePage {
alertTitle: S.of(context).node_reset_settings_title,
alertContent:
S.of(context).nodes_list_reset_to_default_message,
leftButtonText: S.of(context).reset,
rightButtonText: S.of(context).cancel,
actionLeftButton: () async {
rightButtonText: S.of(context).reset,
leftButtonText: S.of(context).cancel,
actionRightButton: () async {
Navigator.of(context).pop();
await nodeListViewModel.reset();
},
actionRightButton: () => Navigator.of(context).pop());
actionLeftButton: () => Navigator.of(context).pop());
});
},
child: Text(
@@ -116,11 +116,11 @@ class NodeListPage extends BasePage {
return AlertWithTwoActions(
alertTitle: S.of(context).remove_node,
alertContent: S.of(context).remove_node_message,
leftButtonText: S.of(context).remove,
rightButtonText: S.of(context).cancel,
actionLeftButton: () =>
Navigator.pop(context, true),
rightButtonText: S.of(context).remove,
leftButtonText: S.of(context).cancel,
actionRightButton: () =>
Navigator.pop(context, true),
actionLeftButton: () =>
Navigator.pop(context, false));
});
},
@@ -171,7 +171,19 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
onHeightChange: (height) {
widget.walletRestorationFromKeysVM.height = height;
print(height);
})],
}),
Padding(
padding: EdgeInsets.only(left: 40, right: 40, top: 24),
child: Text(
S.of(context).restore_from_date_or_blockheight,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.normal,
color: Theme.of(context).hintColor
),
),
)],
]),
),
bottomSectionPadding: EdgeInsets.only(bottom: 24),
@@ -189,7 +201,7 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> {
}
},
text: S.of(context).restore_recover,
color: Palette.blueCraiola,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white,
//isDisabled: walletRestorationStore.disabledState,
);
@@ -1,4 +1,3 @@
import 'package:cake_wallet/palette.dart';
import 'package:mobx/mobx.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -101,13 +100,26 @@ class _RestoreFromSeedDetailsFormState
))
],
),
if (widget.walletRestorationFromSeedVM.hasRestorationHeight)
if (widget.walletRestorationFromSeedVM.hasRestorationHeight) ... [
BlockchainHeightWidget(
key: _blockchainHeightKey,
onHeightChange: (height) {
widget.walletRestorationFromSeedVM.height = height;
print(height);
}),
Padding(
padding: EdgeInsets.only(left: 40, right: 40, top: 24),
child: Text(
S.of(context).restore_from_date_or_blockheight,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.normal,
color: Theme.of(context).hintColor
),
),
)
]
]),
),
bottomSectionPadding: EdgeInsets.only(bottom: 24),
@@ -121,7 +133,7 @@ class _RestoreFromSeedDetailsFormState
isLoading:
widget.walletRestorationFromSeedVM.state is WalletCreating,
text: S.of(context).restore_recover,
color: Palette.blueCraiola,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white,
isDisabled: _nameController.text.isNotEmpty,
);
@@ -6,7 +6,6 @@ import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/widgets/seed_widget.dart';
import 'package:cake_wallet/src/domain/common/wallet_type.dart';
import 'package:cake_wallet/core/seed_validator.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/core/mnemonic_length.dart';
class RestoreWalletFromSeedPage extends BasePage {
+74 -51
View File
@@ -1,17 +1,18 @@
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'package:esys_flutter_share/esys_flutter_share.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/themes.dart';
import 'package:cake_wallet/theme_changer.dart';
import 'package:cake_wallet/view_model/wallet_seed_view_model.dart';
class WalletSeedPage extends BasePage {
WalletSeedPage(this.walletSeedViewModel, {this.onCloseCallback});
WalletSeedPage(this.walletSeedViewModel, {@required this.isNewWalletCreated});
static final imageLight = Image.asset('assets/images/crypto_lock_light.png');
static final imageDark = Image.asset('assets/images/crypto_lock.png');
@@ -19,36 +20,38 @@ class WalletSeedPage extends BasePage {
@override
String get title => S.current.seed_title;
final VoidCallback onCloseCallback;
final bool isNewWalletCreated;
final WalletSeedViewModel walletSeedViewModel;
@override
void onClose(BuildContext context) =>
onCloseCallback != null ? onCloseCallback() : Navigator.of(context).pop();
isNewWalletCreated
? Navigator.of(context).popUntil((route) => route.isFirst)
: Navigator.of(context).pop();
@override
Widget leading(BuildContext context) =>
onCloseCallback != null ? Offstage() : super.leading(context);
isNewWalletCreated ? Offstage() : super.leading(context);
@override
Widget trailing(BuildContext context) {
return onCloseCallback != null
return isNewWalletCreated
? GestureDetector(
onTap: () => onClose(context),
child: Container(
width: 100,
height: 42,
height: 32,
alignment: Alignment.center,
margin: EdgeInsets.only(left: 10),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(16)),
color: Theme.of(context).accentTextTheme.title.color),
color: Theme.of(context).accentTextTheme.caption.color),
child: Text(
S.of(context).seed_language_next,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Colors.blue),
color: Palette.blueCraiola),
),
),
)
@@ -57,9 +60,7 @@ class WalletSeedPage extends BasePage {
@override
Widget body(BuildContext context) {
final _themeChanger = Provider.of<ThemeChanger>(context);
final image =
_themeChanger.getTheme() == Themes.darkTheme ? imageDark : imageLight;
final image = getIt.get<SettingsStore>().isDarkTheme ? imageDark : imageLight;
return Container(
padding: EdgeInsets.all(24),
@@ -85,19 +86,20 @@ class WalletSeedPage extends BasePage {
walletSeedViewModel.name,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme
.title
.color),
),
Padding(
padding: EdgeInsets.only(top: 20),
padding: EdgeInsets.only(top: 20, left: 16, right: 16),
child: Text(
walletSeedViewModel.seed,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
color: Theme.of(context)
.primaryTextTheme
.caption
@@ -108,42 +110,63 @@ class WalletSeedPage extends BasePage {
);
}),
),
Row(
mainAxisSize: MainAxisSize.max,
Column(
children: <Widget>[
Flexible(
child: Container(
padding: EdgeInsets.only(right: 8.0),
child: PrimaryButton(
onPressed: () => Share.text(
S.of(context).seed_share,
walletSeedViewModel.seed,
'text/plain'),
text: S.of(context).save,
color: Colors.green,
textColor: Colors.white),
)),
Flexible(
child: Container(
padding: EdgeInsets.only(left: 8.0),
child: Builder(
builder: (context) => PrimaryButton(
onPressed: () {
Clipboard.setData(ClipboardData(
text: walletSeedViewModel.seed));
Scaffold.of(context).showSnackBar(
SnackBar(
content: Text(
S.of(context).copied_to_clipboard),
backgroundColor: Colors.green,
duration: Duration(milliseconds: 1500),
),
);
},
text: S.of(context).copy,
color: Colors.blue,
textColor: Colors.white)),
))
isNewWalletCreated
? Padding(
padding: EdgeInsets.only(bottom: 52, left: 43, right: 43),
child: Text(
S.of(context).seed_reminder,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.normal,
color: Theme.of(context)
.primaryTextTheme
.overline
.color
),
),
)
: Offstage(),
Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Flexible(
child: Container(
padding: EdgeInsets.only(right: 8.0),
child: PrimaryButton(
onPressed: () => Share.text(
S.of(context).seed_share,
walletSeedViewModel.seed,
'text/plain'),
text: S.of(context).save,
color: Colors.green,
textColor: Colors.white),
)),
Flexible(
child: Container(
padding: EdgeInsets.only(left: 8.0),
child: Builder(
builder: (context) => PrimaryButton(
onPressed: () {
Clipboard.setData(ClipboardData(
text: walletSeedViewModel.seed));
Scaffold.of(context).showSnackBar(
SnackBar(
content: Text(
S.of(context).copied_to_clipboard),
backgroundColor: Colors.green,
duration: Duration(milliseconds: 1500),
),
);
},
text: S.of(context).copy,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white)),
))
],
)
],
)
],
+281 -281
View File
@@ -26,9 +26,9 @@ import 'package:cake_wallet/routes.dart';
class BaseSendWidget extends StatelessWidget {
BaseSendWidget(
{@required this.sendViewModel,
@required this.leading,
@required this.middle,
this.isTemplate = false});
@required this.leading,
@required this.middle,
this.isTemplate = false});
final SendViewModel sendViewModel;
final bool isTemplate;
@@ -73,25 +73,25 @@ class BaseSendWidget extends StatelessWidget {
children: <Widget>[
isTemplate
? BaseTextFormField(
controller: _nameController,
hintText: S.of(context).send_name,
borderColor: Theme.of(context)
.primaryTextTheme
.headline
.color,
textStyle: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: Colors.white),
placeholderTextStyle: TextStyle(
color: Theme.of(context)
.primaryTextTheme
.headline
.decorationColor,
fontWeight: FontWeight.w500,
fontSize: 14),
validator: sendViewModel.templateValidator,
)
controller: _nameController,
hintText: S.of(context).send_name,
borderColor: Theme.of(context)
.primaryTextTheme
.headline
.color,
textStyle: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: Colors.white),
placeholderTextStyle: TextStyle(
color: Theme.of(context)
.primaryTextTheme
.headline
.decorationColor,
fontWeight: FontWeight.w500,
fontSize: 14),
validator: sendViewModel.templateValidator,
)
: Offstage(),
Padding(
padding: EdgeInsets.only(top: isTemplate ? 20 : 0),
@@ -121,9 +121,9 @@ class BaseSendWidget extends StatelessWidget {
AddressTextFieldOption.addressBook
],
buttonColor:
Theme.of(context).primaryTextTheme.display1.color,
Theme.of(context).primaryTextTheme.display1.color,
borderColor:
Theme.of(context).primaryTextTheme.headline.color,
Theme.of(context).primaryTextTheme.headline.color,
textStyle: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
@@ -152,43 +152,43 @@ class BaseSendWidget extends StatelessWidget {
prefixIcon: Padding(
padding: EdgeInsets.only(top: 9),
child:
Text(sendViewModel.currency.title + ':',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.white,
)),
Text(sendViewModel.currency.title + ':',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.white,
)),
),
suffixIcon: isTemplate
? Offstage()
: Container(
height: 32,
width: 32,
margin: EdgeInsets.only(
left: 14, top: 4, bottom: 10),
decoration: BoxDecoration(
color: Theme.of(context)
.primaryTextTheme
.display1
.color,
borderRadius: BorderRadius.all(
Radius.circular(6))),
child: InkWell(
onTap: () =>
sendViewModel.setSendAll(),
child: Center(
child: Text(S.of(context).all,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Theme.of(context)
.primaryTextTheme
.display1
.decorationColor)),
),
),
),
height: 32,
width: 32,
margin: EdgeInsets.only(
left: 14, top: 4, bottom: 10),
decoration: BoxDecoration(
color: Theme.of(context)
.primaryTextTheme
.display1
.color,
borderRadius: BorderRadius.all(
Radius.circular(6))),
child: InkWell(
onTap: () =>
sendViewModel.setSendAll(),
child: Center(
child: Text(S.of(context).all,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Theme.of(context)
.primaryTextTheme
.display1
.decorationColor)),
),
),
),
hintText: '0.0000',
borderColor: Theme.of(context)
.primaryTextTheme
@@ -210,37 +210,37 @@ class BaseSendWidget extends StatelessWidget {
isTemplate
? Offstage()
: Observer(
builder: (_) => Padding(
padding: EdgeInsets.only(top: 10),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Text(
S.of(context).available_balance + ':',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme
.headline
.decorationColor),
)),
Text(
sendViewModel.balance,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme
.headline
.decorationColor),
)
],
),
)),
builder: (_) => Padding(
padding: EdgeInsets.only(top: 10),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Text(
S.of(context).available_balance + ':',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme
.headline
.decorationColor),
)),
Text(
sendViewModel.balance,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme
.headline
.decorationColor),
)
],
),
)),
Padding(
padding: const EdgeInsets.only(top: 20),
child: BaseTextFormField(
@@ -280,52 +280,52 @@ class BaseSendWidget extends StatelessWidget {
isTemplate
? Offstage()
: Observer(
builder: (_) => GestureDetector(
onTap: () =>
_setTransactionPriority(context),
child: Container(
padding: EdgeInsets.only(top: 24),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(S.of(context).send_estimated_fee,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
//color: Theme.of(context).primaryTextTheme.display2.color,
color: Colors.white)),
Container(
child: Row(
children: <Widget>[
Text(
sendViewModel.estimatedFee
.toString() +
' ' +
sendViewModel
.currency.title,
style: TextStyle(
fontSize: 12,
fontWeight:
FontWeight.w600,
//color: Theme.of(context).primaryTextTheme.display2.color,
color: Colors.white)),
Padding(
padding:
EdgeInsets.only(left: 5),
child: Icon(
Icons.arrow_forward_ios,
size: 12,
color: Colors.white,
),
)
],
),
)
],
),
builder: (_) => GestureDetector(
onTap: () =>
_setTransactionPriority(context),
child: Container(
padding: EdgeInsets.only(top: 24),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(S.of(context).send_estimated_fee,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w500,
//color: Theme.of(context).primaryTextTheme.display2.color,
color: Colors.white)),
Container(
child: Row(
children: <Widget>[
Text(
sendViewModel.estimatedFee
.toString() +
' ' +
sendViewModel
.currency.title,
style: TextStyle(
fontSize: 12,
fontWeight:
FontWeight.w600,
//color: Theme.of(context).primaryTextTheme.display2.color,
color: Colors.white)),
Padding(
padding:
EdgeInsets.only(left: 5),
child: Icon(
Icons.arrow_forward_ios,
size: 12,
color: Colors.white,
),
)
],
),
))
)
],
),
),
))
],
),
)
@@ -335,156 +335,156 @@ class BaseSendWidget extends StatelessWidget {
isTemplate
? Offstage()
: Padding(
padding: EdgeInsets.only(top: 30, left: 24, bottom: 24),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Text(
S.of(context).send_templates,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme
.display4
.color),
)
],
),
),
padding: EdgeInsets.only(top: 30, left: 24, bottom: 24),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Text(
S.of(context).send_templates,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme
.display4
.color),
)
],
),
),
isTemplate
? Offstage()
: Container(
height: 40,
width: double.infinity,
padding: EdgeInsets.only(left: 24),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: <Widget>[
GestureDetector(
onTap: () => Navigator.of(context)
.pushNamed(Routes.sendTemplate),
height: 40,
width: double.infinity,
padding: EdgeInsets.only(left: 24),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: <Widget>[
GestureDetector(
onTap: () => Navigator.of(context)
.pushNamed(Routes.sendTemplate),
child: Container(
padding: EdgeInsets.only(left: 1, right: 10),
child: DottedBorder(
borderType: BorderType.RRect,
dashPattern: [6, 4],
color: Theme.of(context)
.primaryTextTheme
.display2
.decorationColor,
strokeWidth: 2,
radius: Radius.circular(20),
child: Container(
padding: EdgeInsets.only(left: 1, right: 10),
child: DottedBorder(
borderType: BorderType.RRect,
dashPattern: [6, 4],
color: Theme.of(context)
.primaryTextTheme
.display2
.decorationColor,
strokeWidth: 2,
radius: Radius.circular(20),
child: Container(
height: 34,
width: 75,
padding: EdgeInsets.only(left: 10, right: 10),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(20)),
color: Colors.transparent,
),
child: Text(
S.of(context).send_new,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme
.display3
.color),
),
)),
),
),
// Observer(
// builder: (_) {
// final templates = sendViewModel.templates;
// final itemCount = templates.length;
// return ListView.builder(
// scrollDirection: Axis.horizontal,
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// itemCount: itemCount,
// itemBuilder: (context, index) {
// final template = templates[index];
// return TemplateTile(
// key: UniqueKey(),
// to: template.name,
// amount: template.amount,
// from: template.cryptoCurrency,
// onTap: () {
// _addressController.text = template.address;
// _cryptoAmountController.text = template.amount;
// getOpenaliasRecord(context);
// },
// onRemove: () {
// showDialog<void>(
// context: context,
// builder: (dialogContext) {
// return AlertWithTwoActions(
// alertTitle: S.of(context).template,
// alertContent: S.of(context).confirm_delete_template,
// leftButtonText: S.of(context).delete,
// rightButtonText: S.of(context).cancel,
// actionLeftButton: () {
// Navigator.of(dialogContext).pop();
// sendViewModel.sendTemplateStore.remove(template: template);
// sendViewModel.sendTemplateStore.update();
// },
// actionRightButton: () => Navigator.of(dialogContext).pop()
// );
// }
// );
// },
// );
// }
// );
// }
// )
],
height: 34,
width: 75,
padding: EdgeInsets.only(left: 10, right: 10),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(20)),
color: Colors.transparent,
),
child: Text(
S.of(context).send_new,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
color: Theme.of(context)
.primaryTextTheme
.display3
.color),
),
)),
),
),
)
// Observer(
// builder: (_) {
// final templates = sendViewModel.templates;
// final itemCount = templates.length;
// return ListView.builder(
// scrollDirection: Axis.horizontal,
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// itemCount: itemCount,
// itemBuilder: (context, index) {
// final template = templates[index];
// return TemplateTile(
// key: UniqueKey(),
// to: template.name,
// amount: template.amount,
// from: template.cryptoCurrency,
// onTap: () {
// _addressController.text = template.address;
// _cryptoAmountController.text = template.amount;
// getOpenaliasRecord(context);
// },
// onRemove: () {
// showDialog<void>(
// context: context,
// builder: (dialogContext) {
// return AlertWithTwoActions(
// alertTitle: S.of(context).template,
// alertContent: S.of(context).confirm_delete_template,
// leftButtonText: S.of(context).delete,
// rightButtonText: S.of(context).cancel,
// actionLeftButton: () {
// Navigator.of(dialogContext).pop();
// sendViewModel.sendTemplateStore.remove(template: template);
// sendViewModel.sendTemplateStore.update();
// },
// actionRightButton: () => Navigator.of(dialogContext).pop()
// );
// }
// );
// },
// );
// }
// );
// }
// )
],
),
),
)
],
),
bottomSectionPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24),
bottomSection: isTemplate
? PrimaryButton(
onPressed: () {
if (_formKey.currentState.validate()) {
// sendViewModel.sendTemplateStore.addTemplate(
// name: _nameController.text,
// address: _addressController.text,
// cryptoCurrency: sendViewModel.currency.title,
// amount: _cryptoAmountController.text);
// sendViewModel.sendTemplateStore.update();
Navigator.of(context).pop();
}
},
text: S.of(context).save,
color: Colors.green,
textColor: Colors.white)
onPressed: () {
if (_formKey.currentState.validate()) {
// sendViewModel.sendTemplateStore.addTemplate(
// name: _nameController.text,
// address: _addressController.text,
// cryptoCurrency: sendViewModel.currency.title,
// amount: _cryptoAmountController.text);
// sendViewModel.sendTemplateStore.update();
Navigator.of(context).pop();
}
},
text: S.of(context).save,
color: Colors.green,
textColor: Colors.white)
: Observer(builder: (_) {
return LoadingPrimaryButton(
onPressed: () {
if (_formKey.currentState.validate()) {
print('SENT!!!');
}
},
text: S.of(context).send,
color: Palette.blueCraiola,
textColor: Colors.white,
isLoading: sendViewModel.state is TransactionIsCreating ||
sendViewModel.state is TransactionCommitting,
isDisabled:
false // FIXME !(syncStore.status is SyncedSyncStatus),
);
}),
return LoadingPrimaryButton(
onPressed: () {
if (_formKey.currentState.validate()) {
print('SENT!!!');
}
},
text: S.of(context).send,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white,
isLoading: sendViewModel.state is TransactionIsCreating ||
sendViewModel.state is TransactionCommitting,
isDisabled:
false // FIXME !(syncStore.status is SyncedSyncStatus),
);
}),
);
}
@@ -554,7 +554,7 @@ class BaseSendWidget extends StatelessWidget {
alertTitle: S.of(context).confirm_sending,
amount: S.of(context).send_amount,
amountValue:
sendViewModel.pendingTransaction.amountFormatted,
sendViewModel.pendingTransaction.amountFormatted,
fee: S.of(context).send_fee,
feeValue: sendViewModel.pendingTransaction.feeFormatted,
leftButtonText: S.of(context).ok,
@@ -696,14 +696,14 @@ class BaseSendWidget extends StatelessWidget {
await showDialog<void>(
builder: (_) => Picker(
items: items,
selectedAtIndex: selectedItem,
title: S.of(context).please_select,
mainAxisAlignment: MainAxisAlignment.center,
onItemSelected: (TransactionPriority priority) => null,
// sendViewModel.setTransactionPriority(priority),
isAlwaysShowScrollThumb: true,
),
items: items,
selectedAtIndex: selectedItem,
title: S.of(context).please_select,
mainAxisAlignment: MainAxisAlignment.center,
onItemSelected: (TransactionPriority priority) => null,
// sendViewModel.setTransactionPriority(priority),
isAlwaysShowScrollThumb: true,
),
context: context);
}
}
}
@@ -43,15 +43,15 @@ class ChangeLanguage extends BasePage {
return AlertWithTwoActions(
alertTitle: S.of(context).change_language,
alertContent: S.of(context).change_language_to(item),
leftButtonText: S.of(context).change,
rightButtonText: S.of(context).cancel,
actionLeftButton: () {
rightButtonText: S.of(context).change,
leftButtonText: S.of(context).cancel,
actionRightButton: () {
settingsStore.saveLanguageCode(
languageCode: code);
currentLanguage.setCurrentLanguage(code);
Navigator.of(context).pop();
},
actionRightButton: () => Navigator.of(context).pop()
actionLeftButton: () => Navigator.of(context).pop()
);
});
}
@@ -33,7 +33,7 @@ class WalletListBody extends StatefulWidget {
class WalletListBodyState extends State<WalletListBody> {
final moneroIcon =
Image.asset('assets/images/monero.png', height: 24, width: 24);
Image.asset('assets/images/monero_logo.png', height: 24, width: 24);
final bitcoinIcon =
Image.asset('assets/images/bitcoin.png', height: 24, width: 24);
final scrollController = ScrollController();
+1 -1
View File
@@ -122,7 +122,7 @@ class WalletMenu {
return;
}
auth.close();
await Navigator.of(context).pushNamed(Routes.seed);
await Navigator.of(context).pushNamed(Routes.seed, arguments: false);
});
break;
case 2:
+1 -2
View File
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:cake_wallet/src/widgets/base_alert_dialog.dart';
import 'package:cake_wallet/palette.dart';
class AlertWithOneAction extends BaseAlertDialog {
AlertWithOneAction({
@@ -32,7 +31,7 @@ class AlertWithOneAction extends BaseAlertDialog {
width: 300,
height: 52,
padding: EdgeInsets.only(left: 12, right: 12),
color: Palette.blueCraiola,
color: Theme.of(context).accentTextTheme.body2.color,
child: ButtonTheme(
minWidth: double.infinity,
child: FlatButton(
+3 -3
View File
@@ -47,7 +47,7 @@ class BaseAlertDialog extends StatelessWidget {
child: Container(
height: 52,
padding: EdgeInsets.only(left: 6, right: 6),
color: Palette.blueCraiola,
color: Theme.of(context).accentTextTheme.body2.decorationColor,
child: ButtonTheme(
minWidth: double.infinity,
child: FlatButton(
@@ -72,7 +72,7 @@ class BaseAlertDialog extends StatelessWidget {
child: Container(
height: 52,
padding: EdgeInsets.only(left: 6, right: 6),
color: Palette.alizarinRed,
color: Theme.of(context).accentTextTheme.body2.color,
child: ButtonTheme(
minWidth: double.infinity,
child: FlatButton(
@@ -92,7 +92,7 @@ class BaseAlertDialog extends StatelessWidget {
)),
),
)
)
),
],
);
}
+3 -3
View File
@@ -398,7 +398,7 @@ class SeedWidgetState extends State<SeedWidget> {
child: PrimaryButton(
onPressed: clear,
text: S.of(context).clear,
color: Colors.red,
color: Colors.orange,
textColor: Colors.white,
isDisabled: items.isEmpty,
),
@@ -413,7 +413,7 @@ class SeedWidgetState extends State<SeedWidget> {
onPressed: () => widget.onFinish != null
? widget.onFinish()
: null,
color: Palette.blueCraiola,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white)
: PrimaryButton(
text: selectedItem != null
@@ -424,7 +424,7 @@ class SeedWidgetState extends State<SeedWidget> {
: null,
onDisabledPressed: () => showErrorIfExist(),
isDisabled: !isCurrentMnemonicValid,
color: Palette.blueCraiola,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white),
),
)
+1 -1
View File
@@ -128,7 +128,7 @@ class TemplateTileState extends State<TemplateTile> {
child: Container(
height: 40,
padding: EdgeInsets.only(left: 24, right: 10),
color: Colors.red,
color: Colors.orange,
child: content,
),
),