100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > Flutter 下拉刷新之RefreshIndicator

Flutter 下拉刷新之RefreshIndicator

时间:2023-05-06 17:53:30

相关推荐

Flutter 下拉刷新之RefreshIndicator

效果

属性

RefreshIndicatorMaterial Design风格的下拉刷新控件,所以同android中的SwipeRefreshLayout用法一样,嵌套在外层即可。

先了解一下属性:

const RefreshIndicator({Key key,@required this.child,this.displacement = 40.0,//指示器显示时距顶部位置@required this.onRefresh,//下拉刷新回调this.color,//指示器颜色,默认ThemeData.accentColorthis.backgroundColor,//指示器背景颜色,默认ThemeData.canvasColorthis.notificationPredicate = defaultScrollNotificationPredicate,this.semanticsLabel,this.semanticsValue,})

基本上只需要关心onRefresh回调即可。

使用

@overrideWidget build(BuildContext context) {return Scaffold(body: RefreshIndicator(//指示器颜色color: Them

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。