SVariableDeclarationList.fromJson constructor

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

Implementation

factory SVariableDeclarationList.fromJson(Map<String, dynamic> json) {
  return SVariableDeclarationList(
    offset: json['offset'] as int,
    length: json['length'] as int,
    type:
        SAstNodeFactory.fromJson(json['type'] as Map<String, dynamic>?)
            as STypeAnnotation?,
    variables:
        (json['variables'] as List?)
            ?.map(
              (v) => SVariableDeclaration.fromJson(v as Map<String, dynamic>),
            )
            .toList() ??
        [],
    isConst: json['isConst'] as bool? ?? false,
    isFinal: json['isFinal'] as bool? ?? false,
    isLate: json['isLate'] as bool? ?? false,
    metadata:
        (json['metadata'] as List?)
            ?.map((a) => SAnnotation.fromJson(a as Map<String, dynamic>))
            .toList() ??
        [],
  );
}