toMap method

Map<String, dynamic> toMap({
  1. EnumMethod? enumMethod,
})

Converts instance to a map.

Implementation

Map<String, dynamic> toMap({EnumMethod? enumMethod}) {
  return {
    "allowWithNoScrollbar": allowWithNoScrollbar,
    "attributedTitle": attributedTitle?.toMap(enumMethod: enumMethod),
    "backgroundColor": backgroundColor?.toHex(),
    "color": color?.toHex(),
    "distanceToTriggerSync": distanceToTriggerSync,
    "enabled": enabled,
    "size": switch (enumMethod ?? EnumMethod.nativeValue) {
      EnumMethod.nativeValue => size?.toNativeValue(),
      EnumMethod.value => size?.toValue(),
      EnumMethod.name => size?.name(),
    },
    "slingshotDistance": slingshotDistance,
  };
}