-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Fixes issue #263: ✨ Support for dark theme
- Loading branch information
1 parent
469cc29
commit ca16196
Showing
28 changed files
with
459 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
## **Customise theme** | ||
The default theme supports dark mode. Refer this colors to override it. | ||
|
||
| Name | Parameter | Default color | | ||
|-----------------------------------------------|------------------------|-------------------------------------| | ||
| `MonthView` Border color | Color? borderColor | colorScheme.surfaceContainerHigh | | ||
| `WeekView` Background color of week view page | Color? backgroundColor | colorScheme.surfaceContainerLowest | | ||
| `DayView` Default background color | Color? backgroundColor | colorScheme.surfaceContainerLow | | ||
| `FilledCell` Dates in month cell color | Color? backgroundColor | colorScheme.surfaceContainerLowest | | ||
| `FilledCell` Dates not in month cell color | Color? backgroundColor | colorScheme.surfaceContainerLow | | ||
| `WeekDayTile` Border color | Color? borderColor | colorScheme.secondaryContainer | | ||
| `WeekDayTile` Background color | Color? backgroundColor | colorScheme.surfaceContainerHigh | | ||
| `WeekDayTile` Text style color | TextStyle? textStyle | colorScheme.onSecondaryContainer | | ||
|
||
To customise `MonthView`, `DayView` & `WeekView` page header use `HeaderStyle`. | ||
|
||
```dart | ||
headerStyle: HeaderStyle( | ||
leftIconConfig: IconDataConfig(color: Colors.red), | ||
rightIconConfig: IconDataConfig(color: Colors.red), | ||
decoration: BoxDecoration( | ||
color: Theme.of(context).highlightColor, | ||
), | ||
), | ||
``` | ||
|
||
### Day view | ||
* Default timeline text color is `colorScheme.onSurface`. | ||
* Use `markingStyle` in `DefaultTimeLineMark` to give text style. | ||
* Default `LiveTimeIndicatorSettings` color `colorScheme.primaryColorLight`. | ||
* Use `liveTimeIndicatorSettings` to customise it. | ||
* Default hour, half hour & quarter color is `colorScheme.surfaceContainerHighest`. | ||
* Use `hourIndicatorSettings` to customise it. | ||
|
||
Default hour indicator settings. | ||
```dart | ||
HourIndicatorSettings( | ||
height: widget.heightPerMinute, | ||
// Color of horizontal and vertical lines | ||
color: Theme.of(context).colorScheme.surfaceContainerHighest, | ||
offset: 5, | ||
); | ||
``` | ||
|
||
### Week view | ||
* To customise week number & weekdays use `weekNumberBuilder` & `weekDayBuilder`. | ||
* Default week tile background color is `colorScheme.surfaceContainerHigh`. | ||
* Use `weekTitleBackgroundColor` to change background color. | ||
* Default page background color is `colorScheme.surfaceContainerLowest`. | ||
* Use `backgroundColor` to change background color. | ||
* Default timeline text color is `colorScheme.onSurface`. Use `markingStyle` in `DefaultTimeLineMark` to give text style. | ||
* To customise timeline use `timeLineBuilder`. | ||
* To change Hour lines color use `HourIndicatorSettings`. | ||
* To style hours, half hours & quarter hours use `HourIndicatorSettings`. Default color used is `surfaceContainerHighest` | ||
|
||
```dart | ||
hourIndicatorSettings: HourIndicatorSettings( | ||
color: Colors.greenAccent, | ||
lineStyle: LineStyle.dashed, | ||
), | ||
showHalfHours: true, | ||
halfHourIndicatorSettings: HourIndicatorSettings( | ||
color: Colors.redAccent, | ||
lineStyle: LineStyle.dashed, | ||
), | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AppTheme { | ||
static final lightTheme = ThemeData( | ||
appBarTheme: AppBarTheme( | ||
backgroundColor: Colors.blue, | ||
), | ||
colorScheme: ColorScheme.fromSeed( | ||
seedColor: Colors.blue, | ||
primary: Colors.blue, | ||
), | ||
); | ||
|
||
static final darkTheme = ThemeData( | ||
appBarTheme: AppBarTheme( | ||
backgroundColor: Colors.blueAccent, | ||
), | ||
colorScheme: ColorScheme.fromSeed( | ||
brightness: Brightness.dark, | ||
seedColor: Colors.blueAccent, | ||
primary: Colors.blue, | ||
), | ||
); | ||
} |
Oops, something went wrong.