FigmaVariable.fromJson constructor

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

Creates a FigmaVariable from a JSON map.

The JSON structure should match Figma's API response format for variables. Throws if required fields are missing or of incorrect type.

Implementation

factory FigmaVariable.fromJson(Map<String, dynamic> json) {
  return FigmaVariable(
    id: json['id'] as String,
    name: json['name'] as String,
    resolvedType: json['resolvedType'] as String,
    valuesByMode: json['valuesByMode'] as Map<String, dynamic>,
    variableCollectionId: json['variableCollectionId'] as String,
  );
}