cake_wallet/lib/themes/theme_base.dart

156 lines
5.1 KiB
Dart
Raw Normal View History

import 'package:cake_wallet/themes/extensions/account_list_theme.dart';
import 'package:cake_wallet/themes/extensions/address_theme.dart';
import 'package:cake_wallet/themes/extensions/alert_theme.dart';
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';
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';
import 'package:cake_wallet/themes/extensions/info_theme.dart';
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';
import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
import 'package:cake_wallet/themes/extensions/order_theme.dart';
import 'package:cake_wallet/themes/extensions/picker_theme.dart';
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
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';
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';
import 'package:flutter/material.dart';
enum ThemeType { bright, light, dark }
abstract class ThemeBase {
2022-10-12 17:09:57 +00:00
ThemeBase({required this.raw});
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;
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(
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;
KeyboardTheme get keyboardTheme;
PinCodeTheme get pinCodeTheme;
SupportPageTheme get supportPageTheme;
2023-07-03 17:56:29 +00:00
ExchangePageTheme get exchangePageTheme;
NewWalletTheme get newWalletTheme;
BalancePageTheme get balancePageTheme;
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;
InfoTheme get infoTheme;
PickerTheme get pickerTheme;
AlertTheme get alertTheme;
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;
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,
syncIndicatorStyle,
keyboardTheme,
pinCodeTheme,
supportPageTheme,
2023-07-03 17:56:29 +00:00
exchangePageTheme,
newWalletTheme,
balancePageTheme,
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,
infoTheme,
pickerTheme,
alertTheme,
orderTheme,
2023-07-05 12:10:36 +00:00
sendPageTheme,
2023-07-05 12:23:29 +00:00
seedWidgetTheme,
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)));
}