Skip to content

Commit

Permalink
Merge pull request #51 from canopas/fix-get-places-url
Browse files Browse the repository at this point in the history
Fix get places url
  • Loading branch information
kaushiksaliya authored Jul 22, 2024
2 parents 50ebf07 + 9370265 commit a27dc05
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions data/lib/service/place_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:http/http.dart' as http;

import '../api/network/client.dart';
import '../config.dart';

const defaultRadius = 1500;

Expand Down Expand Up @@ -127,12 +128,13 @@ class PlaceService {
}

Future<List<ApiNearbyPlace>> searchNearbyPlaces(
String query,
String? lat,
String? lng,
) async {
// final placeRadius = (lat != null && lng != null) ? defaultRadius : '';
const String url ='url';
String query,
String? lat,
String? lng,
) async {
final placeRadius = (lat != null && lng != null) ? defaultRadius : '';
final String url =
'${AppConfig.placeBaseUrl}?query=$query&location=$lat,$lng&radius=$placeRadius&key=${AppConfig.mapApiKey}';

final response = await http.get(Uri.parse(url));

Expand Down

0 comments on commit a27dc05

Please sign in to comment.