v1.0.3keyboard_emoji_picker
기기의 키보드를 사용하여 이모티콘을 선택하는 Flutter 플러그인입니다.
기기 키보드를 사용하여 이모티콘을 선택하는 Flutter 플러그인
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
The keyboard_emoji_picker package provides a simple way to use the device's
native emoji keyboard to pick an emoji. It's currently supported on iOS only.
However, adding support for Android is something I'd like to do in the future
(if you'd like to help, please let me know).

To use KeyboardEmojiPicker, you need to have a KeyboardEmojiPickerWrapper
widget somewhere in your widget tree. This widget will create a hidden
input field in order to make opening the keyboard possible.
import 'package:keyboard_emoji_picker/keyboard_emoji_picker.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
// While this example wraps [MaterialApp], you don't have to.
// You can put it wherever you want to use the picker.
return KeyboardEmojiPickerWrapper(
child: MaterialApp(
title: 'My App',
home: MyHomePage(),
),
);
}
}
Since the package uses the device's keyboard, it's not always available. For
example, if the user has disabled the emoji keyboard, it won't open and will
throw a NoEmojiKeyboardFound exception.
To check if the keyboard is available, you can use the checkHasEmojiKeyboard
method.
final hasEmojiKeyboard = await KeyboardEmojiPicker().checkHasEmojiKeyboard();
if (hasEmojiKeyboard) {
// Open the keyboard.
} else {
// Use another way to pick an emoji or show a dialog asking the user to
// enable the emoji keyboard.
}
To pick an emoji, use the pickEmoji method. It will open the keyboard and
wait for the user to pick an emoji. If the user closes the keyboard, the
method will return null.
It is highly recommended to check if the keyboard is available before calling this method to avoid exceptions.
final emoji = await KeyboardEmojiPicker().pickEmoji();
if (emoji != null) {
// Do something with the emoji
} else {
// The emoji picking process was cancelled (usually, the keyboard was closed).
}
Since the plugin uses a different hidden input than Flutter itself, you need
to close the keyboard manually. To do so, use the closeKeyboard method.
KeyboardEmojiPicker().closeKeyboard();
Contributions are welcome and appreciated! Feel free to open an issue or a pull request!
의존성 목록 4 개
{"sdk":"flutter"}^2.0.2{"sdk":"flutter"}^2.0.0사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗