Skip to content

Commit

Permalink
darker dark
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier committed May 7, 2024
1 parent 4540377 commit 9fdacf5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
8 changes: 7 additions & 1 deletion example/lib/src/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,13 @@ class _AppBar extends StatelessWidget implements PreferredSizeWidget {
final show = context.mq.size.width > 800;
return Row(
children: [
if (show) SizedBox(width: 80, child: AppBar()),
if (show)
SizedBox(
width: 80,
child: AppBar(
backgroundColor: context.theme.colorScheme.surface,
),
),
if (show)
const SizedBox(
height: kToolbarHeight,
Expand Down
16 changes: 12 additions & 4 deletions lib/src/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import 'package:flutter/material.dart';
import 'color_x.dart';
import 'theme_data_x.dart';

typedef ThemePair = ({ThemeData lightTheme, ThemeData darkTheme});

const lightBase = Colors.white;
final darkBase = Colors.black.scale(lightness: 0.13);
final darkBase = Colors.black.scale(lightness: 0.11);
final darkMenuBase = Colors.black.scale(lightness: 0.1);
const kContainerRadius = 10.0;
const kButtonRadius = 6.0;
Expand Down Expand Up @@ -32,6 +34,7 @@ ThemePair phoenixTheme({
switchTheme: _switchTheme(lightScheme),
navigationRailTheme: _naviRailTheme(lightScheme),
navigationBarTheme: _naviBarTheme(lightScheme),
appBarTheme: _appBarTheme(lightScheme),
),
darkTheme: ThemeData(
colorScheme: darkScheme,
Expand All @@ -48,6 +51,7 @@ ThemePair phoenixTheme({
switchTheme: _switchTheme(darkScheme),
navigationRailTheme: _naviRailTheme(darkScheme),
navigationBarTheme: _naviBarTheme(darkScheme),
appBarTheme: _appBarTheme(darkScheme),
)
);
}
Expand All @@ -60,7 +64,7 @@ ColorScheme _darkScheme(Color color) {
surfaceTint: darkBase,
background: darkBase,
surface: darkBase.scale(
lightness: 0.04,
lightness: 0.03,
),
outline: darkBase.scale(
lightness: 0.28,
Expand Down Expand Up @@ -91,7 +95,7 @@ DividerThemeData _dividerTheme(ColorScheme colorScheme) => DividerThemeData(
);

Color _dividerColor(ColorScheme colorScheme) {
return colorScheme.outline.scale(lightness: colorScheme.isLight ? 0.3 : -0.3);
return colorScheme.outline.scale(lightness: colorScheme.isLight ? 0.3 : -0.4);
}

DialogTheme _dialogTheme(ColorScheme colorScheme) {
Expand Down Expand Up @@ -245,4 +249,8 @@ NavigationBarThemeData _naviBarTheme(ColorScheme colorScheme) {
Color _indicatorColor(ColorScheme colorScheme) =>
_dividerColor(colorScheme).withOpacity(0.8);

typedef ThemePair = ({ThemeData lightTheme, ThemeData darkTheme});
AppBarTheme _appBarTheme(ColorScheme colorScheme) {
return AppBarTheme(
backgroundColor: colorScheme.background,
);
}

0 comments on commit 9fdacf5

Please sign in to comment.