Skip to content

Commit 73e8651

Browse files
author
LokeshPalani
committed
I have included missed theme file for calendar
1 parent b452211 commit 73e8651

File tree

1 file changed

+120
-0
lines changed
  • packages/syncfusion_flutter_calendar/lib/src/calendar

1 file changed

+120
-0
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:syncfusion_flutter_core/theme.dart';
3+
4+
/// [SfCalendarThemeDataM2] this class provides material2 themeData.
5+
/// SfCalendarThemeDataM2 class extends the 'SfCalendarThemeData' class and
6+
/// customize the appearance of a mapping component based on th color scheme
7+
/// obtained from the provided [BuildContext].
8+
class SfCalendarThemeDataM2 extends SfCalendarThemeData {
9+
/// This a constructor that takes a [BuildContext] as a parameter.This context
10+
/// is used for obtaining the color scheme of the current theme.
11+
SfCalendarThemeDataM2(this.context);
12+
13+
/// Property that stores the provided [BuildContext]
14+
/// context is later used to obtain the color scheme.
15+
final BuildContext context;
16+
17+
/// A late-initialized property representing the color scheme obtained from
18+
/// the current theme using the provided [BuildContext]
19+
late final ColorScheme colorScheme = Theme.of(context).colorScheme;
20+
21+
@override
22+
Color? get backgroundColor => Colors.transparent;
23+
24+
@override
25+
Color? get headerBackgroundColor => Colors.transparent;
26+
27+
@override
28+
Color? get agendaBackgroundColor => Colors.transparent;
29+
30+
@override
31+
Color? get activeDatesBackgroundColor => Colors.transparent;
32+
33+
@override
34+
Color? get todayBackgroundColor => Colors.transparent;
35+
36+
@override
37+
Color? get trailingDatesBackgroundColor => Colors.transparent;
38+
39+
@override
40+
Color? get leadingDatesBackgroundColor => Colors.transparent;
41+
42+
@override
43+
Color? get viewHeaderBackgroundColor => Colors.transparent;
44+
45+
@override
46+
Color? get allDayPanelColor => Colors.transparent;
47+
48+
@override
49+
Color? get weekNumberBackgroundColor =>
50+
colorScheme.onSurface.withOpacity(0.04);
51+
52+
@override
53+
Color? get cellBorderColor => colorScheme.onSurface.withOpacity(0.16);
54+
55+
@override
56+
Color? get todayHighlightColor => colorScheme.primary;
57+
58+
@override
59+
Color? get selectionBorderColor => colorScheme.primary;
60+
}
61+
62+
/// [SfCalendarThemeDataM3] this class provides material3 themeData.
63+
/// SfCalendarThemeDataM3 class extends the 'SfCalendarThemeData' class and
64+
/// customize the appearance of a mapping component based on th color scheme
65+
/// obtained from the provided [BuildContext].
66+
class SfCalendarThemeDataM3 extends SfCalendarThemeData {
67+
/// This a constructor that takes a [BuildContext] as a parameter.This context
68+
/// is used for obtaining the color scheme of the current theme.
69+
SfCalendarThemeDataM3(this.context);
70+
71+
/// Property that stores the provided [BuildContext]
72+
/// context is later used to obtain the color scheme.
73+
final BuildContext context;
74+
75+
/// A late-initialized property representing the color scheme obtained from
76+
/// the current theme using the provided [BuildContext]
77+
late final ColorScheme colorScheme = Theme.of(context).colorScheme;
78+
79+
@override
80+
Color? get backgroundColor => Colors.transparent;
81+
82+
@override
83+
Color? get headerBackgroundColor => colorScheme.brightness == Brightness.light
84+
? const Color.fromRGBO(247, 242, 251, 1)
85+
: const Color.fromRGBO(37, 35, 42, 1);
86+
87+
@override
88+
Color? get agendaBackgroundColor => Colors.transparent;
89+
90+
@override
91+
Color? get activeDatesBackgroundColor => Colors.transparent;
92+
93+
@override
94+
Color? get todayBackgroundColor => Colors.transparent;
95+
96+
@override
97+
Color? get trailingDatesBackgroundColor => Colors.transparent;
98+
99+
@override
100+
Color? get leadingDatesBackgroundColor => Colors.transparent;
101+
102+
@override
103+
Color? get viewHeaderBackgroundColor => Colors.transparent;
104+
105+
@override
106+
Color? get allDayPanelColor => Colors.transparent;
107+
108+
@override
109+
Color? get weekNumberBackgroundColor =>
110+
colorScheme.onSurface.withOpacity(0.04);
111+
112+
@override
113+
Color? get cellBorderColor => colorScheme.outlineVariant;
114+
115+
@override
116+
Color? get todayHighlightColor => colorScheme.primary;
117+
118+
@override
119+
Color? get selectionBorderColor => colorScheme.primary;
120+
}

0 commit comments

Comments
 (0)