ProtoGoogleStruct.fromJson constructor

ProtoGoogleStruct.fromJson(
  1. Map<String, dynamic> json, {
  2. ProtoJsonConfig config = DefaultProtoJsonConfig.defaultConfig,
})

Implementation

factory ProtoGoogleStruct.fromJson(
  Map<String, dynamic> json, {
  ProtoJsonConfig config = DefaultProtoJsonConfig.defaultConfig,
}) {
  final fields = json['fields'];
  if (fields is Map) {
    return ProtoGoogleStruct(
      fields: fields.map(
        (k, v) => MapEntry(k.toString(), ProtoGoogleValue.fromDynamicJson(v)),
      ),
    );
  }
  return const ProtoGoogleStruct();
}