Created
July 29, 2025 13:25
-
-
Save mukhtharcm/44bbd99614f3406c59692ac1cfd2d26d to your computer and use it in GitHub Desktop.
Dart Basics: Conditionals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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