decodeEdgeInsets static method

HWEdgeInsets? decodeEdgeInsets(
  1. DartObject? obj
)

Implementation

static HWEdgeInsets? decodeEdgeInsets(DartObject? obj) {
  if (obj == null || obj.isNull) return null;

  final top = getField(obj, 'top')?.toDoubleValue() ?? 0.0;
  final bottom = getField(obj, 'bottom')?.toDoubleValue() ?? 0.0;
  final left = getField(obj, 'left')?.toDoubleValue() ?? 0.0;
  final right = getField(obj, 'right')?.toDoubleValue() ?? 0.0;

  return HWEdgeInsets.only(
    top: top,
    bottom: bottom,
    left: left,
    right: right,
  );
}