Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins:
flutter_inappwebview: ["tv-9.0"]
flutter_tts: ["tv-9.0"]
integration_test: ["tv-9.0"]
keyboard_detection_tizen: ["tv-9.0"]
messageport: ["tv-9.0"]
package_info_plus: ["tv-9.0"]
path_provider: ["tv-9.0"]
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**google_sign_in_tizen**](packages/google_sign_in) | [google_sign_in](https://pub.dev/packages/google_sign_in) (1st-party) | [![pub package](https://img.shields.io/pub/v/google_sign_in_tizen.svg)](https://pub.dev/packages/google_sign_in_tizen) | No |
| [**in_app_purchase_tizen**](packages/in_app_purchase) | [in_app_purchase](https://pub.dev/packages/in_app_purchase) (1st-party) | [![pub package](https://img.shields.io/pub/v/in_app_purchase_tizen.svg)](https://pub.dev/packages/in_app_purchase_tizen) | No |
| [**integration_test_tizen**](packages/integration_test) | [integration_test](https://github.com/flutter/flutter/tree/main/packages/integration_test) (1st-party) | [![pub package](https://img.shields.io/pub/v/integration_test_tizen.svg)](https://pub.dev/packages/integration_test_tizen) | No |
| [**keyboard_detection_tizen**](packages/keyboard_detection_tizen) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/keyboard_detection_tizen.svg)](https://pub.dev/packages/keyboard_detection_tizen) | N/A |
| [**messageport_tizen**](packages/messageport) | (Tizen-only) | [![pub package](https://img.shields.io/pub/v/messageport_tizen.svg)](https://pub.dev/packages/messageport_tizen) | N/A |
| [**network_info_plus_tizen**](packages/network_info_plus) | [network_info_plus](https://pub.dev/packages/network_info_plus) (1st-party) | [![pub package](https://img.shields.io/pub/v/network_info_plus_tizen.svg)](https://pub.dev/packages/network_info_plus_tizen) | No |
| [**package_info_plus_tizen**](packages/package_info_plus) | [package_info_plus](https://pub.dev/packages/package_info_plus) (1st-party) | [![pub package](https://img.shields.io/pub/v/package_info_plus_tizen.svg)](https://pub.dev/packages/package_info_plus_tizen) | No |
Expand Down Expand Up @@ -68,6 +69,7 @@ The _"non-endorsed"_ status means that the plugin is not endorsed by the origina
| [**google_sign_in_tizen**](packages/google_sign_in) | ✔️ | ✔️ | ✔️ |
| [**in_app_purchase_tizen**](packages/in_app_purchase) | ✔️ | ❌ | ❌ | Only applicable for TV |
| [**integration_test_tizen**](packages/integration_test) | ✔️ | ✔️ | ✔️ |
| [**keyboard_detection_tizen**](packages/keyboard_detection_tizen) | ✔️ | ✔️ | ✔️ |
| [**messageport_tizen**](packages/messageport) | ✔️ | ✔️ | ✔️ |
| [**network_info_plus_tizen**](packages/network_info_plus) | ✔️ | ❌ | ✔️ | API not supported on emulator. Need plugin-prebuilt to run wifi on RPI. |
| [**package_info_plus_tizen**](packages/package_info_plus) | ✔️ | ✔️ | ✔️ |
Expand Down
26 changes: 26 additions & 0 deletions packages/keyboard_detection_tizen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
build/
3 changes: 3 additions & 0 deletions packages/keyboard_detection_tizen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.1.0

* Initial release.
25 changes: 25 additions & 0 deletions packages/keyboard_detection_tizen/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Copyright (c) 2026 Samsung Electronics Co., Ltd. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the copyright holder nor the names of the
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 changes: 55 additions & 0 deletions packages/keyboard_detection_tizen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# keyboard_detection_tizen

A Tizen-specific Flutter plugin that detects software keyboard (input panel)
visibility and size on Tizen devices. The public API mirrors the
[`keyboard_detection`](https://pub.dev/packages/keyboard_detection) package.

The original `keyboard_detection` package detects keyboard visibility from
`MediaQuery.viewInsets.bottom`, which is not populated on Tizen. This plugin
listens to the `tizen/internal/inputpanel` event channel exposed by the
flutter-tizen embedder instead, and reads the keyboard geometry (height,
width, position) from the same channel.

Requires a flutter-tizen embedder that publishes geometry alongside the
state on the `tizen/internal/inputpanel` channel.

## Usage

```yaml
dependencies:
keyboard_detection_tizen: ^0.1.0
```

```dart
import 'package:keyboard_detection_tizen/keyboard_detection_tizen.dart';

final controller = KeyboardDetectionController(
onChanged: (state) => debugPrint('keyboard: $state'),
);

@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
const TextField(),
StreamBuilder<KeyboardState>(
stream: controller.stream,
builder: (_, snapshot) => Text(
'state: ${snapshot.data ?? KeyboardState.unknown} '
'size: ${controller.size}',
),
),
],
),
);
}
```

## Limitations

- The Tizen input panel channel emits `show` / `hide` / `will_show` only.
`KeyboardState.hiding` is therefore never reached on Tizen.
- Geometry values are physical pixels reported by `ecore_imf`. Convert with
`MediaQueryData.devicePixelRatio` if you need logical pixels.
- Floating / split keyboards are not supported.
32 changes: 32 additions & 0 deletions packages/keyboard_detection_tizen/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json
7 changes: 7 additions & 0 deletions packages/keyboard_detection_tizen/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# keyboard_detection_tizen_example

Demonstrates how to use the `keyboard_detection_tizen` plugin.

## Getting Started

To run this app on your Tizen device, use [flutter-tizen](https://github.com/flutter-tizen/flutter-tizen).
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright 2026 Samsung Electronics Co., Ltd. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:keyboard_detection_tizen/keyboard_detection_tizen.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

const String channelName = 'tizen/internal/inputpanel';
const StandardMethodCodec codec = StandardMethodCodec();

Future<void> emit(WidgetTester tester, Map<String, Object?> payload) async {
final ByteData data = codec.encodeSuccessEnvelope(payload);
await tester.binding.defaultBinaryMessenger.handlePlatformMessage(
channelName,
data,
(_) {},
);
}

testWidgets('reports visible on show event', (WidgetTester tester) async {
final KeyboardDetectionController controller =
KeyboardDetectionController();
await emit(tester, <String, Object?>{'state': 'show'});
await tester.pump();
expect(controller.state, KeyboardState.visible);
expect(controller.stateAsBool(), isTrue);
await controller.dispose();
});

testWidgets('reports hidden on hide event', (WidgetTester tester) async {
final KeyboardDetectionController controller =
KeyboardDetectionController();
await emit(tester, <String, Object?>{'state': 'show'});
await tester.pump();
await emit(tester, <String, Object?>{'state': 'hide'});
await tester.pump();
expect(controller.state, KeyboardState.hidden);
expect(controller.stateAsBool(), isFalse);
await controller.dispose();
});
}
110 changes: 110 additions & 0 deletions packages/keyboard_detection_tizen/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// Copyright 2026 Samsung Electronics Co., Ltd. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// ignore_for_file: public_member_api_docs

import 'package:flutter/material.dart';
import 'package:keyboard_detection_tizen/keyboard_detection_tizen.dart';

void main() {
runApp(const MyApp());
}

class MyApp extends StatelessWidget {
const MyApp({super.key});

@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'keyboard_detection_tizen example',
theme: ThemeData(primarySwatch: Colors.blue),
home: const HomePage(),
);
}
}

class HomePage extends StatefulWidget {
const HomePage({super.key});

@override
State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
late final KeyboardDetectionController _controller;

@override
void initState() {
super.initState();
_controller = KeyboardDetectionController(
onChanged: (KeyboardState state) {
debugPrint('keyboard_detection_tizen: $state');
},
);
}

@override
void dispose() {
_controller.dispose();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Keyboard Detection')),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(24),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
StreamBuilder<KeyboardState>(
stream: _controller.stream,
initialData: _controller.state,
builder: (BuildContext _, AsyncSnapshot<KeyboardState> snap) {
final KeyboardState s = snap.data ?? KeyboardState.unknown;
return Column(
key: const Key('status'),
children: <Widget>[
Text(
'state: ${s.name}',
key: const Key('state-text'),
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 8),
Text(
'visible: ${_controller.stateAsBool() ?? "unknown"}',
key: const Key('visible-text'),
),
const SizedBox(height: 8),
Text(
'width: ${_controller.width.toStringAsFixed(1)} '
'/ size(height): ${_controller.size.toStringAsFixed(1)} ',
key: const Key('size-text'),
),
const SizedBox(height: 8),
Text(
'position: '
'(${_controller.position.dx.toStringAsFixed(1)}, '
'${_controller.position.dy.toStringAsFixed(1)})',
key: const Key('position-text'),
),
],
);
},
),
const SizedBox(height: 32),
const TextField(
decoration: InputDecoration(
labelText: 'Tap here to open keyboard',
),
),
],
),
),
),
);
}
}
26 changes: 26 additions & 0 deletions packages/keyboard_detection_tizen/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: keyboard_detection_tizen_example
description: Demonstrates how to use the keyboard_detection_tizen plugin.
publish_to: "none"

environment:
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"

dependencies:
flutter:
sdk: flutter
keyboard_detection_tizen:
path: ../

dev_dependencies:
flutter_driver:
sdk: flutter
flutter_test:
sdk: flutter
integration_test:
sdk: flutter
integration_test_tizen:
path: ../../integration_test/

flutter:
uses-material-design: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'package:integration_test/integration_test_driver.dart';

Future<void> main() => integrationDriver();
12 changes: 12 additions & 0 deletions packages/keyboard_detection_tizen/example/tizen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
flutter/
.vs/
*.user
bin/
obj/

# Tizen Core CLI (tz) related files
tizen_dotnet_project.yaml
*.csproj.backup

# Flutter-tizen dependency information file
.app.deps.json
Loading
Loading