ListView construction properly done
This commit is contained in:
@@ -23,9 +23,11 @@ class _FetchAPIState extends State<FetchAPI> {
|
||||
appBar: AppBar(
|
||||
title: const Text("Fetching API"),
|
||||
),
|
||||
body: ListView(
|
||||
children: [
|
||||
FutureBuilder<List<Arrival>>(
|
||||
body: Row(
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
child: FutureBuilder<List<Arrival>>(
|
||||
future: fetchedArrivals,
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
@@ -44,10 +46,11 @@ class _FetchAPIState extends State<FetchAPI> {
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Navigator.pushNamedAndRemoveUntil(
|
||||
context, '/', (route) => false);
|
||||
Navigator.pushNamedAndRemoveUntil(context, '/', (route) => false);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
@@ -58,4 +61,10 @@ class _FetchAPIState extends State<FetchAPI> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
fetchedArrivals = fetchArrivals();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user