diff --git a/lib/src/day_view/day_view.dart b/lib/src/day_view/day_view.dart index 166c32d3..163b8937 100644 --- a/lib/src/day_view/day_view.dart +++ b/lib/src/day_view/day_view.dart @@ -354,7 +354,8 @@ class DayViewState extends State> { @override void initState() { super.initState(); - _lastScrollOffset = widget.scrollOffset ?? 0.0; + _lastScrollOffset = widget.scrollOffset ?? + widget.startDuration.inMinutes * widget.heightPerMinute; _reloadCallback = _reload; _setDateRange(); @@ -365,8 +366,8 @@ class DayViewState extends State> { _calculateHeights(); _scrollController = ScrollController( - initialScrollOffset: widget.scrollOffset ?? - widget.startDuration.inMinutes * widget.heightPerMinute); + initialScrollOffset: _lastScrollOffset, + ); _pageController = PageController(initialPage: _currentIndex); _eventArranger = widget.eventArranger ?? SideEventArranger(); _assignBuilders(); diff --git a/lib/src/week_view/_internal_week_view_page.dart b/lib/src/week_view/_internal_week_view_page.dart index e3b28255..ea2f570a 100644 --- a/lib/src/week_view/_internal_week_view_page.dart +++ b/lib/src/week_view/_internal_week_view_page.dart @@ -293,21 +293,26 @@ class _InternalWeekViewPageState child: Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - if (widget.fullDayHeaderTitle.isNotEmpty) - Container( - width: widget.timeLineWidth + - widget.hourIndicatorSettings.offset, - padding: const EdgeInsets.symmetric( - vertical: 2, - horizontal: 1, - ), - child: Text( - widget.fullDayHeaderTitle, - textAlign: widget.fullDayHeaderTextConfig.textAlign, - maxLines: widget.fullDayHeaderTextConfig.maxLines, - overflow: widget.fullDayHeaderTextConfig.textOverflow, - ), - ), + SizedBox( + width: widget.timeLineWidth + + widget.hourIndicatorSettings.offset, + child: widget.fullDayHeaderTitle.isNotEmpty + ? Padding( + padding: const EdgeInsets.symmetric( + vertical: 2, + horizontal: 1, + ), + child: Text( + widget.fullDayHeaderTitle, + textAlign: + widget.fullDayHeaderTextConfig.textAlign, + maxLines: widget.fullDayHeaderTextConfig.maxLines, + overflow: + widget.fullDayHeaderTextConfig.textOverflow, + ), + ) + : SizedBox.shrink(), + ), ...List.generate( filteredDates.length, (index) {