Flutterによって提供されたDismissibleの例の大半は、ListView内のアイテムを破棄しています。たとえば、thisです。 、私はそれをチェックしていることがわかりFlutter/Dartで却下を解除する
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.
でDismissible sourceを掘り:私は、テキストボックスを閉じた後、私はエラーを取得する
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()
:
は、私が現在やっていることはこれですその状態は_resizeAnimation
ですが、私はそれがDismissible
コンストラクタまたはonDismissed
ハンドラの壮大な仕組みにどのように適合するかはわかりません。
これは明らかにエラーメッセージの内容です。この特定のケースでは、DimissibleはListViewの一部ではありません。 ListViewの一部ではないウィジェットを削除する方法が見つかりませんでした。 –
あなたが提供したコードでは、 'ListView'の' Dismissible'_is_部分 – Darky