MatexInstrumentTypeMetadata.fromJson constructor
MatexInstrumentTypeMetadata.fromJson(
- Map<String, dynamic> json
)
Implementation
factory MatexInstrumentTypeMetadata.fromJson(Map<String, dynamic> json) {
final rawWeight = json['weight'];
double? weight;
if (rawWeight != null) {
weight = double.parse(rawWeight.toString());
}
return MatexInstrumentTypeMetadata(
key: json['key'] as String,
main: json['main'] as String,
subKey: json['subKey'] as String?,
sub: json['sub'] as String?,
weight: weight ?? _kWeight,
);
}