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