Skip to content

Commit

Permalink
Fix get places url
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushik committed Jul 22, 2024
1 parent 50ebf07 commit 9370265
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 9370265

Please sign in to comment.