Flutter Tutorial

How to install flutter on windows


 https://flutter.dev/docs/get-started/install/windows


Create a src directory in c: drive because  C:\Program Files reqyuires extra privileges. 

C:\src>git clone https://github.com/flutter/flutter.git -b stable

Once installed,  go to the installed directory and double click the flutter_console.bat file. This will take you to flutter console.  Type flutter doctor,  which is a diagnostic tool.

C:\src\flutter>flutter doctor 


To access flutter globally, add the flutter installation path to environment PATH variables.






Flutter uses programming language 'Dart'.

DART is a statically typed programming language.
Once a variable is declared as string, it cannot be assigned an integer value.
For example:
String name = 'abc';

later if we give name the value of 30, it will give error 'type 'int' can't be assigned to a variable of type 'String'.


Dart - functions





Below is dynamic variable, which we should never use.





void










In arrow function syntax :

String greeting() => 'hello';


Dart - List

void main() {

    List names = ['chun-li', 'yoshi', 'mario'];  // Allows int but not a good practice

    List<String> names = ['chun-li', 'yoshi', 'mario']; // Only strings allowed or else throws error.

    names.add('luigi');

    names.remove('yoshi');

    print(names);

}

Dart - Class

Class, like in any programming language, is a blueprint for an object.





Comments