step 12 : ubah dari nomitism ke google apis untuk address
This commit is contained in:
@@ -5,8 +5,8 @@ import 'base_repository.dart';
|
||||
class GoogleApisRepository extends BaseRepository {
|
||||
GoogleApisRepository({required super.graphql, required super.dio});
|
||||
|
||||
Future<String?> getAddressFromCoordinates(
|
||||
double latitude, double longitude) async {
|
||||
Future<String> getAddressFromCoordinates(
|
||||
String latitude, String longitude) async {
|
||||
final dio = Dio();
|
||||
const apiKey = "AIzaSyAVUr4Ku4O1HlSkK8n9KGnUyqvsXBL-yfs";
|
||||
final latitudeString = latitude.toString();
|
||||
@@ -31,15 +31,15 @@ class GoogleApisRepository extends BaseRepository {
|
||||
return plusCode['compound_code'];
|
||||
} else {
|
||||
print('Alamat Tidak Ditemukan');
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
} else {
|
||||
print('Failed to load data');
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
} catch (e) {
|
||||
print('Error: $e');
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user