I have this constructor in my class. Now when it's like this, I get
The type parameter icon is annotated with @required
but only named parameters without default value can be annotated with it.
-
const Category(
@required this.name,
@required this.icon,
@required this.color
) : assert(name != null),
assert(icon != null),
assert(color != null);
And when calling the constructor like this:
Category(name: _categoryName, icon: _categoryIcon, color: _categoryColor),
It's an error.
All of this goes away when I surround my constructor arguments with {}.
What does this mean?