Search packages, repositories and app categories

GitHub repositoryawaik/flutter_keyboard_size

flutter_keyboard_size

Flutter package - simple but useful provider that gives all info about keyboard in one place in any widget down the tree.

flutter_keyboard_size project cover
Stars
30
Forks
6
Last push (UTC)
Mar 26, 2023
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

flutter_keyboard_size Pub

When the virtual keyboard is opened, we can get its height with MediaQuery.of(context).viewInsets.bottom

BUT, in case of complicated widgets tree, it doesn't work. So, every time we have to mutate the keyboard size down to the widget tree.

This package is a straightforward and convenient provider that helps get info about: keyboard height, is it open or not, set bool value is screen small or not.

Showcase|100x100, 10%

Usage

After installing wrap Scaffold widget to

KeyboardSizeProvider(
      smallSize: 500.0,
      child: Scaffold(

where smallSize property is optional, default is 400.0

After that, down to the widget tree you can use Consumer widget to get info about keyboard

Widget build(BuildContext context) {
    return Consumer<ScreenHeight>(
      builder: (context, _res, child) {
        return Center(

available properties:

  double keyboardHeight
  double screenHeight
  bool isSmall // returns true if screen height becomes less then smallSize property
  bool isOpen // true if open

Full example is here https://github.com/awaik/flutter_keyboard_size/tree/master/example

Credits

This is a project by Agoradesk, P2P cryptocurrency trading platform. Created by the team behind LocalMonero, the biggest and most trusted Monero P2P trading platform.

Alex Awaik GitHub avatar
GitHub author

Alex Awaik ↗

Full Stack developer - mobile + backend (AI integration, clouds, functions, databases)

Berlin, Germany
LanguagesC++CMakeDartHTMLCSwiftKotlinObjective-C

Packages published by this repository

Dependencies used

Dependency list 3 items

  • flutter{"sdk":"flutter"}
  • provider^6.0.4
  • flutter_testDevelopment{"sdk":"flutter"}

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗