Variables, Data Types &
Operators in Dart
A Practical Guide for Beginners
Introduction
• • Explore variables, data types, and operators
in Dart.
• • Fundamental concepts for robust
applications.
Declaring Variables
• • Use `var` keyword to declare variables.
• Example: var message = "Hello, Dart!";
Different Data Types
• • Integers: int score = 42;
• • Strings: String name = "John";
• • Booleans: bool isRaining = true;
• • Lists: List<int> numbers = [1, 2, 3];
• • Maps: Map<String, int> ages = {"Alice": 25,
"Bob": 30};
Type Inference & Explicit Types
• • var age = 23; // Type inferred as int
• • String name = "Alice"; // Explicit type
declaration
Constants & Final Variables
• • const PI = 3.14159; // Compile-time constant
• • final appName = "My App"; // Runtime
constant
Arithmetic Operators
• • +, -, *, /, %
• Example: int sum = a + b;
Comparison Operators
• • ==, !=, <, >, <=, >=
• Example: bool isEqual = a == b;
Logical Operators
• • && (AND), || (OR), ! (NOT)
• Example: bool result = isTrue && isFalse;
String Methods
• • length, toUpperCase(), toLowerCase(),
substring()
• Example: message.substring(0, 5);
Conclusion
• • Learned about Dart variables, data types,
and operators.
• • Explored constants, final variables, and
string manipulation.

Variables_DataTypes_Dart_Presentation.pptx

  • 1.
    Variables, Data Types& Operators in Dart A Practical Guide for Beginners
  • 2.
    Introduction • • Explorevariables, data types, and operators in Dart. • • Fundamental concepts for robust applications.
  • 3.
    Declaring Variables • •Use `var` keyword to declare variables. • Example: var message = "Hello, Dart!";
  • 4.
    Different Data Types •• Integers: int score = 42; • • Strings: String name = "John"; • • Booleans: bool isRaining = true; • • Lists: List<int> numbers = [1, 2, 3]; • • Maps: Map<String, int> ages = {"Alice": 25, "Bob": 30};
  • 5.
    Type Inference &Explicit Types • • var age = 23; // Type inferred as int • • String name = "Alice"; // Explicit type declaration
  • 6.
    Constants & FinalVariables • • const PI = 3.14159; // Compile-time constant • • final appName = "My App"; // Runtime constant
  • 7.
    Arithmetic Operators • •+, -, *, /, % • Example: int sum = a + b;
  • 8.
    Comparison Operators • •==, !=, <, >, <=, >= • Example: bool isEqual = a == b;
  • 9.
    Logical Operators • •&& (AND), || (OR), ! (NOT) • Example: bool result = isTrue && isFalse;
  • 10.
    String Methods • •length, toUpperCase(), toLowerCase(), substring() • Example: message.substring(0, 5);
  • 11.
    Conclusion • • Learnedabout Dart variables, data types, and operators. • • Explored constants, final variables, and string manipulation.