From b8ef7923713cfed0d6180e7b69da39400e64a5e1 Mon Sep 17 00:00:00 2001 From: Clark Patterson Date: Wed, 1 Dec 2021 09:52:39 -0500 Subject: [PATCH 1/2] double cast latlong --- lib/model.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/model.dart b/lib/model.dart index 049b8bc..a62da40 100644 --- a/lib/model.dart +++ b/lib/model.dart @@ -12,8 +12,8 @@ class Coordinates { /// Creates coordinates from a map containing its properties. Coordinates.fromMap(Map map) - : this.latitude = map["latitude"], - this.longitude = map["longitude"]; + : this.latitude = map["latitude"].toDouble(), + this.longitude = map["longitude"].toDouble(); /// Creates a map from the coordinates properties. Map toMap() => { From 41bf3c8d7827b08392383e3ec06f49b0df55479a Mon Sep 17 00:00:00 2001 From: Clark Patterson Date: Wed, 1 Dec 2021 14:25:00 -0500 Subject: [PATCH 2/2] update2 --- lib/model.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/model.dart b/lib/model.dart index a62da40..d52f587 100644 --- a/lib/model.dart +++ b/lib/model.dart @@ -12,8 +12,8 @@ class Coordinates { /// Creates coordinates from a map containing its properties. Coordinates.fromMap(Map map) - : this.latitude = map["latitude"].toDouble(), - this.longitude = map["longitude"].toDouble(); + : this.latitude = map["latitude"]?.toDouble(), + this.longitude = map["longitude"]?.toDouble(); /// Creates a map from the coordinates properties. Map toMap() => {