Skip to content

Instantly share code, notes, and snippets.

@AAQ-AND-DEV
Created March 21, 2019 04:55
Show Gist options
  • Save AAQ-AND-DEV/0d8b50dd45b6c9ab25abb047f90d3bff to your computer and use it in GitHub Desktop.
Save AAQ-AND-DEV/0d8b50dd45b6c9ab25abb047f90d3bff to your computer and use it in GitHub Desktop.
first dart nested function
void main(){
var num = 47;
//is and is!
print(num is String);
print(num is! bool);
print(num is int);
//If statement
if(num is! int){
print("$num is not an int");
}
else {
print("$num is an int!");
}
void evaluate(int num){
if(num >=50){
print("$num is greater than or equal to 50");
}
else if(num>=25){
print("$num is greater than or equal to 25 and less than 50");
}
else {
print("$num is less than 25");
}
}
evaluate(num);
num = 1100;
evaluate(num);
num = -34;
evaluate(num);
num = 34;
evaluate(num);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment