android - Flutter - 选定的项目移动到 ListView 的顶部
问题描述
我一直在寻找一种将所选项目永久移动到 ListView 顶部的方法。
这可以通过按下元素iconbutton
旁边的ListView
, 并让该元素在 上移动到顶部来工作refresh
。
如果可能的话,我希望图标按钮在enabled
启用时变为(即发光/亮起),disabled
在禁用时变为(灰色,但仍可按下)。
我无法在这个问题中包含我的所有代码,因此所有这些_getListItemUi
都可以在以下位置获得:https ://github.com/Jak3-02/myproject2
这是我当前的 ListView 的样子:
Widget _cryptoWidget() {
return new Container(
child: new Column(
children: <Widget>[
new Flexible(
child: new ListView.builder(
itemCount: _currencies.length,
itemBuilder: (BuildContext context, int index) {
final int i = index ~/ 2;
final Crypto currency = _currencies[i];
final MaterialColor color = _colors[i % _colors.length];
if (index.isOdd) {
return new Divider();
}
return _getListItemUi(currency, color);
},
),
),
],
)
);
}
谢谢,所有想法都值得赞赏。:)
解决方案
推荐阅读
- php - 是否有必要清理 PHP 表单提交按钮?
- reactjs - 使用 websocket 时我的反应状态变量没有更新
- python - imaplib.IMAP4.error:FETCH 命令错误:BAD [b' 命令错误。10']
- lua - Roblox 尝试使用“WaitForChild”索引 nil
- git - 如何正确更改 github 中过去几次提交的提交作者?
- bash - 使用 sshpass 在另一台服务器上运行命令
- delphi - 是否可以为 Delphi 创建一个通用调解器来处理通用命令
- drupal - 使用分类工具提示 drupal 7 悬停时分类描述不可见
- node.js - 当 lambda 从错误中退出时如何让 VSCode 终端不清除
- wireshark - 使用 tcprewrite 将 wifi 标头转换为 pcap 文件的以太网标头?