diff --git a/assets/images/2.0x/filter_light_button.png b/assets/images/2.0x/filter_light_button.png new file mode 100644 index 000000000..d18a5e70a Binary files /dev/null and b/assets/images/2.0x/filter_light_button.png differ diff --git a/assets/images/3.0x/filter_light_button.png b/assets/images/3.0x/filter_light_button.png new file mode 100644 index 000000000..efb56c196 Binary files /dev/null and b/assets/images/3.0x/filter_light_button.png differ diff --git a/assets/images/filter_light_button.png b/assets/images/filter_light_button.png new file mode 100644 index 000000000..73451443c Binary files /dev/null and b/assets/images/filter_light_button.png differ diff --git a/lib/palette.dart b/lib/palette.dart index 0c7a3cc1a..766d9fe70 100644 --- a/lib/palette.dart +++ b/lib/palette.dart @@ -1,93 +1,30 @@ import 'package:flutter/material.dart'; class Palette { - static const Color lightBlue = Color.fromRGBO(126, 147, 177, 1.0); - static const Color lightBlueWithOpacity = Color.fromRGBO(126, 147, 177, 0.4); - static const Color lightGrey = Color.fromRGBO(224, 233, 246, 1.0); - static const Color purple = Color.fromRGBO(243, 229, 245, 1.0); - static const Color deepPink = Color.fromRGBO(225, 190, 231, 1.0); - static const Color indigo = Color.fromRGBO(232, 234, 246, 1.0); - static const Color deepIndigo = Color.fromRGBO(197, 202, 233, 1.0); - static const Color creamyGrey = Color.fromRGBO(245, 246, 249, 1.0); - static const Color deepPurple = Color.fromRGBO(124, 83, 240, 1.0); - static const Color wildDarkBlue = Color.fromRGBO(155, 172, 197, 1.0); - static const Color wildDarkBlueWithOpacity = Color.fromRGBO(155, 172, 197, 0.1); - static const Color lightGreen = Color.fromRGBO(52, 186, 204, 1.0); - static const Color darkPurple = Color.fromRGBO(124, 83, 240, 1.0); - static const Color brightBlue = Color.fromRGBO(151, 226, 255, 0.6); - static const Color cloudySky = Color.fromRGBO(121, 201, 233, 0.8); - static const Color darkGrey = Color.fromRGBO(136, 155, 183, 0.21); - static const Color shadowGrey = Color.fromRGBO(132, 141, 198, 0.14); - static const Color shadowGreyWithOpacity = Color.fromRGBO(132, 141, 198, 0.05); - static const Color blueGrey = Color.fromRGBO(103, 107, 141, 1.0); - static const Color lightGrey2 = Color.fromRGBO(249, 249, 249, 1.0); - static const Color violet = Color.fromRGBO(138, 80, 255, 1.0); - static const Color lightViolet = Color.fromRGBO(131, 87, 255, 1); - static const Color cakeGreen = Color.fromRGBO(41, 187, 244, 1.0); - static const Color cakeGreenWithOpacity = Color.fromRGBO(41, 187, 244, 0.2); - static const Color switchBackground = Color.fromRGBO(228, 231, 240, 1.0); - static const Color switchBorder = Color.fromRGBO(211, 222, 238, 1.0); static const Color green = Color.fromRGBO(39, 206, 80, 1.0); static const Color red = Color.fromRGBO(255, 51, 51, 1.0); - static const Color nightBlue = Color.fromRGBO(34, 40, 75, 1.0); - static const Color lavender = Color.fromRGBO(249, 250, 253, 1); - static const Color lightLavender = Color.fromRGBO(242, 244, 247, 1); - static const Color cadetBlue = Color.fromRGBO(191, 201, 215, 1); - static const Color manatee = Color.fromRGBO(138, 153, 175, 1); - static const Color separator = Color.fromRGBO(240, 241, 244, 1); - static const Color containerLavender = Color.fromRGBO(226, 235, 238, 0.4); - static const Color purpleBlue = Color.fromRGBO(84, 92, 139, 1); - static const Color floatingActionButton = Color.fromRGBO(213, 56, 99, 1); - static const Color failure = Color.fromRGBO(226, 35, 35, 1); - static const Color powered = Color.fromRGBO(191, 201, 215, 1); - static const Color buttonShadow = Color.fromRGBO(23, 46, 77, 0.129207); + static const Color blueAlice = Color.fromRGBO(231, 240, 253, 1.0); + static const Color lightBlue = Color.fromRGBO(172, 203, 238, 1.0); + static const Color lavender = Color.fromRGBO(237, 245, 252, 1.0); + static const Color oceanBlue = Color.fromRGBO(30, 52, 78, 1.0); + static const Color lightBlueGrey = Color.fromRGBO(118, 131, 169, 1.0); + static const Color periwinkle = Color.fromRGBO(197, 208, 230, 1.0); + static const Color blue = Color.fromRGBO(88, 143, 252, 1.0); + static const Color darkLavender = Color.fromRGBO(225, 238, 250, 1.0); + static const Color nightBlue = Color.fromRGBO(46, 57, 96, 1.0); } class PaletteDark { - static const Color darkThemeTitle = Color.fromRGBO(132, 154, 186, 1.0); - static const Color darkThemeTitleViolet = Color.fromRGBO(121, 92, 190, 1.0); - static const Color darkThemeGrey = Color.fromRGBO(100, 115, 137, 1.0); - static const Color darkThemeGreyWithOpacity = Color.fromRGBO(100, 115, 137, 0.5); - static const Color darkThemeMidGrey = Color.fromRGBO(20, 26, 38, 1.0); - static const Color darkThemePurpleButton = Color.fromRGBO(182, 143, 255, 0.1); - static const Color darkThemePurpleButtonBorder = Color.fromRGBO(161, 120, 255, 0.7); - static const Color darkThemeBackground = Color.fromRGBO(39, 41, 50, 1.0); - static const Color darkThemeBackgroundDark = Color.fromRGBO(9, 12, 18, 1.0); - static const Color darkThemeDarkGrey = Color.fromRGBO(218, 228, 243, 0.06); - static const Color darkGrey = Color.fromRGBO(218, 228, 243, 0.4); - static const Color darkThemeBlackWithOpacity = Color.fromRGBO(0, 0, 0, 0.2); - static const Color darkThemeBlack = Color.fromRGBO(7, 10, 14, 1.0); - static const Color darkThemeAppBarBlack = Color.fromRGBO(4, 5, 7, 1.0); - static const Color darkThemeViolet = Color.fromRGBO(131, 87, 255, 0.2); - static const Color darkThemeIndigoButton = Color.fromRGBO(216, 223, 246, 0.1); - static const Color darkThemeIndigoButtonBorder = Color.fromRGBO(196, 206, 237, 0.4); - static const Color darkThemeBlueButton = Color.fromRGBO(151, 226, 255, 0.1); - static const Color darkThemeBlueButtonBorder = Color.fromRGBO(62, 190, 240, 0.6); - static const Color darkThemeCloseButton = Color.fromRGBO(34, 40, 74, 1.0); - static const Color darkThemePinButton = Color.fromRGBO(136, 155, 183, 0.1); - static const Color darkThemePinDigitButton = Color.fromRGBO(100, 115, 137, 0.34); - static const Color switchBackground = Color.fromRGBO(100, 115, 137, 0.4); - static const Color wildDarkBlueWithOpacity = Color.fromRGBO(155, 172, 197, 0.4); - static const Color wildDarkBlue = Color.fromRGBO(155, 172, 197, 0.8); - - // NEW - - static const Color backgroundStart = Color.fromRGBO(231, 240, 253, 1.0); - static const Color backgroundEnd = Color.fromRGBO(172, 203, 238, 1.0); - static const Color mainBackgroundColor = Color.fromRGBO(70, 85, 133, 1.0); - static const Color borderCardColor = Color.fromRGBO(81, 96, 147, 1.0); - static const Color walletCardTopStartSync = Color.fromRGBO(89, 104, 152, 1.0); - static const Color walletCardBottomStartSync = Color.fromRGBO(70, 85, 133, 1.0); - static const Color walletCardTopEndSync = Color.fromRGBO(70, 85, 133, 1.0); - static const Color walletCardBottomEndSync = Color.fromRGBO(45, 56, 95, 1.0); - static const Color walletCardText = Color.fromRGBO(140, 153, 201, 1.0); - static const Color walletCardAddressField = Color.fromRGBO(51, 63, 104, 1.0); - static const Color walletCardAddressText = Color.fromRGBO(183, 197, 242, 1.0); - static const Color walletCardSubAddressField = Color.fromRGBO(63, 77, 122, 1.0); - static const Color historyPanel = Color.fromRGBO(33, 43, 73, 1.0); - static const Color historyPanelText = Color.fromRGBO(91, 112, 146, 1.0); - static const Color historyPanelButton = Color.fromRGBO(39, 53, 96, 1.0); - static const Color menuHeader = Color.fromRGBO(41, 52, 84, 1.0); - static const Color menuList = Color.fromRGBO(48, 59, 95, 1.0); - static const Color selectButtonText = Color.fromRGBO(57, 74, 95, 1.0); + static const Color distantBlue = Color.fromRGBO(70, 85, 133, 1.0); // mainBackgroundColor + static const Color lightDistantBlue = Color.fromRGBO(81, 96, 147, 1.0); // borderCardColor + static const Color nightBlue = Color.fromRGBO(45, 56, 95, 1.0); // walletCardBottomEndSync + static const Color gray = Color.fromRGBO(140, 153, 201, 1.0); // walletCardText + static const Color violetBlue = Color.fromRGBO(51, 63, 104, 1.0); // walletCardAddressField + static const Color moderateBlue = Color.fromRGBO(63, 77, 122, 1.0); // walletCardSubAddressField + static const Color darkNightBlue = Color.fromRGBO(33, 43, 73, 1.0); // historyPanel + static const Color pigeonBlue = Color.fromRGBO(91, 112, 146, 1.0); // historyPanelText + static const Color moderateNightBlue = Color.fromRGBO(39, 53, 96, 1.0); // historyPanelButton + static const Color headerNightBlue = Color.fromRGBO(41, 52, 84, 1.0); // menuHeader + static const Color lightNightBlue = Color.fromRGBO(48, 59, 95, 1.0); // menuList + static const Color moderatePurpleBlue = Color.fromRGBO(57, 74, 95, 1.0); // selectButtonText } \ No newline at end of file diff --git a/lib/src/screens/accounts/account_list_page.dart b/lib/src/screens/accounts/account_list_page.dart index 3abcfe126..0d9a19d95 100644 --- a/lib/src/screens/accounts/account_list_page.dart +++ b/lib/src/screens/accounts/account_list_page.dart @@ -35,7 +35,7 @@ class AccountListPageForm extends State<AccountListPage> { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), child: Container( - decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.75)), + decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)), child: Center( child: Column( mainAxisSize: MainAxisSize.min, @@ -61,7 +61,7 @@ class AccountListPageForm extends State<AccountListPage> { borderRadius: BorderRadius.all(Radius.circular(14)), child: Container( height: 296, - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: Column( children: <Widget>[ Expanded( @@ -71,7 +71,7 @@ class AccountListPageForm extends State<AccountListPage> { return ListView.separated( separatorBuilder: (context, index) => Divider( - color: PaletteDark.mainBackgroundColor, + color: Theme.of(context).dividerColor, height: 1, ), itemCount: accounts == null ? 0 : accounts.length, @@ -117,7 +117,7 @@ class AccountListPageForm extends State<AccountListPage> { children: <Widget>[ Icon( Icons.add, - color: PaletteDark.historyPanel, + color: PaletteDark.darkNightBlue, ), Padding( padding: EdgeInsets.only(left: 5), @@ -126,7 +126,7 @@ class AccountListPageForm extends State<AccountListPage> { style: TextStyle( fontSize: 15, fontWeight: FontWeight.w600, - color: PaletteDark.historyPanel, + color: PaletteDark.darkNightBlue, decoration: TextDecoration.none, ), ), diff --git a/lib/src/screens/accounts/account_page.dart b/lib/src/screens/accounts/account_page.dart index 4498857a4..c7fb2b68a 100644 --- a/lib/src/screens/accounts/account_page.dart +++ b/lib/src/screens/accounts/account_page.dart @@ -18,9 +18,6 @@ class AccountPage extends BasePage { @override String get title => S.current.account; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => AccountForm(account); } @@ -65,7 +62,7 @@ class AccountFormState extends State<AccountForm> { return Form( key: _formKey, child: Container( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, padding: EdgeInsets.all(24.0), child: Column( children: <Widget>[ diff --git a/lib/src/screens/accounts/widgets/account_tile.dart b/lib/src/screens/accounts/widgets/account_tile.dart index ba98d73ab..84b965e03 100644 --- a/lib/src/screens/accounts/widgets/account_tile.dart +++ b/lib/src/screens/accounts/widgets/account_tile.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; class AccountTile extends StatelessWidget { AccountTile({ @@ -14,8 +13,8 @@ class AccountTile extends StatelessWidget { @override Widget build(BuildContext context) { - final color = isCurrent ? PaletteDark.menuHeader : Colors.transparent; - final textColor = isCurrent ? Colors.blue : Colors.white; + final color = isCurrent ? Theme.of(context).accentTextTheme.subtitle.decorationColor : Colors.transparent; + final textColor = isCurrent ? Colors.blue : Theme.of(context).primaryTextTheme.title.color; return GestureDetector( onTap: onTap, diff --git a/lib/src/screens/address_book/address_book_page.dart b/lib/src/screens/address_book/address_book_page.dart index bdcb3332d..4a24627b4 100644 --- a/lib/src/screens/address_book/address_book_page.dart +++ b/lib/src/screens/address_book/address_book_page.dart @@ -5,7 +5,6 @@ import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:cake_wallet/routes.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/domain/common/crypto_currency.dart'; import 'package:cake_wallet/src/stores/address_book/address_book_store.dart'; @@ -17,9 +16,6 @@ class AddressBookPage extends BasePage { final bool isEditable; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override String get title => S.current.address_book; @@ -35,11 +31,15 @@ class AddressBookPage extends BasePage { width: 32.0, height: 32.0, decoration: BoxDecoration( - shape: BoxShape.circle, color: PaletteDark.menuList), + shape: BoxShape.circle, + color: Theme.of(context).accentTextTheme.title.backgroundColor + ), child: Stack( alignment: Alignment.center, children: <Widget>[ - Icon(Icons.add, color: Colors.white, size: 22.0), + Icon(Icons.add, + color: Theme.of(context).primaryTextTheme.title.color, + size: 22.0), ButtonTheme( minWidth: 32.0, height: 32.0, @@ -61,17 +61,17 @@ class AddressBookPage extends BasePage { final addressBookStore = Provider.of<AddressBookStore>(context); return Container( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, padding: EdgeInsets.only(top: 20.0, bottom: 20.0), child: Observer( builder: (_) => ListView.separated( separatorBuilder: (_, __) => Container( height: 1, padding: EdgeInsets.only(left: 24), - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: Container( height: 1, - color: PaletteDark.mainBackgroundColor, + color: Theme.of(context).dividerColor, ), ), itemCount: addressBookStore.contactList == null @@ -117,12 +117,12 @@ class AddressBookPage extends BasePage { ? Container( width: double.infinity, height: 1, - color: PaletteDark.mainBackgroundColor, + color: Theme.of(context).dividerColor, ) : Offstage(), Container( width: double.infinity, - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: Padding( padding: const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24), child: Row( @@ -141,7 +141,7 @@ class AddressBookPage extends BasePage { contact.name, style: TextStyle( fontSize: 14, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), ) @@ -153,7 +153,7 @@ class AddressBookPage extends BasePage { ? Container( width: double.infinity, height: 1, - color: PaletteDark.mainBackgroundColor, + color: Theme.of(context).dividerColor, ) : Offstage(), ], diff --git a/lib/src/screens/address_book/contact_page.dart b/lib/src/screens/address_book/contact_page.dart index 13a9ff8cd..bd181bf3b 100644 --- a/lib/src/screens/address_book/contact_page.dart +++ b/lib/src/screens/address_book/contact_page.dart @@ -10,7 +10,6 @@ import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/address_text_field.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; @@ -23,9 +22,6 @@ class ContactPage extends BasePage { @override String get title => S.current.contact; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => ContactForm(contact); } @@ -45,10 +41,6 @@ class ContactFormState extends State<ContactForm> { final _currencyTypeController = TextEditingController(); final _addressController = TextEditingController(); final currencies = CryptoCurrency.all; - final downArrow = Image.asset( - 'assets/images/arrow_bottom_purple_icon.png', - color: PaletteDark.walletCardText, - height: 8); CryptoCurrency _selectectCrypto; @@ -90,13 +82,17 @@ class ContactFormState extends State<ContactForm> { @override Widget build(BuildContext context) { final addressBookStore = Provider.of<AddressBookStore>(context); + final downArrow = Image.asset( + 'assets/images/arrow_bottom_purple_icon.png', + color: Theme.of(context).dividerColor, + height: 8); _contactNameController.addListener(() {onHandleControllers(addressBookStore);}); _currencyTypeController.addListener(() {onHandleControllers(addressBookStore);}); _addressController.addListener(() {onHandleControllers(addressBookStore);}); return Container( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, child: ScrollableWithBottomSection( contentPadding: EdgeInsets.all(24), content: Form( @@ -107,7 +103,6 @@ class ContactFormState extends State<ContactForm> { BaseTextFormField( controller: _contactNameController, hintText: S.of(context).contact_name, - borderColor: PaletteDark.walletCardSubAddressField, validator: (value) { addressBookStore.validateContactName(value); return addressBookStore.errorMessage; @@ -122,7 +117,6 @@ class ContactFormState extends State<ContactForm> { child: BaseTextFormField( controller: _currencyTypeController, hintText: S.of(context).settings_currency, - borderColor: PaletteDark.walletCardSubAddressField, suffixIcon: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.end, diff --git a/lib/src/screens/auth/auth_page.dart b/lib/src/screens/auth/auth_page.dart index 968a9faf6..0483af63d 100644 --- a/lib/src/screens/auth/auth_page.dart +++ b/lib/src/screens/auth/auth_page.dart @@ -8,7 +8,6 @@ import 'package:cake_wallet/src/stores/auth/auth_store.dart'; import 'package:cake_wallet/src/screens/pin_code/pin_code.dart'; import 'package:cake_wallet/src/stores/settings/settings_store.dart'; import 'package:cake_wallet/src/domain/common/biometric_auth.dart'; -import 'package:cake_wallet/palette.dart'; typedef OnAuthenticationFinished = void Function(bool, AuthPageState); @@ -139,7 +138,7 @@ class AuthPageState extends State<AuthPage> { ), ) : Container(), - backgroundColor: PaletteDark.historyPanel, + backgroundColor: Theme.of(context).backgroundColor, border: null, ), resizeToAvoidBottomPadding: false, diff --git a/lib/src/screens/base_page.dart b/lib/src/screens/base_page.dart index db3e0d746..ac3b97297 100644 --- a/lib/src/screens/base_page.dart +++ b/lib/src/screens/base_page.dart @@ -4,13 +4,15 @@ import 'package:cake_wallet/src/widgets/nav_bar.dart'; import 'package:provider/provider.dart'; import 'package:cake_wallet/themes.dart'; import 'package:cake_wallet/theme_changer.dart'; +import 'package:cake_wallet/palette.dart'; enum AppBarStyle { regular, withShadow } abstract class BasePage extends StatelessWidget { String get title => null; bool get isModalBackButton => false; - Color get backgroundColor => Colors.white; + Color get backgroundLightColor => Colors.white; + Color get backgroundDarkColor => PaletteDark.darkNightBlue; bool get resizeToAvoidBottomPadding => true; AppBarStyle get appBarStyle => AppBarStyle.regular; @@ -31,16 +33,13 @@ abstract class BasePage extends StatelessWidget { final _themeChanger = Provider.of<ThemeChanger>(context); Image _closeButton, _backButton; - _backButton = _backArrowImageDarkTheme; - _closeButton = _closeButtonImageDarkTheme; - - /*if (_themeChanger.getTheme() == Themes.darkTheme) { + if (_themeChanger.getTheme() == Themes.darkTheme) { _backButton = _backArrowImageDarkTheme; _closeButton = _closeButtonImageDarkTheme; } else { _backButton = _backArrowImage; _closeButton = _closeButtonImage; - }*/ + } return SizedBox( height: 37, @@ -65,8 +64,7 @@ abstract class BasePage extends StatelessWidget { style: TextStyle( fontSize: 18.0, fontWeight: FontWeight.bold, - color: Colors.white), - //color: Theme.of(context).primaryTextTheme.title.color), + color: Theme.of(context).primaryTextTheme.title.color), ); } @@ -85,10 +83,9 @@ abstract class BasePage extends StatelessWidget { leading: leading(context), middle: middle(context), trailing: trailing(context), - backgroundColor: backgroundColor); - /*backgroundColor: _isDarkTheme - ? Theme.of(context).backgroundColor - : backgroundColor);*/ + backgroundColor: _isDarkTheme + ? backgroundDarkColor + : backgroundLightColor); case AppBarStyle.withShadow: return NavBar.withShadow( @@ -96,10 +93,9 @@ abstract class BasePage extends StatelessWidget { leading: leading(context), middle: middle(context), trailing: trailing(context), - backgroundColor: backgroundColor); - /*backgroundColor: _isDarkTheme - ? Theme.of(context).backgroundColor - : backgroundColor);*/ + backgroundColor: _isDarkTheme + ? backgroundDarkColor + : backgroundLightColor); default: return NavBar( @@ -107,10 +103,9 @@ abstract class BasePage extends StatelessWidget { leading: leading(context), middle: middle(context), trailing: trailing(context), - backgroundColor: backgroundColor); - /*backgroundColor: _isDarkTheme - ? Theme.of(context).backgroundColor - : backgroundColor);*/ + backgroundColor: _isDarkTheme + ? backgroundDarkColor + : backgroundLightColor); } } @@ -122,8 +117,9 @@ abstract class BasePage extends StatelessWidget { final _isDarkTheme = _themeChanger.getTheme() == Themes.darkTheme; return Scaffold( - backgroundColor: - _isDarkTheme ? Theme.of(context).backgroundColor : backgroundColor, + backgroundColor: _isDarkTheme + ? backgroundDarkColor + : backgroundLightColor, resizeToAvoidBottomPadding: resizeToAvoidBottomPadding, appBar: appBar(context), body: SafeArea(child: body(context)), diff --git a/lib/src/screens/dashboard/dashboard_page.dart b/lib/src/screens/dashboard/dashboard_page.dart index b05bb8d9a..86cff5392 100644 --- a/lib/src/screens/dashboard/dashboard_page.dart +++ b/lib/src/screens/dashboard/dashboard_page.dart @@ -1,43 +1,14 @@ -import 'package:cake_wallet/src/screens/dashboard/widgets/menu_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:cake_wallet/palette.dart'; -import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/wallet_card.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/trade_history_panel.dart'; +import 'package:cake_wallet/src/screens/dashboard/widgets/menu_widget.dart'; -class DashboardPage extends BasePage { +class DashboardPage extends StatelessWidget { final _bodyKey = GlobalKey(); @override - Color get backgroundColor => PaletteDark.mainBackgroundColor; - - @override - Widget trailing(BuildContext context) { - final menuButton = Image.asset('assets/images/header.png'); - - return SizedBox( - height: 37, - width: 37, - child: ButtonTheme( - minWidth: double.minPositive, - child: FlatButton( - highlightColor: Colors.transparent, - splashColor: Colors.transparent, - padding: EdgeInsets.all(0), - onPressed: () async { - await showDialog<void>( - builder: (_) => MenuWidget(), - context: context - ); - }, - child: menuButton), - ), - ); - } - - @override - Widget body(BuildContext context) => DashboardPageBody(key: _bodyKey); + Widget build(BuildContext context) => DashboardPageBody(key: _bodyKey); } class DashboardPageBody extends StatefulWidget { @@ -51,21 +22,57 @@ class DashboardPageBodyState extends State<DashboardPageBody> { @override Widget build(BuildContext context) { + final menuButton = Image.asset('assets/images/header.png', + color: Theme.of(context).primaryTextTheme.title.color, + ); return SafeArea( - child: Container( - color: PaletteDark.mainBackgroundColor, - child: Column( - children: <Widget>[ - Padding( - padding: EdgeInsets.only(left: 20, top: 10), - child: WalletCard(), - ), - SizedBox( - height: 28, - ), - Expanded(child: TradeHistoryPanel()) - ], + child: Scaffold( + body: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + Theme.of(context).scaffoldBackgroundColor, + Theme.of(context).primaryColor + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight + ) + ), + child: Column( + children: <Widget>[ + Container( + padding: EdgeInsets.only(top: 10, right: 10), + alignment: Alignment.centerRight, + child: SizedBox( + height: 44, + width: 44, + child: ButtonTheme( + minWidth: double.minPositive, + child: FlatButton( + highlightColor: Colors.transparent, + splashColor: Colors.transparent, + padding: EdgeInsets.all(0), + onPressed: () async { + await showDialog<void>( + builder: (_) => MenuWidget(), + context: context + ); + }, + child: menuButton), + ), + ), + ), + Padding( + padding: EdgeInsets.only(left: 20, top: 20), + child: WalletCard(), + ), + SizedBox( + height: 28, + ), + Expanded(child: TradeHistoryPanel()) + ], + ), ), ), ); diff --git a/lib/src/screens/dashboard/widgets/button_header.dart b/lib/src/screens/dashboard/widgets/button_header.dart index 71b8434e5..50b579ef4 100644 --- a/lib/src/screens/dashboard/widgets/button_header.dart +++ b/lib/src/screens/dashboard/widgets/button_header.dart @@ -2,24 +2,33 @@ import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.da import 'package:cake_wallet/src/stores/action_list/action_list_store.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:provider/provider.dart'; import 'package:cake_wallet/routes.dart'; import 'package:date_range_picker/date_range_picker.dart' as date_rage_picker; +import 'package:cake_wallet/themes.dart'; +import 'package:cake_wallet/theme_changer.dart'; class ButtonHeader extends SliverPersistentHeaderDelegate { final sendImage = Image.asset('assets/images/send.png'); final exchangeImage = Image.asset('assets/images/exchange.png'); final buyImage = Image.asset('assets/images/coins.png'); - final filterButton = Image.asset('assets/images/filter_button.png'); @override Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) { final actionListStore = Provider.of<ActionListStore>(context); final historyPanelWidth = MediaQuery.of(context).size.width; + final _themeChanger = Provider.of<ThemeChanger>(context); + Image filterButton; + + if (_themeChanger.getTheme() == Themes.darkTheme) { + filterButton = Image.asset('assets/images/filter_button.png'); + } else { + filterButton = Image.asset('assets/images/filter_light_button.png'); + } + double buttonsOpacity = 1 - shrinkOffset / (maxExtent - minExtent); double buttonsHeight = maxExtent - minExtent - shrinkOffset; @@ -68,173 +77,173 @@ class ButtonHeader extends SliverPersistentHeaderDelegate { Positioned( top: buttonsHeight, left: 0, - child: Container( - width: historyPanelWidth, - height: 66, - padding: EdgeInsets.only(top: 20, left: 20, right: 20, bottom: 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)), - color: PaletteDark.historyPanel, - ), - child: Stack( - alignment: Alignment.center, - children: <Widget>[ - Text( - S.of(context).trade_history_title, - style: TextStyle( - fontSize: 20, - color: Colors.white + child: ClipRRect( + borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)), + child: Container( + width: historyPanelWidth, + height: 66, + padding: EdgeInsets.only(top: 20, left: 20, right: 20, bottom: 10), + color: Theme.of(context).backgroundColor, + child: Stack( + alignment: Alignment.center, + children: <Widget>[ + Text( + S.of(context).transactions, + style: TextStyle( + fontSize: 20, + color: Theme.of(context).primaryTextTheme.title.color + ), ), - ), - Positioned( - right: 0, - child: PopupMenuButton<int>( - itemBuilder: (context) => [ - PopupMenuItem( - enabled: false, - value: -1, - child: Text(S.of(context).transactions, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Theme.of(context).primaryTextTheme.caption.color))), - PopupMenuItem( - value: 0, - child: Observer( - builder: (_) => Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Text(S.of(context).incoming), - Checkbox( - value: actionListStore - .transactionFilterStore - .displayIncoming, - onChanged: (value) => - actionListStore - .transactionFilterStore - .toggleIncoming(), - ) - ]))), - PopupMenuItem( - value: 1, - child: Observer( - builder: (_) => Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Text(S.of(context).outgoing), - Checkbox( - value: actionListStore - .transactionFilterStore - .displayOutgoing, - onChanged: (value) => - actionListStore - .transactionFilterStore - .toggleOutgoing(), - ) - ]))), - PopupMenuItem( - value: 2, - child: - Text(S.of(context).transactions_by_date)), - PopupMenuDivider(), - PopupMenuItem( - enabled: false, - value: -1, - child: Text(S.of(context).trades, - style: TextStyle( - fontWeight: FontWeight.bold, - color: Theme.of(context).primaryTextTheme.caption.color))), - PopupMenuItem( - value: 3, - child: Observer( - builder: (_) => Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Text('XMR.TO'), - Checkbox( - value: actionListStore - .tradeFilterStore - .displayXMRTO, - onChanged: (value) => - actionListStore - .tradeFilterStore - .toggleDisplayExchange( - ExchangeProviderDescription - .xmrto), - ) - ]))), - PopupMenuItem( - value: 4, - child: Observer( - builder: (_) => Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Text('Change.NOW'), - Checkbox( - value: actionListStore - .tradeFilterStore - .displayChangeNow, - onChanged: (value) => - actionListStore - .tradeFilterStore - .toggleDisplayExchange( - ExchangeProviderDescription - .changeNow), - ) - ]))), - PopupMenuItem( - value: 5, - child: Observer( - builder: (_) => Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Text('MorphToken'), - Checkbox( - value: actionListStore - .tradeFilterStore - .displayMorphToken, - onChanged: (value) => - actionListStore - .tradeFilterStore - .toggleDisplayExchange( - ExchangeProviderDescription - .morphToken), - ) - ]))) - ], - child: filterButton, - onSelected: (item) async { - if (item == 2) { - final List<DateTime> picked = - await date_rage_picker.showDatePicker( - context: context, - initialFirstDate: DateTime.now() - .subtract(Duration(days: 1)), - initialLastDate: (DateTime.now()), - firstDate: DateTime(2015), - lastDate: DateTime.now() - .add(Duration(days: 1))); + Positioned( + right: 0, + child: PopupMenuButton<int>( + itemBuilder: (context) => [ + PopupMenuItem( + enabled: false, + value: -1, + child: Text(S.of(context).transactions, + style: TextStyle( + fontWeight: FontWeight.bold, + color: Theme.of(context).primaryTextTheme.caption.color))), + PopupMenuItem( + value: 0, + child: Observer( + builder: (_) => Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text(S.of(context).incoming), + Checkbox( + value: actionListStore + .transactionFilterStore + .displayIncoming, + onChanged: (value) => + actionListStore + .transactionFilterStore + .toggleIncoming(), + ) + ]))), + PopupMenuItem( + value: 1, + child: Observer( + builder: (_) => Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text(S.of(context).outgoing), + Checkbox( + value: actionListStore + .transactionFilterStore + .displayOutgoing, + onChanged: (value) => + actionListStore + .transactionFilterStore + .toggleOutgoing(), + ) + ]))), + PopupMenuItem( + value: 2, + child: + Text(S.of(context).transactions_by_date)), + PopupMenuDivider(), + PopupMenuItem( + enabled: false, + value: -1, + child: Text(S.of(context).trades, + style: TextStyle( + fontWeight: FontWeight.bold, + color: Theme.of(context).primaryTextTheme.caption.color))), + PopupMenuItem( + value: 3, + child: Observer( + builder: (_) => Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text('XMR.TO'), + Checkbox( + value: actionListStore + .tradeFilterStore + .displayXMRTO, + onChanged: (value) => + actionListStore + .tradeFilterStore + .toggleDisplayExchange( + ExchangeProviderDescription + .xmrto), + ) + ]))), + PopupMenuItem( + value: 4, + child: Observer( + builder: (_) => Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text('Change.NOW'), + Checkbox( + value: actionListStore + .tradeFilterStore + .displayChangeNow, + onChanged: (value) => + actionListStore + .tradeFilterStore + .toggleDisplayExchange( + ExchangeProviderDescription + .changeNow), + ) + ]))), + PopupMenuItem( + value: 5, + child: Observer( + builder: (_) => Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Text('MorphToken'), + Checkbox( + value: actionListStore + .tradeFilterStore + .displayMorphToken, + onChanged: (value) => + actionListStore + .tradeFilterStore + .toggleDisplayExchange( + ExchangeProviderDescription + .morphToken), + ) + ]))) + ], + child: filterButton, + onSelected: (item) async { + if (item == 2) { + final List<DateTime> picked = + await date_rage_picker.showDatePicker( + context: context, + initialFirstDate: DateTime.now() + .subtract(Duration(days: 1)), + initialLastDate: (DateTime.now()), + firstDate: DateTime(2015), + lastDate: DateTime.now() + .add(Duration(days: 1))); - if (picked != null && picked.length == 2) { - actionListStore.transactionFilterStore - .changeStartDate(picked.first); - actionListStore.transactionFilterStore - .changeEndDate(picked.last); + if (picked != null && picked.length == 2) { + actionListStore.transactionFilterStore + .changeStartDate(picked.first); + actionListStore.transactionFilterStore + .changeEndDate(picked.last); + } } - } - }, - ), - ) - ], + }, + ), + ) + ], + ), ), ) ) @@ -274,7 +283,7 @@ class ButtonHeader extends SliverPersistentHeaderDelegate { width: 48, alignment: Alignment.center, decoration: BoxDecoration( - color: PaletteDark.borderCardColor, + color: Theme.of(context).primaryTextTheme.subhead.color, shape: BoxShape.circle ), child: image, @@ -286,7 +295,7 @@ class ButtonHeader extends SliverPersistentHeaderDelegate { title, style: TextStyle( fontSize: 16, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ), ) diff --git a/lib/src/screens/dashboard/widgets/date_section_raw.dart b/lib/src/screens/dashboard/widgets/date_section_raw.dart index 4ec9382fd..f639d3c59 100644 --- a/lib/src/screens/dashboard/widgets/date_section_raw.dart +++ b/lib/src/screens/dashboard/widgets/date_section_raw.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:intl/intl.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:provider/provider.dart'; @@ -40,14 +39,17 @@ class DateSectionRaw extends StatelessWidget { padding: EdgeInsets.only(top: 10, bottom: 10, left: 20, right: 20), alignment: Alignment.center, decoration: BoxDecoration( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, border: Border.all( width: 1, - color: PaletteDark.historyPanel + color: Theme.of(context).backgroundColor ), ), child: Text(title, - style: TextStyle(fontSize: 12, color: PaletteDark.historyPanelText)) + style: TextStyle( + fontSize: 12, + color: Theme.of(context).primaryTextTheme.headline.color + )) ); } } diff --git a/lib/src/screens/dashboard/widgets/menu_widget.dart b/lib/src/screens/dashboard/widgets/menu_widget.dart index 6621cb22a..24bf9cd46 100644 --- a/lib/src/screens/dashboard/widgets/menu_widget.dart +++ b/lib/src/screens/dashboard/widgets/menu_widget.dart @@ -78,7 +78,7 @@ class MenuWidgetState extends State<MenuWidget> { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), child: Container( - decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.75)), + decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -91,7 +91,7 @@ class MenuWidgetState extends State<MenuWidget> { width: 4, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(2)), - color: PaletteDark.walletCardText + color: Theme.of(context).hintColor // ), ) : Container( @@ -115,7 +115,7 @@ class MenuWidgetState extends State<MenuWidget> { curve: Curves.fastOutSlowIn, decoration: BoxDecoration( borderRadius: BorderRadius.only(topLeft: Radius.circular(24), bottomLeft: Radius.circular(24)), - color: PaletteDark.menuList.withOpacity(opacity) + color: Theme.of(context).primaryTextTheme.display1.color.withOpacity(opacity) ), child: isDraw ? ListView.separated( @@ -131,7 +131,7 @@ class MenuWidgetState extends State<MenuWidget> { bottom: fromBottomEdge), decoration: BoxDecoration( borderRadius: BorderRadius.only(topLeft: Radius.circular(24)), - color: PaletteDark.menuHeader + color: Theme.of(context).primaryTextTheme.display2.color ), child: Row( mainAxisAlignment: MainAxisAlignment.start, @@ -148,7 +148,7 @@ class MenuWidgetState extends State<MenuWidget> { Text( walletStore.name, style: TextStyle( - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, decoration: TextDecoration.none, fontFamily: 'Lato', fontSize: 20, @@ -158,7 +158,7 @@ class MenuWidgetState extends State<MenuWidget> { Text( walletStore.account.label, style: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, decoration: TextDecoration.none, fontFamily: 'Lato', fontSize: 12 @@ -193,7 +193,7 @@ class MenuWidgetState extends State<MenuWidget> { alignment: Alignment.topLeft, decoration: BoxDecoration( borderRadius: BorderRadius.only(bottomLeft: Radius.circular(24)), - color: PaletteDark.menuList, + color: Theme.of(context).primaryTextTheme.display1.color, ), child: Row( mainAxisAlignment: MainAxisAlignment.start, @@ -206,7 +206,7 @@ class MenuWidgetState extends State<MenuWidget> { item, style: TextStyle( decoration: TextDecoration.none, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, fontFamily: 'Lato', fontSize: 20, fontWeight: FontWeight.bold @@ -219,7 +219,7 @@ class MenuWidgetState extends State<MenuWidget> { : Container( height: tileHeight, padding: EdgeInsets.only(left: 24, right: 24), - color: PaletteDark.menuList, + color: Theme.of(context).primaryTextTheme.display1.color, child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, @@ -231,7 +231,7 @@ class MenuWidgetState extends State<MenuWidget> { item, style: TextStyle( decoration: TextDecoration.none, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, fontFamily: 'Lato', fontSize: 20, fontWeight: FontWeight.bold @@ -244,9 +244,9 @@ class MenuWidgetState extends State<MenuWidget> { ); }, separatorBuilder: (_, index) => - Divider( + Container( height: 1, - color: PaletteDark.walletCardText, + color: Theme.of(context).dividerColor, ), itemCount: itemCount + 1) : Offstage() diff --git a/lib/src/screens/dashboard/widgets/trade_history_panel.dart b/lib/src/screens/dashboard/widgets/trade_history_panel.dart index 61e7ec989..25edd2fdf 100644 --- a/lib/src/screens/dashboard/widgets/trade_history_panel.dart +++ b/lib/src/screens/dashboard/widgets/trade_history_panel.dart @@ -6,7 +6,6 @@ import 'package:cake_wallet/src/stores/action_list/transaction_list_item.dart'; import 'package:cake_wallet/src/stores/settings/settings_store.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; @@ -58,101 +57,104 @@ class TradeHistoryPanelState extends State<TradeHistoryPanel> { height: panelHeight, duration: Duration(milliseconds: 1000), curve: Curves.fastOutSlowIn, - child: CustomScrollView( - slivers: <Widget>[ - SliverPersistentHeader( - delegate: ButtonHeader(), - pinned: true, - floating: false, - ), - Observer( - key: _listObserverKey, - builder: (_) { - final items = actionListStore.items == null - ? <String>[] - : actionListStore.items; - final itemsCount = items.length + 1; - final symbol = settingsStore.fiatCurrency.toString(); - double freeSpaceHeight = MediaQuery.of(context).size.height - 496; + child: ClipRRect( + borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)), + child: CustomScrollView( + slivers: <Widget>[ + SliverPersistentHeader( + delegate: ButtonHeader(), + pinned: true, + floating: false, + ), + Observer( + key: _listObserverKey, + builder: (_) { + final items = actionListStore.items == null + ? <String>[] + : actionListStore.items; + final itemsCount = items.length + 1; + final symbol = settingsStore.fiatCurrency.toString(); + double freeSpaceHeight = MediaQuery.of(context).size.height - 496; - return SliverList( - key: _listKey, - delegate: SliverChildBuilderDelegate( - (context, index) { + return SliverList( + key: _listKey, + delegate: SliverChildBuilderDelegate( + (context, index) { - if (index == itemsCount - 1) { - freeSpaceHeight = freeSpaceHeight >= 0 ? freeSpaceHeight : 0; + if (index == itemsCount - 1) { + freeSpaceHeight = freeSpaceHeight >= 0 ? freeSpaceHeight : 0; - return Container( - height: freeSpaceHeight, - width: MediaQuery.of(context).size.width, - color: PaletteDark.historyPanel, - ); - } + return Container( + height: freeSpaceHeight, + width: MediaQuery.of(context).size.width, + color: Theme.of(context).backgroundColor, + ); + } - final item = items[index]; + final item = items[index]; - if (item is DateSectionItem) { - freeSpaceHeight -= 38; - return DateSectionRaw(date: item.date); - } + if (item is DateSectionItem) { + freeSpaceHeight -= 38; + return DateSectionRaw(date: item.date); + } - if (item is TransactionListItem) { - freeSpaceHeight -= 62; - final transaction = item.transaction; - final savedDisplayMode = settingsStore.balanceDisplayMode; - final formattedAmount = - savedDisplayMode == BalanceDisplayMode.hiddenBalance - ? '---' - : transaction.amountFormatted(); - final formattedFiatAmount = - savedDisplayMode == BalanceDisplayMode.hiddenBalance - ? '---' - : transaction.fiatAmount(symbol); + if (item is TransactionListItem) { + freeSpaceHeight -= 62; + final transaction = item.transaction; + final savedDisplayMode = settingsStore.balanceDisplayMode; + final formattedAmount = + savedDisplayMode == BalanceDisplayMode.hiddenBalance + ? '---' + : transaction.amountFormatted(); + final formattedFiatAmount = + savedDisplayMode == BalanceDisplayMode.hiddenBalance + ? '---' + : transaction.fiatAmount(symbol); - return TransactionRow( - onTap: () => Navigator.of(context).pushNamed( - Routes.transactionDetails, - arguments: transaction), - direction: transaction.direction, - formattedDate: - transactionDateFormat.format(transaction.date), - formattedAmount: formattedAmount, - formattedFiatAmount: formattedFiatAmount, - isPending: transaction.isPending); - } + return TransactionRow( + onTap: () => Navigator.of(context).pushNamed( + Routes.transactionDetails, + arguments: transaction), + direction: transaction.direction, + formattedDate: + transactionDateFormat.format(transaction.date), + formattedAmount: formattedAmount, + formattedFiatAmount: formattedFiatAmount, + isPending: transaction.isPending); + } - if (item is TradeListItem) { - freeSpaceHeight -= 62; - final trade = item.trade; - final savedDisplayMode = settingsStore.balanceDisplayMode; - final formattedAmount = trade.amount != null - ? savedDisplayMode == BalanceDisplayMode.hiddenBalance - ? '---' - : trade.amountFormatted() - : trade.amount; + if (item is TradeListItem) { + freeSpaceHeight -= 62; + final trade = item.trade; + final savedDisplayMode = settingsStore.balanceDisplayMode; + final formattedAmount = trade.amount != null + ? savedDisplayMode == BalanceDisplayMode.hiddenBalance + ? '---' + : trade.amountFormatted() + : trade.amount; - return TradeRow( - onTap: () => Navigator.of(context) - .pushNamed(Routes.tradeDetails, arguments: trade), - provider: trade.provider, - from: trade.from, - to: trade.to, - createdAtFormattedDate: - transactionDateFormat.format(trade.createdAt), - formattedAmount: formattedAmount); - } + return TradeRow( + onTap: () => Navigator.of(context) + .pushNamed(Routes.tradeDetails, arguments: trade), + provider: trade.provider, + from: trade.from, + to: trade.to, + createdAtFormattedDate: + transactionDateFormat.format(trade.createdAt), + formattedAmount: formattedAmount); + } - return Container( - color: PaletteDark.historyPanel - ); - }, + return Container( + color: Theme.of(context).backgroundColor + ); + }, - childCount: itemsCount - ) - ); - }) - ], + childCount: itemsCount + ) + ); + }) + ], + ), ) ), ); diff --git a/lib/src/screens/dashboard/widgets/trade_row.dart b/lib/src/screens/dashboard/widgets/trade_row.dart index c16f0b42c..5461c8ce4 100644 --- a/lib/src/screens/dashboard/widgets/trade_row.dart +++ b/lib/src/screens/dashboard/widgets/trade_row.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/domain/common/crypto_currency.dart'; import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.dart'; @@ -28,10 +27,10 @@ class TradeRow extends StatelessWidget { child: Container( height: 60, decoration: BoxDecoration( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, border: Border.all( width: 1, - color: PaletteDark.historyPanel + color: Theme.of(context).backgroundColor ), ), padding: EdgeInsets.only(top: 5, bottom: 5, left: 20, right: 20), @@ -41,7 +40,7 @@ class TradeRow extends StatelessWidget { width: 36, decoration: BoxDecoration( shape: BoxShape.circle, - color: PaletteDark.historyPanelButton + color: Theme.of(context).backgroundColor ), child: _getPoweredImage(provider), ), @@ -56,13 +55,13 @@ class TradeRow extends StatelessWidget { Text('${from.toString()} → ${to.toString()}', style: TextStyle( fontSize: 16, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color )), formattedAmount != null ? Text(formattedAmount + ' ' + amountCrypto, - style: const TextStyle( + style: TextStyle( fontSize: 16, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color )) : Container() ]), @@ -71,8 +70,8 @@ class TradeRow extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Text(createdAtFormattedDate, - style: const TextStyle( - fontSize: 14, color: PaletteDark.historyPanelText)) + style: TextStyle( + fontSize: 14, color: Theme.of(context).primaryTextTheme.headline.color)) ]), ], ), diff --git a/lib/src/screens/dashboard/widgets/transaction_raw.dart b/lib/src/screens/dashboard/widgets/transaction_raw.dart index 393bb8f58..2baa3f5ff 100644 --- a/lib/src/screens/dashboard/widgets/transaction_raw.dart +++ b/lib/src/screens/dashboard/widgets/transaction_raw.dart @@ -26,10 +26,10 @@ class TransactionRow extends StatelessWidget { child: Container( height: 60, decoration: BoxDecoration( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, border: Border.all( width: 1, - color: PaletteDark.historyPanel + color: Theme.of(context).backgroundColor ), ), padding: EdgeInsets.only(top: 5, bottom: 5, left: 20, right: 20), @@ -39,7 +39,7 @@ class TransactionRow extends StatelessWidget { width: 36, decoration: BoxDecoration( shape: BoxShape.circle, - color: PaletteDark.historyPanelButton + color: Theme.of(context).primaryTextTheme.display3.color ), child: Image.asset( direction == TransactionDirection.incoming @@ -62,14 +62,14 @@ class TransactionRow extends StatelessWidget { (isPending ? S.of(context).pending : ''), style: TextStyle( fontSize: 16, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color )), Text(direction == TransactionDirection.incoming ? formattedAmount : '- ' + formattedAmount, - style: const TextStyle( + style: TextStyle( fontSize: 16, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color )) ]), SizedBox(height: 5,), @@ -77,13 +77,13 @@ class TransactionRow extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ Text(formattedDate, - style: const TextStyle( - fontSize: 14, color: PaletteDark.historyPanelText)), + style: TextStyle( + fontSize: 14, color: Theme.of(context).primaryTextTheme.headline.color)), Text(direction == TransactionDirection.incoming ? formattedFiatAmount : '- ' + formattedFiatAmount, - style: const TextStyle( - fontSize: 14, color: PaletteDark.historyPanelText)) + style: TextStyle( + fontSize: 14, color: Theme.of(context).primaryTextTheme.headline.color)) ]), ], ), diff --git a/lib/src/screens/dashboard/widgets/wallet_card.dart b/lib/src/screens/dashboard/widgets/wallet_card.dart index 73a2aa2d3..424b4b10e 100644 --- a/lib/src/screens/dashboard/widgets/wallet_card.dart +++ b/lib/src/screens/dashboard/widgets/wallet_card.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/domain/common/balance_display_mode.dart'; import 'package:flutter/services.dart'; import 'package:provider/provider.dart'; @@ -9,7 +10,6 @@ import 'package:cake_wallet/src/stores/wallet/wallet_store.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/domain/common/sync_status.dart'; import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart'; @@ -25,7 +25,6 @@ class WalletCardState extends State<WalletCard> { final _balanceObserverKey = GlobalKey(); final _addressObserverKey = GlobalKey(); - final List<Color> colorsSync = [PaletteDark.walletCardSubAddressField, PaletteDark.walletCardBottomEndSync]; double cardWidth; double cardHeight; double screenWidth; @@ -58,6 +57,11 @@ class WalletCardState extends State<WalletCard> { @override Widget build(BuildContext context) { + final List<Color> colorsSync = [ + Theme.of(context).cardTheme.color, + Theme.of(context).hoverColor + ]; + return Container( width: double.infinity, height: cardHeight, @@ -75,38 +79,40 @@ class WalletCardState extends State<WalletCard> { ), decoration: BoxDecoration( borderRadius: BorderRadius.only(topLeft: Radius.circular(10), bottomLeft: Radius.circular(10)), - color: PaletteDark.borderCardColor, + color: Theme.of(context).focusColor, boxShadow: [ BoxShadow( - color: PaletteDark.historyPanel.withOpacity(0.5), + color: PaletteDark.darkNightBlue.withOpacity(0.5), blurRadius: 8, offset: Offset(5, 5)) ] ), - child: Container( - width: cardWidth, - height: cardHeight, - decoration: BoxDecoration( - borderRadius: BorderRadius.only(topLeft: Radius.circular(10), bottomLeft: Radius.circular(10)), - color: PaletteDark.historyPanel + child: ClipRRect( + borderRadius: BorderRadius.only(topLeft: Radius.circular(10), bottomLeft: Radius.circular(10)), + child: Container( + width: cardWidth, + height: cardHeight, + color: Theme.of(context).cardColor, + child: InkWell( + onTap: () => setState(() => isFrontSide = !isFrontSide), + child: isFrontSide + ? frontSide(colorsSync) + : backSide(colorsSync) + ), ), - child: InkWell( - onTap: () => setState(() => isFrontSide = !isFrontSide), - child: isFrontSide - ? frontSide() - : backSide() - ), - ), + ) ), ); } - Widget frontSide() { + Widget frontSide(List<Color> colorsSync) { final syncStore = Provider.of<SyncStore>(context); final walletStore = Provider.of<WalletStore>(context); final settingsStore = Provider.of<SettingsStore>(context); final balanceStore = Provider.of<BalanceStore>(context); - final triangleButton = Image.asset('assets/images/triangle.png'); + final triangleButton = Image.asset('assets/images/triangle.png', + color: Theme.of(context).primaryTextTheme.title.color, + ); return Observer( key: _syncingObserverKey, @@ -159,7 +165,7 @@ class WalletCardState extends State<WalletCard> { child: Container( width: 1, height: cardHeight, - color: PaletteDark.borderCardColor, + color: Theme.of(context).focusColor, ) ) : Offstage(), @@ -180,7 +186,7 @@ class WalletCardState extends State<WalletCard> { crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ InkWell( - onTap: () {print('TAP 2');}, + onTap: () {}, child: Row( children: <Widget>[ Text( @@ -188,7 +194,7 @@ class WalletCardState extends State<WalletCard> { style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), SizedBox(width: 10), @@ -202,8 +208,8 @@ class WalletCardState extends State<WalletCard> { Text( walletStore.account.label, style: TextStyle( - fontSize: 12, - color: PaletteDark.walletCardText + fontSize: 12, + color: Theme.of(context).primaryTextTheme.caption.color ), ) ], @@ -213,14 +219,14 @@ class WalletCardState extends State<WalletCard> { height: 32, alignment: Alignment.center, decoration: BoxDecoration( - color: PaletteDark.walletCardAddressField, + color: Theme.of(context).accentTextTheme.subtitle.backgroundColor, borderRadius: BorderRadius.all(Radius.circular(16)) ), child: Text( shortAddress, style: TextStyle( fontSize: 12, - color: PaletteDark.walletCardAddressText + color: Theme.of(context).primaryTextTheme.caption.color ), ), ) @@ -265,7 +271,7 @@ class WalletCardState extends State<WalletCard> { balanceDisplayMode.toString(), style: TextStyle( fontSize: 12, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ), SizedBox(height: 5), @@ -273,7 +279,7 @@ class WalletCardState extends State<WalletCard> { balance, style: TextStyle( fontSize: 28, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ) ], @@ -282,7 +288,7 @@ class WalletCardState extends State<WalletCard> { fiatBalance, style: TextStyle( fontSize: 14, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ) ], @@ -300,7 +306,7 @@ class WalletCardState extends State<WalletCard> { statusText, style: TextStyle( fontSize: 12, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ), SizedBox(height: 5), @@ -308,7 +314,7 @@ class WalletCardState extends State<WalletCard> { descriptionText, style: TextStyle( fontSize: 14, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ) ], @@ -327,9 +333,11 @@ class WalletCardState extends State<WalletCard> { ); } - Widget backSide() { + Widget backSide(List<Color> colorsSync) { final walletStore = Provider.of<WalletStore>(context); - final rightArrow = Image.asset('assets/images/right_arrow.png'); + final rightArrow = Image.asset('assets/images/right_arrow.png', + color: Theme.of(context).primaryTextTheme.title.color, + ); double messageBoxHeight = 0; double messageBoxWidth = cardWidth - 10; @@ -371,7 +379,7 @@ class WalletCardState extends State<WalletCard> { S.current.card_address, style: TextStyle( fontSize: 12, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ), GestureDetector( @@ -397,7 +405,7 @@ class WalletCardState extends State<WalletCard> { walletStore.subaddress.address, style: TextStyle( fontSize: 14, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), ) @@ -412,7 +420,7 @@ class WalletCardState extends State<WalletCard> { child: QrImage( data: walletStore.subaddress.address, backgroundColor: Colors.transparent, - foregroundColor: PaletteDark.walletCardText, + foregroundColor: Theme.of(context).primaryTextTheme.caption.color ), ) ], @@ -423,7 +431,7 @@ class WalletCardState extends State<WalletCard> { alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(22)), - color: PaletteDark.walletCardSubAddressField + color: Theme.of(context).primaryTextTheme.overline.color ), child: InkWell( onTap: () => Navigator.of(context, @@ -436,7 +444,7 @@ class WalletCardState extends State<WalletCard> { S.of(context).accounts_subaddresses, style: TextStyle( fontSize: 14, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), rightArrow diff --git a/lib/src/screens/disclaimer/disclaimer_page.dart b/lib/src/screens/disclaimer/disclaimer_page.dart index 73fd9f3f4..47cfa40ab 100644 --- a/lib/src/screens/disclaimer/disclaimer_page.dart +++ b/lib/src/screens/disclaimer/disclaimer_page.dart @@ -2,7 +2,6 @@ import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; @@ -14,9 +13,6 @@ class DisclaimerPage extends BasePage { final bool isReadOnly; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override String get title => 'Terms of Use'; @@ -78,7 +74,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> { @override Widget build(BuildContext context) { return Container( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, child: Column( children: <Widget>[ SizedBox(height: 10.0), @@ -99,7 +95,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> { style: TextStyle( fontSize: 20.0, fontWeight: FontWeight.bold, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), ) @@ -120,7 +116,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> { style: TextStyle( fontSize: 12.0, fontWeight: FontWeight.bold, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), ) @@ -136,7 +132,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> { _fileText, style: TextStyle( fontSize: 12.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), )) ], @@ -154,7 +150,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> { style: TextStyle( fontSize: 14.0, fontWeight: FontWeight.bold, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), ) @@ -240,8 +236,8 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> { decoration: BoxDecoration( gradient: LinearGradient( colors: [ - PaletteDark.historyPanel.withOpacity(0.0), - PaletteDark.historyPanel, + Theme.of(context).backgroundColor.withOpacity(0.0), + Theme.of(context).backgroundColor, ], begin: FractionalOffset.topCenter, end: FractionalOffset.bottomCenter, @@ -279,10 +275,10 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> { ), decoration: BoxDecoration( border: Border.all( - color: Palette.lightGrey, width: 1.0), + color: Theme.of(context).primaryTextTheme.caption.color, width: 1.0), borderRadius: BorderRadius.all( Radius.circular(8.0)), - color: PaletteDark.historyPanel), + color: Theme.of(context).backgroundColor), child: _checked ? Icon( Icons.check, @@ -296,7 +292,7 @@ class DisclaimerBodyState extends State<DisclaimerPageBody> { style: TextStyle( fontWeight: FontWeight.bold, fontSize: 14.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ) ], diff --git a/lib/src/screens/exchange/exchange_page.dart b/lib/src/screens/exchange/exchange_page.dart index b6e2bfca5..d1e7813f9 100644 --- a/lib/src/screens/exchange/exchange_page.dart +++ b/lib/src/screens/exchange/exchange_page.dart @@ -16,7 +16,10 @@ class ExchangePage extends BasePage { String get title => S.current.exchange; @override - Color get backgroundColor => PaletteDark.walletCardSubAddressField; + Color get backgroundLightColor => Palette.darkLavender; + + @override + Color get backgroundDarkColor => PaletteDark.moderateBlue; @override Widget middle(BuildContext context) { @@ -38,7 +41,7 @@ class ExchangePage extends BasePage { child: Text( S.of(context).clear, style: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontWeight: FontWeight.w500, fontSize: 14), ), diff --git a/lib/src/screens/exchange/exchange_template_page.dart b/lib/src/screens/exchange/exchange_template_page.dart index 9b13a082c..db2a6965b 100644 --- a/lib/src/screens/exchange/exchange_template_page.dart +++ b/lib/src/screens/exchange/exchange_template_page.dart @@ -16,7 +16,10 @@ class ExchangeTemplatePage extends BasePage { String get title => S.current.exchange_new_template; @override - Color get backgroundColor => PaletteDark.walletCardSubAddressField; + Color get backgroundLightColor => Palette.darkLavender; + + @override + Color get backgroundDarkColor => PaletteDark.moderateBlue; @override Widget trailing(BuildContext context) { diff --git a/lib/src/screens/exchange/widgets/base_exchange_widget.dart b/lib/src/screens/exchange/widgets/base_exchange_widget.dart index 26807c59f..5500ffda7 100644 --- a/lib/src/screens/exchange/widgets/base_exchange_widget.dart +++ b/lib/src/screens/exchange/widgets/base_exchange_widget.dart @@ -6,7 +6,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:mobx/mobx.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/domain/common/crypto_currency.dart'; @@ -63,19 +62,18 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> { final _formKey = GlobalKey<FormState>(); var _isReactionsSet = false; - final Image arrowBottomPurple = Image.asset( - 'assets/images/arrow_bottom_purple_icon.png', - color: Colors.white, - height: 8, - ); - final Image arrowBottomCakeGreen = Image.asset( - 'assets/images/arrow_bottom_cake_green.png', - color: Colors.white, - height: 8, - ); - @override Widget build(BuildContext context) { + final Image arrowBottomPurple = Image.asset( + 'assets/images/arrow_bottom_purple_icon.png', + color: Theme.of(context).primaryTextTheme.title.color, + height: 8, + ); + final Image arrowBottomCakeGreen = Image.asset( + 'assets/images/arrow_bottom_cake_green.png', + color: Theme.of(context).primaryTextTheme.title.color, + height: 8, + ); final depositWalletName = exchangeStore.depositCurrency == CryptoCurrency.xmr @@ -90,7 +88,7 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> { (_) => _setReactions(context, exchangeStore, walletStore)); return Container( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, child: Form( key: _formKey, child: ScrollableWithBottomSection( @@ -98,12 +96,12 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> { content: Column( children: <Widget>[ TopPanel( - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, edgeInsets: EdgeInsets.only(bottom: 24), widget: Column( children: <Widget>[ TopPanel( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).accentTextTheme.title.color, widget: Observer( builder: (_) => ExchangeCard( key: depositKey, @@ -121,8 +119,8 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> { onCurrencySelected: (currency) => exchangeStore.changeDepositCurrency(currency: currency), imageArrow: arrowBottomPurple, - currencyButtonColor: PaletteDark.walletCardSubAddressField, - addressButtonsColor: PaletteDark.menuList, + currencyButtonColor: Theme.of(context).accentTextTheme.title.color, + addressButtonsColor: Theme.of(context).accentTextTheme.title.backgroundColor, currencyValueValidator: (value) { exchangeStore.validateCryptoCurrency(value); return exchangeStore.errorMessage; @@ -154,7 +152,8 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> { onCurrencySelected: (currency) => exchangeStore .changeReceiveCurrency(currency: currency), imageArrow: arrowBottomCakeGreen, - currencyButtonColor: PaletteDark.menuList, + currencyButtonColor: Theme.of(context).accentTextTheme.title.backgroundColor, + addressButtonsColor: Theme.of(context).accentTextTheme.title.color, currencyValueValidator: (value) { exchangeStore.validateCryptoCurrency(value); return exchangeStore.errorMessage; @@ -185,7 +184,7 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> { style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ) ], @@ -215,7 +214,7 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> { child: DottedBorder( borderType: BorderType.RRect, dashPattern: [8, 4], - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, strokeWidth: 2, radius: Radius.circular(20), child: Container( @@ -232,7 +231,7 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> { style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ), ) @@ -273,7 +272,7 @@ class BaseExchangeWidgetState extends State<BaseExchangeWidget> { child: Text( description, style: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 12 ), ), diff --git a/lib/src/screens/exchange/widgets/currency_picker.dart b/lib/src/screens/exchange/widgets/currency_picker.dart index f245c145e..32398de65 100644 --- a/lib/src/screens/exchange/widgets/currency_picker.dart +++ b/lib/src/screens/exchange/widgets/currency_picker.dart @@ -26,7 +26,7 @@ class CurrencyPicker extends StatelessWidget { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), child: Container( - decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.75)), + decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)), child: Center( child: Column( mainAxisSize: MainAxisSize.min, @@ -53,7 +53,7 @@ class CurrencyPicker extends StatelessWidget { child: Container( height: 400, width: 300, - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, child: GridView.count( shrinkWrap: true, crossAxisCount: 3, @@ -65,7 +65,7 @@ class CurrencyPicker extends StatelessWidget { if (index == 14) { return Container( - color: PaletteDark.menuList, + color: Theme.of(context).primaryTextTheme.display1.color, ); } @@ -73,11 +73,11 @@ class CurrencyPicker extends StatelessWidget { final isItemSelected = index == selectedAtIndex; final color = isItemSelected - ? PaletteDark.historyPanel - : PaletteDark.menuList; + ? Theme.of(context).accentTextTheme.subtitle.decorationColor + : Theme.of(context).primaryTextTheme.display1.color; final textColor = isItemSelected ? Colors.blue - : Colors.white; + : Theme.of(context).primaryTextTheme.title.color; return GestureDetector( onTap: () { diff --git a/lib/src/screens/exchange/widgets/exchange_card.dart b/lib/src/screens/exchange/widgets/exchange_card.dart index 55f166843..308784f3c 100644 --- a/lib/src/screens/exchange/widgets/exchange_card.dart +++ b/lib/src/screens/exchange/widgets/exchange_card.dart @@ -1,6 +1,5 @@ import 'package:flutter/services.dart'; import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/domain/common/crypto_currency.dart'; import 'package:cake_wallet/src/widgets/address_text_field.dart'; @@ -21,7 +20,7 @@ class ExchangeCard extends StatefulWidget { this.onCurrencySelected, this.imageArrow, this.currencyButtonColor = Colors.transparent, - this.addressButtonsColor = PaletteDark.walletCardSubAddressField, + this.addressButtonsColor = Colors.transparent, this.currencyValueValidator, this.addressTextFieldValidator}) : super(key: key); @@ -124,7 +123,7 @@ class ExchangeCardState extends State<ExchangeCard> { style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ) ], @@ -144,7 +143,6 @@ class ExchangeCardState extends State<ExchangeCard> { RegExp('[\\-|\\ |\\,]')) ], hintText: '0.0000', - borderColor: PaletteDark.borderCardColor, validator: widget.currencyValueValidator ), Positioned( @@ -165,7 +163,7 @@ class ExchangeCardState extends State<ExchangeCard> { style: TextStyle( fontWeight: FontWeight.w600, fontSize: 16, - color: Colors.white)), + color: Theme.of(context).primaryTextTheme.title.color)), Padding( padding: EdgeInsets.only(left: 5), child: widget.imageArrow, @@ -189,7 +187,7 @@ class ExchangeCardState extends State<ExchangeCard> { style: TextStyle( fontSize: 10, height: 1.2, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), ) : Offstage(), _min != null ? SizedBox(width: 10) : Offstage(), @@ -200,7 +198,7 @@ class ExchangeCardState extends State<ExchangeCard> { style: TextStyle( fontSize: 10, height: 1.2, - color: PaletteDark.walletCardText)) + color: Theme.of(context).primaryTextTheme.caption.color)) : Offstage(), ]), ), diff --git a/lib/src/screens/exchange/widgets/present_provider_picker.dart b/lib/src/screens/exchange/widgets/present_provider_picker.dart index 079e52a06..1d3a7953d 100644 --- a/lib/src/screens/exchange/widgets/present_provider_picker.dart +++ b/lib/src/screens/exchange/widgets/present_provider_picker.dart @@ -4,7 +4,6 @@ import 'package:cake_wallet/src/domain/exchange/exchange_provider_description.da import 'package:cake_wallet/src/domain/exchange/exchange_provider.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/widgets/picker.dart'; class PresentProviderPicker extends StatelessWidget { @@ -12,11 +11,13 @@ class PresentProviderPicker extends StatelessWidget { final ExchangeStore exchangeStore; - final Image arrowBottom = - Image.asset('assets/images/arrow_bottom_purple_icon.png', color: Colors.white, height: 6); - @override Widget build(BuildContext context) { + final Image arrowBottom = + Image.asset('assets/images/arrow_bottom_purple_icon.png', + color: Theme.of(context).primaryTextTheme.title.color, + height: 6); + return FlatButton( onPressed: () => _presentProviderPicker(context), highlightColor: Colors.transparent, @@ -33,13 +34,13 @@ class PresentProviderPicker extends StatelessWidget { style: TextStyle( fontSize: 16.0, fontWeight: FontWeight.w400, - color: Colors.white)), + color: Theme.of(context).primaryTextTheme.title.color)), Observer( builder: (_) => Text('${exchangeStore.provider.title}', style: TextStyle( fontSize: 10.0, fontWeight: FontWeight.w400, - color:PaletteDark.walletCardText))) + color: Theme.of(context).primaryTextTheme.caption.color))) ], ), SizedBox(width: 5), diff --git a/lib/src/screens/exchange_trade/exchange_confirm_page.dart b/lib/src/screens/exchange_trade/exchange_confirm_page.dart index 08d5479a1..97d3b316c 100644 --- a/lib/src/screens/exchange_trade/exchange_confirm_page.dart +++ b/lib/src/screens/exchange_trade/exchange_confirm_page.dart @@ -6,24 +6,21 @@ 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.trade}); final Trade trade; - final copyImage = Image.asset('assets/images/copy_content.png', color: Colors.white); @override String get title => S.current.copy_id; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) { + final copyImage = Image.asset('assets/images/copy_content.png', + color: Theme.of(context).primaryTextTheme.title.color); + return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.all(24), child: Column( children: <Widget>[ @@ -38,7 +35,7 @@ class ExchangeConfirmPage extends BasePage { style: TextStyle( fontSize: 18.0, fontWeight: FontWeight.w600, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), ), Padding( padding: EdgeInsets.only(top: 60), @@ -48,7 +45,7 @@ class ExchangeConfirmPage extends BasePage { style: TextStyle( fontSize: 16.0, fontWeight: FontWeight.w600, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), ), ), Padding( @@ -72,7 +69,7 @@ class ExchangeConfirmPage extends BasePage { padding: EdgeInsets.only(left: 24, right: 24), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30)), - color: PaletteDark.menuList + color: Theme.of(context).accentTextTheme.title.backgroundColor ), child: Row( mainAxisSize: MainAxisSize.max, @@ -85,7 +82,7 @@ class ExchangeConfirmPage extends BasePage { style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), ), diff --git a/lib/src/screens/exchange_trade/exchange_trade_page.dart b/lib/src/screens/exchange_trade/exchange_trade_page.dart index eb6481d8a..05602a7fd 100644 --- a/lib/src/screens/exchange_trade/exchange_trade_page.dart +++ b/lib/src/screens/exchange_trade/exchange_trade_page.dart @@ -6,7 +6,6 @@ import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/stores/exchange_trade/exchange_trade_store.dart'; import 'package:cake_wallet/src/stores/send/send_store.dart'; @@ -24,9 +23,6 @@ class ExchangeTradePage extends BasePage { @override String get title => S.current.exchange; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => ExchangeTradeForm(); } @@ -51,7 +47,6 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { _setEffects(context); return Container( - color: PaletteDark.historyPanel, child: ScrollableWithBottomSection( contentPadding: EdgeInsets.only(left: 24, right: 24, top: 24), content: Observer(builder: (_) { @@ -78,14 +73,14 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { height: 2, fontWeight: FontWeight.bold, fontSize: 14.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), ), Text( '${trade.id ?? fetchingLabel}', style: TextStyle( fontSize: 14.0, height: 2, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), ) ], ), @@ -98,14 +93,14 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { height: 2, fontWeight: FontWeight.bold, fontSize: 14.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), ), Text( '${trade.amount ?? fetchingLabel}', style: TextStyle( fontSize: 14.0, height: 2, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), ) ], ), @@ -119,14 +114,14 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { height: 2, fontWeight: FontWeight.bold, fontSize: 14.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), ), Text( '${trade.extraId ?? fetchingLabel}', style: TextStyle( fontSize: 14.0, height: 2, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), ) ], ) @@ -139,7 +134,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { style: TextStyle( fontSize: 14.0, fontWeight: FontWeight.bold, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, height: 2), ), Text( @@ -147,7 +142,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { style: TextStyle( fontSize: 14.0, height: 2, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), ) ], ), @@ -159,10 +154,10 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { S.of(context).offer_expires_in, style: TextStyle( fontSize: 14.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), ), TimerWidget(trade.expiredAt, - color: PaletteDark.walletCardText) + color: Theme.of(context).primaryTextTheme.caption.color) ], ) : Container(), @@ -186,7 +181,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { child: QrImage( data: trade.inputAddress ?? fetchingLabel, backgroundColor: Colors.transparent, - foregroundColor: PaletteDark.walletCardText, + foregroundColor: Theme.of(context).primaryTextTheme.display4.color, ), ), )), @@ -208,7 +203,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { style: TextStyle( fontSize: 14.0, fontWeight: FontWeight.bold, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), ), ), Container( @@ -217,7 +212,9 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { child: Text( trade.inputAddress ?? fetchingLabel, textAlign: TextAlign.center, - style: TextStyle(fontSize: 14.0, color: PaletteDark.walletCardText), + style: TextStyle( + fontSize: 14.0, + color: Theme.of(context).primaryTextTheme.caption.color), ), ), ), @@ -242,8 +239,8 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { )); }, text: S.of(context).copy_address, - color: PaletteDark.menuList, - textColor: Colors.white) + color: Theme.of(context).accentTextTheme.title.backgroundColor, + textColor: Theme.of(context).primaryTextTheme.title.color) ), )), Flexible( @@ -264,8 +261,8 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { )); }, text: S.of(context).copy_id, - color: PaletteDark.menuList, - textColor: Colors.white) + color: Theme.of(context).accentTextTheme.title.backgroundColor, + textColor: Theme.of(context).primaryTextTheme.title.color) ), )) ], @@ -284,7 +281,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { textAlign: TextAlign.left, style: TextStyle( fontSize: 13.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), ), ), Text( @@ -292,7 +289,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> { textAlign: TextAlign.left, style: TextStyle( fontSize: 13.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), ) ], ); diff --git a/lib/src/screens/exchange_trade/widgets/copy_button.dart b/lib/src/screens/exchange_trade/widgets/copy_button.dart deleted file mode 100644 index 79d399c0b..000000000 --- a/lib/src/screens/exchange_trade/widgets/copy_button.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class CopyButton extends StatelessWidget { - const CopyButton( - {@required this.onPressed, - @required this.text, - @required this.color, - @required this.borderColor}); - - final VoidCallback onPressed; - final Color color; - final Color borderColor; - final String text; - - @override - Widget build(BuildContext context) { - return ButtonTheme( - minWidth: double.infinity, - height: 44.0, - child: FlatButton( - onPressed: onPressed, - color: color, - shape: RoundedRectangleBorder( - side: BorderSide(color: borderColor), - borderRadius: BorderRadius.circular(10.0)), - child: Text(text, style: TextStyle(fontSize: 14.0)), - )); - } -} diff --git a/lib/src/screens/faq/faq_page.dart b/lib/src/screens/faq/faq_page.dart index eb285b3b4..c823dfba9 100644 --- a/lib/src/screens/faq/faq_page.dart +++ b/lib/src/screens/faq/faq_page.dart @@ -5,15 +5,11 @@ import 'package:provider/provider.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/stores/settings/settings_store.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; -import 'package:cake_wallet/palette.dart'; class FaqPage extends BasePage { @override String get title => S.current.faq; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => FaqForm(); } @@ -24,25 +20,25 @@ class FaqForm extends StatefulWidget { } class FaqFormState extends State<FaqForm> { - final addIcon = Icon(Icons.add, color: Colors.white); - final removeIcon = Icon(Icons.remove, color: Colors.green); List<Icon> icons; List<Color> colors; bool isLoaded = false; @override Widget build(BuildContext context) { + final addIcon = Icon(Icons.add, color: Theme.of(context).primaryTextTheme.title.color); + final removeIcon = Icon(Icons.remove, color: Colors.green); + return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.only(top: 12), child: Container( - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.headline.color, child: FutureBuilder( builder: (context, snapshot) { final faqItems = jsonDecode(snapshot.data.toString()) as List; if (snapshot.hasData) { - setIconsAndColors(faqItems.length); + setIconsAndColors(context, faqItems.length, addIcon); } return SingleChildScrollView( @@ -74,7 +70,7 @@ class FaqFormState extends State<FaqForm> { ), ), ), - backgroundColor: PaletteDark.menuHeader, + backgroundColor: Theme.of(context).accentTextTheme.headline.backgroundColor, onExpansionChanged: (value) { setState(() { if (value) { @@ -82,7 +78,7 @@ class FaqFormState extends State<FaqForm> { colors[index] = Colors.green; } else { icons[index] = addIcon; - colors[index] = Colors.white; + colors[index] = Theme.of(context).primaryTextTheme.title.color; } }); }, @@ -101,7 +97,7 @@ class FaqFormState extends State<FaqForm> { itemChild, style: TextStyle( fontSize: 12, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), )) @@ -111,7 +107,7 @@ class FaqFormState extends State<FaqForm> { ); }, separatorBuilder: (_, __) => - Container(color: PaletteDark.mainBackgroundColor, height: 1.0), + Container(color: Theme.of(context).dividerColor, height: 1.0), itemCount: faqItems == null ? 0 : faqItems.length, ), ); @@ -122,13 +118,13 @@ class FaqFormState extends State<FaqForm> { ); } - void setIconsAndColors(int index) { + void setIconsAndColors(BuildContext context, int index, Icon icon) { if (isLoaded) { return; } - icons = List.generate(index, (int i) => addIcon); - colors = List.generate(index, (int i) => Colors.white); + icons = List.generate(index, (int i) => icon); + colors = List.generate(index, (int i) => Theme.of(context).primaryTextTheme.title.color); isLoaded = true; } diff --git a/lib/src/screens/new_wallet/new_wallet_page.dart b/lib/src/screens/new_wallet/new_wallet_page.dart index 306164430..870f9db0c 100644 --- a/lib/src/screens/new_wallet/new_wallet_page.dart +++ b/lib/src/screens/new_wallet/new_wallet_page.dart @@ -12,7 +12,6 @@ import 'package:cake_wallet/src/domain/services/wallet_service.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/stores/seed_language/seed_language_store.dart'; import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart'; import 'package:cake_wallet/src/screens/seed_language/widgets/seed_language_picker.dart'; @@ -31,9 +30,6 @@ class NewWalletPage extends BasePage { @override String get title => S.current.new_wallet; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => WalletNameForm(); } @@ -102,7 +98,6 @@ class _WalletNameFormState extends State<WalletNameForm> { }); return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.only(top: 24), child: ScrollableWithBottomSection( contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24), @@ -124,21 +119,21 @@ class _WalletNameFormState extends State<WalletNameForm> { style: TextStyle( fontSize: 20.0, fontWeight: FontWeight.w600, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), controller: nameController, decoration: InputDecoration( hintStyle: TextStyle( fontSize: 16.0, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), hintText: S.of(context).wallet_name, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0))), validator: (value) { walletCreationStore.validateWalletName(value); @@ -153,7 +148,7 @@ class _WalletNameFormState extends State<WalletNameForm> { style: TextStyle( fontSize: 16.0, fontWeight: FontWeight.w600, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), ), @@ -162,8 +157,8 @@ class _WalletNameFormState extends State<WalletNameForm> { builder: (_) => SelectButton( image: null, text: seedLocales[seedLanguages.indexOf(seedLanguageStore.selectedSeedLanguage)], - color: PaletteDark.menuList, - textColor: Colors.white, + color: Theme.of(context).accentTextTheme.title.backgroundColor, + textColor: Theme.of(context).primaryTextTheme.title.color, onTap: () async => await showDialog( context: context, builder: (BuildContext context) => SeedLanguagePicker() diff --git a/lib/src/screens/new_wallet/new_wallet_type_page.dart b/lib/src/screens/new_wallet/new_wallet_type_page.dart index 4d662998d..044b52e66 100644 --- a/lib/src/screens/new_wallet/new_wallet_type_page.dart +++ b/lib/src/screens/new_wallet/new_wallet_type_page.dart @@ -4,7 +4,6 @@ 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'; @@ -12,9 +11,6 @@ class NewWalletTypePage extends BasePage { @override String get title => S.current.new_wallet; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => WalletTypeForm(); } @@ -35,10 +31,10 @@ class WalletTypeFormState extends State<WalletTypeForm> { bool isMoneroSelected; bool isBitcoinSelected; - Color moneroBackgroundColor; - Color moneroTextColor; - Color bitcoinBackgroundColor; - Color bitcoinTextColor; + Color moneroBackgroundColor = Colors.transparent; + Color moneroTextColor = Colors.transparent; + Color bitcoinBackgroundColor = Colors.transparent; + Color bitcoinTextColor = Colors.transparent; @override void initState() { @@ -46,18 +42,21 @@ class WalletTypeFormState extends State<WalletTypeForm> { isMoneroSelected = false; isBitcoinSelected = false; - moneroBackgroundColor = PaletteDark.menuList; - moneroTextColor = Colors.white; - bitcoinBackgroundColor = PaletteDark.menuList; - bitcoinTextColor = Colors.white; - super.initState(); + WidgetsBinding.instance.addPostFrameCallback(afterLayout); + } + + void afterLayout(dynamic _) { + moneroBackgroundColor = Theme.of(context).accentTextTheme.title.backgroundColor; + moneroTextColor = Theme.of(context).primaryTextTheme.title.color; + bitcoinBackgroundColor = Theme.of(context).accentTextTheme.title.backgroundColor; + bitcoinTextColor = Theme.of(context).primaryTextTheme.title.color; + setState(() {}); } @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), @@ -78,7 +77,7 @@ class WalletTypeFormState extends State<WalletTypeForm> { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), ), @@ -98,7 +97,7 @@ class WalletTypeFormState extends State<WalletTypeForm> { text: 'Monero', color: moneroBackgroundColor, textColor: moneroTextColor, - onTap: () => onSelectMoneroButton()), + onTap: () => onSelectMoneroButton(context)), ) ], ), @@ -118,28 +117,28 @@ class WalletTypeFormState extends State<WalletTypeForm> { ); } - void onSelectMoneroButton() { + void onSelectMoneroButton(BuildContext context) { isMoneroSelected = true; isBitcoinSelected = false; isDisabledButton = false; - moneroBackgroundColor = Colors.white; - moneroTextColor = PaletteDark.selectButtonText; - bitcoinBackgroundColor = PaletteDark.menuList; - bitcoinTextColor = Colors.white; + moneroBackgroundColor = Theme.of(context).accentTextTheme.title.decorationColor; + moneroTextColor = Theme.of(context).primaryTextTheme.title.backgroundColor; + bitcoinBackgroundColor = Theme.of(context).accentTextTheme.title.backgroundColor; + bitcoinTextColor = Theme.of(context).primaryTextTheme.title.color; setState(() {}); } - void onSelectBitcoinButton() { + void onSelectBitcoinButton(BuildContext context) { isMoneroSelected = false; isBitcoinSelected = true; isDisabledButton = false; - moneroBackgroundColor = PaletteDark.menuList; - moneroTextColor = Colors.white; - bitcoinBackgroundColor = Colors.white; - bitcoinTextColor = PaletteDark.selectButtonText; + moneroBackgroundColor = Theme.of(context).accentTextTheme.title.backgroundColor; + moneroTextColor = Theme.of(context).primaryTextTheme.title.color; + bitcoinBackgroundColor = moneroBackgroundColor = Theme.of(context).accentTextTheme.title.decorationColor; + bitcoinTextColor = Theme.of(context).primaryTextTheme.title.backgroundColor; setState(() {}); } diff --git a/lib/src/screens/nodes/new_node_page.dart b/lib/src/screens/nodes/new_node_page.dart index 9f609f698..2f170e0a7 100644 --- a/lib/src/screens/nodes/new_node_page.dart +++ b/lib/src/screens/nodes/new_node_page.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:provider/provider.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/stores/node_list/node_list_store.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; @@ -13,9 +12,6 @@ class NewNodePage extends BasePage { @override String get title => S.current.node_new; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => NewNodePageForm(); } @@ -58,7 +54,6 @@ class NewNodeFormState extends State<NewNodePageForm> { _nodePortController.addListener(() {onHandleControllers(nodeList);}); return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.only(left: 24, right: 24), child: ScrollableWithBottomSection( contentPadding: EdgeInsets.only(bottom: 24.0), @@ -72,22 +67,22 @@ class NewNodeFormState extends State<NewNodePageForm> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), decoration: InputDecoration( hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).node_address, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), controller: _nodeAddressController, validator: (value) { @@ -105,24 +100,24 @@ class NewNodeFormState extends State<NewNodePageForm> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), keyboardType: TextInputType.numberWithOptions( signed: false, decimal: false), decoration: InputDecoration( hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).node_port, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), controller: _nodePortController, validator: (value) { @@ -140,22 +135,22 @@ class NewNodeFormState extends State<NewNodePageForm> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), decoration: InputDecoration( hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).login, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), controller: _loginController, validator: (value) => null, @@ -170,22 +165,22 @@ class NewNodeFormState extends State<NewNodePageForm> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), decoration: InputDecoration( hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).password, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), controller: _passwordController, validator: (value) => null, diff --git a/lib/src/screens/nodes/nodes_list_page.dart b/lib/src/screens/nodes/nodes_list_page.dart index 990745cc8..8c0a04be6 100644 --- a/lib/src/screens/nodes/nodes_list_page.dart +++ b/lib/src/screens/nodes/nodes_list_page.dart @@ -18,9 +18,6 @@ class NodeListPage extends BasePage { @override String get title => S.current.nodes; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget trailing(context) { final nodeList = Provider.of<NodeListStore>(context); @@ -31,7 +28,7 @@ class NodeListPage extends BasePage { width: 72, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(16)), - color: PaletteDark.menuList + color: Theme.of(context).accentTextTheme.title.backgroundColor ), child: ButtonTheme( minWidth: double.minPositive, @@ -82,24 +79,25 @@ class NodeListPageBodyState extends State<NodeListPageBody> { final trashImage = Image.asset('assets/images/trash.png', height: 32, width: 32, color: Colors.white); - final currentColor = PaletteDark.menuHeader; - final notCurrentColor = PaletteDark.menuList; + final currentColor = Theme.of(context).accentTextTheme.subtitle.decorationColor; + final notCurrentColor = Theme.of(context).accentTextTheme.title.backgroundColor; final currentTextColor = Colors.blue; - final notCurrentTextColor = Colors.white; + final notCurrentTextColor = Theme.of(context).primaryTextTheme.title.color; return Container( height: double.infinity, - color: PaletteDark.historyPanel, padding: EdgeInsets.only(top: 12), child: Column( mainAxisSize: MainAxisSize.max, children: <Widget>[ NodeListRow( title: S.of(context).add_new_node, - trailing: Icon(Icons.add, color: Colors.white, size: 24.0), - color: PaletteDark.menuList, - textColor: Colors.white, + trailing: Icon(Icons.add, + color: Theme.of(context).primaryTextTheme.title.color, + size: 24.0), + color: Theme.of(context).accentTextTheme.title.backgroundColor, + textColor: Theme.of(context).primaryTextTheme.title.color, onTap: () async => await Navigator.of(context).pushNamed(Routes.newNode), isDrawTop: true, @@ -112,10 +110,10 @@ class NodeListPageBodyState extends State<NodeListPageBody> { separatorBuilder: (_, __) => Container( height: 1, padding: EdgeInsets.only(left: 24), - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: Container( height: 1, - color: PaletteDark.walletCardTopEndSync, + color: Theme.of(context).dividerColor, ), ), itemCount: nodeList.nodes.length, diff --git a/lib/src/screens/nodes/widgets/node_list_row.dart b/lib/src/screens/nodes/widgets/node_list_row.dart index 2e3dd4017..17a17c8a9 100644 --- a/lib/src/screens/nodes/widgets/node_list_row.dart +++ b/lib/src/screens/nodes/widgets/node_list_row.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; class NodeListRow extends StatelessWidget { NodeListRow({ @@ -27,7 +26,7 @@ class NodeListRow extends StatelessWidget { ? Container( width: double.infinity, height: 1, - color: PaletteDark.walletCardTopEndSync, + color: Theme.of(context).dividerColor, ) : Offstage(), Container( @@ -54,7 +53,7 @@ class NodeListRow extends StatelessWidget { ? Container( width: double.infinity, height: 1, - color: PaletteDark.walletCardTopEndSync, + color: Theme.of(context).dividerColor, ) : Offstage(), ], diff --git a/lib/src/screens/pin_code/pin_code.dart b/lib/src/screens/pin_code/pin_code.dart index e8d7ad649..111355b2d 100644 --- a/lib/src/screens/pin_code/pin_code.dart +++ b/lib/src/screens/pin_code/pin_code.dart @@ -1,7 +1,6 @@ import 'package:provider/provider.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/stores/settings/settings_store.dart'; import 'package:cake_wallet/generated/i18n.dart'; @@ -29,8 +28,6 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> { static const defaultPinLength = 4; static const sixPinLength = 6; static const fourPinLength = 4; - static final deleteIconImage = Image.asset('assets/images/delete_icon.png'); - static final faceImage = Image.asset('assets/images/face.png'); final _gridViewKey = GlobalKey(); int pinLength = defaultPinLength; @@ -89,9 +86,18 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> { Widget build(BuildContext context) => Scaffold(body: body(context)); Widget body(BuildContext context) { + final deleteIconImage = Image.asset( + 'assets/images/delete_icon.png', + color: Theme.of(context).primaryTextTheme.title.color, + ); + final faceImage = Image.asset( + 'assets/images/face.png', + color: Theme.of(context).primaryTextTheme.title.color, + ); + return SafeArea( child: Container( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, padding: EdgeInsets.only(left: 40.0, right: 40.0, bottom: 40.0), child: Column(children: <Widget>[ Spacer(flex: 2), @@ -99,7 +105,8 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> { style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, - color: Colors.white)), + color: Theme.of(context).primaryTextTheme.title.color + )), Spacer(flex: 3), Container( width: 180, @@ -114,7 +121,9 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> { height: size, decoration: BoxDecoration( shape: BoxShape.circle, - color: isFilled ? Colors.white : PaletteDark.walletCardAddressField, + color: isFilled + ? Theme.of(context).primaryTextTheme.title.color + : Theme.of(context).primaryTextTheme.caption.color, )); }), ), @@ -129,7 +138,7 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> { }, child: Text( _changePinLengthText(), - style: TextStyle(fontSize: 14.0, color: PaletteDark.walletCardText), + style: TextStyle(fontSize: 14.0, color: Theme.of(context).primaryTextTheme.caption.color), )) ], Spacer(flex: 1), @@ -153,7 +162,7 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> { left: marginLeft, right: marginRight), child: FlatButton( onPressed: () {}, - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, shape: CircleBorder(), child: faceImage, ), @@ -166,7 +175,7 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> { left: marginLeft, right: marginRight), child: FlatButton( onPressed: () => _pop(), - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, shape: CircleBorder(), child: deleteIconImage, ), @@ -180,13 +189,13 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> { left: marginLeft, right: marginRight), child: FlatButton( onPressed: () => _push(index), - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, shape: CircleBorder(), child: Text('$index', style: TextStyle( fontSize: 30.0, fontWeight: FontWeight.bold, - color: Colors.white)), + color: Theme.of(context).primaryTextTheme.title.color)), ), ); }), diff --git a/lib/src/screens/receive/receive_page.dart b/lib/src/screens/receive/receive_page.dart index 5484d03df..2479404e1 100644 --- a/lib/src/screens/receive/receive_page.dart +++ b/lib/src/screens/receive/receive_page.dart @@ -6,60 +6,28 @@ import 'package:esys_flutter_share/esys_flutter_share.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:provider/provider.dart'; import 'package:cake_wallet/routes.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/stores/subaddress_list/subaddress_list_store.dart'; import 'package:cake_wallet/src/stores/wallet/wallet_store.dart'; import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart'; -import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/accounts/account_list_page.dart'; import 'package:cake_wallet/src/stores/account_list/account_list_store.dart'; import 'package:cake_wallet/src/screens/receive/widgets/header_tile.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; +import 'package:cake_wallet/themes.dart'; +import 'package:cake_wallet/theme_changer.dart'; -class ReceivePage extends BasePage { +class ReceivePage extends StatefulWidget { @override - Color get backgroundColor => PaletteDark.mainBackgroundColor; - - @override - bool get resizeToAvoidBottomPadding => false; - - @override - String get title => S.current.receive; - - @override - Widget trailing(BuildContext context) { - final walletStore = Provider.of<WalletStore>(context); - final shareImage = Image.asset('assets/images/share.png'); - - return SizedBox( - height: 37.0, - width: 37.0, - child: ButtonTheme( - minWidth: double.minPositive, - child: FlatButton( - highlightColor: Colors.transparent, - splashColor: Colors.transparent, - padding: EdgeInsets.all(0), - onPressed: () => Share.text( - S.current.share_address, walletStore.subaddress.address, 'text/plain'), - child: shareImage), - ), - ); - } - - @override - Widget body(BuildContext context) => ReceiveBody(); + ReceivePageState createState() => ReceivePageState(); } -class ReceiveBody extends StatefulWidget { - @override - ReceiveBodyState createState() => ReceiveBodyState(); -} - -class ReceiveBodyState extends State<ReceiveBody> { +class ReceivePageState extends State<ReceivePage> { final amountController = TextEditingController(); final _formKey = GlobalKey<FormState>(); + final _backArrowImage = Image.asset('assets/images/back_arrow.png'); + final _backArrowImageDarkTheme = + Image.asset('assets/images/back_arrow_dark_theme.png'); @override void dispose() { @@ -73,13 +41,27 @@ class ReceiveBodyState extends State<ReceiveBody> { final subaddressListStore = Provider.of<SubaddressListStore>(context); final accountListStore = Provider.of<AccountListStore>(context); - final copyImage = Image.asset('assets/images/copy_content.png'); + final shareImage = Image.asset('assets/images/share.png', + color: Theme.of(context).primaryTextTheme.title.color, + ); + final copyImage = Image.asset('assets/images/copy_content.png', + color: Theme.of(context).primaryTextTheme.title.color, + ); - final currentColor = PaletteDark.menuList; - final notCurrentColor = PaletteDark.historyPanel; + final currentColor = Theme.of(context).accentTextTheme.subtitle.decorationColor; + final notCurrentColor = Theme.of(context).backgroundColor; final currentTextColor = Colors.blue; - final notCurrentTextColor = PaletteDark.walletCardText; + final notCurrentTextColor = Theme.of(context).primaryTextTheme.caption.color; + + final _themeChanger = Provider.of<ThemeChanger>(context); + Image _backButton; + + if (_themeChanger.getTheme() == Themes.darkTheme) { + _backButton = _backArrowImageDarkTheme; + } else { + _backButton = _backArrowImage; + } amountController.addListener(() { if (_formKey.currentState.validate()) { @@ -89,227 +71,292 @@ class ReceiveBodyState extends State<ReceiveBody> { } }); - return Container( - height: MediaQuery.of(context).size.height, - width: MediaQuery.of(context).size.width, - color: PaletteDark.mainBackgroundColor, - padding: EdgeInsets.only(top: 24), - child: SingleChildScrollView( - child: Column( - children: <Widget>[ - Observer(builder: (_) { - return Row( - children: <Widget>[ - Spacer( - flex: 1, - ), - Flexible( - flex: 2, - child: Center( - child: AspectRatio( - aspectRatio: 1.0, - child: QrImage( - data: walletStore.subaddress.address + - walletStore.amountValue, - backgroundColor: Colors.transparent, - foregroundColor: PaletteDark.walletCardText, - ), - ), - )), - Spacer( - flex: 1, - ) - ], - ); - }), - Padding( - padding: EdgeInsets.all(24), - child: Row( - children: <Widget>[ - Expanded( - child: Form( - key: _formKey, - child: BaseTextFormField( - controller: amountController, - keyboardType: TextInputType.numberWithOptions(decimal: true), - inputFormatters: [ - BlacklistingTextInputFormatter( - RegExp('[\\-|\\ |\\,]')) - ], - textAlign: TextAlign.center, - hintText: S.of(context).receive_amount, - borderColor: PaletteDark.walletCardText, - validator: (value) { - walletStore.validateAmount(value); - return walletStore.errorMessage; - }, - autovalidate: true, - ) - ) - ) - ], - ), - ), - Padding( - padding: EdgeInsets.only(left: 24, right: 24, bottom: 24), - child: Observer( - builder: (_) => GestureDetector( - onTap: () { - Clipboard.setData(ClipboardData( - text: walletStore.subaddress.address)); - Scaffold.of(context).showSnackBar(SnackBar( - content: Text( - S.of(context).copied_to_clipboard, - style: TextStyle(color: Colors.white), - ), - backgroundColor: Colors.green, - duration: Duration(milliseconds: 500), - )); - }, - child: Container( - height: 48, - padding: EdgeInsets.only(left: 24, right: 24), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(24)), - color: PaletteDark.walletCardSubAddressField - ), - child: Row( - mainAxisSize: MainAxisSize.max, - children: <Widget>[ - Expanded( - child: Text( - walletStore.subaddress.address, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - color: Colors.white - ), - ), - ), - Padding( - padding: EdgeInsets.only(left: 12), - child: copyImage, - ) - ], + return Scaffold( + resizeToAvoidBottomPadding: false, + body: Container( + height: MediaQuery.of(context).size.height, + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.only(top: 24), + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + Theme.of(context).scaffoldBackgroundColor, + Theme.of(context).primaryColor + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight + ) + ), + child: Column( + children: <Widget>[ + Container( + padding: EdgeInsets.only( + top: 10, + bottom: 20, + left: 5, + right: 10 + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: <Widget>[ + SizedBox( + height: 44, + width: 44, + child: ButtonTheme( + minWidth: double.minPositive, + child: FlatButton( + highlightColor: Colors.transparent, + splashColor: Colors.transparent, + padding: EdgeInsets.all(0), + onPressed: () => Navigator.of(context).pop(), + child: _backButton), ), ), - ) - ), - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(24), - topRight: Radius.circular(24), - ), - color: PaletteDark.historyPanel, - ), - child: Observer( - builder: (_) => ListView.separated( - separatorBuilder: (context, index) => Divider( - height: 1, - color: PaletteDark.menuList, + Text( + S.of(context).receive, + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + color: Theme.of(context).primaryTextTheme.title.color), + ), + SizedBox( + height: 44.0, + width: 44.0, + child: ButtonTheme( + minWidth: double.minPositive, + child: FlatButton( + highlightColor: Colors.transparent, + splashColor: Colors.transparent, + padding: EdgeInsets.all(0), + onPressed: () => Share.text( + S.current.share_address, walletStore.subaddress.address, 'text/plain'), + child: shareImage), ), - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemCount: subaddressListStore.subaddresses.length + 2, - itemBuilder: (context, index) { - - if (index == 0) { - return HeaderTile( - onTap: () async { - await showDialog<void>( - context: context, - builder: (BuildContext context) { - return AccountListPage(accountListStore: accountListStore); - } - ); - }, - title: walletStore.account.label, - icon: Icon( - Icons.arrow_forward_ios, - size: 14, - color: Colors.white, - ) - ); - } - - if (index == 1) { - return HeaderTile( - onTap: () => Navigator.of(context) - .pushNamed(Routes.newSubaddress), - title: S.of(context).subaddresses, - icon: Icon( - Icons.add, - size: 20, - color: Colors.white, - ) - ); - } - - index -= 2; - - return Observer( - builder: (_) { - final subaddress = subaddressListStore.subaddresses[index]; - final isCurrent = - walletStore.subaddress.address == subaddress.address; - - final label = subaddress.label.isNotEmpty - ? subaddress.label - : subaddress.address; - - final content = InkWell( - onTap: () => walletStore.setSubaddress(subaddress), - child: Container( - color: isCurrent ? currentColor : notCurrentColor, - padding: EdgeInsets.only( - left: 24, - right: 24, - top: 28, - bottom: 28 - ), - child: Text( - label, - style: TextStyle( - fontSize: subaddress.label.isNotEmpty - ? 18 : 10, - fontWeight: FontWeight.bold, - color: isCurrent - ? currentTextColor - : notCurrentTextColor, + ) + ], + ), + ), + Expanded( + child: SingleChildScrollView( + child: Column( + children: <Widget>[ + Observer(builder: (_) { + return Row( + children: <Widget>[ + Spacer( + flex: 1, + ), + Flexible( + flex: 2, + child: Center( + child: AspectRatio( + aspectRatio: 1.0, + child: QrImage( + data: walletStore.subaddress.address + + walletStore.amountValue, + backgroundColor: Colors.transparent, + foregroundColor: Theme.of(context).primaryTextTheme.display4.color, ), ), - ), - ); - - return isCurrent - ? content - : Slidable( - key: Key(subaddress.address), - actionPane: SlidableDrawerActionPane(), - child: content, - secondaryActions: <Widget>[ - IconSlideAction( - caption: S.of(context).edit, - color: PaletteDark.walletCardSubAddressField, - icon: Icons.edit, - onTap: () => Navigator.of(context) - .pushNamed(Routes.newSubaddress, arguments: subaddress), - ) - ] - ); - } + )), + Spacer( + flex: 1, + ) + ], ); - } - ) - ), - ), - ], - ), - ) + }), + Padding( + padding: EdgeInsets.all(24), + child: Row( + children: <Widget>[ + Expanded( + child: Form( + key: _formKey, + child: BaseTextFormField( + controller: amountController, + keyboardType: TextInputType.numberWithOptions(decimal: true), + inputFormatters: [ + BlacklistingTextInputFormatter( + RegExp('[\\-|\\ |\\,]')) + ], + textAlign: TextAlign.center, + hintText: S.of(context).receive_amount, + borderColor: Theme.of(context).primaryTextTheme.caption.color, + validator: (value) { + walletStore.validateAmount(value); + return walletStore.errorMessage; + }, + autovalidate: true, + ) + ) + ) + ], + ), + ), + Padding( + padding: EdgeInsets.only(left: 24, right: 24, bottom: 24), + child: Builder( + builder: (context) => Observer( + builder: (context) => GestureDetector( + onTap: () { + Clipboard.setData(ClipboardData( + text: walletStore.subaddress.address)); + Scaffold.of(context).showSnackBar(SnackBar( + content: Text( + S.of(context).copied_to_clipboard, + style: TextStyle(color: Colors.white), + ), + backgroundColor: Colors.green, + duration: Duration(milliseconds: 500), + )); + }, + child: Container( + height: 48, + padding: EdgeInsets.only(left: 24, right: 24), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(24)), + color: Theme.of(context).primaryTextTheme.overline.color + ), + child: Row( + mainAxisSize: MainAxisSize.max, + children: <Widget>[ + Expanded( + child: Text( + walletStore.subaddress.address, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: Theme.of(context).primaryTextTheme.title.color + ), + ), + ), + Padding( + padding: EdgeInsets.only(left: 12), + child: copyImage, + ) + ], + ), + ), + ) + ) + ), + ), + Observer( + builder: (_) => ListView.separated( + separatorBuilder: (context, index) => Divider( + height: 1, + color: Theme.of(context).dividerColor, + ), + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemCount: subaddressListStore.subaddresses.length + 2, + itemBuilder: (context, index) { + + if (index == 0) { + return ClipRRect( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24) + ), + child: HeaderTile( + onTap: () async { + await showDialog<void>( + context: context, + builder: (BuildContext context) { + return AccountListPage(accountListStore: accountListStore); + } + ); + }, + title: walletStore.account.label, + icon: Icon( + Icons.arrow_forward_ios, + size: 14, + color: Theme.of(context).primaryTextTheme.title.color, + ) + ), + ); + } + + if (index == 1) { + return HeaderTile( + onTap: () => Navigator.of(context) + .pushNamed(Routes.newSubaddress), + title: S.of(context).subaddresses, + icon: Icon( + Icons.add, + size: 20, + color: Theme.of(context).primaryTextTheme.title.color, + ) + ); + } + + index -= 2; + + return Observer( + builder: (_) { + final subaddress = subaddressListStore.subaddresses[index]; + final isCurrent = + walletStore.subaddress.address == subaddress.address; + + final label = subaddress.label.isNotEmpty + ? subaddress.label + : subaddress.address; + + final content = InkWell( + onTap: () => walletStore.setSubaddress(subaddress), + child: Container( + color: isCurrent ? currentColor : notCurrentColor, + padding: EdgeInsets.only( + left: 24, + right: 24, + top: 28, + bottom: 28 + ), + child: Text( + label, + style: TextStyle( + fontSize: subaddress.label.isNotEmpty + ? 18 : 10, + fontWeight: FontWeight.bold, + color: isCurrent + ? currentTextColor + : notCurrentTextColor, + ), + ), + ), + ); + + return isCurrent + ? content + : Slidable( + key: Key(subaddress.address), + actionPane: SlidableDrawerActionPane(), + child: content, + secondaryActions: <Widget>[ + IconSlideAction( + caption: S.of(context).edit, + color: Theme.of(context).primaryTextTheme.overline.color, + icon: Icons.edit, + onTap: () => Navigator.of(context) + .pushNamed(Routes.newSubaddress, arguments: subaddress), + ) + ] + ); + } + ); + } + ) + ), + ], + ), + ) + ) + ], + ) + ), ); } } \ No newline at end of file diff --git a/lib/src/screens/receive/widgets/header_tile.dart b/lib/src/screens/receive/widgets/header_tile.dart index 74ab84e84..5688eaed7 100644 --- a/lib/src/screens/receive/widgets/header_tile.dart +++ b/lib/src/screens/receive/widgets/header_tile.dart @@ -23,7 +23,7 @@ class HeaderTile extends StatelessWidget { top: 24, bottom: 24 ), - color: Colors.transparent, + color: Theme.of(context).backgroundColor, child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -33,7 +33,7 @@ class HeaderTile extends StatelessWidget { style: TextStyle( fontSize: 18, fontWeight: FontWeight.bold, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), Container( @@ -41,7 +41,7 @@ class HeaderTile extends StatelessWidget { width: 32, decoration: BoxDecoration( shape: BoxShape.circle, - color: PaletteDark.menuList + color: Theme.of(context).primaryTextTheme.overline.color ), child: icon, ) diff --git a/lib/src/screens/rescan/rescan_page.dart b/lib/src/screens/rescan/rescan_page.dart index ccc925429..ca6af90fa 100644 --- a/lib/src/screens/rescan/rescan_page.dart +++ b/lib/src/screens/rescan/rescan_page.dart @@ -17,7 +17,7 @@ class RescanPage extends BasePage { final rescanWalletStore = Provider.of<RescanWalletStore>(context); return Padding( - padding: EdgeInsets.only(left: 20, right: 20, bottom: 20), + padding: EdgeInsets.only(left: 24, right: 24, bottom: 24), child: Column(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ BlockchainHeightWidget(key: blockchainKey), @@ -31,9 +31,8 @@ class RescanPage extends BasePage { restoreHeight: blockchainKey.currentState.height); Navigator.of(context).pop(); }, - color: - Theme.of(context).primaryTextTheme.button.backgroundColor, - textColor: Theme.of(context).primaryTextTheme.button.color,)) + color: Colors.blue, + textColor: Colors.white,)) ]), ); } diff --git a/lib/src/screens/restore/restore_options_page.dart b/lib/src/screens/restore/restore_options_page.dart index 54aa045d9..654fb3a5c 100644 --- a/lib/src/screens/restore/restore_options_page.dart +++ b/lib/src/screens/restore/restore_options_page.dart @@ -11,9 +11,6 @@ class RestoreOptionsPage extends BasePage { @override String get title => S.current.restore_restore_wallet; - @override - Color get backgroundColor => PaletteDark.historyPanel; - final imageSeedKeys = Image.asset('assets/images/restore_wallet_image.png'); final imageBackup = Image.asset('assets/images/backup.png'); @@ -23,7 +20,6 @@ class RestoreOptionsPage extends BasePage { width: double.infinity, height: double.infinity, padding: EdgeInsets.all(24), - color: PaletteDark.historyPanel, child: SingleChildScrollView( child: Column( children: <Widget>[ diff --git a/lib/src/screens/restore/restore_wallet_from_keys_page.dart b/lib/src/screens/restore/restore_wallet_from_keys_page.dart index 6a8d1b1d6..766ef7a0e 100644 --- a/lib/src/screens/restore/restore_wallet_from_keys_page.dart +++ b/lib/src/screens/restore/restore_wallet_from_keys_page.dart @@ -14,7 +14,6 @@ import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/widgets/blockchain_height_widget.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/widgets/alert_with_one_action.dart'; @@ -31,9 +30,6 @@ class RestoreWalletFromKeysPage extends BasePage { @override String get title => S.current.restore_title_from_keys; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => RestoreFromKeysFrom(); } @@ -103,7 +99,6 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> { }); return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.only(left: 24, right: 24), child: ScrollableWithBottomSection( contentPadding: EdgeInsets.only(bottom: 24.0), @@ -118,22 +113,22 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), controller: _nameController, decoration: InputDecoration( hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).restore_wallet_name, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), validator: (value) { walletRestorationStore.validateWalletName(value); @@ -151,24 +146,24 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), controller: _addressController, keyboardType: TextInputType.multiline, maxLines: null, decoration: InputDecoration( hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).restore_address, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), validator: (value) { walletRestorationStore.validateAddress(value); @@ -186,22 +181,22 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), controller: _viewKeyController, decoration: InputDecoration( hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).restore_view_key_private, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), validator: (value) { walletRestorationStore.validateKeys(value); @@ -219,22 +214,22 @@ class _RestoreFromKeysFromState extends State<RestoreFromKeysFrom> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), controller: _spendKeyController, decoration: InputDecoration( hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).restore_spend_key_private, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), validator: (value) { walletRestorationStore.validateKeys(value); diff --git a/lib/src/screens/restore/restore_wallet_from_seed_details.dart b/lib/src/screens/restore/restore_wallet_from_seed_details.dart index 1a2f85eab..2347b34b8 100644 --- a/lib/src/screens/restore/restore_wallet_from_seed_details.dart +++ b/lib/src/screens/restore/restore_wallet_from_seed_details.dart @@ -10,16 +10,12 @@ import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart'; import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; class RestoreWalletFromSeedDetailsPage extends BasePage { @override String get title => S.current.restore_wallet_restore_description; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => RestoreFromSeedDetailsForm(); } @@ -76,7 +72,6 @@ class _RestoreFromSeedDetailsFormState }); return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.only(left: 24, right: 24), child: ScrollableWithBottomSection( contentPadding: EdgeInsets.only(bottom: 24.0), @@ -92,22 +87,22 @@ class _RestoreFromSeedDetailsFormState child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), controller: _nameController, decoration: InputDecoration( hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).restore_wallet_name, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), validator: (value) { walletRestorationStore diff --git a/lib/src/screens/restore/restore_wallet_from_seed_page.dart b/lib/src/screens/restore/restore_wallet_from_seed_page.dart index 75ff36d10..74820d50b 100644 --- a/lib/src/screens/restore/restore_wallet_from_seed_page.dart +++ b/lib/src/screens/restore/restore_wallet_from_seed_page.dart @@ -28,7 +28,10 @@ class RestoreWalletFromSeedPage extends BasePage { String get title => S.current.restore_title_from_seed; @override - Color get backgroundColor => PaletteDark.menuList; + Color get backgroundLightColor => Palette.lavender; + + @override + Color get backgroundDarkColor => PaletteDark.lightNightBlue; @override Widget body(BuildContext context) => RestoreFromSeedForm(key: formKey); @@ -54,7 +57,7 @@ class _RestoreFromSeedFormState extends State<RestoreFromSeedForm> { onTap: () => SystemChannels.textInput.invokeMethod<void>('TextInput.hide'), child: Container( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, child: SeedWidget( key: _seedKey, onMnemoticChange: (seed) => walletRestorationStore.setSeed(seed), diff --git a/lib/src/screens/restore/restore_wallet_options_page.dart b/lib/src/screens/restore/restore_wallet_options_page.dart index 061dc1f23..e4800a6d9 100644 --- a/lib/src/screens/restore/restore_wallet_options_page.dart +++ b/lib/src/screens/restore/restore_wallet_options_page.dart @@ -13,9 +13,6 @@ class RestoreWalletOptionsPage extends BasePage { @override String get title => S.current.restore_seed_keys_restore; - @override - Color get backgroundColor => PaletteDark.historyPanel; - final imageSeed = Image.asset('assets/images/restore_seed.png'); final imageKeys = Image.asset('assets/images/restore_keys.png'); @@ -27,7 +24,6 @@ class RestoreWalletOptionsPage extends BasePage { width: double.infinity, height: double.infinity, padding: EdgeInsets.all(24), - color: PaletteDark.historyPanel, child: SingleChildScrollView( child: Column( children: <Widget>[ diff --git a/lib/src/screens/restore/widgets/restore_button.dart b/lib/src/screens/restore/widgets/restore_button.dart index b73505f1c..ba07d1fe8 100644 --- a/lib/src/screens/restore/widgets/restore_button.dart +++ b/lib/src/screens/restore/widgets/restore_button.dart @@ -1,6 +1,5 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; class RestoreButton extends StatelessWidget { const RestoreButton({ @@ -25,7 +24,7 @@ class RestoreButton extends StatelessWidget { alignment: Alignment.topLeft, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(12)), - color: PaletteDark.menuList + color: Theme.of(context).accentTextTheme.title.backgroundColor, ), child: Row( mainAxisSize: MainAxisSize.max, @@ -46,7 +45,7 @@ class RestoreButton extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), Padding( @@ -55,7 +54,7 @@ class RestoreButton extends StatelessWidget { description, style: TextStyle( fontSize: 14, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ), ) diff --git a/lib/src/screens/seed/seed_page.dart b/lib/src/screens/seed/seed_page.dart index cd5cc0d06..2be122635 100644 --- a/lib/src/screens/seed/seed_page.dart +++ b/lib/src/screens/seed/seed_page.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/stores/wallet_seed/wallet_seed_store.dart'; @@ -16,9 +15,6 @@ class SeedPage extends BasePage { static final image = Image.asset('assets/images/crypto_lock.png'); - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override String get title => S.current.seed_title; @@ -44,7 +40,7 @@ class SeedPage extends BasePage { alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(16)), - color: PaletteDark.menuList + color: Theme.of(context).accentTextTheme.title.color ), child: Text( S.of(context).seed_language_next, @@ -67,7 +63,6 @@ class SeedPage extends BasePage { return Container( width: double.infinity, height: double.infinity, - color: PaletteDark.historyPanel, child: ScrollableWithBottomSection( contentPadding: EdgeInsets.only(left: 40, right: 40, bottom: 20), content: Column( @@ -90,7 +85,7 @@ class SeedPage extends BasePage { style: TextStyle( fontSize: 20, fontWeight: FontWeight.bold, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), Padding( @@ -100,7 +95,7 @@ class SeedPage extends BasePage { textAlign: TextAlign.center, style: TextStyle( fontSize: 14, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ), ) diff --git a/lib/src/screens/seed_language/seed_language_page.dart b/lib/src/screens/seed_language/seed_language_page.dart index 9f1ebb506..c17109b96 100644 --- a/lib/src/screens/seed_language/seed_language_page.dart +++ b/lib/src/screens/seed_language/seed_language_page.dart @@ -6,15 +6,11 @@ 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/stores/seed_language/seed_language_store.dart'; import 'package:cake_wallet/src/screens/new_wallet/widgets/select_button.dart'; import 'package:cake_wallet/src/screens/seed_language/widgets/seed_language_picker.dart'; class SeedLanguage extends BasePage { - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => SeedLanguageForm(); } @@ -44,7 +40,6 @@ class SeedLanguageFormState extends State<SeedLanguageForm> { ]; return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.only(top: 24), child: ScrollableWithBottomSection( contentPadding: EdgeInsets.only(left: 24, right: 24, bottom: 24), @@ -64,7 +59,7 @@ class SeedLanguageFormState extends State<SeedLanguageForm> { style: TextStyle( fontSize: 16.0, fontWeight: FontWeight.w600, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), ), @@ -73,8 +68,8 @@ class SeedLanguageFormState extends State<SeedLanguageForm> { builder: (_) => SelectButton( image: null, text: seedLocales[seedLanguages.indexOf(seedLanguageStore.selectedSeedLanguage)], - color: PaletteDark.menuList, - textColor: Colors.white, + color: Theme.of(context).accentTextTheme.title.backgroundColor, + textColor: Theme.of(context).primaryTextTheme.title.color, onTap: () async => await showDialog( context: context, builder: (BuildContext context) => SeedLanguagePicker() diff --git a/lib/src/screens/seed_language/widgets/seed_language_picker.dart b/lib/src/screens/seed_language/widgets/seed_language_picker.dart index 2b478205e..a08a4a324 100644 --- a/lib/src/screens/seed_language/widgets/seed_language_picker.dart +++ b/lib/src/screens/seed_language/widgets/seed_language_picker.dart @@ -48,7 +48,7 @@ class SeedLanguagePickerState extends State<SeedLanguagePicker> { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), child: Container( - decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.75)), + decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)), child: Center( child: Column( mainAxisSize: MainAxisSize.min, @@ -75,7 +75,7 @@ class SeedLanguagePickerState extends State<SeedLanguagePicker> { width: 300, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(14)), - color: PaletteDark.walletCardSubAddressField + color: Theme.of(context).dividerColor ), child: GridView.count( shrinkWrap: true, @@ -173,8 +173,12 @@ class SeedLanguagePickerState extends State<SeedLanguagePicker> { @required VoidCallback onTap}) { BorderRadius borderRadius; - final color = isCurrent ? PaletteDark.historyPanel : PaletteDark.menuList; - final textColor = isCurrent ? Colors.blue : Colors.white; + final color = isCurrent + ? Theme.of(context).accentTextTheme.subtitle.decorationColor + : Theme.of(context).primaryTextTheme.display1.color; + final textColor = isCurrent + ? Colors.blue + : Theme.of(context).primaryTextTheme.title.color; switch (place) { case Places.topLeft: diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart index 0584eb89a..f93d634d3 100644 --- a/lib/src/screens/send/send_page.dart +++ b/lib/src/screens/send/send_page.dart @@ -35,7 +35,10 @@ class SendPage extends BasePage { String get title => S.current.send_title; @override - Color get backgroundColor => PaletteDark.menuList; + Color get backgroundLightColor => Palette.lavender; + + @override + Color get backgroundDarkColor => PaletteDark.lightNightBlue; @override bool get resizeToAvoidBottomPadding => false; @@ -49,7 +52,7 @@ class SendPage extends BasePage { width: 82, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(16)), - color: PaletteDark.menuHeader + color: Theme.of(context).accentTextTheme.title.color ), child: ButtonTheme( minWidth: double.minPositive, @@ -130,13 +133,13 @@ class SendFormState extends State<SendForm> { _setEffects(context); return Container( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, child: ScrollableWithBottomSection( contentPadding: EdgeInsets.only(bottom: 24), content: Column( children: <Widget>[ TopPanel( - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, widget: Form( key: _formKey, child: Column(children: <Widget>[ @@ -162,6 +165,7 @@ class SendFormState extends State<SendForm> { AddressTextFieldOption.qrCode, AddressTextFieldOption.addressBook ], + buttonColor: Theme.of(context).accentTextTheme.title.color, validator: (value) { sendStore.validateAddress(value, cryptoCurrency: CryptoCurrency.xmr); @@ -175,7 +179,7 @@ class SendFormState extends State<SendForm> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), controller: _cryptoAmountController, keyboardType: TextInputType.numberWithOptions( @@ -191,7 +195,7 @@ class SendFormState extends State<SendForm> { style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, )), ), suffixIcon: Padding( @@ -211,7 +215,7 @@ class SendFormState extends State<SendForm> { overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 16, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ) ), ), @@ -220,7 +224,7 @@ class SendFormState extends State<SendForm> { width: 32, margin: EdgeInsets.only(left: 12, bottom: 7, top: 4), decoration: BoxDecoration( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).accentTextTheme.title.color, borderRadius: BorderRadius.all(Radius.circular(6)) ), child: InkWell( @@ -231,7 +235,7 @@ class SendFormState extends State<SendForm> { style: TextStyle( fontSize: 9, fontWeight: FontWeight.bold, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ) ), ), @@ -242,15 +246,15 @@ class SendFormState extends State<SendForm> { ), hintStyle: TextStyle( fontSize: 16.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), hintText: '0.0000', focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0))), validator: (value) { sendStore.validateXMR( @@ -265,7 +269,7 @@ class SendFormState extends State<SendForm> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), controller: _fiatAmountController, keyboardType: TextInputType.numberWithOptions( signed: false, decimal: true), @@ -281,20 +285,20 @@ class SendFormState extends State<SendForm> { style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, )), ), hintStyle: TextStyle( fontSize: 16.0, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), hintText: '0.00', focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0)))), ), Padding( @@ -306,14 +310,14 @@ class SendFormState extends State<SendForm> { style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, )), Text( '${calculateEstimatedFee(priority: settingsStore.transactionPriority)} XMR', style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, )) ], ), @@ -335,7 +339,7 @@ class SendFormState extends State<SendForm> { style: TextStyle( fontSize: 18, fontWeight: FontWeight.w600, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ) ], @@ -363,7 +367,7 @@ class SendFormState extends State<SendForm> { child: DottedBorder( borderType: BorderType.RRect, dashPattern: [8, 4], - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, strokeWidth: 2, radius: Radius.circular(20), child: Container( @@ -380,7 +384,7 @@ class SendFormState extends State<SendForm> { style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ), ) diff --git a/lib/src/screens/send/send_template_page.dart b/lib/src/screens/send/send_template_page.dart index 1326aac51..5197f61ab 100644 --- a/lib/src/screens/send/send_template_page.dart +++ b/lib/src/screens/send/send_template_page.dart @@ -21,7 +21,10 @@ class SendTemplatePage extends BasePage { String get title => S.current.send_title; @override - Color get backgroundColor => PaletteDark.menuList; + Color get backgroundLightColor => Palette.lavender; + + @override + Color get backgroundDarkColor => PaletteDark.lightNightBlue; @override bool get resizeToAvoidBottomPadding => false; @@ -65,33 +68,33 @@ class SendTemplateFormState extends State<SendTemplateForm> { _setEffects(context); return Container( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, child: ScrollableWithBottomSection( contentPadding: EdgeInsets.only(bottom: 24), content: Column( children: <Widget>[ TopPanel( - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, widget: Form( key: _formKey, child: Column(children: <Widget>[ TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), controller: _nameController, decoration: InputDecoration( hintStyle: TextStyle( fontSize: 16.0, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), hintText: S.of(context).send_name, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0))), validator: (value) { sendTemplateStore.validateTemplate(value); @@ -121,6 +124,7 @@ class SendTemplateFormState extends State<SendTemplateForm> { AddressTextFieldOption.qrCode, AddressTextFieldOption.addressBook ], + buttonColor: Theme.of(context).accentTextTheme.title.color, validator: (value) { sendTemplateStore.validateTemplate(value); return sendTemplateStore.errorMessage; @@ -134,7 +138,7 @@ class SendTemplateFormState extends State<SendTemplateForm> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), controller: _cryptoAmountController, keyboardType: TextInputType.numberWithOptions( @@ -150,20 +154,20 @@ class SendTemplateFormState extends State<SendTemplateForm> { style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, )), ), hintStyle: TextStyle( fontSize: 16.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), hintText: '0.0000', focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0))), ), ); @@ -174,7 +178,7 @@ class SendTemplateFormState extends State<SendTemplateForm> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), controller: _fiatAmountController, keyboardType: TextInputType.numberWithOptions( signed: false, decimal: true), @@ -190,20 +194,20 @@ class SendTemplateFormState extends State<SendTemplateForm> { style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, )), ), hintStyle: TextStyle( fontSize: 16.0, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), hintText: '0.00', focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0)))), ), ]), diff --git a/lib/src/screens/send/widgets/sending_alert.dart b/lib/src/screens/send/widgets/sending_alert.dart index 9008ab5c8..db6803ead 100644 --- a/lib/src/screens/send/widgets/sending_alert.dart +++ b/lib/src/screens/send/widgets/sending_alert.dart @@ -1,5 +1,4 @@ import 'dart:ui'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/stores/send/sending_state.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; @@ -31,7 +30,7 @@ class SendingAlertState extends State<SendingAlert> { return Stack( children: <Widget>[ Container( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, child: Center( child: Image.asset( 'assets/images/birthday_cake.png'), @@ -46,7 +45,7 @@ class SendingAlertState extends State<SendingAlert> { style: TextStyle( fontSize: 22, fontWeight: FontWeight.bold, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, decoration: TextDecoration.none, ), ), @@ -70,7 +69,7 @@ class SendingAlertState extends State<SendingAlert> { return Stack( children: <Widget>[ Container( - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, child: Center( child: Image.asset( 'assets/images/birthday_cake.png'), @@ -79,7 +78,7 @@ class SendingAlertState extends State<SendingAlert> { BackdropFilter( filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), child: Container( - decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.25)), + decoration: BoxDecoration(color: Theme.of(context).backgroundColor.withOpacity(0.25)), child: Center( child: Padding( padding: EdgeInsets.only(top: 220), @@ -89,7 +88,7 @@ class SendingAlertState extends State<SendingAlert> { style: TextStyle( fontSize: 22, fontWeight: FontWeight.bold, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, decoration: TextDecoration.none, ), ), diff --git a/lib/src/screens/settings/change_language.dart b/lib/src/screens/settings/change_language.dart index a09188bea..8e2c49ea2 100644 --- a/lib/src/screens/settings/change_language.dart +++ b/lib/src/screens/settings/change_language.dart @@ -5,41 +5,36 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/domain/common/language.dart'; import 'package:cake_wallet/src/stores/settings/settings_store.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; class ChangeLanguage extends BasePage { @override String get title => S.current.settings_change_language; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) { final settingsStore = Provider.of<SettingsStore>(context); final currentLanguage = Provider.of<Language>(context); final currentColor = Colors.green; - final notCurrentColor = Colors.white; + final notCurrentColor = Theme.of(context).primaryTextTheme.title.color; final shortDivider = Container( height: 1, padding: EdgeInsets.only(left: 24), - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: Container( height: 1, - color: PaletteDark.mainBackgroundColor, + color: Theme.of(context).dividerColor, ), ); final longDivider = Container( height: 1, - color: PaletteDark.mainBackgroundColor, + color: Theme.of(context).dividerColor, ); return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.only(top: 10.0), child: ListView.builder( itemCount: languages.values.length, @@ -56,7 +51,7 @@ class ChangeLanguage extends BasePage { index == 0 ? longDivider : Offstage(), Container( padding: EdgeInsets.only(top: 4, bottom: 4), - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: ListTile( contentPadding: EdgeInsets.only(left: 24, right: 24), title: Text( diff --git a/lib/src/screens/settings/enter_pin_code.dart b/lib/src/screens/settings/enter_pin_code.dart deleted file mode 100644 index c18e782c5..000000000 --- a/lib/src/screens/settings/enter_pin_code.dart +++ /dev/null @@ -1,236 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:cake_wallet/palette.dart'; -import 'package:flutter/foundation.dart'; -import 'package:provider/provider.dart'; -import 'package:cake_wallet/theme_changer.dart'; -import 'package:cake_wallet/themes.dart'; -import 'package:cake_wallet/generated/i18n.dart'; - -class EnterPinCode extends StatefulWidget { - const EnterPinCode(this.currentPinLength, this.currentPin); - - final int currentPinLength; - final List<int> currentPin; - - @override - EnterPinCodeState createState() => - EnterPinCodeState(currentPinLength, currentPin); -} - -class EnterPinCodeState extends State<EnterPinCode> { - EnterPinCodeState(this.pinLength, this.currentPin); - - final _gridViewKey = GlobalKey(); - final _closeButtonImage = Image.asset('assets/images/close_button.png'); - final _closeButtonImageDarkTheme = - Image.asset('assets/images/close_button_dark_theme.png'); - static final deleteIconImage = Image.asset('assets/images/delete_icon.png'); - final int pinLength; - final List<int> currentPin; - List<int> pin; - double _aspectRatio = 0; - - void _calcualteCurrentAspectRatio() { - final renderBox = - _gridViewKey.currentContext.findRenderObject() as RenderBox; - final cellWidth = renderBox.size.width / 3; - final cellHeight = renderBox.size.height / 4; - - if (cellWidth > 0 && cellHeight > 0) { - _aspectRatio = cellWidth / cellHeight; - } - - setState(() {}); - } - - @override - void initState() { - super.initState(); - pin = List<int>.filled(pinLength, null); - WidgetsBinding.instance.addPostFrameCallback(_afterLayout); - } - - void _afterLayout(dynamic _) => _calcualteCurrentAspectRatio(); - - @override - Widget build(BuildContext context) { - final _themeChanger = Provider.of<ThemeChanger>(context); - final _isDarkTheme = _themeChanger.getTheme() == Themes.darkTheme; - - return Scaffold( - backgroundColor: Theme.of(context).backgroundColor, - appBar: CupertinoNavigationBar( - leading: ButtonTheme( - minWidth: double.minPositive, - child: FlatButton( - onPressed: () { - Navigator.pop(context, false); - }, - child: _isDarkTheme - ? _closeButtonImageDarkTheme - : _closeButtonImage), - ), - backgroundColor: Theme.of(context).backgroundColor, - border: null), - body: SafeArea( - child: Container( - padding: EdgeInsets.only(left: 40.0, right: 40.0, bottom: 40.0), - child: Column( - children: <Widget>[ - Spacer(flex: 2), - Text(S.of(context).enter_your_pin, - style: TextStyle(fontSize: 24, color: Palette.wildDarkBlue)), - Spacer(flex: 3), - Container( - width: 180, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: List.generate(pinLength, (index) { - const size = 10.0; - final isFilled = pin[index] != null; - - return Container( - width: size, - height: size, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: - isFilled ? Palette.deepPurple : Colors.transparent, - border: Border.all(color: Palette.wildDarkBlue), - )); - }), - ), - ), - Spacer(flex: 3), - Flexible( - flex: 24, - child: Container( - key: _gridViewKey, - child: _aspectRatio > 0 - ? GridView.count( - crossAxisCount: 3, - childAspectRatio: _aspectRatio, - physics: const NeverScrollableScrollPhysics(), - children: List.generate(12, (index) { - if (index == 9) { - return Container( - margin: EdgeInsets.all(5.0), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _isDarkTheme - ? PaletteDark.darkThemePinButton - : Palette.darkGrey, - ), - ); - } else if (index == 10) { - index = 0; - } else if (index == 11) { - return Container( - margin: EdgeInsets.all(5.0), - child: FlatButton( - onPressed: () { - _pop(); - }, - color: _isDarkTheme - ? PaletteDark.darkThemePinButton - : Palette.darkGrey, - shape: CircleBorder(), - child: deleteIconImage, - ), - ); - } else { - index++; - } - - return Container( - margin: EdgeInsets.all(5.0), - child: FlatButton( - onPressed: () { - _push(index); - }, - color: _isDarkTheme - ? PaletteDark.darkThemePinDigitButton - : Palette.creamyGrey, - shape: CircleBorder(), - child: Text('$index', - style: TextStyle( - fontSize: 23.0, - color: Palette.blueGrey)), - ), - ); - }), - ) - : null)) - ], - ), - )), - ); - } - - void _showIncorrectPinDialog(BuildContext context) async { - await showDialog<void>( - context: context, - builder: (BuildContext context) { - return AlertDialog( - content: Text(S.of(context).pin_is_incorrect), - actions: <Widget>[ - FlatButton( - child: Text(S.of(context).ok), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ); - }); - } - - void _push(int num) { - if (_pinLength() >= pinLength) { - return; - } - - for (var i = 0; i < pin.length; i++) { - if (pin[i] == null) { - setState(() => pin[i] = num); - break; - } - } - - final currentPinLength = _pinLength(); - - if (currentPinLength == pinLength) { - if (listEquals<int>(pin, currentPin)) { - Navigator.pop(context, true); - } else { - Navigator.pop(context, false); - - _showIncorrectPinDialog(context); - } - } - } - - void _pop() { - if (_pinLength() == 0) { - return; - } - - for (var i = pin.length - 1; i >= 0; i--) { - if (pin[i] != null) { - setState(() => pin[i] = null); - break; - } - } - } - - int _pinLength() { - return pin.fold(0, (v, e) { - if (e != null) { - return v + 1; - } - - return v; - }); - } -} diff --git a/lib/src/screens/settings/settings.dart b/lib/src/screens/settings/settings.dart index 4ff2eca7d..75d01a7b6 100644 --- a/lib/src/screens/settings/settings.dart +++ b/lib/src/screens/settings/settings.dart @@ -1,7 +1,6 @@ import 'package:cake_wallet/src/screens/auth/auth_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:provider/provider.dart'; @@ -30,9 +29,6 @@ class SettingsPage extends BasePage { @override String get title => S.current.settings_title; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) { return SettingsForm(); @@ -79,7 +75,7 @@ class SettingsFormState extends State<SettingsForm> { textAlign: TextAlign.right, style: TextStyle( fontSize: 14.0, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), )), attribute: Attributes.widget), SettingsItem( @@ -91,7 +87,7 @@ class SettingsFormState extends State<SettingsForm> { textAlign: TextAlign.right, style: TextStyle( fontSize: 14.0, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), )), attribute: Attributes.widget), SettingsItem( @@ -103,7 +99,7 @@ class SettingsFormState extends State<SettingsForm> { textAlign: TextAlign.right, style: TextStyle( fontSize: 14.0, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), )), attribute: Attributes.widget), SettingsItem( @@ -145,7 +141,11 @@ class SettingsFormState extends State<SettingsForm> { children: [ Text(S .of(context) - .settings_transactions), + .settings_transactions, + style: TextStyle( + color: Theme.of(context).primaryTextTheme.title.color + ), + ), Checkbox( value: settingsStore .actionlistDisplayMode @@ -162,7 +162,12 @@ class SettingsFormState extends State<SettingsForm> { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(S.of(context).settings_trades), + Text( + S.of(context).settings_trades, + style: TextStyle( + color: Theme.of(context).primaryTextTheme.title.color + ), + ), Checkbox( value: settingsStore .actionlistDisplayMode @@ -182,7 +187,7 @@ class SettingsFormState extends State<SettingsForm> { Text(S.of(context).settings_display_on_dashboard_list, style: TextStyle( fontSize: 14, - color: Colors.white)), + color: Theme.of(context).primaryTextTheme.title.color)), Observer(builder: (_) { var title = ''; @@ -210,7 +215,7 @@ class SettingsFormState extends State<SettingsForm> { return Text(title, style: TextStyle( fontSize: 14.0, - color: PaletteDark.walletCardText)); + color: Theme.of(context).primaryTextTheme.caption.color)); }) ]), )); @@ -321,20 +326,19 @@ class SettingsFormState extends State<SettingsForm> { final shortDivider = Container( height: 1, padding: EdgeInsets.only(left: 24), - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: Container( height: 1, - color: PaletteDark.mainBackgroundColor, + color: Theme.of(context).dividerColor, ), ); final longDivider = Container( height: 1, - color: PaletteDark.mainBackgroundColor, + color: Theme.of(context).dividerColor, ); return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.only(top: 12), child: SingleChildScrollView( child: Column( @@ -371,7 +375,8 @@ class SettingsFormState extends State<SettingsForm> { child: Text( settingsStore.itemHeaders[ItemHeaders.version], style: TextStyle( - fontSize: 14.0, color: PaletteDark.walletCardText) + fontSize: 14.0, + color: Theme.of(context).primaryTextTheme.caption.color) ), ), ), diff --git a/lib/src/screens/settings/widgets/settings_arrow_list_row.dart b/lib/src/screens/settings/widgets/settings_arrow_list_row.dart index 7e5dd4c92..cf49a4370 100644 --- a/lib/src/screens/settings/widgets/settings_arrow_list_row.dart +++ b/lib/src/screens/settings/widgets/settings_arrow_list_row.dart @@ -1,4 +1,3 @@ -import 'package:cake_wallet/palette.dart'; import 'package:provider/provider.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; @@ -9,15 +8,15 @@ class SettingsArrowListRow extends StatelessWidget { final VoidCallback onTaped; final String title; - final _cakeArrowImage = Image.asset('assets/images/select_arrow.png', - color: PaletteDark.walletCardText); @override Widget build(BuildContext context) { final settingsStore = Provider.of<SettingsStore>(context); + final _cakeArrowImage = Image.asset('assets/images/select_arrow.png', + color: Theme.of(context).primaryTextTheme.caption.color); return Container( - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: ListTile( contentPadding: EdgeInsets.only(left: 24.0, right: 24.0), title: Observer( @@ -25,7 +24,7 @@ class SettingsArrowListRow extends StatelessWidget { settingsStore.itemHeaders[title], style: TextStyle( fontSize: 14.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), )), trailing: _cakeArrowImage, onTap: onTaped), diff --git a/lib/src/screens/settings/widgets/settings_header_list_row.dart b/lib/src/screens/settings/widgets/settings_header_list_row.dart index 30fdc14c7..beae21431 100644 --- a/lib/src/screens/settings/widgets/settings_header_list_row.dart +++ b/lib/src/screens/settings/widgets/settings_header_list_row.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:cake_wallet/src/stores/settings/settings_store.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:provider/provider.dart'; class SettingsHeaderListRow extends StatelessWidget { @@ -29,7 +28,8 @@ class SettingsHeaderListRow extends StatelessWidget { ? settingsStore.itemHeaders[title] : '', style: TextStyle( - fontSize: 15.0, color: Palette.wildDarkBlue), + fontSize: 15.0, + color: Theme.of(context).primaryTextTheme.caption.color), )) ], ), diff --git a/lib/src/screens/settings/widgets/settings_link_list_row.dart b/lib/src/screens/settings/widgets/settings_link_list_row.dart index db82b4097..c0d632161 100644 --- a/lib/src/screens/settings/widgets/settings_link_list_row.dart +++ b/lib/src/screens/settings/widgets/settings_link_list_row.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; class SettingsLinktListRow extends StatelessWidget { SettingsLinktListRow( @@ -13,7 +12,7 @@ class SettingsLinktListRow extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: ListTile( contentPadding: EdgeInsets.only(left: 24.0, right: 24.0), title: Row( @@ -27,7 +26,7 @@ class SettingsLinktListRow extends StatelessWidget { title, style: TextStyle( fontSize: 14.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), ), ) ], diff --git a/lib/src/screens/settings/widgets/settings_raw_widget_list_row.dart b/lib/src/screens/settings/widgets/settings_raw_widget_list_row.dart index aa64d846e..01c3f77d1 100644 --- a/lib/src/screens/settings/widgets/settings_raw_widget_list_row.dart +++ b/lib/src/screens/settings/widgets/settings_raw_widget_list_row.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; class SettingRawWidgetListRow extends StatelessWidget { SettingRawWidgetListRow({@required this.widgetBuilder}); @@ -9,7 +8,7 @@ class SettingRawWidgetListRow extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: widgetBuilder(context) ?? Container(), ); } diff --git a/lib/src/screens/settings/widgets/settings_switch_list_row.dart b/lib/src/screens/settings/widgets/settings_switch_list_row.dart index 78a7ce90d..36abcc163 100644 --- a/lib/src/screens/settings/widgets/settings_switch_list_row.dart +++ b/lib/src/screens/settings/widgets/settings_switch_list_row.dart @@ -1,4 +1,3 @@ -import 'package:cake_wallet/palette.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; @@ -62,14 +61,14 @@ class SettingsSwitchListRow extends StatelessWidget { final settingsStore = Provider.of<SettingsStore>(context); return Container( - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: ListTile( contentPadding: EdgeInsets.only(left: 24.0, right: 24.0), title: Observer( builder: (_) => Text(settingsStore.itemHeaders[title], style: TextStyle( fontSize: 14, - color: Colors.white)), + color: Theme.of(context).primaryTextTheme.title.color)), ), trailing: _getSwitch(context)), ); diff --git a/lib/src/screens/settings/widgets/settings_text_list_row.dart b/lib/src/screens/settings/widgets/settings_text_list_row.dart index da699a772..1115c68d6 100644 --- a/lib/src/screens/settings/widgets/settings_text_list_row.dart +++ b/lib/src/screens/settings/widgets/settings_text_list_row.dart @@ -1,4 +1,3 @@ -import 'package:cake_wallet/palette.dart'; import 'package:provider/provider.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; @@ -16,7 +15,7 @@ class SettingsTextListRow extends StatelessWidget { final settingsStore = Provider.of<SettingsStore>(context); return Container( - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: ListTile( contentPadding: EdgeInsets.only(left: 24.0, right: 24.0), title: Row( @@ -28,7 +27,7 @@ class SettingsTextListRow extends StatelessWidget { settingsStore.itemHeaders[title], style: TextStyle( fontSize: 14.0, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), )), ), Flexible( diff --git a/lib/src/screens/setup_pin_code/setup_pin_code.dart b/lib/src/screens/setup_pin_code/setup_pin_code.dart index 0a41a9099..3313f72a3 100644 --- a/lib/src/screens/setup_pin_code/setup_pin_code.dart +++ b/lib/src/screens/setup_pin_code/setup_pin_code.dart @@ -7,7 +7,6 @@ import 'package:cake_wallet/src/screens/pin_code/pin_code.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/stores/settings/settings_store.dart'; import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; class SetupPinCodePage extends BasePage { @@ -15,9 +14,6 @@ class SetupPinCodePage extends BasePage { final Function(BuildContext, String) onPinCodeSetup; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override String get title => S.current.setup_pin; diff --git a/lib/src/screens/show_keys/show_keys_page.dart b/lib/src/screens/show_keys/show_keys_page.dart index e1bb745f8..d8d5949b0 100644 --- a/lib/src/screens/show_keys/show_keys_page.dart +++ b/lib/src/screens/show_keys/show_keys_page.dart @@ -3,16 +3,12 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/stores/wallet/wallet_keys_store.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/standart_list_row.dart'; class ShowKeysPage extends BasePage { - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override String get title => S.current.wallet_keys; @@ -21,7 +17,6 @@ class ShowKeysPage extends BasePage { final walletKeysStore = Provider.of<WalletKeysStore>(context); return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.only(top: 20.0, bottom: 20.0), child: Observer( builder: (_) { @@ -36,10 +31,10 @@ class ShowKeysPage extends BasePage { separatorBuilder: (context, index) => Container( height: 1, padding: EdgeInsets.only(left: 24), - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: Container( height: 1, - color: PaletteDark.walletCardTopEndSync, + color: Theme.of(context).dividerColor, ), ), itemCount: keysMap.length, diff --git a/lib/src/screens/subaddress/new_subaddress_page.dart b/lib/src/screens/subaddress/new_subaddress_page.dart index 25dd46b03..8309ff4a0 100644 --- a/lib/src/screens/subaddress/new_subaddress_page.dart +++ b/lib/src/screens/subaddress/new_subaddress_page.dart @@ -9,7 +9,6 @@ import 'package:cake_wallet/src/stores/subaddress_creation/subaddress_creation_s import 'package:cake_wallet/src/stores/subaddress_creation/subaddress_creation_store.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; class NewSubaddressPage extends BasePage { @@ -20,9 +19,6 @@ class NewSubaddressPage extends BasePage { @override String get title => S.current.new_subaddress_title; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => NewSubaddressForm(subaddress); @@ -86,7 +82,6 @@ class NewSubaddressFormState extends State<NewSubaddressForm> { return Form( key: _formKey, child: Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.all(24.0), child: Column( children: <Widget>[ diff --git a/lib/src/screens/trade_details/trade_details_page.dart b/lib/src/screens/trade_details/trade_details_page.dart index f5ceea3ef..e750694dc 100644 --- a/lib/src/screens/trade_details/trade_details_page.dart +++ b/lib/src/screens/trade_details/trade_details_page.dart @@ -9,13 +9,9 @@ import 'package:cake_wallet/src/stores/settings/settings_store.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart'; import 'package:cake_wallet/src/widgets/standart_list_row.dart'; -import 'package:cake_wallet/palette.dart'; class TradeDetailsPage extends BasePage { - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override String get title => S.current.trade_details_title; @@ -28,7 +24,6 @@ class TradeDetailsPage extends BasePage { formatDefault: "dd.MM.yyyy, HH:mm"); return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.only(top: 20, bottom: 20), child: Observer(builder: (_) { final trade = exchangeStore.trade; @@ -64,10 +59,10 @@ class TradeDetailsPage extends BasePage { separatorBuilder: (_, __) => Container( height: 1, padding: EdgeInsets.only(left: 24), - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: Container( height: 1, - color: PaletteDark.walletCardTopEndSync, + color: Theme.of(context).dividerColor, ), ), itemCount: items.length, diff --git a/lib/src/screens/transaction_details/transaction_details_page.dart b/lib/src/screens/transaction_details/transaction_details_page.dart index 1686f5928..3cad58072 100644 --- a/lib/src/screens/transaction_details/transaction_details_page.dart +++ b/lib/src/screens/transaction_details/transaction_details_page.dart @@ -15,9 +15,6 @@ class TransactionDetailsPage extends BasePage { final TransactionInfo transactionInfo; - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override String get title => S.current.transaction_details_title; @@ -78,16 +75,15 @@ class TransactionDetailsFormState extends State<TransactionDetailsForm> { @override Widget build(BuildContext context) { return Container( - color: PaletteDark.historyPanel, padding: EdgeInsets.only(top: 20, bottom: 20), child: ListView.separated( separatorBuilder: (context, index) => Container( height: 1, padding: EdgeInsets.only(left: 24), - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: Container( height: 1, - color: PaletteDark.walletCardTopEndSync, + color: Theme.of(context).dividerColor, ), ), itemCount: _items.length, diff --git a/lib/src/screens/wallet_list/wallet_list_page.dart b/lib/src/screens/wallet_list/wallet_list_page.dart index 81928268b..ddea976db 100644 --- a/lib/src/screens/wallet_list/wallet_list_page.dart +++ b/lib/src/screens/wallet_list/wallet_list_page.dart @@ -14,10 +14,6 @@ import 'package:cake_wallet/src/screens/wallet_list/wallet_menu.dart'; import 'package:cake_wallet/src/screens/wallet_list/widgets/wallet_tile.dart'; class WalletListPage extends BasePage { - - @override - Color get backgroundColor => PaletteDark.historyPanel; - @override Widget body(BuildContext context) => WalletListBody(); } @@ -29,8 +25,6 @@ class WalletListBody extends StatefulWidget { class WalletListBodyState extends State<WalletListBody> { final moneroIcon = Image.asset('assets/images/monero.png', height: 24, width: 24); - 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); WalletListStore _walletListStore; ScrollController scrollController = ScrollController(); @@ -39,10 +33,18 @@ class WalletListBodyState extends State<WalletListBody> { final walletStore = Provider.of<WalletStore>(context); _walletListStore = Provider.of<WalletListStore>(context); + final newWalletImage = Image.asset('assets/images/new_wallet.png', + height: 12, + width: 12, + color: Palette.oceanBlue); + final restoreWalletImage = Image.asset('assets/images/restore_wallet.png', + height: 12, + width: 12, + color: Theme.of(context).primaryTextTheme.title.color); + return SafeArea( child: Container( padding: EdgeInsets.only(top: 16), - color: PaletteDark.historyPanel, child: ScrollableWithBottomSection( contentPadding: EdgeInsets.only(bottom: 20), content: Container( @@ -51,7 +53,8 @@ class WalletListBodyState extends State<WalletListBody> { shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), separatorBuilder: (_, index) => Divider( - color: PaletteDark.historyPanel, height: 16), + color: Theme.of(context).backgroundColor, + height: 16), itemCount: _walletListStore.wallets.length, itemBuilder: (__, index) { final wallet = _walletListStore.wallets[index]; @@ -110,7 +113,7 @@ class WalletListBodyState extends State<WalletListBody> { child: Container( height: 108, width: 108, - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, child: Container( padding: EdgeInsets.only(left: 5, right: 5), decoration: BoxDecoration( @@ -156,15 +159,17 @@ class WalletListBodyState extends State<WalletListBody> { image: newWalletImage, text: S.of(context).wallet_list_create_new_wallet, color: Colors.white, - textColor: PaletteDark.historyPanel), + textColor: Palette.oceanBlue, + borderColor: Palette.oceanBlue, + ), SizedBox(height: 10.0), PrimaryImageButton( onPressed: () => Navigator.of(context).pushNamed(Routes.restoreWalletOptions), image: restoreWalletImage, text: S.of(context).wallet_list_restore_wallet, - color: PaletteDark.historyPanelButton, - textColor: Colors.white) + color: Theme.of(context).primaryTextTheme.overline.color, + textColor: Theme.of(context).primaryTextTheme.title.color) ])), ) ); diff --git a/lib/src/screens/wallet_list/widgets/wallet_tile.dart b/lib/src/screens/wallet_list/widgets/wallet_tile.dart index cef7ea7e1..f1d1c14d0 100644 --- a/lib/src/screens/wallet_list/widgets/wallet_tile.dart +++ b/lib/src/screens/wallet_list/widgets/wallet_tile.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:cake_wallet/palette.dart'; class WalletTile extends SliverPersistentHeaderDelegate { WalletTile({ @@ -29,8 +28,8 @@ class WalletTile extends SliverPersistentHeaderDelegate { panelWidth = panelWidth < 12 ? 0 : 12; final currentColor = isCurrent - ? Colors.white - : PaletteDark.historyPanel; + ? Theme.of(context).accentTextTheme.caption.color + : Theme.of(context).backgroundColor; return Stack( fit: StackFit.expand, @@ -55,7 +54,7 @@ class WalletTile extends SliverPersistentHeaderDelegate { height: 108, width: max - 16, padding: EdgeInsets.only(left: 20, right: 20), - color: PaletteDark.historyPanel, + color: Theme.of(context).backgroundColor, child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, @@ -71,7 +70,7 @@ class WalletTile extends SliverPersistentHeaderDelegate { style: TextStyle( fontSize: 22, fontWeight: FontWeight.bold, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ) ], @@ -87,7 +86,7 @@ class WalletTile extends SliverPersistentHeaderDelegate { walletAddress, style: TextStyle( fontSize: 12, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ) ], @@ -105,16 +104,27 @@ class WalletTile extends SliverPersistentHeaderDelegate { child: Container( height: 108, width: panelWidth, + padding: EdgeInsets.only( + top: 1, + left: 1, + bottom: 1 + ), decoration: BoxDecoration( + borderRadius: BorderRadius.only(topLeft: Radius.circular(12), bottomLeft: Radius.circular(12)), + color: Theme.of(context).accentTextTheme.subtitle.color + ), + child: Container( + decoration: BoxDecoration( borderRadius: BorderRadius.only(topLeft: Radius.circular(12), bottomLeft: Radius.circular(12)), gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - PaletteDark.walletCardTopEndSync, - PaletteDark.walletCardBottomEndSync - ] + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Theme.of(context).accentTextTheme.caption.backgroundColor, + Theme.of(context).accentTextTheme.caption.decorationColor + ] ) + ), ), ), ) diff --git a/lib/src/screens/welcome/welcome_page.dart b/lib/src/screens/welcome/welcome_page.dart index fb50d4fba..256fab4b6 100644 --- a/lib/src/screens/welcome/welcome_page.dart +++ b/lib/src/screens/welcome/welcome_page.dart @@ -9,11 +9,6 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart'; class WelcomePage extends BasePage { 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) { @@ -25,9 +20,17 @@ class WelcomePage extends BasePage { @override Widget body(BuildContext context) { + final newWalletImage = Image.asset('assets/images/new_wallet.png', + height: 12, + width: 12, + color: Palette.oceanBlue); + final restoreWalletImage = Image.asset('assets/images/restore_wallet.png', + height: 12, + width: 12, + color: Theme.of(context).primaryTextTheme.title.color); + return Container( padding: EdgeInsets.only(top: 20), - color: PaletteDark.historyPanel, child: ScrollableWithBottomSection( contentPadding: EdgeInsets.only(bottom: 20), content: Column( @@ -45,7 +48,7 @@ class WelcomePage extends BasePage { S.of(context).welcome, style: TextStyle( fontSize: 18, - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, ), textAlign: TextAlign.center, ), @@ -56,7 +59,7 @@ class WelcomePage extends BasePage { style: TextStyle( fontSize: 36, fontWeight: FontWeight.bold, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, ), textAlign: TextAlign.center, ), @@ -68,7 +71,7 @@ class WelcomePage extends BasePage { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, ), textAlign: TextAlign.center, ), @@ -84,7 +87,7 @@ class WelcomePage extends BasePage { S.of(context).please_make_selection, style: TextStyle( fontSize: 12, - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, ), textAlign: TextAlign.center, ), @@ -95,7 +98,9 @@ class WelcomePage extends BasePage { image: newWalletImage, text: S.of(context).create_new, color: Colors.white, - textColor: PaletteDark.historyPanel), + textColor: Palette.oceanBlue, + borderColor: Palette.oceanBlue, + ), ), Padding( padding: EdgeInsets.only(top: 10), @@ -103,8 +108,8 @@ class WelcomePage extends BasePage { onPressed: () => Navigator.pushNamed(context, Routes.restoreOptions), image: restoreWalletImage, text: S.of(context).restore_wallet, - color: PaletteDark.historyPanelButton, - textColor: Colors.white), + color: Theme.of(context).primaryTextTheme.overline.color, + textColor: Theme.of(context).primaryTextTheme.title.color), ) ]), ), diff --git a/lib/src/widgets/address_text_field.dart b/lib/src/widgets/address_text_field.dart index 766afefd2..388719999 100644 --- a/lib/src/widgets/address_text_field.dart +++ b/lib/src/widgets/address_text_field.dart @@ -1,6 +1,5 @@ import 'package:cake_wallet/routes.dart'; import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/domain/common/contact.dart'; import 'package:cake_wallet/src/domain/monero/subaddress.dart'; @@ -20,7 +19,7 @@ class AddressTextField extends StatelessWidget { this.onURIScanned, this.focusNode, this.isBorderExist = true, - this.buttonColor = PaletteDark.walletCardSubAddressField, + this.buttonColor, this.validator}); static const prefixIconWidth = 34.0; @@ -46,7 +45,7 @@ class AddressTextField extends StatelessWidget { focusNode: focusNode, style: TextStyle( fontSize: 16, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), decoration: InputDecoration( suffixIcon: SizedBox( @@ -66,7 +65,7 @@ class AddressTextField extends StatelessWidget { child: Container( padding: EdgeInsets.all(8), decoration: BoxDecoration( - color: buttonColor, + color: buttonColor ?? Theme.of(context).accentTextTheme.title.color, borderRadius: BorderRadius.all(Radius.circular(6))), child: Image.asset('assets/images/qr_code_icon.png')), @@ -84,7 +83,7 @@ class AddressTextField extends StatelessWidget { child: Container( padding: EdgeInsets.all(8), decoration: BoxDecoration( - color: buttonColor, + color: buttonColor ?? Theme.of(context).accentTextTheme.title.color, borderRadius: BorderRadius.all(Radius.circular(6))), child: Image.asset( @@ -103,7 +102,7 @@ class AddressTextField extends StatelessWidget { child: Container( padding: EdgeInsets.all(8), decoration: BoxDecoration( - color: buttonColor, + color: buttonColor ?? Theme.of(context).accentTextTheme.title.color, borderRadius: BorderRadius.all(Radius.circular(6))), child: Image.asset( @@ -115,24 +114,24 @@ class AddressTextField extends StatelessWidget { ), hintStyle: TextStyle( fontSize: 16, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), hintText: placeholder ?? S.current.widgets_address, focusedBorder: isBorderExist ? UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.walletCardSubAddressField, + color: Theme.of(context).dividerColor, width: 1.0)) : InputBorder.none, disabledBorder: isBorderExist ? UnderlineInputBorder( borderSide: - BorderSide(color: PaletteDark.walletCardSubAddressField, width: 1.0)) + BorderSide(color: Theme.of(context).dividerColor, width: 1.0)) : InputBorder.none, enabledBorder: isBorderExist ? UnderlineInputBorder( borderSide: - BorderSide(color: PaletteDark.walletCardSubAddressField, width: 1.0)) + BorderSide(color: Theme.of(context).dividerColor, width: 1.0)) : InputBorder.none, ), validator: validator, diff --git a/lib/src/widgets/base_alert_dialog.dart b/lib/src/widgets/base_alert_dialog.dart index 082cd418b..8a10d1d3f 100644 --- a/lib/src/widgets/base_alert_dialog.dart +++ b/lib/src/widgets/base_alert_dialog.dart @@ -18,7 +18,7 @@ class BaseAlertDialog extends StatelessWidget { style: TextStyle( fontSize: 20, fontWeight: FontWeight.w600, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, decoration: TextDecoration.none, ), ); @@ -31,7 +31,7 @@ class BaseAlertDialog extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Colors.white, + color: Theme.of(context).primaryTextTheme.title.color, decoration: TextDecoration.none, ), ); @@ -122,7 +122,7 @@ class BaseAlertDialog extends StatelessWidget { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), child: Container( - decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.75)), + decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)), child: Center( child: GestureDetector( onTap: () => null, @@ -131,7 +131,7 @@ class BaseAlertDialog extends StatelessWidget { height: 257, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(24)), - color: PaletteDark.menuHeader + color: Theme.of(context).accentTextTheme.title.backgroundColor ), child: Column( children: <Widget>[ @@ -152,7 +152,7 @@ class BaseAlertDialog extends StatelessWidget { Container( width: 300, height: 1, - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, ), Container( width: 300, diff --git a/lib/src/widgets/base_text_form_field.dart b/lib/src/widgets/base_text_form_field.dart index 6c69d16c2..ff06ce4cd 100644 --- a/lib/src/widgets/base_text_form_field.dart +++ b/lib/src/widgets/base_text_form_field.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:flutter/services.dart'; class BaseTextFormField extends StatelessWidget { @@ -12,9 +11,9 @@ class BaseTextFormField extends StatelessWidget { this.hintText = '', this.maxLines = 1, this.inputFormatters, - this.textColor = Colors.white, - this.hintColor = PaletteDark.walletCardText, - this.borderColor = PaletteDark.menuList, + this.textColor, + this.hintColor, + this.borderColor, this.prefix, this.suffix, this.suffixIcon, @@ -52,26 +51,26 @@ class BaseTextFormField extends StatelessWidget { enabled: enabled, style: TextStyle( fontSize: 16.0, - color: textColor + color: textColor ?? Theme.of(context).primaryTextTheme.title.color ), decoration: InputDecoration( prefix: prefix, suffix: suffix, suffixIcon: suffixIcon, hintStyle: TextStyle( - color: hintColor, + color: hintColor ?? Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: hintText, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: borderColor, + color: borderColor ?? Theme.of(context).dividerColor, width: 1.0 ) ), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: borderColor, + color: borderColor ?? Theme.of(context).dividerColor, width: 1.0 ) ) diff --git a/lib/src/widgets/blockchain_height_widget.dart b/lib/src/widgets/blockchain_height_widget.dart index b4d28674b..f342bb03b 100644 --- a/lib/src/widgets/blockchain_height_widget.dart +++ b/lib/src/widgets/blockchain_height_widget.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/domain/monero/get_height_by_date.dart'; -import 'package:cake_wallet/palette.dart'; class BlockchainHeightWidget extends StatefulWidget { BlockchainHeightWidget({GlobalKey key}) : super(key: key); @@ -39,24 +38,24 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), controller: restoreHeightController, keyboardType: TextInputType.numberWithOptions( signed: false, decimal: false), decoration: InputDecoration( hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).widgets_restore_from_blockheight, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), ), )) @@ -69,7 +68,7 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> { style: TextStyle( fontSize: 16.0, fontWeight: FontWeight.bold, - color: Colors.white), + color: Theme.of(context).primaryTextTheme.title.color), ), ), Row( @@ -82,21 +81,21 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> { child: TextFormField( style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), decoration: InputDecoration( hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).widgets_restore_from_date, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), controller: dateController, validator: (value) { diff --git a/lib/src/widgets/nav_bar.dart b/lib/src/widgets/nav_bar.dart index a46072615..b5274d9b4 100644 --- a/lib/src/widgets/nav_bar.dart +++ b/lib/src/widgets/nav_bar.dart @@ -1,8 +1,5 @@ -import 'package:cake_wallet/theme_changer.dart'; -import 'package:cake_wallet/themes.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget { factory NavBar( @@ -11,8 +8,6 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget { Widget middle, Widget trailing, Color backgroundColor}) { - final _themeChanger = Provider.of<ThemeChanger>(context); - final _isDarkTheme = _themeChanger.getTheme() == Themes.darkTheme; return NavBar._internal( leading: leading, @@ -20,8 +15,6 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget { trailing: trailing, height: _height, backgroundColor: backgroundColor); - /*backgroundColor: - _isDarkTheme ? Theme.of(context).backgroundColor : backgroundColor);*/ } factory NavBar.withShadow( @@ -30,8 +23,6 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget { Widget middle, Widget trailing, Color backgroundColor}) { - final _themeChanger = Provider.of<ThemeChanger>(context); - final _isDarkTheme = _themeChanger.getTheme() == Themes.darkTheme; return NavBar._internal( leading: leading, @@ -39,13 +30,8 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget { trailing: trailing, height: 80, backgroundColor: backgroundColor, - /*backgroundColor: - _isDarkTheme ? Theme.of(context).backgroundColor : backgroundColor,*/ decoration: BoxDecoration( color: backgroundColor, - /*_isDarkTheme - ? Theme.of(context).backgroundColor - : backgroundColor,*/ boxShadow: [ BoxShadow( color: Color.fromRGBO(132, 141, 198, 0.11), diff --git a/lib/src/widgets/picker.dart b/lib/src/widgets/picker.dart index c34e31895..e9573c1e6 100644 --- a/lib/src/widgets/picker.dart +++ b/lib/src/widgets/picker.dart @@ -28,7 +28,7 @@ class Picker<Item extends Object> extends StatelessWidget { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 3.0, sigmaY: 3.0), child: Container( - decoration: BoxDecoration(color: PaletteDark.historyPanel.withOpacity(0.75)), + decoration: BoxDecoration(color: PaletteDark.darkNightBlue.withOpacity(0.75)), child: Center( child: Column( mainAxisSize: MainAxisSize.min, @@ -54,10 +54,10 @@ class Picker<Item extends Object> extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(14)), child: Container( height: 233, - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: ListView.separated( separatorBuilder: (context, index) => Divider( - color: PaletteDark.mainBackgroundColor, + color: Theme.of(context).dividerColor, height: 1, ), itemCount: items == null ? 0 : items.length, @@ -67,11 +67,11 @@ class Picker<Item extends Object> extends StatelessWidget { final isItemSelected = index == selectedAtIndex; final color = isItemSelected - ? PaletteDark.menuHeader + ? Theme.of(context).accentTextTheme.subtitle.decorationColor : Colors.transparent; final textColor = isItemSelected ? Colors.blue - : Colors.white; + : Theme.of(context).primaryTextTheme.title.color; return GestureDetector( onTap: () { diff --git a/lib/src/widgets/present_picker.dart b/lib/src/widgets/present_picker.dart deleted file mode 100644 index 3f64a089b..000000000 --- a/lib/src/widgets/present_picker.dart +++ /dev/null @@ -1,44 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:cake_wallet/generated/i18n.dart'; - -Future<T> presentPicker<T extends Object>( - BuildContext context, List<T> list) async { - T _value = list[0]; - - return await showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - title: Text(S.of(context).please_select), - backgroundColor: Theme.of(context).backgroundColor, - content: Container( - height: 150.0, - child: CupertinoPicker( - backgroundColor: Theme.of(context).backgroundColor, - itemExtent: 45.0, - onSelectedItemChanged: (int index) => _value = list[index], - children: List.generate( - list.length, - (index) => Center( - child: Text( - list[index].toString(), - style: TextStyle( - color: Theme.of(context) - .primaryTextTheme - .caption - .color), - ), - ))), - ), - actions: <Widget>[ - FlatButton( - onPressed: () => Navigator.of(context).pop(), - child: Text(S.of(context).cancel)), - FlatButton( - onPressed: () => Navigator.of(context).pop(_value), - child: Text(S.of(context).ok)) - ], - ); - }); -} \ No newline at end of file diff --git a/lib/src/widgets/primary_button.dart b/lib/src/widgets/primary_button.dart index 90987e62c..a5f2e8315 100644 --- a/lib/src/widgets/primary_button.dart +++ b/lib/src/widgets/primary_button.dart @@ -30,7 +30,8 @@ class PrimaryButton extends StatelessWidget { color: isDisabled ? color.withOpacity(0.5) : color, disabledColor: color.withOpacity(0.5), shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(26.0)), + borderRadius: BorderRadius.circular(26.0), + ), child: Text(text, textAlign: TextAlign.center, style: TextStyle( @@ -150,12 +151,14 @@ class PrimaryImageButton extends StatelessWidget { @required this.image, @required this.text, @required this.color, - @required this.textColor}); + @required this.textColor, + this.borderColor = Colors.transparent}); final VoidCallback onPressed; final Image image; final Color color; final Color textColor; + final Color borderColor; final String text; @override @@ -167,6 +170,7 @@ class PrimaryImageButton extends StatelessWidget { onPressed: onPressed, color: color, shape: RoundedRectangleBorder( + side: BorderSide(color: borderColor), borderRadius: BorderRadius.circular(26.0)), child:Center( child: Row( diff --git a/lib/src/widgets/seed_widget.dart b/lib/src/widgets/seed_widget.dart index de4f38be7..0c145b37e 100644 --- a/lib/src/widgets/seed_widget.dart +++ b/lib/src/widgets/seed_widget.dart @@ -245,7 +245,7 @@ class SeedWidgetState extends State<SeedWidget> { bottomLeft: Radius.circular(24), bottomRight: Radius.circular(24) ), - color: PaletteDark.menuList + color: Theme.of(context).accentTextTheme.title.backgroundColor ), child: SingleChildScrollView( child: Column( @@ -256,7 +256,7 @@ class SeedWidgetState extends State<SeedWidget> { S.of(context).restore_active_seed, style: TextStyle( fontSize: 14, - color: PaletteDark.walletCardText + color: Theme.of(context).primaryTextTheme.caption.color ), ), Padding( @@ -275,8 +275,9 @@ class SeedWidgetState extends State<SeedWidget> { child: Text( item.toString(), style: TextStyle( - color: - isValid ? Colors.white : Palette.lightGrey, + color: isValid + ? Theme.of(context).primaryTextTheme.title.color + : Theme.of(context).primaryTextTheme.caption.color, fontSize: 16, fontWeight: isSelected ? FontWeight.w900 : FontWeight.w400, @@ -306,7 +307,7 @@ class SeedWidgetState extends State<SeedWidget> { style: TextStyle( fontSize: 18, fontWeight: FontWeight.bold, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), Padding( @@ -318,7 +319,7 @@ class SeedWidgetState extends State<SeedWidget> { : null, style: TextStyle( fontSize: 16.0, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), controller: _seedController, textInputAction: TextInputAction.done, @@ -333,7 +334,7 @@ class SeedWidgetState extends State<SeedWidget> { Text( '${items.length}/${SeedWidgetState.maxLength}', style: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 14)), SizedBox(width: 10), InkWell( @@ -346,13 +347,13 @@ class SeedWidgetState extends State<SeedWidget> { padding: EdgeInsets.all(7), decoration: BoxDecoration( color: - PaletteDark.menuList, + Theme.of(context).accentTextTheme.title.backgroundColor, borderRadius: BorderRadius.circular(10.0)), child: Text( S.of(context).paste, style: TextStyle( - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), )), ) @@ -362,17 +363,17 @@ class SeedWidgetState extends State<SeedWidget> { ), hintStyle: TextStyle( - color: PaletteDark.walletCardText, + color: Theme.of(context).primaryTextTheme.caption.color, fontSize: 16 ), hintText: S.of(context).restore_from_seed_placeholder, errorText: _errorMessage, focusedBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, width: 1.0)), + color: Theme.of(context).dividerColor, width: 1.0)), enabledBorder: UnderlineInputBorder( borderSide: BorderSide( - color: PaletteDark.menuList, + color: Theme.of(context).dividerColor, width: 1.0))), enableInteractiveSelection: false, ), diff --git a/lib/src/widgets/standart_close_button.dart b/lib/src/widgets/standart_close_button.dart deleted file mode 100644 index a89077450..000000000 --- a/lib/src/widgets/standart_close_button.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/cupertino.dart'; - -class StandartCloseButton extends StatelessWidget { - @override - Widget build(BuildContext context) { - return SizedBox( - height: 37, - width: 37, - child: FlatButton( - padding: EdgeInsets.all(0), - onPressed: () => Navigator.of(context).pop(), - child: Image.asset('assets/images/close_button.png')), - ); - } -} \ No newline at end of file diff --git a/lib/src/widgets/standart_list_row.dart b/lib/src/widgets/standart_list_row.dart index 29c4ad9e3..df4e376f4 100644 --- a/lib/src/widgets/standart_list_row.dart +++ b/lib/src/widgets/standart_list_row.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; class StandartListRow extends StatelessWidget { StandartListRow({this.title, this.value, this.isDrawTop, this.isDrawBottom}); @@ -17,12 +16,12 @@ class StandartListRow extends StatelessWidget { ? Container( width: double.infinity, height: 1, - color: PaletteDark.walletCardTopEndSync, + color: Theme.of(context).dividerColor, ) : Offstage(), Container( width: double.infinity, - color: PaletteDark.menuList, + color: Theme.of(context).accentTextTheme.title.backgroundColor, child: Padding( padding: const EdgeInsets.only(left: 24, top: 16, bottom: 16, right: 24), child: Column( @@ -32,7 +31,7 @@ class StandartListRow extends StatelessWidget { style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, - color: PaletteDark.walletCardText), + color: Theme.of(context).primaryTextTheme.caption.color), textAlign: TextAlign.left), Padding( padding: const EdgeInsets.only(top: 12), @@ -40,7 +39,7 @@ class StandartListRow extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Colors.white)), + color: Theme.of(context).primaryTextTheme.title.color)), ) ]), ), @@ -49,7 +48,7 @@ class StandartListRow extends StatelessWidget { ? Container( width: double.infinity, height: 1, - color: PaletteDark.walletCardTopEndSync, + color: Theme.of(context).dividerColor, ) : Offstage(), ], diff --git a/lib/src/widgets/standart_switch.dart b/lib/src/widgets/standart_switch.dart index 359651da8..cb2696339 100644 --- a/lib/src/widgets/standart_switch.dart +++ b/lib/src/widgets/standart_switch.dart @@ -26,7 +26,7 @@ class StandartSwitchState extends State<StandartSwitch> { decoration: BoxDecoration( color: widget.value ? Colors.green - : PaletteDark.mainBackgroundColor, + : PaletteDark.distantBlue, borderRadius: BorderRadius.all(Radius.circular(14.0))), child: Container( width: 24.0, diff --git a/lib/src/widgets/template_tile.dart b/lib/src/widgets/template_tile.dart index 63cf9b3b0..e34a3b97c 100644 --- a/lib/src/widgets/template_tile.dart +++ b/lib/src/widgets/template_tile.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:cake_wallet/palette.dart'; class TemplateTile extends StatelessWidget { TemplateTile({ @@ -14,10 +13,12 @@ class TemplateTile extends StatelessWidget { final String from; final VoidCallback onTap; - final toIcon = Image.asset('assets/images/to_icon.png'); - @override Widget build(BuildContext context) { + final toIcon = Image.asset('assets/images/to_icon.png', + color: Theme.of(context).primaryTextTheme.title.color, + ); + return Container( padding: EdgeInsets.only(right: 10), child: GestureDetector( @@ -27,7 +28,7 @@ class TemplateTile extends StatelessWidget { padding: EdgeInsets.only(left: 24, right: 24), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(20)), - color: PaletteDark.menuList + color: Theme.of(context).accentTextTheme.title.backgroundColor ), child: Row( mainAxisAlignment: MainAxisAlignment.start, @@ -38,7 +39,7 @@ class TemplateTile extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), Padding( @@ -48,7 +49,7 @@ class TemplateTile extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), ), @@ -63,7 +64,7 @@ class TemplateTile extends StatelessWidget { style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: Colors.white + color: Theme.of(context).primaryTextTheme.title.color ), ), ), diff --git a/lib/themes.dart b/lib/themes.dart index c7b69f171..b51f311a8 100644 --- a/lib/themes.dart +++ b/lib/themes.dart @@ -7,179 +7,135 @@ class Themes { fontFamily: 'Lato', brightness: Brightness.light, backgroundColor: Colors.white, - scaffoldBackgroundColor: Colors.white, - hintColor: Palette.lightBlue, - focusColor: Palette.lightGrey, // focused and enabled border color for text fields + focusColor: Colors.white, // wallet card border + hintColor: Colors.white, // menu + scaffoldBackgroundColor: Palette.blueAlice, // gradient background start + primaryColor: Palette.lightBlue, // gradient background end + cardColor: Palette.blueAlice, + cardTheme: CardTheme( + color: Colors.white, // synced card start + ), + hoverColor: Colors.white, // synced card end primaryTextTheme: TextTheme( title: TextStyle( - color: Colors.black + color: Palette.oceanBlue, // primary text + backgroundColor: Colors.white // selectButton text ), caption: TextStyle( - color: Colors.black, - ), - button: TextStyle( - color: Colors.black, - backgroundColor: Palette.purple, // button purple background color - decorationColor: Palette.deepPink // button pink border color - ), - headline: TextStyle( - color: Colors.black // account list tile, contact page - ), - subtitle: TextStyle( - color: Palette.wildDarkBlue // filters - ), - subhead: TextStyle( - color: Colors.black // transaction raw, trade raw + color: Palette.lightBlueGrey, // secondary text ), overline: TextStyle( - color: PaletteDark.darkThemeCloseButton // standart list row, transaction details + color: Palette.lavender // address field in the wallet card + ), + subhead: TextStyle( + color: Colors.white // send, exchange, buy buttons on dashboard page + ), + headline: TextStyle( + color: Palette.lightBlueGrey // historyPanelText + ), + display1: TextStyle( + color: Colors.white // menuList + ), + display2: TextStyle( + color: Palette.lavender // menuHeader + ), + display3: TextStyle( + color: Palette.lavender // historyPanelButton + ), + display4: TextStyle( + color: Palette.oceanBlue // QR code ) ), - toggleButtonsTheme: ToggleButtonsThemeData( - selectedColor: Palette.cakeGreen, - disabledColor: Palette.wildDarkBlue, - color: Palette.switchBackground, - borderColor: Palette.switchBorder - ), - selectedRowColor: Palette.purple, - dividerColor: Palette.lightGrey, - dividerTheme: DividerThemeData( - color: Palette.lightGrey - ), + dividerColor: Palette.periwinkle, accentTextTheme: TextTheme( title: TextStyle( - color: Colors.grey, - backgroundColor: Palette.creamyGrey // pin button color + color: Palette.darkLavender, // top panel + backgroundColor: Palette.lavender, // bottom panel + decorationColor: PaletteDark.distantBlue // select button background color ), caption: TextStyle( - color: Palette.wildDarkBlue, // clear button color, exchange page - backgroundColor: Palette.brightBlue, // button blue background color - decorationColor: Palette.cloudySky // button blue border color - ), - button: TextStyle( - backgroundColor: Palette.indigo, // button indigo background color - decorationColor: Palette.deepIndigo // button indigo border color + color: Palette.blue, // current wallet label + backgroundColor: Colors.white, // gradient start, wallet label + decorationColor: Palette.lavender, // gradient end, wallet label ), subtitle: TextStyle( - color: Colors.black, - backgroundColor: Palette.lightLavender // send page border color + color: Palette.lightBlueGrey, // border color, wallet label + backgroundColor: Palette.lavender, // address field, wallet card + decorationColor: Palette.darkLavender // selected item ), headline: TextStyle( - color: Palette.lightGrey2, // receive page - backgroundColor: Colors.white, // restore button background color - decorationColor: Palette.darkGrey, // restore button border color - ), - subhead: TextStyle( - color: Palette.lightBlue, // restore button description - backgroundColor: Palette.lightGrey2 // change language background color - ), - overline: TextStyle( - color: Palette.nightBlue, // send page text - backgroundColor: Palette.nightBlue, // send page text - decorationColor: Palette.manatee // send page text + color: Palette.darkLavender, // faq background + backgroundColor: Palette.lavender // faq extension ) ), - cardColor: Palette.lavender, - cardTheme: CardTheme( - color: Palette.cadetBlue - ), - buttonColor: Palette.darkGrey, - primaryIconTheme: IconThemeData( - color: Colors.white - ), - accentIconTheme: IconThemeData( - color: Colors.white - ) ); static final ThemeData darkTheme = ThemeData( fontFamily: 'Lato', brightness: Brightness.dark, - backgroundColor: PaletteDark.darkThemeBackgroundDark, - scaffoldBackgroundColor: PaletteDark.darkThemeBlack, - hintColor: PaletteDark.darkThemeGrey, - focusColor: PaletteDark.darkThemeGreyWithOpacity, // focused and enabled border color for text fields + backgroundColor: PaletteDark.darkNightBlue, + focusColor: PaletteDark.lightDistantBlue, // wallet card border + hintColor: PaletteDark.gray, // menu + scaffoldBackgroundColor: PaletteDark.distantBlue, // gradient background start + primaryColor: PaletteDark.distantBlue, // gradient background end + cardColor: PaletteDark.darkNightBlue, + cardTheme: CardTheme( + color: PaletteDark.moderateBlue, // synced card start + ), + hoverColor: PaletteDark.nightBlue, // synced card end primaryTextTheme: TextTheme( title: TextStyle( - color: PaletteDark.darkThemeTitle + color: Colors.white, + backgroundColor: PaletteDark.moderatePurpleBlue // selectButton text ), caption: TextStyle( - color: Colors.white - ), - button: TextStyle( - color: Palette.wildDarkBlue, - backgroundColor: PaletteDark.darkThemePurpleButton, // button purple background color - decorationColor: PaletteDark.darkThemePurpleButtonBorder // button pink border color - ), - headline: TextStyle( - color: PaletteDark.darkThemeGrey // account list tile, contact page - ), - subtitle: TextStyle( - color: PaletteDark.darkThemeGrey // filters - ), - subhead: TextStyle( - color: Palette.blueGrey // transaction raw, trade raw + color: PaletteDark.gray, ), overline: TextStyle( - color: PaletteDark.darkThemeGrey // standart list row, transaction details + color: PaletteDark.lightDistantBlue // address field in the wallet card + ), + subhead: TextStyle( + color: PaletteDark.lightDistantBlue // send, exchange, buy buttons on dashboard page + ), + headline: TextStyle( + color: PaletteDark.pigeonBlue // historyPanelText + ), + display1: TextStyle( + color: PaletteDark.lightNightBlue // menuList + ), + display2: TextStyle( + color: PaletteDark.headerNightBlue // menuHeader + ), + display3: TextStyle( + color: PaletteDark.moderateNightBlue // historyPanelButton + ), + display4: TextStyle( + color: PaletteDark.gray // QR code ) ), - toggleButtonsTheme: ToggleButtonsThemeData( - selectedColor: Palette.cakeGreen, - disabledColor: Palette.wildDarkBlue, - color: PaletteDark.switchBackground, - borderColor: PaletteDark.darkThemeMidGrey - ), - selectedRowColor: PaletteDark.darkThemeViolet, - dividerColor: PaletteDark.darkThemeDarkGrey, - dividerTheme: DividerThemeData( - color: PaletteDark.darkThemeGreyWithOpacity - ), + dividerColor: PaletteDark.distantBlue, accentTextTheme: TextTheme( title: TextStyle( - color: PaletteDark.darkThemeTitle, - backgroundColor: PaletteDark.darkThemePinDigitButton // pin button color + color: PaletteDark.moderateBlue, // top panel + backgroundColor: PaletteDark.lightNightBlue, // bottom panel + decorationColor: Colors.white // select button background color ), caption: TextStyle( - color: PaletteDark.darkThemeTitleViolet, // clear button color, exchange page - backgroundColor: PaletteDark.darkThemeBlueButton, // button blue background color - decorationColor: PaletteDark.darkThemeBlueButtonBorder // button blue border color - ), - button: TextStyle( - backgroundColor: PaletteDark.darkThemeIndigoButton, // button indigo background color - decorationColor: PaletteDark.darkThemeIndigoButtonBorder // button indigo border color + color: Colors.white, // current wallet label + backgroundColor: PaletteDark.distantBlue, // gradient start, wallet label + decorationColor: PaletteDark.nightBlue, // gradient end, wallet label ), subtitle: TextStyle( - color: PaletteDark.wildDarkBlueWithOpacity, - backgroundColor: PaletteDark.darkThemeDarkGrey // send page border color + color: PaletteDark.darkNightBlue, // border color, wallet label + backgroundColor: PaletteDark.violetBlue, // address field, wallet card + decorationColor: PaletteDark.headerNightBlue // selected item ), headline: TextStyle( - color: PaletteDark.darkThemeBlack, // receive page - backgroundColor: PaletteDark.darkThemeMidGrey, // restore button background color - decorationColor: PaletteDark.darkThemeDarkGrey, // restore button border color - ), - subhead: TextStyle( - color: Palette.wildDarkBlue, // restore button description - backgroundColor: PaletteDark.darkThemeMidGrey // change language background color - ), - overline: TextStyle( - color: PaletteDark.darkThemeTitle, // send page text - backgroundColor: PaletteDark.darkThemeGrey, // send page text - decorationColor: PaletteDark.darkThemeTitle // send page text + color: PaletteDark.lightNightBlue, // faq background + backgroundColor: PaletteDark.headerNightBlue // faq extension ) ), - cardColor: PaletteDark.darkThemeMidGrey, - cardTheme: CardTheme( - color: PaletteDark.darkThemeGrey - ), - buttonColor: PaletteDark.darkThemePinButton, - primaryIconTheme: IconThemeData( - color: PaletteDark.darkThemeViolet - ), - accentIconTheme: IconThemeData( - color: PaletteDark.darkThemeIndigoButtonBorder - ) ); } \ No newline at end of file