From f411d41fd75074e1e14734ecb608afc3ff3e524b Mon Sep 17 00:00:00 2001 From: Shubham Jitiya Date: Tue, 5 Nov 2024 11:50:35 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20Fixes=20issue=20#417:=20=F0=9F=90=9B=20F?= =?UTF-8?q?ixes=20calendar=20scroll=20physics=20for=20day=20&=20week=20vie?= =?UTF-8?q?w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 114 ++++++++++++------ example/lib/widgets/day_view_widget.dart | 1 + example/lib/widgets/week_view_widget.dart | 1 + lib/src/day_view/_internal_day_view_page.dart | 5 + lib/src/day_view/day_view.dart | 1 + .../week_view/_internal_week_view_page.dart | 5 + lib/src/week_view/week_view.dart | 5 + 7 files changed, 95 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b573f981..247b3ed4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,59 +1,99 @@ # [1.2.1 - Unreleased] -- Fixes issue in showing quarter hours when startHour is provided. [#387](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/387) -- Use `hourLinePainter` in `DayView` [#386](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/386) -- Refactor `SideEventArranger` to arrange events properly. [#290](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/290) -- Adds generic type in `_InternalWeekViewPageState`. [#380](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/380) +- Fixes issue in showing quarter hours when startHour is + provided. [#387](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/387) +- Use `hourLinePainter` + in `DayView` [#386](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/386) +- Refactor `SideEventArranger` to arrange events + properly. [#290](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/290) +- Adds generic type + in `_InternalWeekViewPageState`. [#380](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/380) - Adds additional configurations for `HeaderStyle`. - Added `mainAxisSize`, `mainAxisAlignment`, `rightIconConfig` and `leftIconConfig`. -- Adds additional configurations for `CalendarPageHeader`, `MonthPageHeader`, `DayPageHeader` and `WeekPageHeader`. +- Adds additional configurations for `CalendarPageHeader`, `MonthPageHeader`, `DayPageHeader` + and `WeekPageHeader`. - Added `titleBuilder` to build custom title for header. +- Fixes issue calendar scroll physics for day & week + view. [#416](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/417) - `Deprecations`: - - deprecated `backgroundColor` and `iconColor` from `CalendarPageHeader`, `DayPageHeader`, `MonthPageHeader` and `WeekPageHeader`. + - deprecated `backgroundColor` and `iconColor` + from `CalendarPageHeader`, `DayPageHeader`, `MonthPageHeader` and `WeekPageHeader`. - **Solution:** use `headerStyle` instead. - - deprecated `leftIconVisible`, `rightIconVisible`, `leftIconPadding`, `rightIconPadding`, `leftIcon` and `rightIcon` from `HeaderStyle`. + - + deprecated `leftIconVisible`, `rightIconVisible`, `leftIconPadding`, `rightIconPadding`, `leftIcon` + and `rightIcon` from `HeaderStyle`. - **Solution:** use `rightIconConfig` and `leftIconConfig` instead. # [1.2.0 - 10 May 2024](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/1.2.0) -- Fixed issue when adding full-day events to WeekView, event is not display at correct date. [#259](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/259) -- Added support for onLongPress of event in day, week and month view. [#342](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/342) -- Added check to keep hour in timeline (in day and week view) if LiveTimeIndicator time or backgroundView dosen't overlap. [#336](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/336) -- Added event tap, double tap and long press for full day event in day and week view. [#260](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/260) -- 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) -- Added header title for full day events in week view. [#308](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/308) -- Added support for double tapping gestures on any event in day, week, and month view. [#195](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/195) -- Added support to set end time of day and week view. [#298](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/298) -- Added support for horizontal scroll physics of week and month view page. [#314](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/314) -- Fixed issue related to the live time indicator is that it is not in the correct position when startHour is set for the week and day view. [#346](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/346) -- Fixed issue of onDateTap returns wrong date when startHour is set for week and day view. [#341](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/341) -- Fixed issue related to onDateTap no triggered in WeekView and dayView. [#332](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/332) - -# [1.1.0 - 28 Feb 2024](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/1.1.0) - -- Fixed issue related to Hiding Header [#299](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/299) +- Fixed issue when adding full-day events to WeekView, event is not display at correct + date. [#259](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/259) +- Added support for onLongPress of event in day, week and month + view. [#342](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/342) +- Added check to keep hour in timeline (in day and week view) if LiveTimeIndicator time or + backgroundView dosen't + overlap. [#336](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/336) +- Added event tap, double tap and long press for full day event in day and week + view. [#260](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/260) +- 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) +- Added header title for full day events in week + view. [#308](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/308) +- Added support for double tapping gestures on any event in day, week, and month + view. [#195](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/195) +- Added support to set end time of day and week + view. [#298](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/298) +- Added support for horizontal scroll physics of week and month view + page. [#314](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/314) +- Fixed issue related to the live time indicator is that it is not in the correct position when + startHour is set for the week and day + view. [#346](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/346) +- Fixed issue of onDateTap returns wrong date when startHour is set for week and day + view. [#341](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/341) +- Fixed issue related to onDateTap no triggered in WeekView and + dayView. [#332](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/332) + +# [1.1.0 - 28 Feb 2024](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/1.1.0) + +- 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 - feature added a callback for the default header title. [#241](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/241) + feature added a callback for the default header + title. [#241](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/241) - Added feature added the quarterHourIndicator for the DayView & halfHourIndicator and - quarterHourIndicator for WeekView. [#270](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/270) + quarterHourIndicator for + WeekView. [#270](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/270) - Added - feature added Support for changing the week day position(top/bottom) in weekView. [#283](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/283) -- Adds new flag `includeEdges` in `EventArrangers`. [#290](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/294) -- Fixed null check exception while adding events. [#282](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/282) -- Added new method `update` to update the events in `EventController`. [#125](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/125) -- Added new parameter `includeFullDayEvents` in `getEventsOnDay` to decide whether to include full-day events in the returned list or not. -- Added getters `isRangingEvent` and `isFullDayEvent` in `CalendarEventData` to check if the event is a ranging event or a full-day event. -- Added new method `occursOnDate` in `CalendarEventData` to check if the event occurs on the given date or not. + feature added Support for changing the week day position(top/bottom) in + weekView. [#283](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/283) +- Adds new flag `includeEdges` + in `EventArrangers`. [#290](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/294) +- Fixed null check exception while adding + events. [#282](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/282) +- Added new method `update` to update the events + in `EventController`. [#125](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/125) +- Added new parameter `includeFullDayEvents` in `getEventsOnDay` to decide whether to include + full-day events in the returned list or not. +- Added getters `isRangingEvent` and `isFullDayEvent` in `CalendarEventData` to check if the event + is a ranging event or a full-day event. +- Added new method `occursOnDate` in `CalendarEventData` to check if the event occurs on the given + date or not. - Made `description` in `CalendarEventData` nullable. -- Fixed issue in `MonthView` event's titleStyle to set the style from specific event.[#325](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/325) +- Fixed issue in `MonthView` event's titleStyle to set the style from specific + event.[#325](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/325) + ### Deprecations - - Deprecated `events` getter in `EventController` and adds `allEvents` to replace it. + +- Deprecated `events` getter in `EventController` and adds `allEvents` to replace it. # [1.0.4 - 9 Aug 2023](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/1.0.4) diff --git a/example/lib/widgets/day_view_widget.dart b/example/lib/widgets/day_view_widget.dart index 9ec788e8..664253ce 100644 --- a/example/lib/widgets/day_view_widget.dart +++ b/example/lib/widgets/day_view_widget.dart @@ -22,6 +22,7 @@ class DayViewWidget extends StatelessWidget { showHalfHours: true, heightPerMinute: 3, timeLineBuilder: _timeLineBuilder, + scrollPhysics: const BouncingScrollPhysics(), hourIndicatorSettings: HourIndicatorSettings( color: Theme.of(context).dividerColor, ), diff --git a/example/lib/widgets/week_view_widget.dart b/example/lib/widgets/week_view_widget.dart index 294ab5b1..8b158afc 100644 --- a/example/lib/widgets/week_view_widget.dart +++ b/example/lib/widgets/week_view_widget.dart @@ -16,6 +16,7 @@ class WeekViewWidget extends StatelessWidget { width: width, showLiveTimeLineInAllDays: true, timeLineWidth: 65, + scrollPhysics: const BouncingScrollPhysics(), liveTimeIndicatorSettings: LiveTimeIndicatorSettings( color: Colors.redAccent, showTime: true, diff --git a/lib/src/day_view/_internal_day_view_page.dart b/lib/src/day_view/_internal_day_view_page.dart index 39965140..591bbdb1 100644 --- a/lib/src/day_view/_internal_day_view_page.dart +++ b/lib/src/day_view/_internal_day_view_page.dart @@ -133,6 +133,9 @@ class InternalDayViewPage extends StatefulWidget { /// Flag to keep scrollOffset of pages on page change final bool keepScrollOffset; + /// Use this field to disable the calendar scrolling + final ScrollPhysics? scrollPhysics; + /// Defines a single day page. const InternalDayViewPage({ Key? key, @@ -161,6 +164,7 @@ class InternalDayViewPage extends StatefulWidget { required this.scrollNotifier, required this.fullDayEventBuilder, required this.dayViewScrollController, + required this.scrollPhysics, required this.scrollListener, this.lastScrollOffset = 0.0, required this.dayDetectorBuilder, @@ -223,6 +227,7 @@ class _InternalDayViewPageState controller: widget.keepScrollOffset ? scrollController : widget.dayViewScrollController, + physics: widget.scrollPhysics, child: SizedBox( height: widget.height, width: widget.width, diff --git a/lib/src/day_view/day_view.dart b/lib/src/day_view/day_view.dart index 71b041bf..49c79b73 100644 --- a/lib/src/day_view/day_view.dart +++ b/lib/src/day_view/day_view.dart @@ -497,6 +497,7 @@ class DayViewState extends State> { widget.emulateVerticalOffsetBy, lastScrollOffset: _lastScrollOffset, dayViewScrollController: _scrollController, + scrollPhysics: widget.scrollPhysics, scrollListener: _scrollPageListener, keepScrollOffset: widget.keepScrollOffset, ), diff --git a/lib/src/week_view/_internal_week_view_page.dart b/lib/src/week_view/_internal_week_view_page.dart index 3549dbf3..04842eb6 100644 --- a/lib/src/week_view/_internal_week_view_page.dart +++ b/lib/src/week_view/_internal_week_view_page.dart @@ -160,6 +160,9 @@ class InternalWeekViewPage extends StatefulWidget { /// Flag to keep scrollOffset of pages on page change final bool keepScrollOffset; + /// Use this field to disable the calendar scrolling + final ScrollPhysics? scrollPhysics; + /// A single page for week view. const InternalWeekViewPage({ Key? key, @@ -204,6 +207,7 @@ class InternalWeekViewPage extends StatefulWidget { required this.endHour, this.fullDayHeaderTitle = '', required this.fullDayHeaderTextConfig, + required this.scrollPhysics, required this.scrollListener, required this.weekViewScrollController, this.lastScrollOffset = 0.0, @@ -339,6 +343,7 @@ class _InternalWeekViewPageState controller: widget.keepScrollOffset ? scrollController : widget.weekViewScrollController, + physics: widget.scrollPhysics, child: SizedBox( height: widget.height, width: widget.width, diff --git a/lib/src/week_view/week_view.dart b/lib/src/week_view/week_view.dart index 38a524b1..dafd27e4 100644 --- a/lib/src/week_view/week_view.dart +++ b/lib/src/week_view/week_view.dart @@ -230,6 +230,9 @@ class WeekView extends StatefulWidget { /// If true this will show week day at bottom position. final bool showWeekDayAtBottom; + /// Use this field to disable the calendar scrolling + final ScrollPhysics? scrollPhysics; + /// Defines scroll physics for a page of a week view. /// /// This can be used to disable the horizontal scroll of a page. @@ -273,6 +276,7 @@ class WeekView extends StatefulWidget { this.weekDayBuilder, this.weekNumberBuilder, this.backgroundColor = Colors.white, + this.scrollPhysics, this.scrollOffset = 0.0, this.onEventTap, this.onEventLongTap, @@ -561,6 +565,7 @@ class WeekViewState extends State> { fullDayHeaderTitle: _fullDayHeaderTitle, fullDayHeaderTextConfig: _fullDayHeaderTextConfig, lastScrollOffset: _lastScrollOffset, + scrollPhysics: widget.scrollPhysics, scrollListener: _scrollPageListener, keepScrollOffset: widget.keepScrollOffset, ),