maybeParse static method
Implementation
static BorderValue? maybeParse(dynamic value) {
if (value == null) return null;
// value is required and must be a map
if (value is! Map<String, dynamic>) {
throw FormatException(
'BorderValue must be a Map and not "$value" of type ${value.runtimeType}',
);
}
final width =
DimensionValue.maybeParse(value['width']) ?? DimensionValue.zero;
final color = ColorValue.maybeParse(value['color']) ?? ColorValue.black;
final style = BorderStyle.values.firstWhere(
(e) => e.name == value['style'],
orElse: () => BorderStyle.solid,
);
return BorderValue._(width, style, color);
}