showCustomLoading static method
- required ToastBuilder toastBuilder,
- WrapAnimation? wrapAnimation = nilWrapAnimation,
- WrapAnimation? wrapToastAnimation = nilWrapAnimation,
- Alignment? align = nilAlignment,
- BackButtonBehavior? backButtonBehavior = nilBackButtonBehavior,
- Object clickClose = nil,
- Object allowClick = nil,
- Object ignoreContentClick = nil,
- Object crossPage = nil,
- Object enableKeyboardSafeArea = nil,
- VoidCallback? onClose = nilVoidCallback,
- Duration? duration = nilDuration,
- Duration? animationDuration = nilDuration,
- Duration? animationReverseDuration = nilDuration,
- Color backgroundColor = nilColor,
- Object useSafeArea = nil,
Display a custom loading Toast.
toastBuilder
- Builder function to generate the widget to display.
align
- Alignment of the ToastContent area within the MainContent area.
wrapAnimation
- See showAnimationWidget.wrapAnimation
, default value is loadingAnimation
.
wrapToastAnimation
- See showAnimationWidget.wrapToastAnimation
, default value is null.
animationDuration
- See showAnimationWidget.animationDuration
.
animationReverseDuration
- See showAnimationWidget.animationReverseDuration
.
ignoreContentClick
- See showEnhancedWidget.ignoreContentClick
.
duration
- See showEnhancedWidget.duration
.
allowClick
- See showEnhancedWidget.allowClick
.
clickClose
- See showEnhancedWidget.clickClose
.
crossPage
- See showEnhancedWidget.crossPage
.
backgroundColor
- See showEnhancedWidget.backgroundColor
.
onClose
- See showEnhancedWidget.onClose
.
backButtonBehavior
- See showEnhancedWidget.backButtonBehavior
.
enableKeyboardSafeArea
- See showEnhancedWidget.enableKeyboardSafeArea
.
显示一个自定义的加载Toast
toastBuilder
生成需要显示的Widget的builder函数
align
ToastContent区域在MainContent区域的对齐
wrapAnimation
请看showAnimationWidget.wrapAnimation
,默认值为loadingAnimation
wrapToastAnimation
请看showAnimationWidget.wrapToastAnimation
,默认值为null
animationDuration
请看showAnimationWidget.animationDuration
animationReverseDuration
请看showAnimationWidget.animationReverseDuration
ignoreContentClick
请看showEnhancedWidget.ignoreContentClick
duration
请看showEnhancedWidget.duration
allowClick
请看showEnhancedWidget.allowClick
clickClose
请看showEnhancedWidget.clickClose
crossPage
请看showEnhancedWidget.crossPage
backgroundColor
请看showEnhancedWidget.backgroundColor
onClose
请看showEnhancedWidget.onClose
backButtonBehavior
请看showEnhancedWidget.backButtonBehavior
enableKeyboardSafeArea
请看showEnhancedWidget.enableKeyboardSafeArea
Implementation
static CancelFunc showCustomLoading({
required ToastBuilder toastBuilder,
WrapAnimation? wrapAnimation = nilWrapAnimation,
WrapAnimation? wrapToastAnimation = nilWrapAnimation,
Alignment? align = nilAlignment,
BackButtonBehavior? backButtonBehavior = nilBackButtonBehavior,
/*bool*/ Object clickClose = nil,
/*bool*/ Object allowClick = nil,
/*bool*/ Object ignoreContentClick = nil,
/*bool*/ Object crossPage = nil,
/*bool*/ Object enableKeyboardSafeArea = nil,
VoidCallback? onClose = nilVoidCallback,
Duration? duration = nilDuration,
Duration? animationDuration = nilDuration,
Duration? animationReverseDuration = nilDuration,
Color backgroundColor = nilColor,
/*bool*/ Object useSafeArea = nil,
}) {
var o = defaultOption.customLoading;
wrapAnimation = returnFirstIfNotNil(wrapAnimation, o.wrapAnimation);
wrapToastAnimation = returnFirstIfNotNil(wrapToastAnimation, o.wrapToastAnimation);
align = returnFirstIfNotNil(align, o.align);
backButtonBehavior = returnFirstIfNotNil(backButtonBehavior, o.backButtonBehavior);
clickClose = returnFirstIfNotNil(clickClose, o.clickClose);
allowClick = returnFirstIfNotNil(allowClick, o.allowClick);
ignoreContentClick = returnFirstIfNotNil(ignoreContentClick, o.ignoreContentClick);
crossPage = returnFirstIfNotNil(crossPage, o.crossPage);
enableKeyboardSafeArea = returnFirstIfNotNil(enableKeyboardSafeArea, o.enableKeyboardSafeArea);
onClose = returnFirstIfNotNil(onClose, o.onClose);
duration = returnFirstIfNotNil(duration, o.duration);
animationDuration = returnFirstIfNotNil(animationDuration, o.animationDuration);
animationReverseDuration = returnFirstIfNotNil(animationReverseDuration, o.animationReverseDuration);
backgroundColor = returnFirstIfNotNil(backgroundColor, o.backgroundColor);
useSafeArea = returnFirstIfNotNil(useSafeArea, o.useSafeArea);
assert(isNilOr<bool>([enableKeyboardSafeArea, clickClose, crossPage, allowClick, ignoreContentClick, useSafeArea]), 'Must be of bool type');
return showAnimationWidget(
groupKey: loadKey,
enableKeyboardSafeArea: enableKeyboardSafeArea,
toastBuilder: toastBuilder,
backButtonBehavior: backButtonBehavior,
animationDuration: animationDuration ?? o.animationDuration,
animationReverseDuration: animationReverseDuration,
wrapAnimation: wrapAnimation,
wrapToastAnimation: (controller, cancel, child) {
if (wrapToastAnimation != null) {
child = wrapToastAnimation(controller, cancel, child);
}
if (align != null) {
child = Align(alignment: align, child: child);
}
return useSafeArea == true ? SafeArea(child: child) : child;
},
onClose: onClose,
clickClose: clickClose,
allowClick: allowClick,
crossPage: crossPage,
ignoreContentClick: ignoreContentClick,
onlyOne: false,
duration: duration,
backgroundColor: backgroundColor);
}