At Flutter app, sometime we need to create class for mode. Although it can be done manaually, it takes too much time. So we can use some tools to complete this.
We can use these tools. You can view more usafe methods on the officail website.
First, we should add these package to your pubspec.yaml, like below. Then run the pub get command in terminal to install them. At this point we have made preparations.
Then we can create jsons fold to save our mode json file. The following is a case of caching mode, we can create mulitple json files corresponding to multiple modes.
Next we just should use flutter packages pub run json_model in terminal and wait a minute, we can see the mode file be producted in lib/models. We just include the fold's index.dart to use our mode.