File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ class CustomRefreshIndicatorState extends State<CustomRefreshIndicator>
340340 throw StateError (
341341 "Cannot show indicator. "
342342 "Controller must be in the idle state. "
343- "Current state: ${controller .state }." ,
343+ "Current state: ${controller .state . name }." ,
344344 );
345345 }
346346 setIndicatorState (IndicatorState .dragging);
@@ -357,6 +357,14 @@ class CustomRefreshIndicatorState extends State<CustomRefreshIndicator>
357357 Duration draggingDuration = const Duration (milliseconds: 300 ),
358358 Curve draggingCurve = Curves .linear,
359359 }) async {
360+ if (! controller.isIdle) {
361+ throw StateError (
362+ "Cannot refresh. "
363+ "Controller must be in the idle state. "
364+ "Current state: ${controller .state .name }." ,
365+ );
366+ }
367+
360368 await show (
361369 draggingDuration: draggingDuration,
362370 draggingCurve: draggingCurve,
You can’t perform that action at this time.
0 commit comments