prop top-level constant
Prop
const prop
This object serves the same purpose as the Prop object, and is actually derived from such.
This annotation is a default setting of the Prop object, where the default value defaultValue
is null
, while optional
is false.
@prop
int myNum;
This converts to this:
AppComponent({super.template, required this.myNum});
This is also the default for any object that does not contain the annotation, but still is uninitialised.
Implementation
const prop = Prop(defaultTo: null, optional: false);