Last active
January 28, 2020 07:02
-
-
Save libindev/ab0053982fdd29c980a7195df3e72917 to your computer and use it in GitHub Desktop.
Dart Samples
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() { | |
/// dynamic is a special type indicating it can be any type. | |
dynamic x = 'hal'; | |
x = 123; | |
print(x); | |
var a = 'hal'; | |
// a = 123; | |
print(x); | |
} |
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(){ | |
print( 10.sum(12)); | |
} | |
extension SUM on int { | |
int sum (int no) { | |
return this+no; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment