I m sorry for asking like those simple questions. because I m noob to json and flutter. I just need to understand this code segment. Please help.
var placeId = json['candidates'][0]['place_id'] as String;
I just found this code part when I need to get placeId for a place in google map using API_KEY in flutter project. This is the full code part of it.
Future<String> getPlaceId(String input) async {
final String url =
'https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=$input&inputtype=textquery&key=$key';
var response = await http.get(Uri.parse(
'https://maps.googleapis.com/maps/api/place/findplacefromtext/json?input=$input&inputtype=textquery&key=$key'));
var json = convert.jsonDecode(response.body);
var placeId = json['candidates'][0]['place_id'] as String;
print(placeId);
return placeId;}
I found this code part from this video https://youtu.be/tfFByL7F-00
I need to know what is ['candidates'][0] and what is ['place_id'] how can I found those properties for place id. Are there more properties for placeId. where can I learn this type of code json['candidates'][0]['place_id'].
Thank you :)