toMap method
- EnumMethod? enumMethod,
override
Converts instance to a map.
Implementation
Map<String, dynamic> toMap({EnumMethod? enumMethod}) {
return {
"allowGoBackWithBackButton": allowGoBackWithBackButton,
"closeButtonCaption": closeButtonCaption,
"closeButtonColor": closeButtonColor?.toHex(),
"closeOnCannotGoBack": closeOnCannotGoBack,
"hidden": hidden,
"hideCloseButton": hideCloseButton,
"hideDefaultMenuItems": hideDefaultMenuItems,
"hideProgressBar": hideProgressBar,
"hideTitleBar": hideTitleBar,
"hideToolbarBottom": hideToolbarBottom,
"hideToolbarTop": hideToolbarTop,
"hideUrlBar": hideUrlBar,
"menuButtonColor": menuButtonColor?.toHex(),
"presentationStyle": switch (enumMethod ?? EnumMethod.nativeValue) {
EnumMethod.nativeValue => presentationStyle?.toNativeValue(),
EnumMethod.value => presentationStyle?.toValue(),
EnumMethod.name => presentationStyle?.name(),
},
"shouldCloseOnBackButtonPressed": shouldCloseOnBackButtonPressed,
"toolbarBottomBackgroundColor": toolbarBottomBackgroundColor?.toHex(),
"toolbarBottomTintColor": toolbarBottomTintColor?.toHex(),
"toolbarBottomTranslucent": toolbarBottomTranslucent,
"toolbarTopBackgroundColor": toolbarTopBackgroundColor?.toHex(),
"toolbarTopBarTintColor": toolbarTopBarTintColor?.toHex(),
"toolbarTopFixedTitle": toolbarTopFixedTitle,
"toolbarTopTintColor": toolbarTopTintColor?.toHex(),
"toolbarTopTranslucent": toolbarTopTranslucent,
"transitionStyle": switch (enumMethod ?? EnumMethod.nativeValue) {
EnumMethod.nativeValue => transitionStyle?.toNativeValue(),
EnumMethod.value => transitionStyle?.toValue(),
EnumMethod.name => transitionStyle?.name(),
},
"windowAlphaValue": windowAlphaValue,
"windowFrame": windowFrame?.toMap(enumMethod: enumMethod),
"windowStyleMask": switch (enumMethod ?? EnumMethod.nativeValue) {
EnumMethod.nativeValue => windowStyleMask?.toNativeValue(),
EnumMethod.value => windowStyleMask?.toValue(),
EnumMethod.name => windowStyleMask?.name(),
},
"windowTitlebarSeparatorStyle": switch (enumMethod ??
EnumMethod.nativeValue) {
EnumMethod.nativeValue => windowTitlebarSeparatorStyle?.toNativeValue(),
EnumMethod.value => windowTitlebarSeparatorStyle?.toValue(),
EnumMethod.name => windowTitlebarSeparatorStyle?.name(),
},
"windowType": switch (enumMethod ?? EnumMethod.nativeValue) {
EnumMethod.nativeValue => windowType?.toNativeValue(),
EnumMethod.value => windowType?.toValue(),
EnumMethod.name => windowType?.name(),
},
};
}