knopp / flutter_reorderable_list

ReorderableList for Flutter
BSD 3-Clause "New" or "Revised" License
336 stars 98 forks source link

It is an error to call setState unless mounted is true. #26

Closed MalteMagnussen closed 4 years ago

MalteMagnussen commented 4 years ago

https://api.flutter.dev/flutter/widgets/State/mounted.html

Got this error in my App, and checking "mounted" fixed it:

NoSuchMethodError: NoSuchMethodError: The method 'markNeedsBuild' was called on null.
Receiver: null
Tried calling: markNeedsBuild()
  File "framework.dart", line 1253, in State.setState
  File "flutter_reorderable_list.dart", line 604, in _ReorderableItemState.update
  File "flutter_reorderable_list.dart", line 402, in _ReorderableListState.end
  File "<asynchronous suspension>"
  File "unparsed"