INNER CODE UNIT · Dart

SuggestionPortalController

TerminalStudio/xterm.dart · lib/suggestion.dart:8

class SuggestionPortalController extends OverlayPortalController {
  final _cursorRect = ValueNotifier<Rect>(Rect.zero);

  /// Updates the location of the suggestion popup to [rect]. If the popup is
  /// not showing, it will be shown after this call.
  void update(Rect rect) {
    _cursorRect.value = rect;
    if (!isShowing) show();
  }
}

/// A convenience widget to place a suggestion popup around the cursor specified
/// by [SuggestionPortalController].
class SuggestionPortal extends StatefulWidget {
  const SuggestionPortal({
    super.key,
    required this.controller,
    required this.overlayBuilder,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…