encodeDialogTheme static method

Map<String, dynamic>? encodeDialogTheme(
  1. DialogTheme? value
)

Encodes the given value to a JSON representation.

{
  "actionsPadding": "<EdgeInsetsGeometry>",
  "alignment": "<Alignment>",
  "backgroundColor": "<Color>",
  "contentTextStyle": "<TextStyle>",
  "elevation": "<double>",
  "iconColor": "<Color>",
  "shadowColor": "<Color>",
  "shape": "<ShapeBorder>",
  "surfaceColor": "<Color>",
  "titleTextStyle": "<TextStyle>"
}

See also:

Implementation

static Map<String, dynamic>? encodeDialogTheme(DialogTheme? value) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = <String, dynamic>{
      'actionsPadding': encodeEdgeInsetsGeometry(
        value.actionsPadding as EdgeInsets?,
      ),
      'alignment': encodeAlignmentGeometry(value.alignment),
      'backgroundColor': encodeColor(value.backgroundColor),
      'contentTextStyle': encodeTextStyle(value.contentTextStyle),
      'elevation': value.elevation,
      'shadowColor': encodeColor(value.shadowColor),
      'shape': encodeShapeBorder(value.shape),
      'surfaceTintColor': encodeColor(value.shadowColor),
      'titleTextStyle': encodeTextStyle(value.titleTextStyle),
    };
  }

  return _stripDynamicNull(result);
}