Skip to content

aimsugita/flutter-keyboard-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter Keyboard Plugin

A Flutter plugin to detect keyboard events on Android. Useful for non-touchscreen devices.

Sponsor

pub package

Example

The example app can show detected events in a ListView.

It's present in the usual example directory.

$ git clone https://github.com/devxpy/flutter-keyboard-plugin.git
$ cd flutter-keyboard-plugin/example
$ flutter run

Installation

Since flutter plugins don't have access to the regular Activity events, you also, need to make a small change to the android/app/src/main/kotlin/.../MainActivity.kt file in your project.

Just replace FlutterActivity() by KeyboardPluginActivity().

Here's what it should look like:-

import android.os.Bundle
import com.pycampers.keyboard.KeyboardPluginActivity
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity : KeyboardPluginActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        GeneratedPluginRegistrant.registerWith(this)
    }
}

Then just follow the regular plugin installation on dart pub.

About

Flutter plugin to detect keyboard events.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 87.1%
  • Ruby 6.6%
  • Kotlin 3.4%
  • Swift 2.1%
  • Objective-C 0.8%