From 7b9188e2e828712b5ca23922e3d01d00b4229120 Mon Sep 17 00:00:00 2001 From: marco Date: Thu, 18 Jun 2026 18:17:30 +0200 Subject: [PATCH] refactored location model --- lib/model/location.dart | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/model/location.dart b/lib/model/location.dart index d43ea86..55c726d 100644 --- a/lib/model/location.dart +++ b/lib/model/location.dart @@ -1,16 +1,10 @@ import 'latlng.dart'; class Location { - final String? _address; - final LatLng? _coordinates; + final LatLng coordinates; + final String address; - Location({this._address, this._coordinates}); - - Location.fromAddress({required this._address}) : _coordinates = null; - Location.fromCoordinates({required this._coordinates}) : _address = null; - - String get address => _address ?? ''; - LatLng get coordinates => _coordinates ?? LatLng.empty(); + Location({required this.coordinates, this.address = ''}); factory Location.fromJson(Map json) { return Location(