Last active
August 10, 2019 08:33
-
-
Save juliuscanute/b2842a0d2e519b17571d6b24c99d43c5 to your computer and use it in GitHub Desktop.
[Creating a constructor within a class] #dart #class #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
const $1({p1,p2,...,pn}): assert(condition(p1)),super(p1); | |
//$1 - Enclosing Class Name. | |
//p1...pn - Parameters to pass to the constructor. | |
const MyWidget({Key key, | |
@required this.name, | |
@required this.color, | |
@required this.iconLocation, | |
}) : assert(name != null), | |
assert(color != null), | |
assert(iconLocation != null), | |
super(key: key); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment