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