toJson method

  1. @override
Map<String, dynamic> toJson()
override
  • to json
  • 转 json

Implementation

@override
Map<String, dynamic> toJson() {
  return <String, dynamic>{
    if (url != null) 'url': url,
    if (assetName != null) 'assetName': assetName,
    if (semanticLabel != null) 'semanticLabel': semanticLabel,
    'excludeFromSemantics': excludeFromSemantics,
    if (width != null) 'width': width,
    if (height != null) 'height': height,
    if (color != null) 'color': color?.value,
    if (colorBlendMode != null) 'colorBlendMode': colorBlendMode?.index,
    'fit': fit.index,
    'repeat': repeat.index,
    'matchTextDirection': matchTextDirection,
    'gaplessPlayback': gaplessPlayback,
    'isAntiAlias': isAntiAlias,
    'filterQuality': filterQuality.index,
  };
}