Skip to content

Commit

Permalink
fix: 🐛Header view hidden functionality added #299. (#324)
Browse files Browse the repository at this point in the history
- In DayView, MonthView and WeekView hidden method added for hiding header.
  • Loading branch information
ravilsimform authored Feb 22, 2024
1 parent 90818ea commit ab16d9b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# [1.0.5] (UnReleased)

- Fixed issue related to Hiding Header [#299](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/299)
- Fixed issue related to auto scroll to initial duration for day
view. [#269](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/269)
- Added
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ MonthView(
// This callback will only work if cellBuilder is null.
onEventTap: (event, date) => print(event),
onDateLongPress: (date) => print(date),
headerBuilder: MonthHeader.hidden // To hide month header
);
```

Expand Down Expand Up @@ -177,7 +178,8 @@ DayView(
startHour: 5 // To set the first hour displayed (ex: 05:00)
hourLinePainter: (lineColor, lineHeight, offset, minuteHeight, showVerticalLine, verticalLineOffset) {
return //Your custom painter.
}
},
dayTitleBuilder: DayHeader.hidden // To Hide day header
);
```

Expand Down Expand Up @@ -208,7 +210,8 @@ WeekView(
showVerticalLines: false, // Show the vertical line between days.
hourLinePainter: (lineColor, lineHeight, offset, minuteHeight, showVerticalLine, verticalLineOffset) {
return //Your custom painter.
}
},
weekPageHeaderBuilder: WeekHeader.hidden // To hide week header
);
```

Expand Down
5 changes: 5 additions & 0 deletions lib/src/day_view/day_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -911,3 +911,8 @@ class DayViewState<T extends Object?> extends State<DayView<T>> {
DateTime get currentDate =>
DateTime(_currentDate.year, _currentDate.month, _currentDate.day);
}

class DayHeader {
/// Hide Header Widget
static Widget hidden(DateTime date) => SizedBox.shrink();
}
5 changes: 5 additions & 0 deletions lib/src/month_view/month_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -667,3 +667,8 @@ class _MonthPageBuilder<T> extends StatelessWidget {
);
}
}

class MonthHeader {
/// Hide Header Widget
static Widget hidden(DateTime date) => SizedBox.shrink();
}
5 changes: 5 additions & 0 deletions lib/src/week_view/week_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1003,3 +1003,8 @@ class WeekViewState<T extends Object?> extends State<WeekView<T>> {
bool _showLiveTimeIndicator(List<DateTime> dates) =>
dates.any((date) => date.compareWithoutTime(DateTime.now()));
}

class WeekHeader {
/// Hide Header Widget
static Widget hidden(DateTime date, DateTime date1) => SizedBox.shrink();
}

0 comments on commit ab16d9b

Please sign in to comment.