From c5e6f03643172e49e02ef5da362e0efae2354275 Mon Sep 17 00:00:00 2001 From: moazelsawaf Date: Sun, 5 May 2024 12:07:29 +0300 Subject: [PATCH] fix: :bug: consider initial `rangeStartDay` value in range selection --- lib/src/table_calendar.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/table_calendar.dart b/lib/src/table_calendar.dart index bcd52656..06708b66 100644 --- a/lib/src/table_calendar.dart +++ b/lib/src/table_calendar.dart @@ -287,6 +287,12 @@ class _TableCalendarState extends State> { super.initState(); _focusedDay = ValueNotifier(widget.focusedDay); _rangeSelectionMode = widget.rangeSelectionMode; + + if (_isRangeSelectionOn && widget.onRangeSelected != null) { + if (widget.rangeStartDay != null && widget.rangeEndDay == null) { + _firstSelectedDay = widget.rangeStartDay; + } + } } @override