encode method Null safety

Object encode()

Implementation

Object encode() {
  final Map<Object?, Object?> pigeonMap = <Object?, Object?>{};
  pigeonMap['enabled'] = enabled;
  pigeonMap['position'] = position?.index;
  pigeonMap['marginLeft'] = marginLeft;
  pigeonMap['marginTop'] = marginTop;
  pigeonMap['marginRight'] = marginRight;
  pigeonMap['marginBottom'] = marginBottom;
  pigeonMap['opacity'] = opacity;
  pigeonMap['rotation'] = rotation;
  pigeonMap['visibility'] = visibility;
  pigeonMap['fadeWhenFacingNorth'] = fadeWhenFacingNorth;
  pigeonMap['clickable'] = clickable;
  pigeonMap['image'] = image;
  return pigeonMap;
}