diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d5531f5..7c20dbda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ - # [1.1.1] (UnReleased) +- 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) diff --git a/lib/src/week_view/_internal_week_view_page.dart b/lib/src/week_view/_internal_week_view_page.dart index 55d4584e..e430c1af 100644 --- a/lib/src/week_view/_internal_week_view_page.dart +++ b/lib/src/week_view/_internal_week_view_page.dart @@ -12,7 +12,6 @@ import '../event_controller.dart'; import '../modals.dart'; import '../painters.dart'; import '../typedefs.dart'; -import '../constants.dart'; /// A single page for week view. class InternalWeekViewPage extends StatelessWidget { @@ -146,7 +145,7 @@ class InternalWeekViewPage extends StatelessWidget { final int endHour; /// Title of the full day events row - final String? fullDayHeaderTitle; + final String fullDayHeaderTitle; /// A single page for week view. const InternalWeekViewPage({ @@ -191,7 +190,7 @@ class InternalWeekViewPage extends StatelessWidget { required this.emulateVerticalOffsetBy, required this.onTileDoubleTap, required this.endHour, - this.fullDayHeaderTitle, + this.fullDayHeaderTitle = '', }) : super(key: key); @override @@ -237,36 +236,39 @@ class InternalWeekViewPage extends StatelessWidget { child: Container( decoration: BoxDecoration( border: Border( - bottom: BorderSide(color: hourIndicatorSettings.color, width: 2), + bottom: + BorderSide(color: hourIndicatorSettings.color, width: 2), ), ), child: Row( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( width: timeLineWidth + hourIndicatorSettings.offset, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 1), - child: Text( - fullDayHeaderTitle ?? "", - textAlign: TextAlign.center, - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), + padding: const EdgeInsets.symmetric( + vertical: 2, + horizontal: 1, + ), + child: Text( + fullDayHeaderTitle, + textAlign: TextAlign.center, + maxLines: 2, + overflow: TextOverflow.ellipsis, ), ), ...List.generate( filteredDates.length, - (index) { - final fullDayEventList = controller.getFullDayEvent(filteredDates[index]); + (index) { + final fullDayEventList = + controller.getFullDayEvent(filteredDates[index]); return Container( width: weekTitleWidth, child: fullDayEventList.isEmpty ? null : fullDayEventBuilder.call( - fullDayEventList, - dates[index], - ), + fullDayEventList, + dates[index], + ), ); }, ) @@ -398,14 +400,16 @@ class InternalWeekViewPage extends StatelessWidget { endHour: endHour, ), if (showLiveLine && liveTimeIndicatorSettings.height > 0) - LiveTimeIndicator( - liveTimeIndicatorSettings: liveTimeIndicatorSettings, - width: width, - height: height, - heightPerMinute: heightPerMinute, - timeLineWidth: timeLineWidth, - startHour: startHour, - endHour: endHour, + IgnorePointer( + child: LiveTimeIndicator( + liveTimeIndicatorSettings: liveTimeIndicatorSettings, + width: width, + height: height, + heightPerMinute: heightPerMinute, + timeLineWidth: timeLineWidth, + startHour: startHour, + endHour: endHour, + ), ), ], ), diff --git a/lib/src/week_view/week_view.dart b/lib/src/week_view/week_view.dart index dcb29ae3..c89a1d14 100644 --- a/lib/src/week_view/week_view.dart +++ b/lib/src/week_view/week_view.dart @@ -232,7 +232,7 @@ class WeekView extends StatefulWidget { final ScrollPhysics? pageViewPhysics; /// Title of the full day events row - final String? fullDayHeaderTitle; + final String fullDayHeaderTitle; /// Main widget for week view. const WeekView({ @@ -289,7 +289,7 @@ class WeekView extends StatefulWidget { this.pageViewPhysics, this.onEventDoubleTap, this.endHour = Constants.hoursADay, - this.fullDayHeaderTitle, + this.fullDayHeaderTitle = '', }) : assert(!(onHeaderTitleTap != null && weekPageHeaderBuilder != null), "can't use [onHeaderTitleTap] & [weekPageHeaderBuilder] simultaneously"), assert((timeLineOffset) >= 0, @@ -331,7 +331,7 @@ class WeekViewState extends State> { late DateTime _currentWeek; late int _totalWeeks; late int _currentIndex; - late String? _fullDayHeaderTitle; + late String _fullDayHeaderTitle; late EventArranger _eventArranger;