show<T> static method

Future<T?> show<T>(
  1. BuildContext context, {
  2. String? content,
  3. bool barrierDismissible = true,
  4. bool useRootNavigator = true,
})

展示加载弹窗的静态方法。

  • context 上下文
  • content 加载时的提示文案
  • barrierDismissible 点击蒙层背景是否关闭弹窗,默认为 true,可关闭,详见 showDialog 中的 barrierDismissible
  • useRootNavigator 把弹窗添加到 context 中的 rootNavigator 还是最近的 Navigator,默认为 true,添加到 rootNavigator,详见 showDialog 中的 useRootNavigator

Implementation

static Future<T?> show<T>(
  BuildContext context, {
  String? content,
  bool barrierDismissible = true,
  bool useRootNavigator = true,
}) {
  return SafeDialog.show<T>(
      context: context,
      tag: _loadingDialogTag,
      barrierDismissible: barrierDismissible,
      useRootNavigator: useRootNavigator,
      builder: (_) {
        return LoadingDialog(
            content:
                content ?? BrnIntl.of(context).localizedResource.loading);
      });
}