Flutter generate .g.dart file

https://caijinglong.github.io/json2dart/index.html

This site can automatically json_serializable json file into the format required, and a new copy into ***. Dart file, by entering the code in the Terminal, automatically generated file .g.dart

flutter packages pub run build_runner build

If there is an error you can try the following this

flutter packages pub run build_runner build --delete-conflicting-outputs
Published 57 original articles · won praise 3 · Views 6184

Guess you like

Origin blog.csdn.net/qq_39830579/article/details/103920706