Flutter Day : 3 Introduction to Dart
Nikhil Suryawanshi
MLOps Engineer | 7x GCP | Kubernetes | Terraform | AWS | DevOps | Java | Python
Dart :
Dart is a client-optimized programming language for apps on multiple platforms. It is developed by Google and is used to build mobile, desktop, server, and web applications. Dart is an object-oriented, class-based, garbage-collected language with C-style syntax. Dart can compile to either native code or JavaScript.
Data type :
In computer science and computer programming, a data type or simply type is an attribute of data which tells the compiler or interpreter how the programmer intends to use the data. Most programming languages support basic data types of integer numbers, Floating-point numbers, characters and Booleans.
The variables in the dart can be defined as their "data type" or keyword "var"
This example shows that a is an integer type variable so that it only contain numbers not strings.
If a variable is define with the keyword "var" it automatically get the datatype by its own here it is shown by the example.
List is a collection data type. It allows multiple values to be stored within the same field. In Table Design, you must configure the List data type with all the values that the field stores.
The variable which contain more than one values that is known as the list of that similar data type
The variable which contain more than one values but having different data types is known as the list of that "object" data type , below is the example of the list of object type.
If the ;list has been declared by the keyword "List" it has been changed to the dynamic list
If a list is declared with the generic "<...>" then it only supports that data type only , otherwise it generates an error.
If it contains similar data type as the generic has declared it runs without error.
When you need to set the index of the values by your own you need to use the map , In the map the variable contain value by the index of the keys.
here the "name" is the key and "nik" is t
Functions and procedures are the basic building blocks of programs. They are small sections of code that are used to perform a particular task, and they are used for two main reasons. The first reason is that they can be used to avoid repetition of commands within the program.
Here , nik() is the parameterized function which is used to print the given values while it has been called in the main() function
Here , nik() is the parameterized function which is used to add the given values while it has been called in the main() function
Here nik() is the function which return the output of the function where it has been called into the main() function after adding the values.
Here to optimize the code and reduce the complexity the function is written into the different file and imported to the main file where the function is call for getting the sum of the numbers
Android :
Here the runApp() is the function from where the android app starts , MaterialApp is the function which is used to give the pre-created UI for the app. center is also a function which adjust the text and widget position ,and the Text() is the function for printing text on screen.