borderRadiusToJson static method

Map<String, dynamic>? borderRadiusToJson(
  1. BorderRadius? e
)

Implementation

static Map<String, dynamic>? borderRadiusToJson(BorderRadius? e) {
  if (e == null) return null;
  final x = {
    if (e.topLeft != Radius.zero) "topLeft": e.topLeft,
    if (e.topRight != Radius.zero) "topRight": e.topRight,
    if (e.bottomLeft != Radius.zero) "bottomLeft": e.bottomLeft,
    if (e.bottomRight != Radius.zero) "bottomRight": e.bottomRight,
  }.map((k, v) => MapEntry(k, (v.x + v.y) / 2));
  if (x.isEmpty) return null;
  return x;
}