- Set your API Key inside the
.env.examplefile :
OPEN_AI_API_KEY=<YOUR_KEY_HERE>
- if you're willing to change the environment variable name, then you should change it as well inside the
lib/env/env.dart, otherwise if you're not changing it, pass directly to the next step. - Change
.env.examplefile name to.env. - Run
dart pub get. - Run
dart run build_runner build. - Run the
lib/main.dartfrom your IDE, alternatively, Rundart run lib/main.dartfrom your command line. - That's it, now run your main.dart and other dart files.