fromJson method

  1. @override
ChipThemeData? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

@override
ChipThemeData? fromJson(Map<String, dynamic>? json) {
  if (json == null) return null;

  return ChipThemeData(
    backgroundColor: const NullableColorConverter().fromJson(
      json['backgroundColor'],
    )!,
    brightness: const NullableBrightnessConverter().fromJson(
      json['brightness'],
    )!,
    checkmarkColor: const NullableColorConverter().fromJson(
      json['checkmarkColor'],
    ),
    deleteIconColor: const NullableColorConverter().fromJson(
      json['deleteIconColor'],
    ),
    disabledColor: const NullableColorConverter().fromJson(
      json['disabledColor'],
    )!,
    elevation: (json['elevation'] as num?)?.toDouble(),
    labelPadding: const NullableEdgeInsetsGeometryConverter().fromJson(
      json['labelPadding'],
    ),
    labelStyle: const NullableTextStyleConverter().fromJson(
      json['labelStyle'],
    )!,
    padding: const NullableEdgeInsetsGeometryConverter().fromJson(
      json['padding'],
    )!,
    pressElevation: (json['pressElevation'] as num?)?.toDouble(),
    secondaryLabelStyle: const NullableTextStyleConverter().fromJson(
      json['secondaryLabelStyle'],
    )!,
    secondarySelectedColor: const NullableColorConverter().fromJson(
      json['secondarySelectedColor'],
    )!,
    selectedColor: const NullableColorConverter().fromJson(
      json['selectedColor'],
    )!,
    shape: const NullableShapeBorderConverter().fromJson(
      json['shape'],
    ) as OutlinedBorder?,
    side: const NullableBorderSideConverter().fromJson(json['side']),
    selectedShadowColor: const NullableColorConverter().fromJson(
      json['selectedShadowColor'],
    ),
    shadowColor: const NullableColorConverter().fromJson(
      json['shadowColor'],
    ),
    showCheckmark: json['showCheckmark'] == null
        ? null
        : (json['showCheckmark'] as bool),
  );
}