0
0
Fluttermobile~5 mins

Dart programming language overview in Flutter

Choose your learning style9 modes available
Introduction

Dart is the language used to build Flutter apps. It helps you write code that runs fast and looks great on phones.

When creating mobile apps for Android and iOS with Flutter.
When you want a language that is easy to learn and write for app development.
When you need fast app performance and smooth animations.
When you want to build apps that work on multiple platforms from one codebase.
Syntax
Flutter
void main() {
  print('Hello, Dart!');
}
The main() function is the starting point of every Dart program.
Use print() to show messages in the console.
Examples
Declaring variables with types: number, text, and true/false.
Flutter
int age = 25;
String name = 'Alice';
bool isStudent = true;
Using var for flexible types, final for values set once, and const for compile-time constants.
Flutter
var greeting = 'Hi there!';
final pi = 3.14;
const maxScore = 100;
Creating a list of strings and printing each item with a loop.
Flutter
List<String> fruits = ['apple', 'banana', 'orange'];
for (var fruit in fruits) {
  print(fruit);
}
Sample App

This program shows how to use variables and print a message with values inside the text.

Flutter
void main() {
  String appName = 'My Flutter App';
  int version = 1;
  print('Welcome to $appName version $version');
}
OutputSuccess
Important Notes

Dart is easy to read and write, making it great for beginners.

It supports both simple and complex programming styles.

Dart code runs quickly on mobile devices, helping apps feel smooth.

Summary

Dart is the main language for Flutter app development.

It uses simple syntax with clear rules for variables and functions.

Dart helps build fast, beautiful apps for multiple platforms.