fromJson method

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

Implementation

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

  return ButtonStyle(
    alignment: const NullableAlignmentConverter().fromJson(json['alignment']),
    animationDuration: (json['animationDuration'] == null
        ? null
        : Duration(milliseconds: (json['animationDuration'] as num).toInt())),
    backgroundColor:
        const NullableMaterialStatePropertyColorConverter().fromJson(
      json['backgroundColor'],
    ),
    elevation: const NullableMaterialStatePropertyDoubleConverter()
        .fromJson(json['elevation']),
    enableFeedback: json['enableFeedback'] == null
        ? null
        : (json['enableFeedback'] as bool),
    foregroundColor:
        const NullableMaterialStatePropertyColorConverter().fromJson(
      json['foregroundColor'],
    ),
    minimumSize: const NullableMaterialStatePropertySizeConverter().fromJson(
      json['minimumSize'],
    ),
    mouseCursor:
        const NullableMaterialStatePropertyMouseCursorConverter().fromJson(
      json['mouseCursor'],
    ),
    overlayColor:
        const NullableMaterialStatePropertyColorConverter().fromJson(
      json['overlayColor'],
    ),
    padding: const NullableMaterialStatePropertyEdgeInsetsGeometryConverter()
        .fromJson(
      json['padding'],
    ),
    shadowColor: const NullableMaterialStatePropertyColorConverter().fromJson(
      json['shadowColor'],
    ),
    shape:
        const NullableMaterialStatePropertyOutlinedBorderConverter().fromJson(
      json['shape'],
    ),
    side: const NullableMaterialStatePropertyBorderSideConverter().fromJson(
      json['side'],
    ),
    tapTargetSize: const NullableMaterialTapTargetSizeConverter().fromJson(
      json['tapTargetSize'],
    ),
    textStyle:
        const NullableMaterialStatePropertyTextStyleConverter().fromJson(
      json['textStyle'],
    ),
    visualDensity: const NullableVisualDensityConverter().fromJson(
      json['visualDensity'],
    ),
  );
}