1

I have installed Android Studio and flutter successfully. When I run flutter doctor in command prompt it gives me [all green ticks in these brackets].

The question is that after the creation of a new flutter project on the right-hand side of the screen under the project I am unable to see/locate any dart main file to write code. For further clarification, you can see the attached image below.

Unable to locate the dart file to write code in the project hierarchy:
Unable to locate the dart file to write code in the project hierarchy

I have 0 ideas what is still missing in the configuration of Flutter / Android Studio

eyllanesc
  • 235,170
  • 19
  • 170
  • 241

1 Answers1

1

Well, I figured out why pubspec.yaml and main.dart was not in my project due to the older version of flutter. I downloaded the latest version flutter_windows_2.2.2-stable, created a new flutter project, and included the flutter SDK path of flutter_windows_2.2.2-stable which resolved all my problems. Kindly, make sure whoever wants to start Mobile Application development in Android Studio + Flutter + Dart always download the latest version of everything.

Recent Experiment:

After downloading the latest version of Flutter still, I was unable to get the pubspec.yaml and main.dart files in my Android Studio Project, so the solution is below:

  1. where you have extracted your flutter_windows_2.2.2-stable remember the directory path like E:\src\flutter_windows_2.2.2-stable which is in my scenario.

    ******************* CMD WORK *******************

  2. Open cmd(Command Prompt) by default you will be in the directory like C:\Users\UserName\

  3. Now go to the path E:\src and to navigate write E: hit enter, now you will be in the E: directory. Write cd E:\src hit enter.

  4. type flutter create project_name ( make sure whenever you withe the name of the project it should be like this my_first_app in this format you name the projects with proper naming convention in flutter [word_word_word_word] ) then hit enter, wait for a while it will create a new flutter project for you including pubspec.yaml and main.dart files + necessary files to be imported.

Reference for naming convention in flutter (https://medium.com/flutter-community/file-and-folder-structure-in-flutter-967b8be3155e#:~:text=Flutter%20doesn't%20have%20a,letters%20and%20underscores%20between%20words.&text=When%20naming%20folders%2C%20you%20want,them%20very%20direct%20and%20clear.)

Right now after the creation of a project(Flutter) in Android Studio you are unable to see/locate the pubspec.yaml and main.dart files use cmd for the project creation which worked in my scenario.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241