Created
April 24, 2017 03:13
-
-
Save matanlurey/da1ad1d87de41b1864d1814b89db1ea6 to your computer and use it in GitHub Desktop.
An example of defining a new user-type with a const constructor
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
class User { | |
final String name; | |
const User(this.name); | |
} | |
main() { | |
const user = const User('Joe'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment