@@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
33import 'light_app_colors.dart' ;
44
55// Default theme is light theme
6- class AppColorsExtension extends ThemeExtension <AppColorsExtension > {
7- AppColorsExtension ({
6+ class CalendarThemeExtension extends ThemeExtension <CalendarThemeExtension > {
7+ CalendarThemeExtension ({
88 this .primary = LightAppColors .primary,
99 this .onPrimary = LightAppColors .onPrimary,
1010 this .onPrimaryContainer = LightAppColors .onPrimaryContainer,
@@ -13,8 +13,9 @@ class AppColorsExtension extends ThemeExtension<AppColorsExtension> {
1313 this .secondaryContainer = LightAppColors .secondaryContainer,
1414 this .outlineVariant = LightAppColors .outlineVariant,
1515 this .onSurface = LightAppColors .onSurface,
16- this .surfaceContainerLowest = LightAppColors .surfaceContainerLowest,
17- this .surfaceContainerLow = LightAppColors .surfaceContainerLow,
16+ this .daysInMonth = LightAppColors .surfaceContainerLowest,
17+ this .daysNotInMonth = LightAppColors .surfaceContainerLow,
18+ this .pageBackground = LightAppColors .surfaceContainerLowest,
1819 });
1920
2021 final Color primary;
@@ -25,31 +26,39 @@ class AppColorsExtension extends ThemeExtension<AppColorsExtension> {
2526 final Color secondaryContainer;
2627 final Color outlineVariant;
2728 final Color onSurface;
28- final Color surfaceContainerLowest;
29- final Color surfaceContainerLow;
29+ final Color daysInMonth;
30+ final Color daysNotInMonth;
31+
32+ /// Background color of week view & day view
33+ final Color pageBackground;
3034
3135 @override
32- ThemeExtension <AppColorsExtension > copyWith ({
36+ ThemeExtension <CalendarThemeExtension > copyWith ({
3337 Color ? primary,
3438 Color ? onPrimary,
39+ Color ? daysInMonth,
40+ Color ? daysNotInMonth,
41+ Color ? pageBackground,
3542 Color ? surfaceContainerHigh,
36- Color ? background,
3743 }) {
38- return AppColorsExtension (
44+ return CalendarThemeExtension (
3945 primary: primary ?? this .primary,
4046 onPrimary: onPrimary ?? this .onPrimary,
4147 surfaceContainerHigh: surfaceContainerHigh ?? this .surfaceContainerHigh,
48+ daysInMonth: daysInMonth ?? this .daysInMonth,
49+ daysNotInMonth: daysNotInMonth ?? this .daysNotInMonth,
50+ pageBackground: pageBackground ?? this .pageBackground,
4251 );
4352 }
4453
4554 @override
46- ThemeExtension <AppColorsExtension > lerp (
47- covariant ThemeExtension <AppColorsExtension >? other,
55+ ThemeExtension <CalendarThemeExtension > lerp (
56+ covariant ThemeExtension <CalendarThemeExtension >? other,
4857 double t,
4958 ) {
50- if (other is ! AppColorsExtension ) return this ;
59+ if (other is ! CalendarThemeExtension ) return this ;
5160
52- return AppColorsExtension (
61+ return CalendarThemeExtension (
5362 primary: Color .lerp (primary, other.primary, t)! ,
5463 );
5564 }
0 commit comments