toJson method

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

Implementation

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

  return <String, dynamic>{
    'alignment': const NullableAlignmentConverter()
        .toJson(object.alignment as Alignment?),
    'animationDuration': object.animationDuration?.inMilliseconds,
    'backgroundColor':
        const NullableMaterialStatePropertyColorConverter().toJson(
      object.backgroundColor,
    ),
    'elevation': const NullableMaterialStatePropertyDoubleConverter()
        .toJson(object.elevation),
    'enableFeedback': object.enableFeedback,
    'foregroundColor':
        const NullableMaterialStatePropertyColorConverter().toJson(
      object.foregroundColor,
    ),
    'minimumSize': const NullableMaterialStatePropertySizeConverter()
        .toJson(object.minimumSize),
    'mouseCursor':
        const NullableMaterialStatePropertyMouseCursorConverter().toJson(
      object.mouseCursor,
    ),
    'overlayColor': const NullableMaterialStatePropertyColorConverter()
        .toJson(object.overlayColor),
    'padding':
        const NullableMaterialStatePropertyEdgeInsetsGeometryConverter()
            .toJson(object.padding),
    'shadowColor': const NullableMaterialStatePropertyColorConverter()
        .toJson(object.shadowColor),
    'shape': const NullableMaterialStatePropertyOutlinedBorderConverter()
        .toJson(object.shape),
    'side': const NullableMaterialStatePropertyBorderSideConverter()
        .toJson(object.side),
    'tapTargetSize': const NullableMaterialTapTargetSizeConverter().toJson(
      object.tapTargetSize,
    ),
    'textStyle': const NullableMaterialStatePropertyTextStyleConverter()
        .toJson(object.textStyle),
    'visualDensity': const NullableVisualDensityConverter().toJson(
      object.visualDensity,
    ),
  };
}