Skip to content

Commit

Permalink
fix: Fixes issue #417: 🐛 Fixes calendar scroll physics for day & week…
Browse files Browse the repository at this point in the history
… view
  • Loading branch information
shubham-jitiya-simform committed Nov 5, 2024
1 parent 982747f commit f411d41
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 37 deletions.
114 changes: 77 additions & 37 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
1 change: 1 addition & 0 deletions example/lib/widgets/day_view_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class DayViewWidget extends StatelessWidget {
showHalfHours: true,
heightPerMinute: 3,
timeLineBuilder: _timeLineBuilder,
scrollPhysics: const BouncingScrollPhysics(),
hourIndicatorSettings: HourIndicatorSettings(
color: Theme.of(context).dividerColor,
),
Expand Down
1 change: 1 addition & 0 deletions example/lib/widgets/week_view_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class WeekViewWidget extends StatelessWidget {
width: width,
showLiveTimeLineInAllDays: true,
timeLineWidth: 65,
scrollPhysics: const BouncingScrollPhysics(),
liveTimeIndicatorSettings: LiveTimeIndicatorSettings(
color: Colors.redAccent,
showTime: true,
Expand Down
5 changes: 5 additions & 0 deletions lib/src/day_view/_internal_day_view_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ class InternalDayViewPage<T extends Object?> 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,
Expand Down Expand Up @@ -161,6 +164,7 @@ class InternalDayViewPage<T extends Object?> extends StatefulWidget {
required this.scrollNotifier,
required this.fullDayEventBuilder,
required this.dayViewScrollController,
required this.scrollPhysics,
required this.scrollListener,
this.lastScrollOffset = 0.0,
required this.dayDetectorBuilder,
Expand Down Expand Up @@ -223,6 +227,7 @@ class _InternalDayViewPageState<T extends Object?>
controller: widget.keepScrollOffset
? scrollController
: widget.dayViewScrollController,
physics: widget.scrollPhysics,
child: SizedBox(
height: widget.height,
width: widget.width,
Expand Down
1 change: 1 addition & 0 deletions lib/src/day_view/day_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ class DayViewState<T extends Object?> extends State<DayView<T>> {
widget.emulateVerticalOffsetBy,
lastScrollOffset: _lastScrollOffset,
dayViewScrollController: _scrollController,
scrollPhysics: widget.scrollPhysics,
scrollListener: _scrollPageListener,
keepScrollOffset: widget.keepScrollOffset,
),
Expand Down
5 changes: 5 additions & 0 deletions lib/src/week_view/_internal_week_view_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ class InternalWeekViewPage<T extends Object?> 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,
Expand Down Expand Up @@ -204,6 +207,7 @@ class InternalWeekViewPage<T extends Object?> extends StatefulWidget {
required this.endHour,
this.fullDayHeaderTitle = '',
required this.fullDayHeaderTextConfig,
required this.scrollPhysics,
required this.scrollListener,
required this.weekViewScrollController,
this.lastScrollOffset = 0.0,
Expand Down Expand Up @@ -339,6 +343,7 @@ class _InternalWeekViewPageState<T extends Object?>
controller: widget.keepScrollOffset
? scrollController
: widget.weekViewScrollController,
physics: widget.scrollPhysics,
child: SizedBox(
height: widget.height,
width: widget.width,
Expand Down
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 @@ -230,6 +230,9 @@ class WeekView<T extends Object?> 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.
Expand Down Expand Up @@ -273,6 +276,7 @@ class WeekView<T extends Object?> extends StatefulWidget {
this.weekDayBuilder,
this.weekNumberBuilder,
this.backgroundColor = Colors.white,
this.scrollPhysics,
this.scrollOffset = 0.0,
this.onEventTap,
this.onEventLongTap,
Expand Down Expand Up @@ -561,6 +565,7 @@ class WeekViewState<T extends Object?> extends State<WeekView<T>> {
fullDayHeaderTitle: _fullDayHeaderTitle,
fullDayHeaderTextConfig: _fullDayHeaderTextConfig,
lastScrollOffset: _lastScrollOffset,
scrollPhysics: widget.scrollPhysics,
scrollListener: _scrollPageListener,
keepScrollOffset: widget.keepScrollOffset,
),
Expand Down

0 comments on commit f411d41

Please sign in to comment.