0

I can't create a new dart file in android studio.Please help

[main.dart is auto created by android studio] screen1

[flutter doctor is fine] screen2

2
  • You can create files by right clicking the lib folder and then selecting new>dart file. and add a name to it. It will be created as Nameyougave.dart Commented Jul 27, 2021 at 16:43
  • you did the correct way, keep typing, or do a restart of androidStudio Commented Jul 27, 2021 at 16:48

2 Answers 2

1

Open your flutter project in android studio. Go to android studio settings by following this flow. File => Settings => Languages & Frameworks and select Dart check its Sdk path is it correct or not and is the dart support is enabled for your project or not.

If this is all good then by right click at lib and hover on New => Dart File give it some name (extension is not required just name it) and you are good to work in it.

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

Comments

0

You should right click on lib folder and create dart file or create file with extention .dart eg. abc.dart

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.