Skip to content

Commit

Permalink
fix: 🐛 display live time indicator only when it is in between of star…
Browse files Browse the repository at this point in the history
…tHour and endHour #366 (#365)
  • Loading branch information
apurva010 authored May 9, 2024
1 parent 5921392 commit caeeb5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- # [1.1.1] (UnReleased)
- Fixed live time indicator not displaying on correct position when start and end hour is set. [#366](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/366)
- Fixed synchronization of scroll between pages in day and week view. [#186](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/186)
- Added showWeekTileBorder field whether to show border for header in month view. [#306](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/306)
- Fixed an issue related to hiding day, which is not in the current month in MonthView. [#328](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/328)
Expand Down
9 changes: 6 additions & 3 deletions lib/src/components/_internal_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,13 @@ class _LiveTimeIndicatorState extends State<LiveTimeIndicator> {
/// to set dy offset of live time indicator
final startMinutes = widget.startHour * 60;

/// Check if live time is not between startHour and endHour then
/// Check if live time is not between startHour and endHour if it is then
/// don't show live time indicator
if (_currentTime.hour > widget.startHour ||
widget.endHour < _currentTime.hour) {
///
/// e.g. startHour : 1:00, endHour : 13:00 and live time is 17:00
/// then no need to display live time indicator on timeline
if (_currentTime.hour > widget.startHour &&
widget.endHour <= _currentTime.hour) {
return SizedBox.shrink();
}
return CustomPaint(
Expand Down

0 comments on commit caeeb5b

Please sign in to comment.