-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
9946672
commit 5e0f72e
Showing
93 changed files
with
3,768 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
migrate_working_dir/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
/pubspec.lock | ||
**/doc/api/ | ||
.dart_tool/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: "80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819" | ||
channel: "[user-branch]" | ||
|
||
project_type: plugin | ||
|
||
# Tracks metadata for the flutter migrate command | ||
migration: | ||
platforms: | ||
- platform: root | ||
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 | ||
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 | ||
- platform: android | ||
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 | ||
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 | ||
- platform: ios | ||
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 | ||
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 | ||
- platform: web | ||
create_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 | ||
base_revision: 80c2e84975bbd28ecf5f8d4bd4ca5a2490bfc819 | ||
|
||
# User provided section | ||
|
||
# List of Local paths (relative to this file) that should be | ||
# ignored by the migrate tool. | ||
# | ||
# Files that are not part of the templates will be ignored by default. | ||
unmanaged_files: | ||
- 'lib/main.dart' | ||
- 'ios/Runner.xcodeproj/project.pbxproj' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## [0.1.0] - [DATE] | ||
Initial release: | ||
* iOS: Reports keyboard closed, opening, open, and closing. No keyboard height. | ||
* Android: Reports keyboard closed, opening, open, and closing, as well as keyboard height. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright (c) 2021 Superlist, SuperDeclarative! and the contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Super Keyboard | ||
A plugin that reports keyboard visibility and size. | ||
|
||
## Support Platforms | ||
This plugin supports iOS and Android. | ||
|
||
## Unified API | ||
For users that don't care about differences between how iOS and Android report | ||
keyboard information, the easiest way to use `super_keyboard` is through the | ||
unified (lowest common denominator) API. | ||
|
||
Build a widget subtree based on the keyboard state: | ||
```dart | ||
@override | ||
Widget build(BuildContext context) { | ||
return SuperKeyboardBuilder( | ||
builder: (context, keyboardState) { | ||
// TODO: do something with the keyboard state. | ||
return const SizedBox(); | ||
} | ||
); | ||
} | ||
``` | ||
|
||
Directly listen for changes to the keyboard state: | ||
```dart | ||
void startListeningToKeyboardState() { | ||
SuperKeyboard.instance.state.addListener(_onKeyboardStateChange); | ||
} | ||
void stopListeningToKeyboardState() { | ||
SuperKeyboard.instance.state.removeListener(_onKeyboardStateChange); | ||
} | ||
void _onKeyboardStateChange(KeyboardState newState) { | ||
// TODO: do something with the new keyboard state. | ||
} | ||
``` | ||
|
||
Activate logs: | ||
```dart | ||
SuperKeyboard.initLogs(); | ||
``` | ||
|
||
## iOS and Android | ||
Platform-specific APIs are also available. The unified `SuperKeyboard` API | ||
delegates to the platform-specific APIs under the hood. | ||
|
||
iOS is available in `SuperKeyboardIOS`. | ||
|
||
Android is available in `SuperKeyboardAndroid`. | ||
|
||
Per-platform APIs are made available because each platform reports keyboard | ||
state and height in different ways. Those reporting methods may, or may not | ||
be compatible with each in general. Also, one platform might report more | ||
keyboard information than the other. We want to provide the maximum information | ||
possible to users, which can't be done with a lowest common denominator API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/workspace.xml | ||
/.idea/libraries | ||
.DS_Store | ||
/build | ||
/captures | ||
.cxx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
group = "com.flutterbountyhunters.superkeyboard.super_keyboard" | ||
version = "1.0-SNAPSHOT" | ||
|
||
buildscript { | ||
ext.kotlin_version = "1.7.10" | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
classpath("com.android.tools.build:gradle:7.3.0") | ||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
apply plugin: "com.android.library" | ||
apply plugin: "kotlin-android" | ||
|
||
android { | ||
if (project.android.hasProperty("namespace")) { | ||
namespace = "com.flutterbountyhunters.superkeyboard.super_keyboard" | ||
} | ||
|
||
compileSdk = 34 | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
sourceSets { | ||
main.java.srcDirs += "src/main/kotlin" | ||
test.java.srcDirs += "src/test/kotlin" | ||
} | ||
|
||
defaultConfig { | ||
minSdk = 21 | ||
} | ||
|
||
dependencies { | ||
testImplementation("org.jetbrains.kotlin:kotlin-test") | ||
testImplementation("org.mockito:mockito-core:5.0.0") | ||
} | ||
|
||
testOptions { | ||
unitTests.all { | ||
useJUnitPlatform() | ||
|
||
testLogging { | ||
events "passed", "skipped", "failed", "standardOut", "standardError" | ||
outputs.upToDateWhen {false} | ||
showStandardStreams = true | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = 'super_keyboard' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.flutterbountyhunters.superkeyboard.super_keyboard"> | ||
</manifest> |
Oops, something went wrong.