100日後にiOSアプリをリリースする駆け出しエンジニア続編(107日目)

こんにちは

RefreshIndicatorについて、、

使い方は非常に簡単です

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: new RefreshIndicator(
onRefresh: _onRefresh, //画面のオーバスクロール時に起動される更新処理(onRefresh属性)
child: ListView(
physics: const AlwaysScrollableScrollPhysics(), //RefreshIndicatorを常に表示させたい場合
padding: const EdgeInsets.all(8.0),
children: <Widget>[
Container(
padding: const EdgeInsets.all(16.0),
height: 50,
color: Colors.amber[600],
child: Text("Updated at - " + updated_at.toString()),
),
],
)),
);
}

Instagramみたいなスクロールになると思います。

この記事が気に入ったらサポートをしてみませんか?