ISBN.fromJson constructor
Returns a valid ISBN object.
If key
is null
ISBN.key is used to get it's corresponding value in map
.
Throws InvalidValueException if map
's value is not a valid ISBN number.
Implementation
factory ISBN.fromJson(Map<String, dynamic> map, {String? key}) {
final flatMap = flattenMap(map);
final value = flatMap[key ?? ISBN.key].toString();
return ISBN(value.toString());
}