2023-07-05 18:10:45 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/account_list_theme.dart';
|
2023-07-03 18:48:27 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/address_theme.dart';
|
2023-07-05 11:45:38 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/alert_theme.dart';
|
2023-07-03 18:36:17 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
|
2023-07-03 12:43:33 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
|
2023-07-05 12:54:53 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
|
2023-07-03 18:15:58 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
|
2023-07-03 17:56:29 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
|
2023-07-03 20:37:38 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/filter_theme.dart';
|
2023-07-07 15:41:00 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
|
2023-07-05 11:35:26 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/info_theme.dart';
|
2023-07-03 16:29:44 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
|
2023-07-03 19:39:48 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/menu_theme.dart';
|
2023-07-03 18:26:44 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
|
2023-07-05 11:54:18 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/order_theme.dart';
|
2023-07-05 11:41:16 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/picker_theme.dart';
|
2023-07-03 16:38:39 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
|
2023-07-05 12:29:32 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
|
2023-07-05 18:10:45 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/qr_code_theme.dart';
|
|
|
|
import 'package:cake_wallet/themes/extensions/receive_page_theme.dart';
|
2023-07-05 12:23:29 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
|
2023-07-05 12:10:36 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
|
2023-07-03 16:58:02 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/support_page_theme.dart';
|
2023-07-03 12:48:09 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
|
2023-07-05 12:38:00 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
|
2023-07-03 20:40:58 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
|
2020-12-15 19:30:16 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2023-07-05 18:10:45 +00:00
|
|
|
enum ThemeType { bright, light, dark }
|
2020-12-15 19:30:16 +00:00
|
|
|
|
|
|
|
abstract class ThemeBase {
|
2022-10-12 17:09:57 +00:00
|
|
|
ThemeBase({required this.raw});
|
2020-12-15 19:30:16 +00:00
|
|
|
|
|
|
|
final int raw;
|
|
|
|
String get title;
|
|
|
|
ThemeType get type;
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
|
|
|
return title;
|
|
|
|
}
|
2023-06-30 16:55:22 +00:00
|
|
|
|
|
|
|
Brightness get brightness;
|
|
|
|
Color get backgroundColor;
|
|
|
|
Color get primaryColor;
|
|
|
|
Color get primaryTextColor;
|
|
|
|
Color get containerColor;
|
2023-07-03 12:37:29 +00:00
|
|
|
Color get dialogBackgroundColor;
|
2023-06-30 16:55:22 +00:00
|
|
|
|
|
|
|
ColorScheme get colorScheme => ColorScheme.fromSeed(
|
|
|
|
brightness: brightness,
|
|
|
|
seedColor: primaryColor,
|
|
|
|
background: backgroundColor);
|
|
|
|
|
2023-07-03 12:43:33 +00:00
|
|
|
ThemeData get generatedThemeData => ThemeData.from(
|
|
|
|
colorScheme: colorScheme,
|
|
|
|
textTheme: TextTheme().apply(fontFamily: 'Lato'));
|
|
|
|
|
2023-07-03 19:21:11 +00:00
|
|
|
DashboardPageTheme get dashboardPageTheme => DashboardPageTheme(
|
2023-07-03 18:15:58 +00:00
|
|
|
firstGradientBackgroundColor: backgroundColor,
|
|
|
|
secondGradientBackgroundColor: backgroundColor,
|
|
|
|
thirdGradientBackgroundColor: backgroundColor,
|
2023-07-07 15:41:00 +00:00
|
|
|
textColor: primaryTextColor,
|
|
|
|
indicatorDotTheme: IndicatorDotTheme(
|
|
|
|
indicatorColor: primaryColor, activeIndicatorColor: backgroundColor));
|
2023-07-03 12:26:43 +00:00
|
|
|
|
2023-07-03 12:43:33 +00:00
|
|
|
CakeScrollbarTheme get scrollbarTheme;
|
|
|
|
|
2023-07-03 12:48:09 +00:00
|
|
|
SyncIndicatorTheme get syncIndicatorStyle;
|
|
|
|
|
2023-07-03 16:29:44 +00:00
|
|
|
KeyboardTheme get keyboardTheme;
|
|
|
|
|
2023-07-03 16:38:39 +00:00
|
|
|
PinCodeTheme get pinCodeTheme;
|
|
|
|
|
2023-07-03 16:58:02 +00:00
|
|
|
SupportPageTheme get supportPageTheme;
|
|
|
|
|
2023-07-03 17:56:29 +00:00
|
|
|
ExchangePageTheme get exchangePageTheme;
|
|
|
|
|
2023-07-03 18:26:44 +00:00
|
|
|
NewWalletTheme get newWalletTheme;
|
|
|
|
|
2023-07-03 18:36:17 +00:00
|
|
|
BalancePageTheme get balancePageTheme;
|
|
|
|
|
2023-07-03 18:48:27 +00:00
|
|
|
AddressTheme get addressTheme;
|
|
|
|
|
2023-07-03 19:39:48 +00:00
|
|
|
CakeMenuTheme get menuTheme;
|
|
|
|
|
2023-07-03 20:37:38 +00:00
|
|
|
FilterTheme get filterTheme;
|
|
|
|
|
2023-07-03 20:40:58 +00:00
|
|
|
WalletListTheme get walletListTheme;
|
|
|
|
|
2023-07-05 11:35:26 +00:00
|
|
|
InfoTheme get infoTheme;
|
|
|
|
|
2023-07-05 11:41:16 +00:00
|
|
|
PickerTheme get pickerTheme;
|
|
|
|
|
2023-07-05 11:45:38 +00:00
|
|
|
AlertTheme get alertTheme;
|
|
|
|
|
2023-07-05 11:54:18 +00:00
|
|
|
OrderTheme get orderTheme;
|
|
|
|
|
2023-07-05 12:10:36 +00:00
|
|
|
SendPageTheme get sendPageTheme;
|
|
|
|
|
2023-07-05 12:23:29 +00:00
|
|
|
SeedWidgetTheme get seedWidgetTheme;
|
|
|
|
|
2023-07-05 12:29:32 +00:00
|
|
|
PlaceholderTheme get placeholderTheme;
|
|
|
|
|
2023-07-05 12:38:00 +00:00
|
|
|
TransactionTradeTheme get transactionTradeTheme;
|
|
|
|
|
2023-07-05 12:54:53 +00:00
|
|
|
CakeTextTheme get cakeTextTheme;
|
|
|
|
|
2023-07-05 17:31:31 +00:00
|
|
|
AccountListTheme get accountListTheme;
|
|
|
|
|
2023-07-05 17:49:47 +00:00
|
|
|
ReceivePageTheme get receivePageTheme;
|
|
|
|
|
2023-07-05 17:59:14 +00:00
|
|
|
QRCodeTheme get qrCodeTheme;
|
|
|
|
|
2023-07-03 12:43:33 +00:00
|
|
|
ThemeData get themeData => generatedThemeData.copyWith(
|
|
|
|
primaryColor: primaryColor,
|
|
|
|
cardColor: containerColor,
|
|
|
|
dialogBackgroundColor: dialogBackgroundColor,
|
2023-07-03 12:48:09 +00:00
|
|
|
extensions: [
|
2023-07-03 19:21:11 +00:00
|
|
|
dashboardPageTheme,
|
2023-07-03 12:48:09 +00:00
|
|
|
scrollbarTheme,
|
2023-07-03 16:29:44 +00:00
|
|
|
syncIndicatorStyle,
|
|
|
|
keyboardTheme,
|
2023-07-03 16:38:39 +00:00
|
|
|
pinCodeTheme,
|
2023-07-03 16:58:02 +00:00
|
|
|
supportPageTheme,
|
2023-07-03 17:56:29 +00:00
|
|
|
exchangePageTheme,
|
2023-07-03 18:26:44 +00:00
|
|
|
newWalletTheme,
|
2023-07-03 18:36:17 +00:00
|
|
|
balancePageTheme,
|
2023-07-03 18:48:27 +00:00
|
|
|
addressTheme,
|
2023-07-03 19:39:48 +00:00
|
|
|
menuTheme,
|
2023-07-03 20:37:38 +00:00
|
|
|
filterTheme,
|
2023-07-03 20:40:58 +00:00
|
|
|
walletListTheme,
|
2023-07-05 11:35:26 +00:00
|
|
|
infoTheme,
|
2023-07-05 11:41:16 +00:00
|
|
|
pickerTheme,
|
2023-07-05 11:45:38 +00:00
|
|
|
alertTheme,
|
2023-07-05 11:54:18 +00:00
|
|
|
orderTheme,
|
2023-07-05 12:10:36 +00:00
|
|
|
sendPageTheme,
|
2023-07-05 12:23:29 +00:00
|
|
|
seedWidgetTheme,
|
2023-07-05 12:29:32 +00:00
|
|
|
placeholderTheme,
|
2023-07-05 12:38:00 +00:00
|
|
|
transactionTradeTheme,
|
2023-07-05 12:54:53 +00:00
|
|
|
cakeTextTheme,
|
2023-07-05 17:31:31 +00:00
|
|
|
accountListTheme,
|
2023-07-05 17:49:47 +00:00
|
|
|
receivePageTheme,
|
2023-07-05 17:59:14 +00:00
|
|
|
qrCodeTheme,
|
2023-07-03 12:48:09 +00:00
|
|
|
],
|
2023-07-07 15:41:00 +00:00
|
|
|
scrollbarTheme: generatedThemeData.scrollbarTheme.copyWith(
|
2023-07-03 12:43:33 +00:00
|
|
|
thumbColor: MaterialStateProperty.all(scrollbarTheme.thumbColor),
|
|
|
|
trackColor: MaterialStateProperty.all(scrollbarTheme.trackColor),
|
|
|
|
radius: Radius.circular(3),
|
|
|
|
thickness: MaterialStateProperty.all(6),
|
|
|
|
thumbVisibility: MaterialStateProperty.all(true),
|
2023-07-07 15:41:00 +00:00
|
|
|
crossAxisMargin: 6),
|
|
|
|
appBarTheme: generatedThemeData.appBarTheme.copyWith(
|
|
|
|
titleTextStyle: TextStyle(color: cakeTextTheme.titleColor)));
|
2023-07-03 16:29:44 +00:00
|
|
|
}
|