mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-09-20 23:36:36 +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
|
// To modify the state of the app, use this method
|
||||||
setState(() {
|
setState(() {
|
||||||
// Get the JSON data
|
// 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
|
// Extract the required part and assign it to the global variable named data
|
||||||
data = dataConvertedToJSON['results'];
|
data = dataConvertedToJSON['results'];
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user