- void main(){ ==> Work <== } ==> Void Is a main Function In this we do our complete work
- print("ExamPle Print"); ==> Print This OutPut Inside Console
- KeyWord: (var) ==> (Variable) ==> (Variable Inside (Integer_Val,Boolean_Val,String_Val,Double_Val))
- KeyWord: (int) ==> (Integer) ==> (Integer Inside (Numeric_Val))
- KeyWord: (num) ==> (Number) ==> (Number Inside (Numeric_Val && Double))
- KeyWord: (double) ==> (Double) ==> (Double Inside (Double_Val Means (.,Devide_Val) Value))
- KeyWord: (bool) ==> (Boolean) ==> (Boolean Inside (Boolean_Val Means (True,False) Value))
- KeyWord: (String) ==> (String) ==> (String Inside (String_Val Means ("This_Is_String") Value))
- Operator: (+) ==> (Addition) ==> (Addition both values)
- Operator: (-) ==> (Subtraction) ==> (Subtraction both values)
- Operator: (*) ==> (MultipliCation) ==> (Multiplication both values)
- Operator: (/) ==> (DiviSion) ==> (Division both values)
- Operator: (~/) ==> (DiviSion_Integer) ==> (Return Integer Value)
- Operator: (%) ==> (Module) ==> (Module both values)
- Operator: (<) ==> (Less_then) ==> (2 Less_then 5 = True)
- Operator: (>) ==> (Greater_than) ==> (2 Greater_then 5 = False)
- Operator: (<=) ==> (Less_then_Equal_To) ==> (5 Less_then_Equal_To 5 = True)
- Operator: (>=) ==> (Greater_than_Equal_To) ==> (12 Greater_than_Equal_To 12 = True)
- Operator: (==) ==> (Equal To Equal) ==> (Two values are equal)
- Operator: (!=) ==> (Not Equal_To) ==> (Two values are not equal)
- Operator: (${}) ==> (Dollor Culry Breket) ==> (String Inside Uses Variable Name Output Is Variable Value)
- Operator: (&&) ==> (Equal To Equal) ==> (Two values are equal)
- Operator: (||) ==> (Correct Any One Value) ==> (Correct one of the two values)
- Operator: (!) ==> (Not) ==> (Output Is False But This Operator (!) Output Convert Into True)
- Unary_Operators: (i++) ==> (Post_Increament) ==> (Increments later)
- Unary_Operators: (++i) ==> (Pre_Increament) ==> (Increments first)
- Unary_Operators: (i--) ==> (Post_Decreament) ==> (Decreament later)
- Unary_Operators: (--i) ==> (Pre_Decreament) ==> (Decreament first)
- Conditional_Statement: (if) ==> (First_Condition) ==> (If condition is true then print output (IF))
- Conditional_Statement: (else if) ==> (Second_Condition) ==> (If condition is true then print output(Else_IF))
- Conditional_Statement: (else) ==> (Last_Condition) ==> (If IF and Else IF are both wrong then print Else)
- ArraY: (["ExamPle",123,false,23.45]) ==> (Square Brecket) ==> (In List we store more than one element)
- Method: (Replace) ==> (listName[5] = "ReplaCe_Text") ==> (Replace One Element)
- Method: (Replace_Range) ==> (listName.replaceRange(1,4,[786,false,65.98])) ==> (Replace Multiples Elements)
- Method: (List_First_Element_Access) ==> (listName.first;) ==> (List Inside First Element Print Console)
- Method: (List_Last_Element_Access) ==> (listName.last;) ==> (List Inside Last Element Print Console)
- Method: (Center Element Access) ==> (listName.elementAt(3);) ==> (List Inside Center Element Access Throw By ElementAt Function)
- Method: (List_Length) ==> (listName.length) ==> (Print List Length)
- Method: (Elements Line By Line) ==> (listName.sort()) ==> (Elements Line By Line Interpretion Alphabets || Number)
- Method: (Is_Emplty_Now) ==> (listName.isEmpty) ==> (Check List Is Empty Print OutPut Booleans Value)
- Method: (Is_Not_Emplty_Now) ==> (listName.isNotEmpty) ==> (Check List Is Not Empty Print OutPut Booleans Value)
- Method: (Clear_List) ==> (listName.clear()) ==> (List Is Empty Now)
- Method: (Reversed_List) ==> (List.of(listName.reversed)) ==> (List Is Reversed Throw By reversed Method)
- Method: (Add_New_Element_Inside_List) ==> (listName.add("New_Element")) ==> (List Inside One New Element Added)
- Method: (Add_All) ==> (listName.addAll(["New_Element","New_Element_1","New_Element_2"]))==>(Add_Multiples_New_Elements_Inside_List)
- Method: (Insert_One_Element) ==> (listName.insert(3,"New_Element")) ==> (List_Inside_Insert_PartiCular_Point_Of_Index_Value)
- Method: (InsertAll) ==> (listName.insertAll(2,["New_Element_1","New_Element_2","New_Element_3"]))==> (Insert_More_Then_One_Element)
- Method: (Remove_Element) ==> (listName.remove("Remove_Element_Name")) ==> (Inside_List_Remove_Element)
- Method: (Remove_At) ==> (listName.removeAt(listName.length -5))==>(List_Inside_More_Then_One_Elements_Remove_Throw_removeAt_Method)
- Method: (Remove_Last) ==> (listName.removeLast()) ==> (List_Inside_Last_Element_Remove_Throw_By_(removeLast)_Method)
- Method: (remove_Where) ==> (listName.removeWhere((e) => e < 0)) ==> (List_Elements Is Less_Then 0 Then Remove This Elements)
- Method: (retain_Where) ==> (listName.retainWhere((e) => e > 30)) ==> (List_Elements Is Greater_Then 30 Then Print This Elements)
- Method: (Remove_Range) ==>(listName.removeRange(3,6))==>(List_Inside_One_&More_Then_Elements_Remove_Throw_By(removeRange)_Method)
- Map: ({Pro: "Val",Pro1: 23.45}) ==> (Square Brecket) ==> (In List we store more than one element)
- A variable is “a named space in the memory”
- that stores values. In other words, it acts a
- container for values in a program.
- var name = "FullName: Jibran Abdul Jabbar;";
- var school = "Coaching: Online Jawan Pakistan";
- print(name + " " + school);
- int: locale_Variable
- double: locale_Variable
- num: locale_Variable
- int numberVal = 86;
- print(numberVal);
- double pointVal = 86.6;
- print(pointVal);
-
num numAndPointVal = 83;
-
print(numAndPointVal);
-
num numAndPointVal1 = 86.66;
-
print(numAndPointVal1);
-
String Full_Name = "Jibran Abdul Jabbar";
-
print(Full_Name);
-
String date = "2-April-2021";
-
print(date);
-
String email = "jibran.jabbar06@gmail.com";
-
print(email);
-
bool statusTrue = true;
-
bool statusFalse = false;
-
print(statusTrue);
-
print(statusFalse);
- int num1 = 7;
- int num2 = 2;
- bool checkCondition = num2 < num1;
- print(checkCondition);
- int num3 = 9;
- int num4 = 6;
- bool checkCondition1 = num3 < num4 && num3 > num4;
- print(checkCondition1);
- int num5 = 4;
- int num6 = 8;
- bool checkCondition2 = num5 < num6 || num5 > num6;
- print(checkCondition2);
- int num7 = 9;
- int num8 = 14;
- bool checkCondition3 = num7 < num8 == num7 < num8;
- print(checkCondition3);
-
- Arithmetic Operators.
-
- Equality & Relational Operators.
-
- Logical Operators.
- int num9 = 5;
- int num10 = 10;
- int outputAddition = num9 + num10;
- print(outputAddition);
- print("Addition OutPut Is: ${outputAddition}");
- int num11 = 7;
- int num12 = 6;
- int outputSubtraction = num11 - num12;
- print(outputSubtraction);
- print("Subtraction OutPut Is: ${outputSubtraction}");
- int num13 = 5;
- int num14 = 4;
- int outputMultipliCation = num13 * num14;
- print(outputMultipliCation);
- print("MultipliCation OutPut Is: ${outputMultipliCation}");
- int num15 = 9;
- int num16 = 7;
- double outputDivision = num15 / num16;
- print(outputDivision);
- print("Division OutPut Is: ${outputDivision}");
- int num17 = 435;
- int num18 = 1;
- int outputDivisionInt = num17 ~/ num18;
- print(outputDivisionInt);
- print("Division_Int OutPut Is: ${outputDivisionInt}");
- int num19 = 10;
- int num20 = 3;
- int outputModule = num19 % num20;
- print(outputModule);
- print("Module % OutPut Is: ${outputModule}");
-
- Compilation => Whole code get translate at one step.
-
- Interpretation => Line by Line which is left to right
-
translation.
-
- Assembler => Translation of Assembly Language.
-
int a = 10;
-
int b = a++;
-
print("Post_Increament Output Is: ${b}");
-
int c = 35;
-
int d = ++c;
-
print("Pre_Increament Output Is: ${d}");
-
int e = 5;
-
int f = e--;
-
print("Post_Decreament Output Is: ${f}");
-
int g = 15;
-
int h = --g;
-
print("Pre_Decreament Output Is: ${h}");
- int i = 5;
- int j = i++ + --i - i + i++ - i-- + ++i;
- // 5 + 5 - 5 + 5 - 6 + 6 = 10
-
print("Answer Is: ${j}");
-
int x = 9;
-
int y = x + ++x - x-- + x++ + x - --x + ++x - x--;
- // 9 + 10 - 10 + 9 +10 - 9 + 10 - 10 = 19
- print("Answer Is: ${y}");
- int age = 9;
- bool checkCondition = age > 8;
-
// 9 > 8
- print(checkCondition);
- int age1 = 7;
- bool checkCondition1 = age1 < 9;
-
// 7 < 9
- print(checkCondition1);
- int age2 = 8;
- bool checkCondition2 = age2 >= 8;
-
// 8 >= 8
- print(checkCondition2);
- int age3 = 5;
- bool checkCondition3 = age3 <= 5;
-
// 5 <= 5
- print(checkCondition3);
- int age4 = 12;
- bool checkCondition4 = age4 == 12;
-
// 12 == 12
- print(checkCondition4);
- int age5 = 3;
- bool checkCondition5 = age5 != 5;
-
// 3 != 5;
- print(checkCondition5);
- &&
- String name0 = "Jibran";
- int age6 = 7;
- bool checkCondition0 = name0 == "Jibran" && age6 == 7;
- print(checkCondition0);
- ||
- String name1 = "ExamPle";
- int age = 7;
- bool checkCondition01 = name1=="ExamPlesss" || age==7;
- print(checkCondition01);
- !
- int age8 = 8;
- bool checkCondition02 = !(age8 > 8);
- print(checkCondition02);
- var age = 6;
- var age1 = 6;
- if(age > age1) {
-
print('Age Is Greater Then Age1');
-
}
- else if(age < age1) {
-
print('Age Is Less Then Age1');
-
}
- else if(age == age1) {
-
print("Age Is Equal To Age1");
- }
- else{
-
print("There Is No Output");
- }
-
var marks = 85;
-
if(marks > 96){
-
print("OutPut_Is: Exellent...");
-
}
-
else if(marks > 86){
-
print("OutPut_Is: Very_Good...");
-
}
-
else if(marks > 76){
-
print("OutPut_Is: Good...");
-
}
-
else {
-
print("OutPut_Is: AveraGe...");
-
}
- var a = "Jibran";
- var b = "Jibran";
- if(a == b){
-
print("A Is Equal To B");
- }
- else if(a == "Hayyan"){
-
print("A Is Equal To Hayyan");
- }
- else{
-
print("Not Equality");
- }
-
JavaScript Programming Language = [ ] = Array ;
-
C Shap Programming Language = [ ] = Array ;
-
Python Programming Language = [ ] = List ;
-
Dart Programming Language = [ ] = List ;
-
In List we store more than one element
-
var arrDigit = [0,1,2,3,4,5];
-
print(arr);
-
var arrString = ["ExamPle1","ExamPle2","ExamPle3","ExamPle4","ExamPle5"];
-
print(arrString);
-
var arrBool = [true,false];
-
print(arrBool);
-
var arrMulti = ["ExamPle",123,true,65.66];
- Index = 0 1 2 3
- Length = 1 2 3 4
- print(arrMulti);
-
int integer_Val = 23;
-
String string_Val = "ExamPle_String";
-
double double_Val = 1.43;
-
bool boolean_Val = true;
-
arrMulti[2] = false; ===> Replace_Element_Throw_Index
-
print(arrMulti.first); ===> List Inside First Element Return = ExamPle
-
print(arrMulti.last); ===> List Inside Last Element Return = 65.66
-
print(arrMulti.elementAt(2)); ===> List Inside Center Element Return = true
-
print(arrMulti.length) ===> Return List Length = 4
-
arrMulti.replaceRange(1,3,[786, false]) print(arrMulti) ===> Replace Element Throw Index
-
var list_Multi_Digit = [67,54,87,23,91,9,120,1];
-
list_Multi_Digit.sort()
-
print(listMulti)
-
var list_Multi_String = ["Car","Bike","Apple","Gents","Fruit","Verb","Onion","Mango"];
-
list_Multi_String.sort()
-
print(listMulti)
-
var list = [];
-
if(list.isEmpty){ ===> List Inside Empty List = Console = List Is Empty Now
-
print("List Is Empty Now");
-
}
-
list.add("ExamPle1"); ===> List Inside .Add Element = [ExamPle1]
-
list.add("ExamPle2"); ===> List Inside .Add Element = [ExamPle1,ExamPle2]
-
list.add("ExamPle3"); ===> List Inside .Add Element = [ExamPle1,ExamPle2,ExamPle3]
-
print(list); ===> List Is Not Empty Because List Inside Multiples Items For ExamPle: [ExamPle1,ExamPle2,ExamPle3]
-
if(list.isNotEmpty){ ===> List Is Not Empty Because List Inside Multiples Items = Console = List Is Not Empty Now
-
print("List Is Not Empty Now");
-
}
-
list.clear(); ===> List Is Empty Now = []
-
print(list);
- var list1 = [8,4,6,2,9,1,5];
- var reversed = List.of(list1.reversed); ===> List Inside Values Reversed
- print("List: ${list1}");
- print("Reversed_Value: ${reversed}");
- Add
- var list2 = [];
- list2.add(3); ===> Add Single Element Inside List2 Throw add Method
- list2.add(1);
- list2.add(2);
- Add_All
-
var list3 = [5,0,4]
-
list2.addAll(list3); ===> Add Multiples Elements Inside List2 Throw addAll Method
- Or
-
list2.addAll(["ExamPle3","ExamPle4","ExamPle5"]); ===> Add Multiples Elements Inside List2 Throw addAll Method
-
list2.sort()
-
print(list2);
- Insert
-
var list4 = [1,2,3,4,5];
-
list4.insert(3,30);
-
print(list4);
-
list4.insertAll(2,[23,33,43]);
-
print(list4);
-
var list5 = ["ExamPle","ExamPle1","ExamPle2"];
-
print(list5);
-
list5.insert(1,"Insert_ExamPle");
-
print(list5);
- Insert_All
-
list5.insertAll(0,["Insert_All_ExamPle","Insert_All_ExamPle_1"]);
-
print(list5);
- Remove
-
var list6 = ["ExamPle","ExamPle1","ExamPle2"];
-
list6.remove("ExamPle1");
-
print(list6);
- RemoveAt
-
var list6 = ["ExamPle","ExamPle1","ExamPle2"];
-
list6.removeAt(list6.length -1);
-
print(list6);
- RemoveLast
-
var list6 = [1,2,3];
-
list6.removeLast();
-
print(list6);
-
var list7 = [7,89,-3,-27,-8,54,3];
-
list7.removeWhere((e) => e < 0);
-
print(list7);
-
var list7 = [7,89,-3,-27,-8,54,3];
-
list7.removeWhere((e) => e > 0);
-
print(list7);
-
var list7 = [7,5,4,2,1,8,12,76];
-
list7.removeRange(0,6);
-
print(list7);
-
var list7 = ["ExamPle","ExamPle1","ExamPle2"];
-
list7.removeRange(0,2);
-
print(list7);
-
var list7 = [7,89,-3,-27,-8,54,3];
-
list7.retainWhere((e) => e < 7);
-
print(list7);
-
var list7 = [7,89,-3,-27,-8,54,3];
-
list7.retainWhere((e) => e > 7);
-
print(list7);
-
Map is an object that represent is an key/value.
-
The Map can be declared by using curly braces {}.
-
And each key-value pair is separated by the commas(,).
-
Map_Syntex:
-
var map = { ===> + var map = {
-
"Name": "ExamPle_Name", ===> + "Key" : "Value",
-
"Roll_No": "1897", ===> + "Key" : "Value",
-
"Contact_No": "+92111111111" ===> + "Key" : "Value",
-
}; ===> + }; ===> (SemiColon(;))
-
print(map); + print(map);
- Second_ExamPle
-
var fruit = {1: "Apple", 2: "Mango", 3: "OranGe", 4: "Banana", 5: "WaterMelon"};
-
print(fruit);
-
Map_Keys:
-
print(fruit.keys); ===> Return Also Map_(fruit) Keys
-
Map_Values:
-
print(fruit.values); ===> Return Also Map_(fruit) Values
- Map_Length
-
print('Fruit Map length Is: ${fruit.length} '); ===> Return Also Map_(fruit) Length
- Is_Empty && Is_Not_Empty Using Map
-
var map1 = {};
-
if(map1.isEmpty){
-
print("Map1 Is Empty Now");
-
}
-
if(map1.isNotEmpty){
-
print("Map1 Is Not Empty");
-
}
- ||
-
print(map1.isEmpty);
-
print(map.isNotEmpty);
- Clear Map
-
map_Name.clear(); ===> Return map_Name Is Empty;
- Add & Replace Pare Inside Map
-
var map_2 = {
-
1: "ExamPle_1",
-
2: "ExamPle_2",
-
3: "ExamPle_3"
-
};
-
print(map_2);
- Add
-
map_2[4] = "ExamPle_4"; ===> SQuare Braces Inside Keys And Assigning Operator Inside Value && Add New Pare Inside Map
-
print(map_2);
- Replace
-
map_2[3] = "ExamPle_Replace_Value"; ===> Replace Any Key/Value Inside Map
-
print(map_2);
- Put_If_Absent ==> Key Is not Exits Inside Map Then Put This Key Inside Map
-
map_2.putIfAbsent(5, () => "ExamPle_5"); ===> Map Inside 5 Key Is Not_Exits false Add Key/Value To Assign Put_If_Absent Method Inside
-
print(map_2);
-
map_2.putIfAbsent(6, () => "ExamPle_6");
-
print(map_2);
- Add_All
-
var student = {
-
"Name": "Mark",
-
"Father_Name": "Myers",
-
"Roll_No": 1878,
-
"CoaChing": "BMJ_EduCation"
-
};
-
student.putIfAbsent("Contact_No", () => "+921111111111");
- Add_All
-
student.addAll({"Gender": "Male","Country": "Pakistan"});
-
print("Student Data Is: ${student}");
- Student Data Store ExamPle
-
var Student = {
-
1878: ["Myers","Online_Mobile_App_Dev","+921111111111"],
-
1879: ["Mark","Online_Mobile_App_Dev","+922222222222"],
-
1880: ["Ace","Online_Mobile_App_Dev","+923333333333"];
-
};
-
print(student)
- Remove_Map_Elements
-
var map_1 = {
-
1: "Apple",
-
2: "Mango",
-
3: "Orange",
-
4: "Watermillon",
-
5: "Banana",
-
6: "Strawberry",
-
7: "Cherry",
-
8: "Grapes"
-
9: "Coconot"
-
};
-
print(map_1);
-
map_1.remove(3);
-
print(map_1);
- StartsWith || EndsWith && RemoveWhere
- map_1.removeWhere((key, value) => value.startsWith("C"));
- map_1.removeWhere((key, value) => value.endsWith("e"));
print(map_1);
-
||
-
StartsWith
- String subject_Phy = "Physic";
- var startWith = subject_Phy.startsWith("W");
- print("Subject Name Is: ${subject_Phy}; Condition Is True Or False: ${startWith} "); // False
- ||
- String subject_Che = "Chemistry";
- var startWith1 = subject_Che.startsWith("C");
- print("Subject Name Is: ${subject_Che}; Condition Is True Or False: ${startWith1} "); // True
- EndsWith
- String subject_Bio = "Biology";
- var startWith2 = subject_Bio.endsWith("y");
- print("Subject Name Is: ${subject_Bio}; Condition Is True Or False: ${startWith2} "); // True
- ||
- String subject_Comp = "Computer";
- var startWith3 = subject_Comp.endsWith("e");
- print("Subject Name Is: ${subject_Comp}; Condition Is True Or False: ${startWith3} "); // False
- Spread Operators: ...Map_Name
-
var map_2 = {
-
1: "One",
-
2: "Two"
-
};
-
var map_3 = {
-
3: "Three",
-
4: "Four"
-
};
-
var map_4 = {
-
5: "Five",
-
6: "Six"
-
};
-
var map_Complete = {...map_2,...map_3,...map_4};
-
print(map_Complete);
- Second_Example: {}..addAll(Map_Name);
- var map_Complete1 = {}..addAll(map_2)..addAll(map_3)..addAll(map_4);
- print(map_Complete1);
- From_Iterables_Method
- var keys = [1,2,3,4,5];
- print(keys);
- var values = ["Dart","Flutter","Node_Js","Docker","MongoDB"];
- print(values);
- var complete_Keys_Values = Map.fromIterables(keys,values);
- print(complete_Keys_Values);
- Contain_Keys || Contain_Values
-
var map_Find = {
-
1: "HTML",
-
2: "CSS",
-
3: "JavaScript",
-
4: "ES6",
-
5: "React Js",
-
6: "Redux",
-
7: "React Native",
-
8: "Linux",
-
9: "Github",
-
};
-
print(map_Find);
-
var find_Key = map_Find.containsKey(4);
-
var find_Key1 = map_Find.containsKey(43); // False
-
print(find_Key); // True
-
print(find_Key1); // False
-
var find_Value = map_Find.containsValue("Linux");
-
var find_Value1 = map_Find.containsValue("Firebase"); //False
-
print(find_Value); // True
-
print(find_Value1); // False
- Map Iteration Dart
-
var map_Iteration = {
-
1: "Firebase",
-
2: "Bootstrap",
-
3: "Responsive_Web_Designing",
-
4: "Material_UI",
-
5: "Devops",
-
};
-
map_Iteration.forEach((key,val) {
-
print("Key: ${key}; Value: ${val};");
-
});
- For Loop In Dart
- for (var i = 0; i < 10; i++) {
-
print(i);
- }
- Infinite Loop
- for (var i = 1; i > 0; i++) {
-
print(i);
- }
- Table Generate Using For Loop
-
var num_Table = 2;
-
for (var t = 1; t <= 10; t++) {
-
print('${num_Table} x ${t} = ${num_Table*t}')
-
}
- For_In In Dart
- var database = ["SQL","No_SQL","Firebase_Database","MongoDB"];
- This Is LonG Coading
- print(database[0]);
- print(database[1]);
- print(database[2]);
- print(database[3]);
- This Is Short CoadinG
- for (var a in database) {
-
print(a);
- }
- Second Option
- for (var s = 0; s < database.length; s++){
-
print(database[s]);
- }
- While Loop In Dart
- var num = 0;
- while(num <= 10){
-
print(num);
-
num++;
- }
- Second Condition
- var condition = "Yes";
- while(condition == "Yes"){
-
print(condition);
-
condition = "No";
- }
- Infinite Loop
- var condition = "Yes";
- while(condition == "Yes"){
-
print(condition);
-
condition = "Yes";
- }
- Table Generate Using While Loop
- var table_Count = 1;
- var table_Num = 3;
- while(table_Count <= 10){
-
print('${table_Num} x ${table_Count} = ${table_Num * table_Count}');
-
table_Count++;
- }
- Do While Loop In Dart
- var num1 = 0;
- do{
-
print(num1);
-
num1++;
- }
- while(num1 <= 10);
- Second Condition
- var condition_Do = "Yes"; // Ye Ek Bar Print Lazmi Hoga
- do {
-
print(condition_Do);
-
condition_Do = "No";
- }
- while(condition_Do == "Yes");
- Infinite Loop
- var condition_Do = "Yes"; // Ye Ek Bar Print Lazmi Hoga
- do {
-
print(condition_Do);
-
condition_Do = "Yes";
- }
- while(condition_Do == "Yes");
- Table Generate Using Do While Loop
- var table_Num_1 = 4;
- var table_Count_1 = 1;
- do {
-
print('${table_Num_1} x ${table_Count_1} = ${table_Num_1 * table_Count_1}');
-
table_Count_1++;
- }
- while(table_Count_1 <= 10);
-
Function
-
Functions are the building blocks of readable, maintainable, and reusable code. A
-
function is a set of statements to perform a specific task. Functions organize the
-
program into logical blocks of code. Once defined, functions may be called to
-
access code.
-
Function Call
- functionName(); // Function Call Syntex
- Second Condition
-
condition();
-
Within Parameters Function Call
-
withInPara(10, 15, 5);
-
withInPara(25, 5, 20);
-
withInPara(31, 29, 5);
- Uses Return Keyword
- print(withInPara(10, 15, 5));
- print(withInPara(25, 5, 20));
- print(withInPara(31, 29, 5));
- Classes In Object Oriented Programming
- var carInstence = Car();
- carInstence.carName = "Lamborghini";
- carInstence.carNamePrint();
- Second Instence Of Class
- var carInstence1 = Car();
- carInstence1.carName = "Farari";
- carInstence1.carNamePrint();
- Classes Extends Uses Inheritence Impelement
-
var class2 = Class2();
-
class2.class1Func();
-
class2.class2Func();
-
var class3 = Class3();
-
class3.class1Func();
-
class3.class3Func();
-
Second Example
-
Circle Class Extends With Parent Class
var cir = Circle(); cir.dis(); cir.cir();
-
Square Class Extends With Circle Class And Parent Class
var sq = Square(); sq.sq(); sq.cir(); sq.dis();
- Without Parameters Function
- dynamic functionName(){
-
print("This Is a Function Syntex"); // Function Create Syntex
- }
- Second Condition
- dynamic condition(){
- var num1 = 5;
- var num2 = 10;
- var value = num1 + num2;
- print(value);
- }
- Within Parameters Function
- dynamic withInPara(var num1, var num2, var num3,){
-
var total = num1 + num2 + num3;
-
print(total);
- }
- Uses Return Keyword
- dynamic withInPara(var num1, var num2, var num3,){
-
var total = num1 + num2 + num3;
-
return total;
- }
- Arrow Function
- void Function_Name() => Call_Function()
- Syntex
- Function_Name () => Coading_Writen
- Classes In ObJect Oriented ProGramminG
-
class Car {
-
var carName = "";
-
dynamic carNamePrint() => print("This Car Name Is: ${carName}");
-
}
- Classes Extends Uses Inheritence Impelement
-
class Class1{
-
dynamic class1Func () => print("This Is Class_1");
-
}
-
class Class2 extends Class1 {
-
dynamic class2Func () => print("This Is Class_2");
-
}
-
class Class3 extends Class1 {
-
dynamic class3Func () => print("This Is Class_3");
-
}
- Second Example
-
class Shape {
-
dynamic dis() {
-
print("Parent Class");
-
}
-
}
-
class Circle extends Shape {
-
dynamic cir() {
-
print("Circle (Child) Class");
-
}
-
}
-
class Square extends Circle {
-
dynamic sq() {
-
print("Square (Child) Class");
-
}
-
}