LayoutTreeSnapshot.fromJson constructor

LayoutTreeSnapshot.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory LayoutTreeSnapshot.fromJson(Map<String, dynamic> json) {
  return LayoutTreeSnapshot(
    nodeIndex: (json['nodeIndex'] as List).map((e) => e as int).toList(),
    styles: (json['styles'] as List)
        .map((e) => ArrayOfStrings.fromJson(e as List))
        .toList(),
    bounds: (json['bounds'] as List)
        .map((e) => Rectangle.fromJson(e as List))
        .toList(),
    text: (json['text'] as List)
        .map((e) => StringIndex.fromJson(e as int))
        .toList(),
    stackingContexts: RareBooleanData.fromJson(
        json['stackingContexts'] as Map<String, dynamic>),
    paintOrders: json.containsKey('paintOrders')
        ? (json['paintOrders'] as List).map((e) => e as int).toList()
        : null,
    offsetRects: json.containsKey('offsetRects')
        ? (json['offsetRects'] as List)
            .map((e) => Rectangle.fromJson(e as List))
            .toList()
        : null,
    scrollRects: json.containsKey('scrollRects')
        ? (json['scrollRects'] as List)
            .map((e) => Rectangle.fromJson(e as List))
            .toList()
        : null,
    clientRects: json.containsKey('clientRects')
        ? (json['clientRects'] as List)
            .map((e) => Rectangle.fromJson(e as List))
            .toList()
        : null,
    blendedBackgroundColors: json.containsKey('blendedBackgroundColors')
        ? (json['blendedBackgroundColors'] as List)
            .map((e) => StringIndex.fromJson(e as int))
            .toList()
        : null,
    textColorOpacities: json.containsKey('textColorOpacities')
        ? (json['textColorOpacities'] as List).map((e) => e as num).toList()
        : null,
  );
}