more detailed flood station info
This commit is contained in:
24
lib/Widgets/flood_station_list_view.dart
Normal file
24
lib/Widgets/flood_station_list_view.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../model/flood_station.dart';
|
||||
|
||||
class FloodStationListView extends StatelessWidget {
|
||||
const FloodStationListView({super.key, required List<FloodStation> stations})
|
||||
: _stations = stations;
|
||||
|
||||
final List<FloodStation> _stations;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
final item = _stations.elementAt(index);
|
||||
return ListTile(
|
||||
title: Text(item.label),
|
||||
subtitle: Text(item.town),
|
||||
);
|
||||
},
|
||||
itemCount: _stations.length,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user