mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-26 20:46:21 +00:00
refactor: text themes using same dialogBackgroundColor
This commit is contained in:
parent
ec1d2518bf
commit
8e7646f594
9 changed files with 13 additions and 43 deletions
|
@ -20,7 +20,7 @@ class AccountTile extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final color = isCurrent
|
||||
? Theme.of(context).textTheme!.titleSmall!.decorationColor!
|
||||
? Theme.of(context).dialogBackgroundColor
|
||||
: Theme.of(context).textTheme!.displayLarge!.decorationColor!;
|
||||
final textColor = isCurrent
|
||||
? Theme.of(context).primaryColor
|
||||
|
|
|
@ -66,7 +66,7 @@ class ChooseYatAddressButtonsState extends State<ChooseYatAddressButtons> {
|
|||
Container(
|
||||
width: 300,
|
||||
height: 158,
|
||||
color: Theme.of(context).accentTextTheme!.bodyMedium!.backgroundColor!,
|
||||
color: Theme.of(context).dialogBackgroundColor,
|
||||
child: ListView.separated(
|
||||
controller: controller,
|
||||
padding: EdgeInsets.all(0),
|
||||
|
|
|
@ -55,7 +55,7 @@ class PopUpCancellableAlertDialog extends StatelessWidget {
|
|||
child: Container(
|
||||
width: 340,
|
||||
padding: EdgeInsets.all(10),
|
||||
color: Theme.of(context).accentTextTheme.titleLarge!.decorationColor!,
|
||||
color: Theme.of(context).dialogBackgroundColor,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
|
|
|
@ -31,10 +31,7 @@ class AlertWithOneAction extends BaseAlertDialog {
|
|||
width: 300,
|
||||
height: 52,
|
||||
padding: EdgeInsets.only(left: 12, right: 12),
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme!
|
||||
.bodyMedium!
|
||||
.backgroundColor!,
|
||||
color: Theme.of(context).dialogBackgroundColor,
|
||||
child: ButtonTheme(
|
||||
minWidth: double.infinity,
|
||||
child: TextButton(
|
||||
|
|
|
@ -57,10 +57,7 @@ class BaseAlertDialog extends StatelessWidget {
|
|||
onPressed: actionLeft,
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: leftActionButtonColor ??
|
||||
Theme.of(context)
|
||||
.accentTextTheme!
|
||||
.bodyLarge!
|
||||
.decorationColor!,
|
||||
Theme.of(context).dialogBackgroundColor,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.zero))),
|
||||
child: Text(
|
||||
|
@ -85,10 +82,7 @@ class BaseAlertDialog extends StatelessWidget {
|
|||
onPressed: actionRight,
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: rightActionButtonColor ??
|
||||
Theme.of(context)
|
||||
.accentTextTheme!
|
||||
.bodyMedium!
|
||||
.backgroundColor!,
|
||||
Theme.of(context).dialogBackgroundColor,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.zero))),
|
||||
child: Text(
|
||||
|
@ -125,10 +119,7 @@ class BaseAlertDialog extends StatelessWidget {
|
|||
borderRadius: BorderRadius.all(Radius.circular(30)),
|
||||
child: Container(
|
||||
width: 300,
|
||||
color: Theme.of(context)
|
||||
.accentTextTheme!
|
||||
.titleLarge!
|
||||
.decorationColor!,
|
||||
color: Theme.of(context).dialogBackgroundColor,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
|
|
|
@ -84,11 +84,6 @@ class BrightTheme extends LightTheme {
|
|||
decorationColor:
|
||||
Colors.white // background of tiles (account list)
|
||||
),
|
||||
// subtitle -> titleSmall
|
||||
titleSmall: TextStyle(
|
||||
decorationColor:
|
||||
Colors.white // background of current tile (account list)
|
||||
),
|
||||
// body -> bodyMedium
|
||||
bodyMedium: TextStyle(
|
||||
color: Palette.moderatePurpleBlue, // scrollbar thumb
|
||||
|
@ -193,7 +188,6 @@ class BrightTheme extends LightTheme {
|
|||
// title -> titleLarge
|
||||
titleLarge: TextStyle(
|
||||
backgroundColor: Palette.periwinkleCraiola, // picker divider
|
||||
decorationColor: Colors.white // dialog background
|
||||
),
|
||||
bodySmall: TextStyle(
|
||||
backgroundColor: Palette.moderateLavender, // button background (confirm exchange)
|
||||
|
@ -260,11 +254,9 @@ class BrightTheme extends LightTheme {
|
|||
bodyMedium: TextStyle(
|
||||
color: Palette.darkGray, // indicators (PIN code)
|
||||
decorationColor: Palette.darkGray, // switch (PIN code)
|
||||
backgroundColor: Colors.white // alert right button
|
||||
),
|
||||
// body2 -> bodyLarge
|
||||
bodyLarge: TextStyle(
|
||||
decorationColor: Colors.white, // alert left button,
|
||||
backgroundColor: Palette.dullGray // keyboard bar color
|
||||
)
|
||||
));
|
||||
|
|
|
@ -20,6 +20,8 @@ class DarkTheme extends ThemeBase {
|
|||
Color get primaryTextColor => Colors.white;
|
||||
@override
|
||||
Color get containerColor => PaletteDark.nightBlue;
|
||||
@override
|
||||
Color get dialogBackgroundColor => PaletteDark.darkNightBlue;
|
||||
|
||||
@override
|
||||
ThemeData get themeData => super.themeData.copyWith(
|
||||
|
@ -84,11 +86,6 @@ class DarkTheme extends ThemeBase {
|
|||
decorationColor: PaletteDark
|
||||
.darkOceanBlue // background of tiles (account list)
|
||||
),
|
||||
// subtitle -> titleSmall
|
||||
titleSmall: TextStyle(
|
||||
decorationColor: PaletteDark
|
||||
.darkNightBlue // background of current tile (account list)
|
||||
),
|
||||
// body1 -> bodyMedium
|
||||
bodyMedium: TextStyle(
|
||||
color: PaletteDark.wildBlueGrey, // scrollbar thumb
|
||||
|
@ -196,7 +193,6 @@ class DarkTheme extends ThemeBase {
|
|||
// title -> titleLarge
|
||||
titleLarge: TextStyle(
|
||||
backgroundColor: PaletteDark.dividerColor, // picker divider
|
||||
decorationColor: PaletteDark.darkNightBlue // dialog background
|
||||
),
|
||||
bodySmall: TextStyle(
|
||||
backgroundColor: PaletteDark.deepVioletBlue, // button background (confirm exchange)
|
||||
|
@ -269,11 +265,9 @@ class DarkTheme extends ThemeBase {
|
|||
bodyMedium: TextStyle(
|
||||
color: PaletteDark.indicatorVioletBlue, // indicators (PIN code)
|
||||
decorationColor: PaletteDark.lightPurpleBlue, // switch (PIN code)
|
||||
backgroundColor: PaletteDark.darkNightBlue // alert right button
|
||||
),
|
||||
// body2 -> bodyLarge
|
||||
bodyLarge: TextStyle(
|
||||
decorationColor: PaletteDark.darkNightBlue, // alert left button
|
||||
backgroundColor: PaletteDark.granite // keyboard bar color
|
||||
),
|
||||
),
|
||||
|
|
|
@ -20,6 +20,8 @@ class LightTheme extends ThemeBase {
|
|||
Color get primaryTextColor => Palette.darkBlueCraiola;
|
||||
@override
|
||||
Color get containerColor => Palette.blueAlice;
|
||||
@override
|
||||
Color get dialogBackgroundColor => Colors.white;
|
||||
|
||||
@override
|
||||
ThemeData get themeData => super.themeData.copyWith(
|
||||
|
@ -84,11 +86,6 @@ class LightTheme extends ThemeBase {
|
|||
decorationColor:
|
||||
Colors.white // background of tiles (account list)
|
||||
),
|
||||
// subtitle -> titleSmall
|
||||
titleSmall: TextStyle(
|
||||
decorationColor:
|
||||
Colors.white // background of current tile (account list)
|
||||
),
|
||||
// body -> bodyMedium
|
||||
bodyMedium: TextStyle(
|
||||
color: Palette.moderatePurpleBlue, // scrollbar thumb
|
||||
|
@ -194,7 +191,6 @@ class LightTheme extends ThemeBase {
|
|||
// title -> headlititleLargene6
|
||||
titleLarge: TextStyle(
|
||||
backgroundColor: Palette.periwinkleCraiola, // picker divider
|
||||
decorationColor: Colors.white // dialog background
|
||||
),
|
||||
bodySmall: TextStyle(
|
||||
backgroundColor: Palette.blueAlice, // button background (confirm exchange)
|
||||
|
@ -261,11 +257,9 @@ class LightTheme extends ThemeBase {
|
|||
bodyMedium: TextStyle(
|
||||
color: Palette.darkGray, // indicators (PIN code)
|
||||
decorationColor: Palette.darkGray, // switch (PIN code)
|
||||
backgroundColor: Colors.white // alert right button
|
||||
),
|
||||
// body2 -> bodyLarge
|
||||
bodyLarge: TextStyle(
|
||||
decorationColor: Colors.white, // alert left button,
|
||||
backgroundColor: Palette.dullGray // keyboard bar color
|
||||
),
|
||||
),
|
||||
|
|
|
@ -20,6 +20,7 @@ abstract class ThemeBase {
|
|||
Color get primaryColor;
|
||||
Color get primaryTextColor;
|
||||
Color get containerColor;
|
||||
Color get dialogBackgroundColor;
|
||||
|
||||
ColorScheme get colorScheme => ColorScheme.fromSeed(
|
||||
brightness: brightness,
|
||||
|
@ -37,5 +38,6 @@ abstract class ThemeBase {
|
|||
.copyWith(
|
||||
primaryColor: primaryColor,
|
||||
cardColor: containerColor,
|
||||
dialogBackgroundColor: dialogBackgroundColor,
|
||||
extensions: [pageGradientTheme]);
|
||||
}
|
Loading…
Reference in a new issue