fromJson static method

FShadow fromJson(
  1. Map<String, dynamic> json
)

Implementation

static FShadow fromJson(final Map<String, dynamic> json) {
  try {
    return FShadow(
      x: StaticTypeInput<double>.fromJson(json['x'] as Map<String, dynamic>),
      y: StaticTypeInput<double>.fromJson(json['y'] as Map<String, dynamic>),
      spread:
          StaticTypeInput<double>.fromJson(json['s'] as Map<String, dynamic>),
      blur:
          StaticTypeInput<double>.fromJson(json['b'] as Map<String, dynamic>),
      fill: FFill.fromJson(json['f'] as Map<String, dynamic>),
      opacity: FSize.fromJson(json['o'] as Map<String, dynamic>),
    );
  } catch (e) {
    return const FShadow(
      x: StaticTypeInput<double>(value: 0, type: FGeneralTypeEnum.double),
      y: StaticTypeInput<double>(value: 0, type: FGeneralTypeEnum.double),
      spread:
          StaticTypeInput<double>(value: 0, type: FGeneralTypeEnum.double),
      blur: StaticTypeInput<double>(value: 16, type: FGeneralTypeEnum.double),
      fill: FFill(),
      opacity: FSize(
        size: '0',
        sizeTablet: '0',
        sizeDesktop: '0',
      ),
    );
  }
}