mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	Add reverse geocoding and show asset location on map in detail view (#43)
* Added reserve geocoding, location in search suggestion, and search by location * Added mapbox sdk to app * Added mapbox to image detailed view
This commit is contained in:
		
							
								
								
									
										51
									
								
								mobile/lib/shared/models/mapbox_info.model.dart
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								mobile/lib/shared/models/mapbox_info.model.dart
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,51 @@
 | 
			
		||||
import 'dart:convert';
 | 
			
		||||
 | 
			
		||||
class MapboxInfo {
 | 
			
		||||
  final bool isEnable;
 | 
			
		||||
  final String mapboxSecret;
 | 
			
		||||
  MapboxInfo({
 | 
			
		||||
    required this.isEnable,
 | 
			
		||||
    required this.mapboxSecret,
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  MapboxInfo copyWith({
 | 
			
		||||
    bool? isEnable,
 | 
			
		||||
    String? mapboxSecret,
 | 
			
		||||
  }) {
 | 
			
		||||
    return MapboxInfo(
 | 
			
		||||
      isEnable: isEnable ?? this.isEnable,
 | 
			
		||||
      mapboxSecret: mapboxSecret ?? this.mapboxSecret,
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Map<String, dynamic> toMap() {
 | 
			
		||||
    return {
 | 
			
		||||
      'isEnable': isEnable,
 | 
			
		||||
      'mapboxSecret': mapboxSecret,
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  factory MapboxInfo.fromMap(Map<String, dynamic> map) {
 | 
			
		||||
    return MapboxInfo(
 | 
			
		||||
      isEnable: map['isEnable'] ?? false,
 | 
			
		||||
      mapboxSecret: map['mapboxSecret'] ?? '',
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  String toJson() => json.encode(toMap());
 | 
			
		||||
 | 
			
		||||
  factory MapboxInfo.fromJson(String source) => MapboxInfo.fromMap(json.decode(source));
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  String toString() => 'MapboxInfo(isEnable: $isEnable, mapboxSecret: $mapboxSecret)';
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  bool operator ==(Object other) {
 | 
			
		||||
    if (identical(this, other)) return true;
 | 
			
		||||
 | 
			
		||||
    return other is MapboxInfo && other.isEnable == isEnable && other.mapboxSecret == mapboxSecret;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  int get hashCode => isEnable.hashCode ^ mapboxSecret.hashCode;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user