toJson method Null safety

  1. @override
Map<String, dynamic> toJson()
override

Holds the override implementation of the widget to get json format of the widget class

Implementation

@override
Map<String, dynamic> toJson() {
  return {
    "child": child,
    "gradient": gradient,
    "bgImage": bgImage,
    ...LayoutProps(
      h: h,
      w: w,
      maxW: maxW,
      maxH: maxH,
      minH: minH,
      minW: minW,
      height: height,
      width: width,
    ).toJson(),
    ...StyleProps(
            m: m,
            mt: mt,
            mr: mr,
            mb: mb,
            ml: ml,
            mx: mx,
            my: my,
            p: p,
            pt: pt,
            pr: pr,
            pb: pb,
            pl: pl,
            px: px,
            py: py)
        .toJson(),
    ...FlexBoxProps(alignment: alignment).toJson(),
    ...ShadowProps(shadow: shadow).toJson(),
    ...BorderProps(
      borderWidth: borderWidth,
      borderLeft: borderLeft,
      borderRight: borderRight,
      borderTop: borderTop,
      borderBottom: borderBottom,
      borderStyle: borderStyle,
      borderColor: borderColor,
      borderRadius: borderRadius,
      borderBottomLeftRadius: borderBottomLeftRadius,
      borderBottomRightRadius: borderBottomRightRadius,
      borderTopLeftRadius: borderTopLeftRadius,
      borderTopRightRadius: borderTopRightRadius,
      borderLeftRadius: borderLeftRadius,
      borderRightRadius: borderRightRadius,
      borderTopRadius: borderTopRadius,
      borderBottomRadius: borderBottomRadius,
    ).toJson(),
    ...ColorProps(
      color: color,
    ).toJson()
  };
}