feat :
1 - search in map with api 2 - show details in selected location
This commit is contained in:
@@ -13,10 +13,10 @@ abstract class InspectionRemoteDataSource {
|
||||
/// containing the list of inspections.
|
||||
Future<List<Map<String, dynamic>>> fetchInspections(String userId);
|
||||
|
||||
|
||||
Future<List<PoultryLocationModel>?> getNearbyLocation({
|
||||
double? centerLat,
|
||||
double? centerLng,
|
||||
double? radius,
|
||||
double? centerLat,
|
||||
double? centerLng,
|
||||
double? radius,
|
||||
String? value,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -25,13 +25,19 @@ class InspectionRemoteDataSourceImp implements InspectionRemoteDataSource {
|
||||
double? centerLat,
|
||||
double? centerLng,
|
||||
double? radius,
|
||||
String? value,
|
||||
}) async {
|
||||
DioRemote dioRemote = DioRemote(baseUrl: 'https://habackend.rasadyaar.ir/');
|
||||
await dioRemote.init();
|
||||
|
||||
var res = await dioRemote.get<List<PoultryLocationModel>>(
|
||||
'poultry-loc/',
|
||||
queryParameters: {'center_lat': centerLat, 'center_lng': centerLng, 'radius': radius},
|
||||
queryParameters: buildRawQueryParams(
|
||||
centerLat: centerLat,
|
||||
centerLng: centerLng,
|
||||
radius: radius,
|
||||
value: value,
|
||||
),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
fromJsonList: (json) =>
|
||||
json.map((item) => PoultryLocationModel.fromJson(item as Map<String, dynamic>)).toList(),
|
||||
|
||||
Reference in New Issue
Block a user