toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  var paddingVal = {};

  if (padding != null) {
    paddingVal = {
      'top': padding!.top,
      'bottom': padding!.bottom,
      'left': padding!.left,
      'right': padding!.right,
    };
  }

  var result = {};
  if (margin != null) {
    result = {
      'top': margin!.top,
      'bottom': margin!.bottom,
      'left': margin!.left,
      'right': margin!.right,
    };
  }
  return {'padding': paddingVal, 'margin': result};
}