import 'dart:typed_data';
import 'package:google_maps_flutter/google_maps_flutter.dart';
/// The result returned after completing location selection.
class LocationResult {
/// The human readable name of the location. This is primarily the
/// name of the road. But in cases where the place was selected from Nearby
/// places list, we use the name provided on the list item.
String address; // or road
/// Latitude/Longitude of the selected location.
LatLng latLng;
List screen;
LocationResult({this.latLng, this.address,this.screen});
LocationResult.fromJson(Map json) {
address = json['address'];
var latlngJson = json['latLng'];
if (latlngJson != null) {
latLng = LatLng(latlngJson[0], latlngJson[1]);
}
screen = Uint8List.fromList(List.from(json['screen']));
}
Map toJson() {
final Map data = new Map();
data['address'] = this.address??'';
data['latLng'] = [this.latLng.latitude,this.latLng.longitude];
data['screen'] = this.screen.toList();
return data;
}
@override
String toString() {
return 'LocationResult{address: $address, latLng: $latLng,screen:$screen}';
}
}