Skip to content

Commit b8632af

Browse files
authored
Merge pull request #1163 from EnsembleUI/calendar-enhance
calendar: new method clearRange
2 parents 234fe7c + e6dbefc commit b8632af

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/widget/calendar.dart

+7-3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class EnsembleCalendar extends StatefulWidget
7575
duration: const Duration(milliseconds: 300), curve: Curves.easeOut),
7676
'addRowSpan': (value) => setRowSpan(value),
7777
'update': () => _controller.update(),
78+
'clearRange': () => clearRange(),
7879
};
7980
}
8081

@@ -119,6 +120,12 @@ class EnsembleCalendar extends StatefulWidget
119120
};
120121
}
121122

123+
void clearRange() {
124+
_controller.rangeStart = null;
125+
_controller.rangeEnd = null;
126+
_controller.range = null;
127+
}
128+
122129
void setRowSpanItemTemplate(dynamic rowSpanData) {
123130
try {
124131
if (rowSpanData is! Map ||
@@ -308,9 +315,6 @@ class EnsembleCalendar extends StatefulWidget
308315
updatedDisabledDays.remove(date);
309316
}
310317

311-
_controller.rangeStart = null;
312-
_controller.rangeEnd = null;
313-
_controller.range = null;
314318
_controller.selectedDays.value = updatedDisabledDays;
315319
}
316320

0 commit comments

Comments
 (0)