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