keyboard_service 1.0.3

Flutter Android iOS web

Keyboard visibility / (auto-) dismiss package without native plugin

keyboard_service #

Keyboard visibility / (auto-) dismiss package without native plugin

Watch on GitHub Star on GitHub pub package

Getting Started #

Use it for example when you want to automatically dimiss the on-screen keyboard when tapped outside of textfield. And if you want know if the on-screen keyboard is visible and/or want to explicitly dismiss it.

There are 2 classes

  • 'KeyboardService': Check if keyboard is visible and dismiss keyboard.
  • 'KeyboardAutoDismiss': A widget that wraps a Scaffold widget for automatically dismissing the keyboard.

Also see example project

Wrap your top scaffold:

return KeyboardAutoDismiss(
        scaffold: Scaffold(
            appBar: AppBar(
                title: Text('Keyboard Service Example'),
            ),
      ...
        ),
    );

Use the service class if needed:

// Use method below to dismiss the keyboard
KeyboardService.dismiss();

// Use the optional BuildContext parameter to remove focus of a TextField
KeyboardService.dismiss(unfocus: context);

License #

This project is licensed under the MIT License - see the license file for details.

5
likes
110
pub points
71%
popularity

Keyboard visibility / (auto-) dismiss package without native plugin

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

gerrel.developer@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on keyboard_service