📌  相关文章
📜  未处理的异常:'package:flutter src widgets scroll_controller.dart':断言失败:第 152 行 pos 12:'_positions.isNotEmpty':ScrollController 未附加到任何滚动视图. - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:28.043000             🧑  作者: Mango

代码示例1
To avoid such type of errors check if exist

if (_scrollController.hasClients) {
    _scrollController.animateTo(0.0, curve: Curves.easeOut, duration: const Duration(milliseconds: 300))
}

If this is false, then members that interact with the [ScrollPosition], such as
[position], [offset], [animateTo], and [jumpTo], must not be called.