1 - search in map with api
2 - show details in selected location
This commit is contained in:
2025-07-30 12:31:47 +03:30
parent 2806301367
commit f563c6188e
25 changed files with 3960 additions and 337 deletions

View File

@@ -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,
});
}

View File

@@ -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(),