showPopupWindow<T> function

Future<T?> showPopupWindow<T>({
  1. required BuildContext context,
  2. required Widget popupWindow,
  3. double elevation = 8.0,
  4. String? semanticLabel,
  5. required RelativeRect position,
  6. bool fullWidth = false,
})

弹窗方法

Implementation

Future<T?> showPopupWindow<T>({
  required BuildContext context,
  required Widget popupWindow,
  double elevation: 8.0,
  String? semanticLabel,
  required RelativeRect position,
  bool fullWidth: false,
}) {
  var label = semanticLabel;
  switch (defaultTargetPlatform) {
    case TargetPlatform.iOS:
      label = semanticLabel;
      break;
    default:
      label = semanticLabel ?? MaterialLocalizations.of(context).popupMenuLabel;
  }

  return Navigator.push<T>(
      context,
      new _PopupWindowRoute(
        // context: context,
        position: position,
        child: popupWindow,
        elevation: elevation,
        semanticLabel: label,
        theme: Theme.of(context),
        barrierLabel:
        MaterialLocalizations.of(context).modalBarrierDismissLabel,
        fullWidth: fullWidth,
      ));
}