How Make Flutter app development free course by #Ndmeaa

As you know, nowadays the scope of mobile devices has increased a lot and every day new apps are being published on Google Play Store and App Store.

Friends, we currently have mainly two operating systems for mobile. First Android and second iOS. And the number of mobile users is increasing day by day, so if a developer or a company makes an app, then it launches it for both Android and iOS.

 

Android Apps मुख्यतः JAVA या Kotlin और iOS Apps Swift या Objective C प्रोग्रामिंग language में बनाये जाते हैं। तो अगर हम Android और iOS दोनो प्लेटफॉर्म के लिए App बनाना है तो हमे दो बार कोड लिखना पड़ेगा । एक बार Android के लिए और एक बार iOS के लिए।

इस Problem का Solution है Flutter । Flutter में आप एक बार कोड लिख उसे Android और iOS दोनो में रन करा सकते हैं।

Flutter क्या है?(Flutter मूलरुप से एक Mobile App Development Framework है।

*Flutter is an open-source UI software development kit created by Google. It is used to develop cross platform applications from a single codebase for any web browser, Android, iOS, Linux, macOS, and Windows First described in 2015, Flutter was released in May 2017.

* A tool that allowed you build native cross platform (android ios web desktop ) one programming language and codebase.

Cross Platform क्या है?

एक ऐसा Codebase जिसे हम किसी भी Platform या Operating Environment मे Execute कर सकते है इसे हम Cross Platform कहते है।

Flutter बाकी Frameworks से क्यो बेहतर है?

अगर हम इस बात पर ध्यान दे की Flutter बाकी Frameworks से क्यो बेहतर है, तो आपको बता दे की Flutter का खुद क्या Rendering engine है।

Frameworks-:

*फ्रेमवक एक संरचना है जिस पर आप सॉफटवेयर बना सकते हैं । यह एक नी़ंव के रूप में कार्य करता है, जिसके मदद से आप किसी प्रोजैक्ट को एकदम scratch से शुरू किए बिना बना सकते है ।

सिंपल भाषा में अगर मैं कहूँ तो यह एक तरीका है जिसमें हम अपने database, logic और visual पार्ट को divide कर देते है. MVC की फुल फॉर्म Model-View-Controller है जिसका मतलब है की हम database को model के नाम से और logic part को controller के नाम से और visual पार्ट को view के नाम जाना जाता है.

मतलब जब हम किसी भी अन्य Framework की सहायता से Cross Platform के Codebase को तैयार करते है तब हम जिस Platform पर Codebase को Execute कर रहे है तब हमे उस Platform के Components की आवश्यकता होतहै।

जैसे की अगर हमने किसी अन्य Framework की सहायता से एक Codebase तैयार किया है और हम उस Codebase को IOS Platform पर Execute कर रहे है तब Codebase को Execute करने के लिए IOS Platform के Components जैसे UI button इत्यादि की जरूरत होती है।

लेकिन वही पर हम Flutter Framework पर Codebase को किसी भी Platform मे execute कर रहे है तब हमे उस Platform के components की आवश्यकता नहीं होती है क्योंकि Flutter का खुद का Rendering Engine है, जो की हर एक Pixel जो drawn किया जाता है उसे खुद से Control करता है।

जिससे Platform के जो Native Components है उनकी Dependency कम होती है और हम Complex से Complex UI को बेहतर तरीके से डिजाइन कर सकते है, इसीलिए Flutter बाकी Frameworks से बेहतर माना जाता है।

*Frameworks are a special type of library that do not have "finished" functions like regular libraries. Frameworks are rather program scaffolding that provides a blueprint but not a finished unit.

Therefore, the framework provides the blueprint and basic framework and also shows what the programmer still needs in terms of customization. The framework provides the flow of a software application and tells the developer what it needs and calls developer-provided code as needed. If a library is used, the application calls code from the library.

 

Flutter की इस series में हम Flutter-dart programming introduction-Hindi देखेंगे | Flutter, Google द्वारा 2011 में बनाया गया था | Flutter एक open-source , general-purpose, object-oriented programming language है, जिसका syntax लगभग C की तरह ही है| Dart programming का मुख्य उद्देश्य Web और Mobile के लिए frontend user interface बनाने के लिए प्रयोग किया जाता है। 

*Dart is a programming language designed by Lars Bak(लार्स बाक) and Kasper Lund(कैस्पर लुंड) and developed by Google. The programming language can be used to develop web and mobile apps as well as server and desktop applications.

It is an object-oriented, class-based, garbage-collected language with C-style syntax.

Dart dart syntax-:

void main() {

Print('hello world');

}

The main() function is a predefined method in Dart. This method acts as the entry point to the application. A Dart script needs the main() method for

execution. print() is a predefined function that prints the specified string or value to the standard output i.e. the terminal.

The output of the above code will be

'Hello World'

Data Type in Dart:-

*Dart एक strongly typed प्रोग्रामिंग लैंग्वेज है। इसका मतलब है की जो भी value हम अपने प्रोग्रामिंग लैंग्वेज में प्रयोग करते है उसका कुछ टाइप होगा या तो वह string होगा या number. यहा पर हम Dart programming language के कुछ basic data types के बारे में बात करने जा रहे है-

 

Data Type Example Description
String String name =”Ndmeaa Partner” यह text को रखता है | इसमें आप single या double quotation मार्क को प्रयोग कर सकते है |
num, int, double int sNo = 23;
double price = 501.1;
Dart में दो तरह के numbers होते है :
1. Integer
2. Double
Boolean bool isTrue = true;
or
bool isTrue = false;
bool keyword का प्रयोग Boolean value true, या false को represent करने में किया जाता है |
object Animal = Animal() dart में सामान्यतः सबकुछ एक object ही होता है e.g., Integer, String etc.

Variables and Functions:-

 Memory में namespace होते है जो values को store करते है। किसी variable का नाम identifier कहलाता है। Dart में किसी variable को declare करने के लिए var keyword का प्रयोग किया जाता है।

For example:

var age = 23;

यहा पर age एक variable है जो एक integer value 23 को store किया है | हम इसे int और double से भी कर सकते है। Dart में Type Inference का एक feature है जो की value के टाइप का अनुमान कर लेता है, अगर हम उसे var keyword से create करे।

 

Fuction:-

Function statements का समूह होते है जो किसी specific टास्क को perform करते है। Functions code के लॉजिकल ब्लाक में organized होते होते है। किसी function के declaration में function का नाम, return type, और parameters सम्मिलित होते है।

Dart programming में हम function को इस उदाहरण से देखते है –

void addNumbers(int a, int b)
{
 print(a+b);
}
void main(){
 addNumbers(2,7);
}

ऊपर दिया गया function दो नंबर को जोड़ता है और उसका योग प्रिंट करता है |

 

Operators:-

Dart programming अन्य सभी languages की तरह सभी operators को support करता है, जैसे –

  • Arithmetic
  • Equality
  • Increment or Decrement
  • Logical
  • Comparison

Decision Making And Loops:-

Decision-making किसी भी programming language का वह फीचर होता है जिसकी सहायता से हम अपने code को किसी स्पेशल condition के basis पर execute कर सकते है |

Dart language निम्न प्रकार के decision-making statements को support करता है –

    • If Statement
    • If-else statement
    • Switch statement

Example –

void main(){
var age = 21;
if(age > 20){
   print("You are eligible for Marrige.");
}else{
  print("You are not eligible for Marrige.");
}
}

 

  • var age = 21;: Declares a variable age and assigns it the value 21.
  • if (age > 20) { ... }: Checks if the value of age is greater than 20.
    • If age is greater than 20, it prints "You are eligible for Marriage."
    • If age is 20 or less, it prints "You are not eligible for Marriage."

When you run this program, it will print "You are eligible for Marriage." since the age is 21, which is greater than 20. If you change the value of age to something less than or equal to 20, it will print "You are not eligible for Marriage."

  • Loops का प्रयोग किसी code के ब्लाक को बार बार repeat करने के लिए किया जाता है और वह code तब तक execute होता है जब तक की specific condition न मिल जाये |
  • Dart language निम्न प्रकार के loop statements को support करता है –
    • for
    • for..in
    • while
    • do..while

void main(){
var name = ["Ndmeaa","Ndmeaa Partner","Singh","Abhimanyu"];

for(var elem in name) {
  print(elem);
 } 
}

Explain:-

आपने यहाँ एक Dart में main फ़ंक्शन बनाया है। इस फ़ंक्शन में आपने एक लिस्ट name बनाई है जिसमें कुछ नाम हैं। फिर आपने एक for लूप का इस्तेमाल किया है ताकि आप इस लिस्ट के हर एक तत्व को प्रिंट कर सकें।

इस कोड में, for लूप का प्रयोग करके हर तत्व elem को प्रिंट किया जाता है, जिसे आपने लिस्ट name में संग्रहित किया है। इस तरह, आपको लिस्ट के हर तत्व को अलग-अलग प्रिंट किया जाएगा।

  • var names = ["Ndmeaa", "Ndmeaa Partner", "Singh", "Abhimanyu"];: Declares a list named names containing four strings.
  • for (var name in names) { ... }: Iterates (दोहराता) over each element in the list names.
    • Inside the loop, name represents the current element in the list.
    • print(name);: Prints each name to the console.
    • *var name = ["Ndmeaa", "Ndmeaa पार्टनर", "सिंह", "अभिमन्यु"];: चार तारों वाले नामों की एक सूची घोषित करता है।
      के लिए (नामों में var नाम) {... }: सूची के नामों में प्रत्येक तत्व पर पुनरावृत्ति करता है।
      लूप के अंदर, नाम सूची में वर्तमान तत्व का प्रतिनिधित्व करता है।
      प्रिंट(नाम);: प्रत्येक नाम को कंसोल पर प्रिंट करता है।

Comments in Dart-:

.Single-line comments ( // ) − Any text between a "//" and the end of a line is treated as a comment

 .Multi-line comments (/* */) − These comments may span multiple lines. Data Type in Dart-

Dart एक strongly typed प्रोग्रामिंग लैंग्वेज है। इसका मतलब है की जो भी value हम अपने प्रोग्रामिंग लैंग्वेज में प्रयोग करते है उसका कुछ टाइप होगा या तो वह string होगा या number. यहा पर हम Dart programming language के कुछ basic data types के बारे में बात करने जा रहे है.

Variables, memory में namespace होते है जो values को store करते है। किसी variable का नाम identifier कहलाता है। Dart में किसी variable को declare करने के लिए var keyword का प्रयोग किया जाता है।

For example:

var age = 24;

यहा पर age एक variable है जो एक integer value 24 को store किया है | हम इसे int और double से भी कर सकते है। Dart में Type Inference का एक feature है जो की value के टाइप का अनुमान कर लेता है, अगर हम उसे var keyword से create करे।

Function statements का समूह होते है जो किसी specific टास्क को perform करते है। Functions code के लॉजिकल ब्लाक में organised होते होते है। किसी function के declaration में function का नाम, return type, और parameters सम्मिलित होते है।

Dart programming में हम function को इस उदाहरण से देखते है –

void addNumbers(int a, int b) {
  int c = a + b;
  print(c);
}

void main() {
  addNumbers(2, 7);
}

 

 

  • void addNumbers(int a, int b) { ... }: This defines a function addNumbers that takes two integer parameters a and b.

    • Inside the function, it calculates the sum of a and b and assigns it to a variable c.
    • Then, it prints the value of c.
  • void main() { ... }: This is the main function where the program starts its execution.

    • It calls the addNumbers function with the arguments 2 and 7.

When you run this code, it will print the sum of 2 and 7, which is 9, to the console.

ऊपर दिया गया function दो नंबर को जोड़ता है और उसका योग प्रिंट करता है |

Continue And break:-

C programming की तरह dart programming में भी continue और break कीवर्ड का प्र्योग किया जाता है। continue keyword किसी loop में remaining code को skip कर देता है और loop के next iteration पर jump कर जाता है।

break keyword किसी भी loop के execution को रोक देता है, और उस loop से बाहर आ जाता है। Dart programming में भी continue और break keyword का प्रयोग बिलकुल C programming की तरह किया जाता है।

Example

void main(){
for(int i = 1; i < 20; i++){
if(i%2==0){
 continue;
}
print(i);
if(i==19){
 break;
}
}
}

*यहाँ, आपने एक Dart में main फ़ंक्शन बनाया है। इस फ़ंक्शन में, एक for लूप का इस्तेमाल किया गया है जो 1 से 19 तक के सभी अंकों को देखता है। फिर एक if स्टेटमेंट का इस्तेमाल किया गया है ताकि केवल असमान अंकों को प्रिंट किया जा सके। अंत में, एक और if स्टेटमेंट का इस्तेमाल किया गया है जिससे लूप को 19 तक ही चलाया जा सके। अगर यह शर्त पूरी नहीं होती है, तो लूप ब्रेक किया जाता है।

void main() { for (int i = 1; i < 20; i++) { // 1 से 19 तक के सभी अंकों के लिए एक for लूप चलाया जाता है if (i % 2 == 0) { // अगर वर्तमान अंक द्वारा 2 से भागीय अंक है, तो आगे का कोड नहीं चलाया जाता है continue; } print(i); // अगर अंक वर्तमान में जोड़ी नहीं है, तो इसे प्रिंट किया जाता है if (i == 19) { // अगर वर्तमान अंक 19 है, तो लूप ब्रेक किया जाता है break; } } }

इस तरह, कोड में प्रत्येक संख्या 1 से 19 तक प्रिंट किया जाता है, जो विभिन्न अपेक्षाओं को पूरा करते हैं। अधिकांश संख्याओं के साथ continue असंवेदनशील रूप से कार्रवाई को बाधित करता है, जबकि 19 पर पहुंचने पर लूप को ब्रेक किया जाता है।

 

  • void main() { ... }: This is the main function where the program starts its execution.
  • for (int i = 1; i < 20; i++) { ... }: This loop initializes i to 1 and iterates as long as i is less than 20, incrementing i by 1 in each iteration.
  • if (i % 2 != 0) { ... }: This condition checks if i is odd (i % 2 != 0). If it is, it prints the value of i.
  • if (i == 19) { ... }: This condition checks if i is equal to 19. If it is, the loop breaks, stopping further iterations.

When you run this code, it will print all the odd numbers from 1 to 19, each on a new line.

*i को 1 से प्रारंभ करें और जब तक i 20 से कम है तब तक पुनरावृत्त करें, प्रत्येक पुनरावृत्ति में i को 1 से बढ़ाएं।

Run Program

Final और Const Keyword in Dart:-

 

We use a final keyword to restrict the user. The final keyword can be applied in many contexts such as variables, classes, and methods.

const keyword is used to declare constants. Whenever we declare a value with a const keyword, we cannot change its value later.

हम final keyword का प्रयोग user को restrict करने के लिए करते है। final keyword बहुत सारे contexts में apply किया जा सकता है जैसे की, variables, classes और methods.

const keyword का प्रयोग constants को declare करने के लिए किया जाता है। जब भी हम किसी value को const keyword से declare करते है तो हम उसके value को बाद में बदल नही सकते।

 

Example –

void main(){
final num = 200;
const pi = 3.14
print(num);
print(pi*num);
}
  • void main() { ... }: This is the entry point of your program.
  • final num = 200;: Defines a variable num and assigns it the value 200. final means that the value cannot be changed once it's assigned.
  • const pi = 3.14;: Defines a constant pi and assigns it the value 3.14. const means that the value is constant and cannot be changed.
  • print(num);: Prints the value of num.
  • print(pi * num);: Prints the result of multiplying pi by num.

*In the provided code, pi is a constant representing the mathematical constant pi, which is approximately equal to 3.14.

 

Some Operators:- In programming, the double equals sign == is an operator used to check for equality between two values. When you write a == b, you are asking whether a is equal to b. If a and b have the same value, the expression evaluates to true, otherwise, it evaluates to false.

For example:

  • 5 == 5 evaluates(मूल्यांकन करता है) to true because 5 is equal to 5.
  • 10 == 5 evaluates to false because 10 is not equal to 5.
  • On the other hand, the single equals sign = is an assignment operator. It is used to assign a value to a variable. For example, x = 5 assigns the value 5 to the variable x.

    So, when you see pi = 3.14, it means you're assigning the value 3.14 to the variable pi. And when you see pi * num, it means you're multiplying the value stored in pi by the value stored in num.

 

Object-Oriented Programming:-

Dart is an object-oriented programming language, which means that like all other OOPs languages, every value in Dart is an object. Number is also an object in Dart language. Dart programming covers all the concepts of OOPs like objects, classes, interfaces, constructors, etc.

Dart एक object-oriented programming language है, इसका मतलब यह है कि अन्य सभी OOPs language की तरह dart में भी प्रत्येक value एक object होती है। Dart language में number भी एक object होता है। Dart programming OOPs के सारे concept जैसे objects, classes, interfaces, constructors आदि।

Example

class Dog {
//Property Declaration
String color, type;

//Method creation
String eating(){
 return "Dog is eating";
}
String Hunting(){
 return "Dog is Hunting in the jungle.";
}
String resting(){
 return "Dog is resting .";
}
}

void main(){
//Object creation
var newDog = new Dog();
//Accessing Class property
newDog.color = "Black";
newDog.type = "Deshi";
//Output Display
print(newDog.color);
print(newDog.type);
print(newDog.Hunting());
print(newDog.resting());
print(newDog.eating());
}

Run Program

0
551