border static method
Returns a BorderDirectional from the specified list.
The list is a list of values as interpreted by borderSide. An empty or missing list results in a null return value. The list should have one through four items. Extra items are ignored.
The values are interpreted as follows:
- start: first value.
- top: second value, defaulting to same as start.
- end: third value, defaulting to same as start.
- bottom: fourth value, defaulting to same as top.
Implementation
static List<Map<String, dynamic>?>? border(BoxBorder? border) {
if (border == null) return null;
if (border is Border) {
return [
borderSide(border.left),
borderSide(border.top),
borderSide(border.right),
borderSide(border.bottom),
];
} else if (border is BorderDirectional) {
return [
borderSide(border.start),
borderSide(border.top),
borderSide(border.end),
borderSide(border.bottom),
];
}
// TODO: custom border?
return null;
}