class Dimensions { final int width; final int height; const Dimensions({required this.width, required this.height}); @override String toString() { return 'Dimensions(width: $width, height: $height})'; } Map toJson() { return { 'width': width, 'height': height, }; } factory Dimensions.fromJson(Map json) { return Dimensions( width: json['width'] as int, height: json['height'] as int, ); } }