Pull down to refresh (yw lingy)
This commit is contained in:
@@ -24,10 +24,14 @@ class _FetchAPIState extends State<FetchAPI> {
|
||||
fetchedArrivals = fetchArrivals();
|
||||
});
|
||||
},
|
||||
icon: const Icon(Icons.refresh_rounded))
|
||||
icon: const Icon(Icons.refresh_sharp),
|
||||
),
|
||||
const SizedBox(width: 30,),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
body: RefreshIndicator(
|
||||
onRefresh: _refreshData,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -68,9 +72,16 @@ class _FetchAPIState extends State<FetchAPI> {
|
||||
const SizedBox(height: 35,),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _refreshData() async {
|
||||
setState(() {
|
||||
fetchedArrivals = fetchArrivals();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
Reference in New Issue
Block a user