flutter - How to control listviewbuilder from outside the listview in flutter?
问题描述
How to control listviewbuilder from outside the listview in flutter?
In a textfield I can use a controller like so: controller: Textcontroller. Can I do something similar in listviewbuilder to clear all the objects in it?
解决方案
所以准确地说。我的代码看起来像这样
Expanded(
child: new ListView.builder(
itemCount: List.length,
itemBuilder: (context,index){
return new Card(
//all stuff with data
),
),
);
},
……
我将如何实现 StatefulBuilder 或更改它的状态,就像评论中的人写的那样?
推荐阅读
- python - 正则表达式在python中查找开头和结尾带有字母的单词?
- html - HTML 表单按钮被按下
- python - 在python中解析xml文件时没有得到任何东西
- python - 检查矩阵是否是另一个python的标量倍数
- python - twitterscraper 无法正常工作(最后刮掉零条推文并崩溃)
- unity3d - 在网站和移动应用程序之间同步游戏
- python - 带有抽象方法的 Python mixin 会覆盖具体方法
- angularjs - Bootstrap 在 Angular 项目中无法本地工作
- python-3.x - python3x中两个子类之间的跨类引用
- ios - App Store Connect 分发选项(必要与否?)