actually when we open any a new flutter project then we automatically get the main.dart file but in my case in did not get any file like that and moreover if I create it and copy paste the demo home page default code its not running and showing
I want the main.dart file to open automatically and when we click on run then it should open in the emulator
Enter this in your terminal:
flutter pub get
Related
Flutter opened and moved to developer folder. I haven't had any luck updating the flutter path in the terniaml. It fails to open flutter
I enter the info posted on the flutter website and replace the path with my info on where the flutter folder is located on my computer. i run, source $HOME/.. Then a error code comes back. If i run,
echo $PATH
then it comes back flutter not detected.
According to the installing Flutter documentation, you should put the downloaded folder in the development folder, not the developer folder. Try moving the downloaded folder to the development folder.
If you are unable to update the path via the terminal. Just do it manually.
Steps to manually update the path:
Since you already know you have a zsh terminal. Go to /Users/[your username]. Unhide the files by hitting [cmd+shift+.].
If you don't have a .zshrc file. Just create a new file. You can download my .zshrc file from here: .zshrc file
open it in TextEdit and write this
export PATH="$PATH:/Users/syedsadiquh/Development/SDKs/flutter/bin"
After the $PATH: just replace it with your own flutter/bin location.
Now close all terminal windows to source the new file automatically.
Now verify your path by running echo $PATH
Now verify that flutter is available by running which flutter.
The official flutter docs to refer (see update your path section): Official flutter docs
After few mounts I tried to create new project on terminal but it's not going till end and show me this error message:
Image File not found E:\my_project\web\icons\Icon-maskable-192.png
Also has same problem when use VPN. and
there is a screenshot from my code.
As per the screenshot, You are using Windows I think.
press Ctrl+Shift+p. There you can select a new Flutter project.
I am trying to start a new flutter projetc on android studio but i can't do nothing, look what appears here
When i run "flutter doctor" it's like this.
you can create a flutter project from the console just open windows console in the folder you want to create a project in and write flutter create project name and write name with small letters
I try to reinstall my flutter folder, I download flutter in there website and replace the old one on the folder, but when I run flutter in terminal I get this error
fee#Mac-mini ~ % flutter
/Users/fee/Documents/flutter/bin/internal/shared.sh: line 228:
/Users/fee/Documents/flutter/bin/cache/dart-sdk/bin/dart: No such file or directory
and I cant run even flutter doctor or flutter clean can some one help me thank you
im using mac
These links will help you -
Video
Official docs - https://flutter.dev/docs/get-started/install/macos
You have to update your path variable for flutter. At first, you need to know which shell you are using by typing echo $SHELL in your terminal. Depending on your shell, edit .bashrc, .bash_profile or .zshrc by any editor. Then you have to add below code to your shell:
export PATH="$PATH:/Users/fee/Documents/flutter/bin"
Then, type source .bashrc or source .bash_profile which you have updated earlier or logout and login back to take effect your new changes.
Check your update by typing which flutter or flutter doctor in terminal.
Try it like this.
Delete the cache folder under flutter/bin
I know that in Android Studio you could run a dart file that you put out of the lib folder individually much like dartpad. I'm wondering how you could do the same in VSCode. I haven't found a way to do it without it running and building the whole UI.
You can run a dart file from the command line like this.
$ dart path_to_your_file/your_file_with_main.dart
This will execute the main() function of the file.
After creating a flutter project to run individually dart file in Flutter
you have to add main function like below code with you desire class name
void main() { runApp(newfile()); }
or
void main() => runApp(newfile());
then go to project bar of android studio right click on the selected file you will see Run'newfile.dart' then you will also see in the toolbar, select your app from the run configurations drop-down menu
like
Select File and Edit Configuration
Add Run External Tools
Add dart in Program & Working dir $ProjectFileDir$