Added ProgressIndicator and Error Message
This commit is contained in:
@@ -11,7 +11,11 @@ class FloodStationListView extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.builder(
|
||||
return ListView.separated(
|
||||
separatorBuilder: (context, index) => Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
||||
child: Divider(),
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
final item = _stations.elementAt(index);
|
||||
return ListTile(
|
||||
|
||||
@@ -20,7 +20,7 @@ class FloodStationPage extends StatelessWidget {
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
if (snapshot.data!.isEmpty) {
|
||||
return Text('No readings on record.');
|
||||
return Center(child: Text('No readings on record.'));
|
||||
}
|
||||
return Center(
|
||||
child: Padding(
|
||||
@@ -30,8 +30,10 @@ class FloodStationPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
);
|
||||
} else if (snapshot.hasError) {
|
||||
return Center(child: Text('An unknown Error occured'));
|
||||
} else {
|
||||
return Placeholder();
|
||||
return Center(child: CircularProgressIndicator());
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user