edgeInsetsToJson static method

Map<String, dynamic>? edgeInsetsToJson(
  1. EdgeInsets? e
)

Implementation

static Map<String, dynamic>? edgeInsetsToJson(EdgeInsets? e) {
  if (e == null) return null;
  final x = {
    if (e.left > 0) "left": e.left,
    if (e.right > 0) "right": e.right,
    if (e.top > 0) "top": e.top,
    if (e.bottom > 0) "bottom": e.bottom,
  };
  if (x.isEmpty) return null;
  return x;
}