InstanceConstant.fromJson constructor

InstanceConstant.fromJson(
  1. Map<String, Object?> json,
  2. List<Constant> constants
)

Creates an InstanceConstant object from JSON.

json is a map representing the JSON structure. constants is a list of Constant objects that are referenced by index in the JSON.

Implementation

factory InstanceConstant.fromJson(
  Map<String, Object?> json,
  List<Constant> constants,
) {
  return InstanceConstant(
    fields: json.map(
      (key, constantIndex) => MapEntry(key, constants[constantIndex as int]),
    ),
  );
}