toMap method

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

Implementation

@override
Map<String, dynamic> toMap() {
  if (_widthAndAspectRatio != null) {
    return {'width': _widthAndAspectRatio?.size.toMap(), 'aspect': _widthAndAspectRatio?.aspect};
  }
  if (_heightAndAspectRatio != null) {
    return {'height': _heightAndAspectRatio?.size.toMap(), 'aspect': _heightAndAspectRatio?.aspect};
  }
  if (_shorterDimensionAndAspectRatio != null) {
    return {
      'shorterDimension': _shorterDimensionAndAspectRatio?.size.toMap(),
      'aspect': _shorterDimensionAndAspectRatio?.aspect
    };
  }
  return _widthAndHeight != null ? _widthAndHeight!.toMap() : {};
}