-
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
836953e
commit ef37178
Showing
28 changed files
with
447 additions
and
185 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,61 @@ | ||
## **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 | NA | 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`. | ||
* Default hour, half hour & quarter color is `colorScheme.surfaceContainerHighest`. | ||
* Default timeline color `colorScheme.primaryColorLight`. | ||
|
||
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 | ||
* Week-number text color - Default color `onSecondaryContainer`. | ||
* To customise week number & weekdays use `weekNumberBuilder` & `weekDayBuilder`. | ||
* Default week tile color is `colorScheme.surfaceContainerHigh`. | ||
* To give background color use `backgroundColor` Default background color is `colorScheme.surfaceContainerLowest`. | ||
* To customise timeline use `timeLineBuilder`. Default text color is `colorScheme.onSurface`. | ||
* 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.