maybeParse static method

BoxShadowValue? maybeParse(
  1. dynamic value
)

Implementation

static BoxShadowValue? maybeParse(dynamic value) {
  final x = DimensionValue.maybeParse(value['x'] ?? 0)!;
  final y = DimensionValue.maybeParse(value['y'] ?? 0)!;
  final blur = DimensionValue.maybeParse(value['blur'] ?? 0)!;
  final spread = DimensionValue.maybeParse(value['spread'] ?? 0)!;
  final color = ColorValue.maybeParse(value['color'] ?? '#000000')!;

  // TODO(mark): Add support for inner shadows

  return BoxShadowValue._(
    x,
    y,
    blur,
    spread,
    color,
    BoxShadowType.dropShadow,
  );
}