From d153d259a93c35b831e75a1d044bed6a387835b9 Mon Sep 17 00:00:00 2001 From: ASHUTOSH AGARWAL Date: Thu, 18 Apr 2024 11:16:39 +0530 Subject: [PATCH] Update image_and_location_data.dart --- lib/src/image_and_location_data.dart | 44 +++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/lib/src/image_and_location_data.dart b/lib/src/image_and_location_data.dart index bb4ad1d..e3c541d 100644 --- a/lib/src/image_and_location_data.dart +++ b/lib/src/image_and_location_data.dart @@ -1,15 +1,51 @@ class ImageAndLocationData { final String? imagePath; - final String? latitude; - final String? longitude; - final String? locationName; - final String? subLocation; + final LocationData? locationData; + String? get latitude => locationData?.longitude; + String? get longitude => locationData?.longitude; + String? get locationName => locationData?.locationName; + String? get subLocation => locationData?.subLocation; ImageAndLocationData({ required this.imagePath, + required this.locationData, + }); +} + +class LocationData { + /// Latitude value of the current location as a string. + + final String? latitude; + + /// Longitude value of the current location as a string. + + final String? longitude; + + /// Name of the current location as a string. + + final String? locationName; + + /// SubLocation of the current location as a string. + + final String? subLocation; + + LocationData({ required this.latitude, required this.longitude, required this.locationName, required this.subLocation, }); + + @override + bool operator ==(Object other) { + return other is LocationData && + latitude == other.latitude && + longitude == other.longitude && + locationName == other.locationName && + subLocation == other.subLocation; + } + + @override + int get hashCode => + Object.hash(latitude, longitude, locationName, subLocation); }