toMap method
- 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,
};
}