encodeAppBarTheme static method

Map<String, dynamic>? encodeAppBarTheme(
  1. AppBarTheme? value
)

Encodes the given value to a JSON representation.

{
  "actionsIconTheme": <IconThemeData>,
  "backgroundColor": <Color>,
  "backwardsCompatibility": <bool>,
  "brightness": <Brightness>,
  "centerTitle": <bool>,
  "color": <Color>,
  "elevation": <double>,
  "foregroundColor": <Color>,
  "iconTheme": <IconThemeData>,
  "shadowColor": <Color>,
  "systemOverlayStyle": <SystemUiOverlayStyle>,
  "textTheme": <TextTheme>,
  "titleSpacing": <double>,
  "titleTextStyle": <TextStyle>,
  "toolbarTextStyle": <TextStyle>
}

See also:

Implementation

static Map<String, dynamic>? encodeAppBarTheme(AppBarTheme? value) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = <String, dynamic>{
      'actionsIconTheme': encodeIconThemeData(value.actionsIconTheme),
      'backgroundColor':
          encodeColor(value.backgroundColor) ?? encodeColor(value.color),
      'backwardsCompatibility': value.backwardsCompatibility,
      'brightness': encodeBrightness(value.brightness),
      'centerTitle': value.centerTitle,
      'elevation': value.elevation,
      'foregroundColor': encodeColor(value.foregroundColor),
      'iconTheme': encodeIconThemeData(value.iconTheme),
      'shadowColor': encodeColor(value.shadowColor),
      'systemOverlayStyle':
          encodeSystemUiOverlayStyle(value.systemOverlayStyle),
      'textTheme': encodeTextTheme(value.textTheme),
      'titleSpacing': value.titleSpacing,
      'titleTextStyle': encodeTextStyle(value.titleTextStyle),
      'toolbarTextStyle': encodeTextStyle(value.toolbarTextStyle),
    };
  }

  return _stripNull(result);
}