toJson method

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

Abstract function that concrete classes must implement. This must encode the internal data model to a JSON compatible representation.

While not required, it is suggested to call removeNull before returning.

Implementation

@override
Map<String, dynamic> toJson() {
  return JsonClass.removeNull({
    'bottom': true == bottom ? null : bottom,
    'left': true == left ? null : left,
    'maintainBottomViewPadding':
        false == maintainBottomViewPadding ? null : maintainBottomViewPadding,
    'minimum': EdgeInsets.zero == minimum
        ? null
        : ThemeEncoder.encodeEdgeInsets(
            minimum,
          ),
    'right': true == right ? null : right,
    'top': true == top ? null : top,
    'child': child.toJson(),
    ...args,
  });
}