Skip to content

Instantly share code, notes, and snippets.

@mukhtharcm
Created July 29, 2025 13:19
Show Gist options
  • Save mukhtharcm/bf6c0747f584a790059ff8bf2a8b1a3c to your computer and use it in GitHub Desktop.
Save mukhtharcm/bf6c0747f584a790059ff8bf2a8b1a3c to your computer and use it in GitHub Desktop.
Dart Variables and Printing
void main() {
// Variables are like labeled boxes to store information.
// String: For text
String name = "Ahmed";
// int: For whole numbers
int age = 28;
// double: For numbers with decimals
double bankBalance = 1250.75;
// bool: For true/false values
bool isZakatDue = true;
// The print() function displays the value in the console.
print("My name is " + name); // You can join strings with +
print("My age is: $age"); // Or embed variables directly with $
print("My balance is: $bankBalance");
print("Is Zakat due? $isZakatDue");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment