showBubbleMenu<T> function Null safety

Future<T?> showBubbleMenu<T>(
  1. {@required BuildContext? context,
  2. @required RelativeRect? position,
  3. @required List<FLBubbleMenuItem<T>>? items,
  4. String? semanticLabel}
)

Implementation

Future<T?> showBubbleMenu<T>({
  @required BuildContext? context,
  @required RelativeRect? position,
  @required List<FLBubbleMenuItem<T>>? items,
  String? semanticLabel,
}) {
  assert(context != null);
  assert(position != null);
  assert(items != null && items.isNotEmpty);
  assert(debugCheckHasMaterialLocalizations(context!));
  String label = semanticLabel!;
  switch (defaultTargetPlatform) {
    case TargetPlatform.iOS:
      label = semanticLabel;
      break;
    case TargetPlatform.android:
    case TargetPlatform.fuchsia:
    case TargetPlatform.linux:
    case TargetPlatform.macOS:
    case TargetPlatform.windows:
      label =
          semanticLabel; // ?? MaterialLocalizations.of(context!).popupMenuLabel;
  }

  return Navigator.push(
      context!,
      _FLBubblePopupRoute<T>(
          position: position!,
          items: items!,
          semanticLabel: label,
          barrierLabel:
              MaterialLocalizations.of(context).modalBarrierDismissLabel));
}