showAutoHidden method
void
showAutoHidden(
- BuildContext context, {
- LoadingStyle style = LoadingStyle.overlay,
- LoadingType type = LoadingType.classic,
- String overlayKey = '',
- String? text,
- Duration duration = const Duration(seconds: 2),
- void complete()?,
显示loading
context
widget context
style
loading渲染方式
type
加载类型(设置该类型显示加载的不同样式)
overlayKey
当前style==LoadingStyle.aloneOverlay时,该为必填项用于区分不同loading视图的标识
text
显示文本
Duration 持续时间
complete
完成回调
Implementation
void showAutoHidden(BuildContext context,
{LoadingStyle style = LoadingStyle.overlay,
LoadingType type = LoadingType.classic,
String overlayKey = '',
String? text,
Duration duration = const Duration(seconds: 2),
void Function()? complete}) {
show(context, style: style, type: type, overlayKey: overlayKey, text: text);
Future.delayed(duration, () {
_instance?.dismiss();
if (complete != null) {
complete();
}
});
}