- Search web for "Flutter" and click on Install link
- Choose Windows
- Scroll to "Get the Flutter SDK" and download flutter zip file form (the link is filtered in some counhteries)
- Extract The zip into a folder like c:\SDKs
- click windows logo (start) and type environment , select "Edit System Environment variable" form the menu
- Click Environment variable button in the opened dialog
- then in system variables list select "Path" and click edit
- Click "New" in the opened dialog, and browse for the bin folder of flutter path : c:\SDKs\Flutter\bin and ok
- Then repeat the same process for "path" in "User variables" list
- In Cmd , type "flutter doctor" ,It should give the information about flutter installation and what is missing
. Flutter codes can be run and tesed rapidly in the browser without need to install Android SDK tool chain or Android Studio
1.Install Flutter ( by DartCode) Extention in vscode 2. To open command palette in VSCode: Ctrl+shift+p or Menu>View> command palette 3. Type flutter and choose new project 4. select a project type,select a Path and give a name for the project and accept to trust the created folder 5. it will generate the project 6. In the right hand of vscode`s status bar(footer),Choose chrome instead of Windows 7. Press F5 to run the project 8. it will download needed files in first run and then runs the project.
- close any folder and create a new file name something.dart
- copy following dart code in it and save:
void main(){
// this will print "hi"
print("hi!");
// variables:
int i= 5, j=null;
double d= 3.14;
string s= "what`s up?";
var t= 12.5;
// using a variable inside a string:
print("The number is $i"+d.toString());
// "if" , "switch" ,"for",continue,break, functions,arrow functions, syntax is like c or c# language
//class defenition:
Class User{
String name;
String number;
User (this.name,this.number); // constructor
}
// class usage:
User user1=User("Dvid","baker");
print(user1.name);
4.press f5 to run it and see the result in the debug console
- Type this in cmd
flutter create projectName
cd projectName
flutter analyze
flutter test
flutter run lib/main.dart
- pub is the package manager for dart
- add dependency to your project using pubspec.yaml file :
...
dependencies:
path: ^1.7.0
dev_dependencies:
..pedantic:^1.9.0
dev_dependencies will not includeed in your app compilation
- pub commands:
flutter pub get
flutter pub outdated
flutter pub upgrade
flutter pub add http