Very simple api request
This commit is contained in:
1 parent
123136f265
commit
86496005e0
5 files changed
+44
-1
No files matched your search
@@ -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() ?? ''),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user