native_emoji_picker 0.1.1 native_emoji_picker: ^0.1.1 copied to clipboard
Flutter plugin to present emoji picker, this calls the underlying swift code to give you nice emoji only picker for your flutter app. This plugin currently supports only iOS.
import 'package:flutter/material.dart';
import 'package:native_emoji_picker/native_emoji_picker.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
var selectedEmoji = "📝";
@override
void initState() {
super.initState();
}
void showPicker() async {
NativeEmojiPicker.showEmojiPickerWith(
initialEmoji: selectedEmoji,
onNewEmoji: (newValue) {
setState(() {
selectedEmoji = newValue;
});
},
);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Native Emoji Picker Example'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'Selected Emoji $selectedEmoji',
style: const TextStyle(
fontSize: 24,
),
),
Center(
child: TextButton(
onPressed: showPicker,
child: const Text(
'Show Picker',
style: TextStyle(
fontSize: 21,
),
),
),
),
],
),
),
);
}
}