{"id":15506531,"url":"https://github.com/f-person/flutter_persistent_keyboard_height","last_synced_at":"2026-02-27T06:05:11.638Z","repository":{"id":46165807,"uuid":"403081318","full_name":"f-person/flutter_persistent_keyboard_height","owner":"f-person","description":"Flutter package to get keyboard height. Can be used to display a sticker/emoji modal with correct height.","archived":false,"fork":false,"pushed_at":"2022-03-13T17:00:58.000Z","size":425,"stargazers_count":14,"open_issues_count":1,"forks_count":16,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-08T08:57:17.231Z","etag":null,"topics":["dart","dart-package","flutter","flutter-package","keyboard-height"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flutter_persistent_keyboard_height","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f-person.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-04T14:45:41.000Z","updated_at":"2023-04-10T11:07:25.000Z","dependencies_parsed_at":"2022-09-02T04:01:12.468Z","dependency_job_id":null,"html_url":"https://github.com/f-person/flutter_persistent_keyboard_height","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/f-person/flutter_persistent_keyboard_height","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-person%2Fflutter_persistent_keyboard_height","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-person%2Fflutter_persistent_keyboard_height/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-person%2Fflutter_persistent_keyboard_height/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-person%2Fflutter_persistent_keyboard_height/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f-person","download_url":"https://codeload.github.com/f-person/flutter_persistent_keyboard_height/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f-person%2Fflutter_persistent_keyboard_height/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29887018,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T05:38:26.446Z","status":"ssl_error","status_checked_at":"2026-02-27T05:38:25.235Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","dart-package","flutter","flutter-package","keyboard-height"],"created_at":"2024-10-02T09:28:18.110Z","updated_at":"2026-02-27T06:05:11.620Z","avatar_url":"https://github.com/f-person.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flutter_persistent_keyboard_height [![Pub version](https://img.shields.io/pub/v/flutter_persistent_keyboard_height.svg)](https://pub.dev/packages/flutter_persistent_keyboard_height)\n\nFlutter package to get keyboard height. The height is persisted during app\nsessions and keyboard states (you can use the height when keyboard is closed).\n\n![](https://github.com/f-person/flutter_persistent_keyboard_height/blob/master/doc/demo.gif?raw=true)\n\n## Usage\n\n#### Registering the provider\n\nFirst thing you need to do is wrap a widget from children of which you want\nto get the keyboard height with `PersistentKeyboardHeightProvider`.\nAdd it to the `builder` of your app widget (perhaps `MaterialApp`) if you\nwant to get keyboard height from all widgets.\n\n```dart\nclass MyApp extends StatelessWidget {\n  const MyApp({Key? key}) : super(key: key);\n\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      title: 'Flutter Persistent Keyboard Height Example',\n      home: const FlutterPersistentKeyboardHeightExample(),\n      builder: (context, child) =\u003e PersistentKeyboardHeightProvider(\n        child: child!,\n      ),\n    );\n  }\n}\n```\n\n#### Getting the keyboard height\nIn order to get keyboard height use the `PersistentKeyboardHeight`\ninherited widget:\n```dart\nWidget build(BuildContext context) {\n  final keyboardHeight = PersistentKeyboardHeight.of(context).keyboardHeight;\n\n  return Scaffold(\n    body: Column(\n      mainAxisAlignment: MainAxisAlignment.center,\n      children: [\n        const Padding(\n          padding: EdgeInsets.all(16.0),\n          child: TextField(\n            decoration: InputDecoration(\n              labelText: 'Flutter Persistent Keyboard Size Example',\n            ),\n          ),\n        ),\n        const SizedBox(height: 8),\n        Text('Keyboard height: $keyboardHeight'),\n      ],\n    ),\n  );\n}\n```\n\n#### Using a custom storage provider\nBy default, the package uses `shared_preferences` to preserve the keyboard\nheight but if you want to use a custom solution for preserving the height\nyou can do that by implementing the `IPersistentKeyboardHeightStorageProvider`\ninterface and passing an instance of the class to `PersistentKeyboardHeightProvider`:\n```dart\nclass CustomPersistentKeyboardHeightStorageProvider\n    implements IPersistentKeyboardHeightStorageProvider {\n  const CustomPersistentKeyboardHeightStorageProvider();\n\n  @override\n  Future\u003cdouble\u003e getHeight() {\n    // read the height from storage\n  }\n\n  @override\n  Future\u003cvoid\u003e setHeight(double height) {\n    // save the height to storage\n  }\n}\n\nclass MyApp extends StatelessWidget {\n  const MyApp({Key? key}) : super(key: key);\n\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      title: 'Flutter Persistent Keyboard Height Example',\n      home: const FlutterPersistentKeyboardHeightExample(),\n      builder: (context, child) =\u003e PersistentKeyboardHeightProvider(\n        child: child!,\n      ),\n    );\n  }\n}\n```\n\n---\n\nCheck out the `example` directory for a complete example app.\n\n## The development process\nThe first version of this package was developed in two livestreams.\nUnfortunately, my voice disappeared at the middle of the first livestream but\nthe second livestream is okay. In case you want to check them out, here are the links: \n[Part 1](https://www.youtube.com/watch?v=Ezks4Ae8rxI), \n[Part 2](https://www.youtube.com/watch?v=eude8Ht9bNI).\n\n## Thanks to\n* The [keyboard_utils](https://github.com/IsaiasSantana/keyboard_utils) package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff-person%2Fflutter_persistent_keyboard_height","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff-person%2Fflutter_persistent_keyboard_height","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff-person%2Fflutter_persistent_keyboard_height/lists"}