Models can also be generated using the Amplify CLI directly.

In your terminal, make sure you are in your project/root folder and **execute the codegen command**:

```console
amplify codegen models
```

The generated files will be under the `lib/models` directory by default. They get re-generated each time codegen is run.

<Callout>

Codegen generates models using Dart null safety by default for a new Flutter project. It also provides a configurable feature flag to generate null safe models for existing Flutter projects. Check [here](https://docs.amplify.aws/lib-v1/project-setup/null-safety/q/platform/flutter) for more details.

</Callout>
