Patch.fromJson(Map<String, dynamic> json) : _small = json[ 'small']!, // Use the null assertion operator if you are sure the value won't be null _large = json[ 'large']!;