Hibok
您不能選擇超過 %s 個話題 話題必須以字母或數字為開頭,可包含連接號 ('-') 且最長為 35 個字
 
 
 
 
 
 

42 行
1.3 KiB

  1. import 'dart:typed_data';
  2. import 'package:google_maps_flutter/google_maps_flutter.dart';
  3. /// The result returned after completing location selection.
  4. class LocationResult {
  5. /// The human readable name of the location. This is primarily the
  6. /// name of the road. But in cases where the place was selected from Nearby
  7. /// places list, we use the <b>name</b> provided on the list item.
  8. String address; // or road
  9. /// Latitude/Longitude of the selected location.
  10. LatLng latLng;
  11. List<int> screen;
  12. LocationResult({this.latLng, this.address,this.screen});
  13. LocationResult.fromJson(Map<String, dynamic> json) {
  14. address = json['address'];
  15. var latlngJson = json['latLng'];
  16. if (latlngJson != null) {
  17. latLng = LatLng(latlngJson[0], latlngJson[1]);
  18. }
  19. screen = Uint8List.fromList(List<int>.from(json['screen']));
  20. }
  21. Map<String, dynamic> toJson() {
  22. final Map<String, dynamic> data = new Map<String, dynamic>();
  23. data['address'] = this.address??'';
  24. data['latLng'] = [this.latLng.latitude,this.latLng.longitude];
  25. data['screen'] = this.screen.toList();
  26. return data;
  27. }
  28. @override
  29. String toString() {
  30. return 'LocationResult{address: $address, latLng: $latLng,screen:$screen}';
  31. }
  32. }