Skip to content

[Feature Request] Scope the virtual keyboard in standalone mode #4

Description

@EArminjon

https://github.com/Masum-MSNR/virtual_keypad/blob/1397e17648da4228f5fd6677bd1228a742aead00/lib/src/widgets/keyboard.dart#L138

Inside the pseudo code given here : #3, the bellow code was very useful.
It allow virtual keyboard to only be shown under a specific scope and so ignore parent inputs.
For kiosk app, this is not very useful but for our usecases inside the widgetbook it make sens.

void _openKeyboard() {
    if (!mounted) return;

    final focusedContext = FocusManager.instance.primaryFocus?.context;
    final isInside =
        focusedContext != null && focusedContext.findAncestorStateOfType<_VirtualKeyboardLayoutState>() == this;

    if (!isInside) {
      _closeKeyboard();
    } else {
      setState(() {
        _isKeyboardOpen = true;
        _keyboardType = _toKeyboardType(_tracker.configuration?.inputType);
        _inputAction = _tracker.configuration?.inputAction;
      });
    }
  }

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions