RuntimeVersion.fromJson constructor

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

Implementation

factory RuntimeVersion.fromJson(Map<String, dynamic> json) {
  final apis = (json['apis'] as List)
      .map<ApiVersion>((json) => ApiVersion.fromJson(json))
      .toList();

  return RuntimeVersion(
    specName: json['specName'] as String,
    implName: json['implName'] as String,
    authoringVersion: json['authoringVersion'] as int,
    specVersion: json['specVersion'] as int,
    implVersion: json['implVersion'] as int,
    apis: apis,
    transactionVersion: json.containsKey('transactionVersion')
        ? json['transactionVersion']
        : 1,
    stateVersion: json.containsKey('stateVersion') ? json['stateVersion'] : 0,
  );
}