displayAutoCompleteSuggestions method

void displayAutoCompleteSuggestions(
  1. List<RichSuggestion> suggestions
)

Display autocomplete suggestions with the overlay.

Implementation

void displayAutoCompleteSuggestions(List<RichSuggestion> suggestions) {
  final RenderBox? renderBox = context.findRenderObject() as RenderBox?;
  Size? size = renderBox?.size;

  final RenderBox? appBarBox =
      this.appBarKey.currentContext?.findRenderObject() as RenderBox?;

  clearOverlay();

  this.overlayEntry = OverlayEntry(
    builder: (context) => Positioned(
      width: size?.width,
      top: appBarBox?.size.height,
      child: Material(elevation: 1, child: Column(children: suggestions)),
    ),
  );

  Overlay.of(context)?.insert(this.overlayEntry!);
}