mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-09-20 06:40:56 +08:00
Update main.dart
"JSON" changed to "json" as it is written as part 'json.dart'; in the convert.dart file. "JSON" displays an error in the Android Studio IDE.
This commit is contained in:
@ -34,7 +34,7 @@ class MyGetHttpDataState extends State<MyGetHttpData> {
|
||||
// To modify the state of the app, use this method
|
||||
setState(() {
|
||||
// Get the JSON data
|
||||
var dataConvertedToJSON = JSON.decode(response.body);
|
||||
var dataConvertedToJSON = json.decode(response.body);
|
||||
// Extract the required part and assign it to the global variable named data
|
||||
data = dataConvertedToJSON['results'];
|
||||
});
|
||||
|
Reference in New Issue
Block a user