Skip to content

Instantly share code, notes, and snippets.

@mukhtharcm
Created July 29, 2025 13:25
Show Gist options
  • Save mukhtharcm/44bbd99614f3406c59692ac1cfd2d26d to your computer and use it in GitHub Desktop.
Save mukhtharcm/44bbd99614f3406c59692ac1cfd2d26d to your computer and use it in GitHub Desktop.
Dart Basics: Conditionals
void main() {
double userWealth = 5000.0;
double nisab = 3000.0; // The minimum threshold for Zakat
print("Your wealth is: $userWealth");
print("The Nisab threshold is: $nisab");
// The 'if' statement checks if a condition is true.
if (userWealth > nisab) {
// This code runs ONLY if the condition is true.
print("Result: Your wealth is above the Nisab.");
print("Zakat is likely obligatory for you.");
} else {
// This code runs ONLY if the condition is false.
print("Result: Your wealth is below the Nisab.");
print("Zakat is not obligatory for you at this time.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment