more detailed flood station info
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../Widgets/flood_station_list_view.dart';
|
||||
import '../model/flood_station.dart';
|
||||
import '../services/api.dart';
|
||||
|
||||
@@ -13,16 +14,11 @@ class LandingPage extends StatelessWidget {
|
||||
if (!snapshot.hasData) {
|
||||
return CircularProgressIndicator();
|
||||
} else if (snapshot.hasData) {
|
||||
return ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
title: Text(snapshot.data!.elementAt(index).town),
|
||||
);
|
||||
},
|
||||
itemCount: snapshot.data!.length,
|
||||
);
|
||||
return FloodStationListView(stations: snapshot.data!);
|
||||
} else if (snapshot.hasError) {
|
||||
return Text(snapshot.error.toString());
|
||||
} else {
|
||||
return Placeholder();
|
||||
return Text('An unknown error occured.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user