-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Fixes issue #263: ✨ Support for dark theme #431
Open
shubham-jitiya-simform
wants to merge
1
commit into
master
Choose a base branch
from
feature/dark_theme_support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create a separate file for theme customization instructions.