mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-23 10:45:27 +01:00
Cw 396 additional themes (#962)
* fix: SectionStandardList using BuildContext as param * refactor: deprecated backgroundColor -> colorScheme.background * refactor: themeBase and current themes * refactor: accentTextTheme.titleLarge.color -> dialogTheme.backgroundColor * refactor: gradient background * refactor: text themes using the same color as primaryColor * refactor: accentTextTheme.bodySmall.color -> cardColor * refactor: text themes using same dialogBackgroundColor * refactor: scrollbarTheme * refactor: create SyncIndicatorTheme * refactor: SectionDivider * refactor: base_page improvements and simplify * refactor: collapsible_standart_list improvements * refactor: accentTextTheme.bodyLarge.backgroundColor -> KeyboardTheme.keyboardBarColor * refactor: create PinCodeTheme for accentTextTheme.bodyMedium * refactor: create SupportPageTheme for accentTextTheme.displayLarge.backgroundColor and fix cases that use it * refactor: accentTextTheme.displayLarge.color -> disabledColor * refactor: create ExchangePageTheme * refactor: create DashboardPageTheme and use textColor * refactor: create NewWalletTheme for accentTextTheme.displayMedium * refactor: create BalancePageTheme for accentTextTheme.displaySmall.backgroundColor * refactor: create AddressTheme for accentTextTheme.displaySmall.color * refactor: create IndicatorDotTheme * refactor: create CakeMenuTheme * refactor: create FilterTheme * refactor: create WalletListTheme * refactor: accentTextTheme.bodySmall.decorationColor -> InfoTheme.textColor * refactor: accentTextTheme.titleLarge.backgroundColor -> PickerTheme.dividerColor * refactor: primaryTextTheme.bodyLarge.backgroundColor -> AlertTheme.leftButtonTextColor * refactor: primaryTextTheme.displayLarge.backgroundColor -> OrderTheme.iconColor * refactor: create SendPageTheme * fix: missing migrated styles * refactor: primaryTextTheme.labelSmall.decorationColor -> PlaceholderTheme.color * refactor: create TransactionTradeTheme * refactor: create CakeTextTheme * refactor: create AccountListTheme * refactor: create ReceivePageTheme * refactor: create QRCodeTheme * refactor: move remaining items to CakeTextTheme and some missing fixes * feat(display_settings): add new theme selector * feat: additional themes * fix: conflict error * fix(lag): move colorScheme initialization to constructor * feat: add backdropColor to alert and picker backdrop filters * fix: merge fixes * fix: send template page missing new colors * fix: anonpay pages title and icon colors * fix: merge fixes * fix: unspent coins page * fix: also fix exchange template * fix: missing checkbox * fix: fixes for high contrast theme * Merge branch 'main' into CW-396-additional-themes * fix: merge fixes * fix: .gitignore and rm added files * Fix review comments --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/src/widgets/standard_list.dart';
|
||||
import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
|
||||
|
||||
class SettingsCellWithArrow extends StandardListRow {
|
||||
SettingsCellWithArrow({required String title, required Function(BuildContext context)? handler})
|
||||
@@ -7,5 +8,5 @@ class SettingsCellWithArrow extends StandardListRow {
|
||||
|
||||
@override
|
||||
Widget buildTrailing(BuildContext context) => Image.asset('assets/images/select_arrow.png',
|
||||
color: Theme.of(context).primaryTextTheme.labelSmall!.color!);
|
||||
color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
|
||||
import 'package:cake_wallet/view_model/settings/choices_list_item.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/themes/extensions/address_theme.dart';
|
||||
|
||||
class SettingsChoicesCell extends StatelessWidget {
|
||||
const SettingsChoicesCell(this.choicesListItem, {Key? key}) : super(key: key);
|
||||
|
||||
final ChoicesListItem choicesListItem;
|
||||
final ChoicesListItem<dynamic> choicesListItem;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -22,7 +24,7 @@ class SettingsChoicesCell extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: Theme.of(context).primaryTextTheme.titleLarge!.color!,
|
||||
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -34,7 +36,7 @@ class SettingsChoicesCell extends StatelessWidget {
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
color: Theme.of(context).accentTextTheme.displaySmall!.color!,
|
||||
color: Theme.of(context).extension<AddressTheme>()!.actionButtonColor,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -42,18 +44,18 @@ class SettingsChoicesCell extends StatelessWidget {
|
||||
final isSelected = choicesListItem.selectedItem == e;
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
choicesListItem.onItemSelected?.call(e);
|
||||
choicesListItem.onItemSelected.call(e);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
color: isSelected
|
||||
? Theme.of(context).accentTextTheme.bodyLarge!.color!
|
||||
? Theme.of(context).primaryColor
|
||||
: null,
|
||||
),
|
||||
child: Text(
|
||||
choicesListItem.displayItem?.call(e) ?? e.toString(),
|
||||
choicesListItem.displayItem.call(e),
|
||||
style: TextStyle(
|
||||
color: isSelected
|
||||
? Colors.white
|
||||
|
||||
@@ -27,7 +27,7 @@ class SettingsLinkProviderCell extends StandardListRow {
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Palette.blueCraiola));
|
||||
color: Theme.of(context).primaryColor));
|
||||
|
||||
static void _launchUrl(String url) async {
|
||||
try {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
|
||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/src/widgets/picker.dart';
|
||||
@@ -55,7 +56,7 @@ class SettingsPickerCell<ItemType> extends StandardListRow {
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Theme.of(context).primaryTextTheme!.labelSmall?.color,
|
||||
color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
|
||||
import 'package:cake_wallet/themes/theme_base.dart';
|
||||
import 'package:cake_wallet/themes/theme_list.dart';
|
||||
import 'package:cake_wallet/view_model/settings/display_settings_view_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SettingsThemeChoicesCell extends StatelessWidget {
|
||||
SettingsThemeChoicesCell(this._displaySettingsViewModel);
|
||||
|
||||
final items = ThemeList.all;
|
||||
|
||||
final DisplaySettingsViewModel _displaySettingsViewModel;
|
||||
|
||||
final double cellHeight = 25;
|
||||
final double cellWidth = 12;
|
||||
final double cellRadius = 6;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(cellHeight),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
S.current.color_theme,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.normal,
|
||||
color:
|
||||
Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: cellHeight),
|
||||
GridView.builder(
|
||||
itemCount: items.length,
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3,
|
||||
mainAxisExtent: 75,
|
||||
crossAxisSpacing: 20,
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
final ThemeBase e = items[index];
|
||||
final currentTheme = _displaySettingsViewModel.theme;
|
||||
final isSelected = currentTheme == e;
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.all(5),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
_displaySettingsViewModel.setTheme(e);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(cellRadius),
|
||||
border: isSelected
|
||||
? Border.all(
|
||||
color: Theme.of(context).primaryColor)
|
||||
: null,
|
||||
color: Theme.of(context)
|
||||
.extension<CakeTextTheme>()!
|
||||
.secondaryTextColor
|
||||
.withOpacity(
|
||||
currentTheme.brightness == Brightness.light
|
||||
? 0.1
|
||||
: 0.3),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: cellWidth, vertical: cellHeight),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(cellRadius),
|
||||
bottomLeft: Radius.circular(cellRadius)),
|
||||
color: e.themeData.primaryColor,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: cellWidth, vertical: cellHeight),
|
||||
decoration: BoxDecoration(
|
||||
color: e.themeData.colorScheme.background,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: cellWidth, vertical: cellHeight),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
topRight: Radius.circular(cellRadius),
|
||||
bottomRight: Radius.circular(cellRadius)),
|
||||
color: e.themeData.cardColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
|
||||
|
||||
class SettingsVersionCell extends StatelessWidget {
|
||||
SettingsVersionCell({required this.title});
|
||||
@@ -18,7 +19,7 @@ class SettingsVersionCell extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.normal,
|
||||
color: Theme.of(context).primaryTextTheme!.labelSmall!.color!),
|
||||
color: Theme.of(context).extension<TransactionTradeTheme>()!.detailsTitlesColor),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user