lib/home.dart:29:25: Error: The method 'decode' isn't defined for the class 'dart.core::String'.
Try correcting the name to the name of an existing method, or defining a method named 'decode'.
var data = json.decode(json);
^^^^^^
Compiler failed on /Volumes/RamDisk/flute/lib/main.dart
Finished with error: Gradle task assembleDebug failed with exit code 1
json.decode(json) 코드에서 컴파일 에러가 계속 되어 확인 해보니 Dart2 에서는 json.decode()를 jsonDecode()로 써줘야 했다.
새댓글 등록