Dismissing a Dismissible with Flutter/Dart

后端 未结 5 1196
轻奢々
轻奢々 2021-01-03 17:53

In the majority of the Dismissible examples provided by Flutter, they are dismissing items within a ListView. For example, this.

What I am currently doing is this:

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-03 18:32

    The error message is pretty clear.

    Make sure to implement the onDismissed handler and to immediately remove the Dismissible widget from the application once that handler has fired.

    An empty function is not enough. Once an item has been dismissed, that widget has to be removed from the widget tree. Which means that you must remove the Dismissible from your ListView.

提交回复
热议问题