encodeBadgeThemeData static method

Map<String, dynamic>? encodeBadgeThemeData(
  1. BadgeThemeData? value
)

Encodes the given value to an JSON encoded map. This provides the given structure below:

{
  "alignment": "<AlignmentGeometry>",
  "backgroundColor": "<Color>",
  "largeSize": "<double>",
  "offset": "<Offset>",
  "padding": "<EdgeInsets>",
  "smallSize": "<double>",
  "textColor": "<Color>",
  "textStyle": "<TextStyle>"
}

See also:

Implementation

static Map<String, dynamic>? encodeBadgeThemeData(BadgeThemeData? value) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = {
      'alignment': encodeAlignmentGeometry(value.alignment),
      'backgroundColor': encodeColor(value.backgroundColor),
      'largeSize': value.largeSize,
      'offset': encodeOffset(value.offset),
      'padding': encodeEdgeInsetsGeometry(value.padding as EdgeInsets?),
      'smallSize': value.smallSize,
      'textColor': encodeColor(value.textColor),
      'textStyle': encodeTextStyle(value.textStyle),
    };
  }

  return _stripDynamicNull(result);
}