fromJson method

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

Implementation

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

  return ButtonThemeData(
    alignedDropdown: (json['alignedDropdown'] as bool),
    buttonColor: const NullableColorConverter().fromJson(
      json['buttonColor'],
    ),
    colorScheme: const NullableColorSchemeConverter().fromJson(
      json['colorScheme'],
    ),
    disabledColor: const NullableColorConverter().fromJson(
      json['disabledColor'],
    ),
    focusColor: const NullableColorConverter().fromJson(
      json['focusColor'],
    ),
    height: ((json['height'] ?? 36.0) as num).toDouble(),
    highlightColor: const NullableColorConverter().fromJson(
      json['highlightColor'],
    ),
    hoverColor: const NullableColorConverter().fromJson(
      json['hoverColor'],
    ),
    layoutBehavior: const NullableButtonBarLayoutBehaviorConverter().fromJson(
          json['layoutBehavior'],
        ) ??
        ButtonBarLayoutBehavior.padded,
    materialTapTargetSize:
        const NullableMaterialTapTargetSizeConverter().fromJson(
      json['materialTapTargetSize'],
    ),
    minWidth: ((json['minWidth'] ?? 88.0) as num).toDouble(),
    padding: const NullableEdgeInsetsGeometryConverter().fromJson(
      json['padding'],
    ),
    shape: const NullableShapeBorderConverter().fromJson(
      json['shape'],
    ),
    splashColor: const NullableColorConverter().fromJson(
      json['splashColor'],
    ),
    textTheme: const NullableButtonTextThemeConverter().fromJson(
      json['textTheme'],
    )!,
  );
}