CornerRadius
One radius per corner
What cornerRadius takes when the corners differ. A plain number rounds all four alike; these name them. Leading and trailing follow the writing direction, as in EdgeInsets;
Properties
topLeadingNumberTop leading (left) corner
topTrailingNumberTop trailing (right) corner
bottomLeadingNumberBottom leading (left) corner
bottomTrailingNumberBottom trailing (right) corner
Methods
CornerRadius.all(value)CornerRadius ›The same radius on all four corners. The same as writing the number.
- value Number required
CornerRadius.only(options)CornerRadius ›The corners named; the rest stay square.
- options Any required
- topLeading Number
Points.
- topTrailing Number
Points.
- bottomLeading Number
Points.
- bottomTrailing Number
Points.
- topLeading Number
CornerRadius.horizontal(leading, trailing)CornerRadius ›The two corners on the leading side, and the two on the trailing side.
- leading Number required
- trailing Number required
CornerRadius.vertical(top, bottom)CornerRadius ›The two top corners, and the two bottom corners.
- top Number required
- bottom Number required
Examples
Rounded on top only
Container({
backgroundColor: Color.blue(),
cornerRadius: CornerRadius.vertical(16, 0),
child: Text("Header")
})One corner
Rectangle({
fill: Color.red(),
cornerRadius: CornerRadius.only({ topTrailing: 12 })
})