Skip to content

Commit

Permalink
Improve themes
Browse files Browse the repository at this point in the history
  • Loading branch information
janheinrichmerker committed Aug 20, 2020
1 parent 12b0c26 commit dbae003
Showing 1 changed file with 24 additions and 27 deletions.
51 changes: 24 additions & 27 deletions lib/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,30 @@ BrightnessBased<ThemeData> getBrightnessBasedThemeData(AppColorScheme theme) {
);
return baseTheme
.copyWith(
textTheme: baseTheme.textTheme.withAppFonts(),
primaryTextTheme: baseTheme.primaryTextTheme.withAppFonts(),
accentTextTheme: baseTheme.accentTextTheme.withAppFonts(),
bottomAppBarTheme: baseTheme.bottomAppBarTheme.copyWith(
shape: StadiumBorderNotchedRectangle(),
color: colorScheme.primary,
),
bottomSheetTheme: baseTheme.bottomSheetTheme.copyWith(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(16),
textTheme: baseTheme.textTheme.withAppFonts(),
primaryTextTheme: baseTheme.primaryTextTheme.withAppFonts(),
accentTextTheme: baseTheme.accentTextTheme.withAppFonts(),
bottomAppBarTheme: baseTheme.bottomAppBarTheme.copyWith(
shape: StadiumBorderNotchedRectangle(),
color: colorScheme.primary,
),
),
backgroundColor: colorScheme.surface,
),
cardTheme: baseTheme.cardTheme.copyWith(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
shape: RoundedRectangleBorder(
borderRadius: const BorderRadius.all(
Radius.circular(8.0),
bottomSheetTheme: baseTheme.bottomSheetTheme.copyWith(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(16),
),
),
backgroundColor: colorScheme.surface,
),
),
),
)
cardTheme: baseTheme.cardTheme.copyWith(
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
shape: RoundedRectangleBorder(
borderRadius: const BorderRadius.all(
Radius.circular(8.0),
),
),
),
)
.asBrightnessBased();
}

Expand Down Expand Up @@ -156,11 +156,8 @@ class BrightnessBased<T> {
"of Brightness.dark or Brightness.light.");
}

T getByContext(BuildContext context) {
return get(MediaQuery
.of(context)
.platformBrightness);
}
T getByContext(BuildContext context) =>
get(MediaQuery.of(context).platformBrightness);

BrightnessBased(this._light, this._dark);

Expand Down

0 comments on commit dbae003

Please sign in to comment.