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:
Widget build(BuildContext context) {
return new Scaffold(
key: _scaffoldKey,
appBar: new AppBar(
title: new Text(widget.title),
),
body: new Center(
child: new ListView(
children: <Widget>[
new Dismissible(
key: personKey,
child: new Text('Dismiss Me'),
onDismissed: (DismissDirection direction) {}
)
],
) // end ListView
) // end Center
); // end return
} // end build()
After I dismiss the text box, I get the error:
A dismissed Dismissible widget is still part of the tree.
Make sure to implement the onDismissed handler and to immediately remove the Dismissible widget from the application once that handler has fired.
Digging through the Dismissible source at , I see that it checks that status of _resizeAnimation
, but I'm not sure how that fits into the grand scheme of a Dismissible
constructor or onDismissed
handler.
question from:
https://stackoverflow.com/questions/47735143/dismissing-a-dismissible-with-flutter-dart 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…