diff --git a/CHANGELOG.md b/CHANGELOG.md index 64b04e1c..45bb32e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# [1.2.1 - Unreleased] + +- Fixes issue in showing quarter hours when startHour is provided. [#387](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/387) + # [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) diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 94dd2276..8c8fe21e 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -18,7 +18,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.18.0 <4.0.0" + sdk: ">=3.5.3 <4.0.0" + flutter: 3.24.3 dependencies: flutter: @@ -29,7 +30,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 intl: - flutter_colorpicker: ^0.6.0 + flutter_colorpicker: ^1.1.0 calendar_view: path: ../ diff --git a/lib/src/components/_internal_components.dart b/lib/src/components/_internal_components.dart index 129e84c1..d764d858 100644 --- a/lib/src/components/_internal_components.dart +++ b/lib/src/components/_internal_components.dart @@ -175,7 +175,7 @@ class TimeLine extends StatefulWidget { required this.height, required this.timeLineOffset, required this.timeLineBuilder, - required this.startHour, + this.startHour = 0, this.showHalfHours = false, this.showQuarterHours = false, required this.liveTimeIndicatorSettings, @@ -248,14 +248,14 @@ class _TimeLineState extends State { minutes: 30, ), if (widget.showQuarterHours) - for (int i = 0; i < widget.endHour; i++) ...[ + for (int i = widget.startHour; i < widget.endHour; i++) ...[ /// this is for 15 minutes _timelinePositioned( - topPosition: widget.hourHeight * i - + topPosition: widget.hourHeight * (i - widget.startHour) - widget.timeLineOffset + widget.hourHeight * 0.25, bottomPosition: widget.height - - (widget.hourHeight * (i + 1)) + + (widget.hourHeight * (i - widget.startHour + 1)) + widget.timeLineOffset, hour: i, minutes: 15, @@ -263,11 +263,11 @@ class _TimeLineState extends State { /// this is for 45 minutes _timelinePositioned( - topPosition: widget.hourHeight * i - + topPosition: widget.hourHeight * (i - widget.startHour) - widget.timeLineOffset + widget.hourHeight * 0.75, bottomPosition: widget.height - - (widget.hourHeight * (i + 1)) + + (widget.hourHeight * (i - widget.startHour + 1)) + widget.timeLineOffset, hour: i, minutes: 45, diff --git a/lib/src/week_view/_internal_week_view_page.dart b/lib/src/week_view/_internal_week_view_page.dart index 2603e890..bc7e5ab0 100644 --- a/lib/src/week_view/_internal_week_view_page.dart +++ b/lib/src/week_view/_internal_week_view_page.dart @@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; import '../components/_internal_components.dart'; -import '../components/week_view_components.dart'; import '../components/event_scroll_notifier.dart'; +import '../components/week_view_components.dart'; import '../enumerations.dart'; import '../event_arrangers/event_arrangers.dart'; import '../event_controller.dart'; @@ -353,8 +353,12 @@ class _InternalWeekViewPageState minuteHeight: widget.heightPerMinute, verticalLineOffset: widget.verticalLineOffset, showVerticalLine: widget.showVerticalLine, - startHour: widget.startHour, + lineStyle: widget.hourIndicatorSettings.lineStyle, + dashWidth: widget.hourIndicatorSettings.dashWidth, + dashSpaceWidth: + widget.hourIndicatorSettings.dashSpaceWidth, emulateVerticalOffsetBy: widget.emulateVerticalOffsetBy, + startHour: widget.startHour, endHour: widget.endHour, ), ),