Adding content to 100-dart-basics

pull/3389/head
syedmouaazfarrukh 2 years ago
parent ff16ea542f
commit d0aa6001a2
  1. 5
      src/roadmaps/flutter/content/100-dart-basics/100-dart-pad.md
  2. 8
      src/roadmaps/flutter/content/100-dart-basics/101-variables.md
  3. 14
      src/roadmaps/flutter/content/100-dart-basics/102-built-in-types.md
  4. 1
      src/roadmaps/flutter/content/100-dart-basics/103-functions.md
  5. 11
      src/roadmaps/flutter/content/100-dart-basics/104-operators.md
  6. 15
      src/roadmaps/flutter/content/100-dart-basics/105-control-flow-statements.md

@ -1,7 +1,8 @@
# Dart pad
# DartPad
DartPad is an open source tool that lets you play with the Dart language in any modern browser.
DartPad is an online tool that allows developers to write and run Dart code snippets. It can also be used to run Flutter code, making it a convenient way to try out Flutter apps and widgets without having to set up a full development environment.
Visit the following resources to learn more:
- [DartPad](https://dart.dev/tools/dartpad)
- [DartPad in Tutorials](https://dart.dev/resources/dartpad-best-practices)

@ -1,5 +1,13 @@
# Variables
In Flutter, variables are used to store values. There are two types of variables in Flutter:
- local variables: These are declared within a function and are only accessible within that function
- Instance variables: They are declared within a class and are accessible throughout the entire class.
Variables in Flutter can store values of different data types, such as numbers, strings, booleans, and more.
Visit the following resources to learn more:
- [Variables](https://dart.dev/guides/language/language-tour#variables)
- [Dart - Variables](https://howtoflutter.dev/dart/variables/)

@ -1,5 +1,17 @@
# Built in types
# Built-in Types
There are several built-in data types, including:
- int: used to store integers
- double: used to store floating-point numbers
- String: used to store text
- bool: used to store true or false values
- List: used to store ordered collections of objects
- Map: used to store unordered collections of key-value pairs
Additionally, there are other complex data types like dynamic, var, and Object in Dart programming language which is used in Flutter.
Visit the following resources to learn more:
- [Built-in types](https://dart.dev/guides/language/language-tour#built-in-types)
- [Overview of Built-in Types](https://dart.dev/guides/language/coming-from/js-to-dart#built-in-types)

@ -5,3 +5,4 @@ Dart is a true object-oriented language, so even functions are objects and have
Visit the following resources to learn more:
- [Functions](https://dart.dev/guides/language/language-tour#functions)
- [Dart Function](https://www.javatpoint.com/dart-function)

@ -1,5 +1,16 @@
# Operators
Operators are symbols or keywords used to perform operations on values. There are several types of operators available in Flutter:
- Arithmetic operators: used to perform mathematical operations like addition (+), subtraction (-), multiplication (*), division (/), and more.
- Relational operators: used to compare values and return a boolean result (==, !=, >, <, >=, <=).
- Logical operators: used to perform logical operations like AND (&&), OR (||), and NOT (!).
- Assignment operators: used to assign values to variables (=, +=, -=, *=, /=, %=).
- Ternary operator: a shorthand way of writing simple if-else statements (condition ? if_true : if_false).
These operators can be used to perform operations on values, variables, and expressions in Flutter.
Visit the following resources to learn more:
- [Operators](https://dart.dev/guides/language/language-tour#operators)
- [Operators in Dart](https://www.geeksforgeeks.org/operators-in-dart/)

@ -1,5 +1,18 @@
# Control flow statements
# Control Flow Statements
In Dart, control flow statements are used to control the flow of execution of a program. The following are the main types of control flow statements in Dart:
- if-else: used to conditionally execute code based on a boolean expression.
- for loop: used to repeat a block of code a specific number of times.
- while loop: used to repeat a block of code as long as a given condition is true.
- do-while loop: similar to the while loop, but the block of code is executed at least once before the condition is evaluated.
- switch-case: used to select one of several code blocks to execute based on a value.
- break: used to exit a loop early.
- continue: used to skip the current iteration of a loop and continue with the next one.
These control flow statements can be used to create complex logic and control the flow of execution in Dart programs.
Visit the following resources to learn more:
- [Control flow statements](https://dart.dev/guides/language/language-tour#control-flow-statements)
- [Dart Control Flow Statements](https://www.w3adda.com/dart-tutorial/dart-control-flow-statements)
Loading…
Cancel
Save