Skip to content
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

# Syncfusion Flutter Widgets

Syncfusion Flutter widgets libraries include high-quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
Syncfusion Flutter widgets libraries include high-quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base. Please find the [supported platforms](https://help.syncfusion.com/flutter/system-requirements#supported-platforms) for our Flutter widgets.

**Disclaimer:** This is a commercial package. To use our packages, you need to have either the Syncfusion Commercial License or Syncfusion Community license. For more details, please check the [LICENSE](https://github.com/syncfusion/flutter-examples/blob/master/LICENSE) file.

**Note:** Our packages are now compatible with Flutter for Web. However, this will be in Beta until Flutter for Web becomes stable.

<img src="https://cdn.syncfusion.com/content/images/flutter-widgets-collage.png"/>


Expand Down
120 changes: 120 additions & 0 deletions packages/syncfusion_flutter_calendar/lib/src/calendar/theme.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_core/theme.dart';

/// [SfCalendarThemeDataM2] this class provides material2 themeData.
/// SfCalendarThemeDataM2 class extends the 'SfCalendarThemeData' class and
/// customize the appearance of a mapping component based on th color scheme
/// obtained from the provided [BuildContext].
class SfCalendarThemeDataM2 extends SfCalendarThemeData {
/// This a constructor that takes a [BuildContext] as a parameter.This context
/// is used for obtaining the color scheme of the current theme.
SfCalendarThemeDataM2(this.context);

/// Property that stores the provided [BuildContext]
/// context is later used to obtain the color scheme.
final BuildContext context;

/// A late-initialized property representing the color scheme obtained from
/// the current theme using the provided [BuildContext]
late final ColorScheme colorScheme = Theme.of(context).colorScheme;

@override
Color? get backgroundColor => Colors.transparent;

@override
Color? get headerBackgroundColor => Colors.transparent;

@override
Color? get agendaBackgroundColor => Colors.transparent;

@override
Color? get activeDatesBackgroundColor => Colors.transparent;

@override
Color? get todayBackgroundColor => Colors.transparent;

@override
Color? get trailingDatesBackgroundColor => Colors.transparent;

@override
Color? get leadingDatesBackgroundColor => Colors.transparent;

@override
Color? get viewHeaderBackgroundColor => Colors.transparent;

@override
Color? get allDayPanelColor => Colors.transparent;

@override
Color? get weekNumberBackgroundColor =>
colorScheme.onSurface.withOpacity(0.04);

@override
Color? get cellBorderColor => colorScheme.onSurface.withOpacity(0.16);

@override
Color? get todayHighlightColor => colorScheme.primary;

@override
Color? get selectionBorderColor => colorScheme.primary;
}

/// [SfCalendarThemeDataM3] this class provides material3 themeData.
/// SfCalendarThemeDataM3 class extends the 'SfCalendarThemeData' class and
/// customize the appearance of a mapping component based on th color scheme
/// obtained from the provided [BuildContext].
class SfCalendarThemeDataM3 extends SfCalendarThemeData {
/// This a constructor that takes a [BuildContext] as a parameter.This context
/// is used for obtaining the color scheme of the current theme.
SfCalendarThemeDataM3(this.context);

/// Property that stores the provided [BuildContext]
/// context is later used to obtain the color scheme.
final BuildContext context;

/// A late-initialized property representing the color scheme obtained from
/// the current theme using the provided [BuildContext]
late final ColorScheme colorScheme = Theme.of(context).colorScheme;

@override
Color? get backgroundColor => Colors.transparent;

@override
Color? get headerBackgroundColor => colorScheme.brightness == Brightness.light
? const Color.fromRGBO(247, 242, 251, 1)
: const Color.fromRGBO(37, 35, 42, 1);

@override
Color? get agendaBackgroundColor => Colors.transparent;

@override
Color? get activeDatesBackgroundColor => Colors.transparent;

@override
Color? get todayBackgroundColor => Colors.transparent;

@override
Color? get trailingDatesBackgroundColor => Colors.transparent;

@override
Color? get leadingDatesBackgroundColor => Colors.transparent;

@override
Color? get viewHeaderBackgroundColor => Colors.transparent;

@override
Color? get allDayPanelColor => Colors.transparent;

@override
Color? get weekNumberBackgroundColor =>
colorScheme.onSurface.withOpacity(0.04);

@override
Color? get cellBorderColor => colorScheme.outlineVariant;

@override
Color? get todayHighlightColor => colorScheme.primary;

@override
Color? get selectionBorderColor => colorScheme.primary;
}
Loading