-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Provide more configurations for page headers.
- Loading branch information
1 parent
22b8282
commit e730cba
Showing
16 changed files
with
540 additions
and
254 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Migration Guide | ||
|
||
## Migrate from `1.x.x` to latest | ||
|
||
1. Migrate `HeaderStyle`. | ||
```dart | ||
// Old | ||
final style = HeaderStyle( | ||
headerTextStyle : TextStyle(), | ||
headerMargin : EdgeInsets.zero, | ||
headerPadding : EdgeInsets.zero, | ||
titleAlign : TextAlign.center, | ||
decoration : BoxDecoration(), | ||
mainAxisAlignment : MainAxisAlignment.spaceBetween, | ||
leftIcon : Icon(Icons.left), | ||
rightIcon : Icon(Icons.right), | ||
leftIconVisible : true, | ||
rightIconVisible : true, | ||
leftIconPadding : EdgeInsets.zero, | ||
rightIconPadding : EdgeInsets.zero, | ||
); | ||
``` | ||
```dart | ||
// After Migration | ||
// NOTE: leftIconVisible and rightIconVisible is removed in | ||
// latest version. set leftIconConfig and rightIconConfig null to | ||
// hide the respective icon. | ||
final style = HeaderStyle( | ||
headerTextStyle : TextStyle(), | ||
headerMargin : EdgeInsets.zero, | ||
headerPadding : EdgeInsets.zero, | ||
titleAlign : TextAlign.center, | ||
decoration : BoxDecoration(), | ||
mainAxisAlignment : MainAxisAlignment.spaceBetween, | ||
// Set this null to hide the left icon. | ||
leftIconConfig : IconDataConfig( | ||
padding: EdgeInsets.zero, | ||
icon: Icon(Icons.left), | ||
), | ||
// Set this null to hide the right icon. | ||
rightIconConfig : IconDataConfig( | ||
padding: EdgeInsets.zero, | ||
icon: Icon(Icons.right), | ||
), | ||
); | ||
``` | ||
2. Migrate `CalendarPageHeader` | `DayPageHeader` | `MonthPageHeader` | `WeekPageHeader`: | ||
```dart | ||
// Old | ||
final header = MonthPageBuilder({ | ||
date = DateTime.now(), | ||
dateStringBuilder = (date, {secondaryDate}) => '$date', | ||
backgroundColor = Constants.headerBackground, | ||
iconColor = Constants.black, | ||
}); | ||
``` | ||
```dart | ||
// After Migration | ||
final header = MonthPageBuilder({ | ||
date = DateTime.now(), | ||
dateStringBuilder = (date, {secondaryDate}) => '$date', | ||
headerStyle = HeaderStyle.withSameIcons( | ||
decoration: BoxDecoration( | ||
color: Constants.headerBackground, | ||
), | ||
iconConfig: IconDataConfig( | ||
color: Constants.black, | ||
), | ||
), | ||
}); | ||
``` |
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
Oops, something went wrong.