0

I'm working on a flutter project and I want to create a new file inside my flutter project folder and not in my device storage. Is there a way to create this file and appear inside my folder like under the pubspec.yaml file.

2
  • 1
    All files created are locally saved in device storage. Could you explain why you do not want it to be saved in device storage or what issue you face if it is saved in device storage? Commented May 18, 2022 at 12:42
  • In my case I want to create a file that contain user database information and save it in my flutter project because I will use it inside my code. But when I create a file it save in the default path downloads and you can't change the default path that's why I want to created it directly in my flutter project folder Commented May 18, 2022 at 12:45

2 Answers 2

2

If I understood correctly that you want to create a new file in the project folder in the application? This is not possible.

Sign up to request clarification or add additional context in comments.

Comments

0

Alright, so you are trying to create a new file in one of the flutter project file but for some reason it ends up in Downloads folder. Have you tried to create a new file by right clicking on the lib folder and then choosing new file? This will create the file under lib folder. Same way, you could create any file under any desired folder within lib.

1 Comment

yes I know how to create a file, but in my case I want to create it and write inside of it from a function in my code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.