Very simple api request

This commit is contained in:
2025-01-24 17:41:24 +01:00
parent 123136f265
commit 86496005e0
5 changed files with 44 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
class FloodStation {
final String id;
final String town;
final double? latestReading;
FloodStation({
required this.id,
required this.town,
this.latestReading,
});
factory FloodStation.fromMap(Map<String, dynamic> json) => FloodStation(
id: json['@id'] ?? '',
town: json['town'] ?? '',
latestReading: double.tryParse(json['latestReading']?.toString() ?? ''),
);
}