toJson method

  1. @override
Map<String, dynamic> toJson()
override

Implementation

@override
Map<String, dynamic> toJson() {
  final json = super.toJson();
  double? width = this.width;
  if (width == double.infinity) width = MATCH_PARENT;

  double? height = this.height;
  if (height == double.infinity) height = MATCH_PARENT;
  json.addAll({
    // screen bounds
    'width': width,
    'height': height,
  });

  return json;
}