Style constructor
Style([
- Attribute? p1,
- Attribute? p2,
- Attribute? p3,
- Attribute? p4,
- Attribute? p5,
- Attribute? p6,
- Attribute? p7,
- Attribute? p8,
- Attribute? p9,
- Attribute? p10,
- Attribute? p11,
- Attribute? p12,
- Attribute? p13,
- Attribute? p14,
- Attribute? p15,
- Attribute? p16,
- Attribute? p17,
- Attribute? p18,
- Attribute? p19,
- Attribute? p20,
Creates a new Style instance with a specified list of Attributes.
This factory constructor initializes a Style with a list of
attributes provided as individual parameters. Only non-null attributes
are included in the resulting Style.
There is no specific reason for only 20 parameters. This is just a
reasonable number of parameters to support. If you need more than 20,
consider breaking up your mixes into many style mixes that can be applied
or use the Style.create constructor.
Example:
final style = Style(attribute1, attribute2, attribute3);
Implementation
factory Style([
Attribute? p1,
Attribute? p2,
Attribute? p3,
Attribute? p4,
Attribute? p5,
Attribute? p6,
Attribute? p7,
Attribute? p8,
Attribute? p9,
Attribute? p10,
Attribute? p11,
Attribute? p12,
Attribute? p13,
Attribute? p14,
Attribute? p15,
Attribute? p16,
Attribute? p17,
Attribute? p18,
Attribute? p19,
Attribute? p20,
]) {
final params = [
p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, //
p11, p12, p13, p14, p15, p16, p17, p18, p19, p20,
].whereType<Attribute>();
return Style.create(params);
}