flutter_in_action_2nd
flutter_in_action_2nd copied to clipboard
6.4.2 滚动监听勘误
onNotification: (ScrollNotification notification) {
double progress = notification.metrics.pixels /
notification.metrics.maxScrollExtent;
//重新构建
setState(() {
_progress = "${(progress * 100).toInt()}%";
});
print("BottomEdge: ${notification.metrics.extentAfter == 0}");
return false;
//return true; //放开此行注释后,进度条将失效
},
测试发现 注释放开后进度条仍然有效