ChatGPT-Flutter-AIChatBot icon indicating copy to clipboard operation
ChatGPT-Flutter-AIChatBot copied to clipboard

env file name

Open mridul2620 opened this issue 2 years ago • 10 comments

in the main.dart, the line await dotenv.load(fileName: ".env"); is throwing error of "FileNotFoundError". What to do please help.

mridul2620 avatar Mar 20 '23 19:03 mridul2620

in the main.dart, the line await dotenv.load(fileName: ".env"); is throwing error of "FileNotFoundError". What to do please help.

Try adding flutter_dotenv: ^5.0.2 in pubspec.yaml file, it will work

Rahul0714 avatar Mar 22 '23 10:03 Rahul0714

in the main.dart, the line await dotenv.load(fileName: ".env"); is throwing error of "FileNotFoundError". What to do please help.

i am facing the same error have you solved it?

ALIRAZANOMI avatar Mar 22 '23 18:03 ALIRAZANOMI

in the main.dart, the line await dotenv.load(fileName: ".env"); is throwing error of "FileNotFoundError". What to do please help.

Try adding flutter_dotenv: ^5.0.2 in pubspec.yaml file, it will work

It did not solve the error.

SHOAIBAHMED12842 avatar Mar 29 '23 05:03 SHOAIBAHMED12842

in the main.dart, the line await dotenv.load(fileName: ".env"); is throwing error of "FileNotFoundError". What to do please help.

Try adding flutter_dotenv: ^5.0.2 in pubspec.yaml file, it will work

Is .env file will be in root folder is it empty or something present in the file?

SHOAIBAHMED12842 avatar Mar 29 '23 05:03 SHOAIBAHMED12842

Its empty. file is missing. user needs to update his repo

ji4a avatar Mar 29 '23 22:03 ji4a

.env file is missing

mohitrajsinha avatar Apr 24 '23 21:04 mohitrajsinha

You just need to make your own with your own API_KEY

Memie1 avatar Jun 25 '23 21:06 Memie1

@Memie1 can you put some examples or links to urls that show how? https://codewithandrea.com/articles/flutter-api-keys-dart-define-env-files/ It seems more involved than you make it out to be but is there a short cut?

nyck33 avatar Jul 06 '23 12:07 nyck33

@Memie1 can you put some examples or links to urls that show how? https://codewithandrea.com/articles/flutter-api-keys-dart-define-env-files/ It seems more involved than you make it out to be but is there a short cut?

Most of this code already does most of this work. From what I remember.

Basically, it's as simple as creating a file called '.env' alongside your pubspec.yaml and then taking your api key from the open ai website. Then write just this one line in that file:

API_KEY="YOUR_API_KEY"

In terms of links on how to do it, idk if I can find any that would actually be helpful. I'd say it's just a matter of if you've ever worked with .env files before, then it's fairly straightforward because the code from this project itself already does all the work of calling for the .env file for you, you just need to make that .env file.

If you're making the project from scratch, though, I wish you the best of luck because that's a bit beyond me.

Memie1 avatar Jul 08 '23 14:07 Memie1

Thanks! @Memie1 It worked!
I did not see license but am I free to refactor it to get the UI the way I want then to commercialize this if the opportunity comes up?

nyck33 avatar Jul 08 '23 15:07 nyck33