map_padding.dart 701 B

12345678910111213141516171819202122232425262728293031323334
  1. import "codable.dart";
  2. class MapPadding implements Codable {
  3. final double left;
  4. final double top;
  5. final double right;
  6. final double bottom;
  7. MapPadding({this.left = 0, this.top = 0, this.right = 0, this.bottom = 0});
  8. @override
  9. Map<String, dynamic> toJson() {
  10. return {
  11. 'left': left,
  12. 'top': top,
  13. 'right': right,
  14. 'bottom': bottom,
  15. };
  16. }
  17. factory MapPadding.fromJson(Map<String, dynamic> map) {
  18. return MapPadding(
  19. left: map['left'],
  20. top: map['top'],
  21. right: map['right'],
  22. bottom: map['bottom'],
  23. );
  24. }
  25. @override
  26. String toString() {
  27. return 'MapPadding{left: $left, top: $top, right: $right, bottom: $bottom}';
  28. }
  29. }