fromJson method

  1. @override
TooltipThemeData? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

@override
TooltipThemeData? fromJson(Map<String, dynamic>? json) {
  if (json == null) return null;

  return TooltipThemeData(
    // @unencodable
    // decoration
    excludeFromSemantics: json['excludeFromSemantics'] == null
        ? null
        : (json['excludeFromSemantics'] as bool),
    height: (json['height'] as num?)?.toDouble(),
    margin: const NullableEdgeInsetsGeometryConverter().fromJson(
      json['margin'],
    ),
    padding: const NullableEdgeInsetsGeometryConverter().fromJson(
      json['padding'],
    ),
    preferBelow:
        json['preferBelow'] == null ? null : (json['preferBelow'] as bool),
    showDuration: (json['showDuration'] == null
        ? null
        : Duration(milliseconds: (json['showDuration'] as num).toInt())),
    textStyle: const NullableTextStyleConverter().fromJson(
      json['textStyle'],
    ),
    verticalOffset: (json['verticalOffset'] as num?)?.toDouble(),
    waitDuration: (json['waitDuration'] == null
        ? null
        : Duration(milliseconds: (json['waitDuration'] as num).toInt())),
  );
}