Emoji Text Field
A universal emoji picker that works with any TextField in Flutter. Easy to integrate with customizable design and comprehensive emoji support featuring 35+ categories and 2700+ emojis.

โจ Features
- ๐ฏ Universal Compatibility - Works with any TextField or TextEditingController
- ๐ฑ Multiple Display Options - Bottom sheet, overlay, or enhanced TextField
- ๐ Smart Search - Keyword-based emoji search ("happy", "love", "food")
- ๐ 35+ Categories - Comprehensive emoji organization including Smileys, Animals, Food, Activities, Travel, Weather, Objects, Symbols, Flags, and more
- ๐จ 2700+ Emojis - Complete Unicode emoji support with latest additions
- โฐ Recent Emojis - Automatically saves recently used emojis
- ๐จ Fully Customizable - Colors, sizes, animations, categories, and keywords
- ๐ณ Haptic Feedback - Enhanced user experience with tactile feedback
- ๐ High Performance - Optimized rendering and smooth animations
- ๐งช Well Tested - Comprehensive unit and widget tests
- ๐ Great Documentation - Clear examples and API documentation
๐ฑ Screenshots
Mobile Demo
Web Demo
๐ Quick Start
Installation
Add this to your package's pubspec.yaml file:
dependencies:
emoji_text_field: ^1.0.0
Then run:
flutter pub get
Basic Usage
1. Enhanced TextField (Recommended)
import 'package:emoji_text_field/emoji_text_field.dart';
EmojiTextField(
controller: textController,
hintText: 'Type a message...',
decoration: const InputDecoration(
border: OutlineInputBorder(),
),
)
2. Manual Bottom Sheet
EmojiTextFieldView.showEmojiKeyboard(
context: context,
textController: textController,
);
3. Overlay Display
EmojiTextFieldView.showEmojiOverlay(
context: context,
textController: textController,
textFieldKey: fieldKey,
);
๐ Advanced Usage
Custom Configuration
EmojiTextField(
controller: textController,
maxLines: 4,
emojiConfig: const EmojiViewConfig(
height: 350,
backgroundColor: Colors.white,
indicatorColor: Colors.blue,
categoryIconColor: Colors.grey,
columns: 8,
enableSearch: true,
showRecentTab: true,
hapticFeedback: true,
searchHintText: 'Search emojis...',
),
decoration: const InputDecoration(
border: OutlineInputBorder(),
hintText: 'Write something...',
),
)
Multiline Support
Perfect for comments, posts, and long-form content:
EmojiTextField(
controller: commentController,
maxLines: 5,
hintText: 'Write your comment...',
decoration: const InputDecoration(
border: OutlineInputBorder(),
alignLabelWithHint: true,
),
)
Integration with Existing TextFields
You can add emoji support to any existing TextField:
TextField(
controller: myController,
decoration: InputDecoration(
hintText: 'Type here...',
suffixIcon: IconButton(
onPressed: () {
EmojiTextFieldView.showEmojiKeyboard(
context: context,
textController: myController,
);
},
icon: const Icon(Icons.emoji_emotions),
),
),
)
Custom Categories and Keywords
final customCategories = {
'favorites': EmojiCategory(
name: 'My Favorites',
icon: Icons.star,
emojis: ['๐', '๐ฅ', '๐ฏ', '๐', 'โค๏ธ'],
),
// ... more categories
};
final customKeywords = {
'๐ฅ': ['fire', 'hot', 'lit', 'awesome', 'trending'],
'๐ฏ': ['hundred', 'perfect', 'score', 'complete'],
// ... more keywords
};
EmojiTextField(
controller: textController,
emojiConfig: EmojiViewConfig(
customCategories: customCategories,
customKeywords: customKeywords,
),
)
๐ Complete Example
import 'package:flutter/material.dart';
import 'package:emoji_text_field/emoji_text_field.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Emoji Text Field Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
useMaterial3: true,
),
home: const EmojiTextFieldExample(),
);
}
}
class EmojiTextFieldExample extends StatefulWidget {
const EmojiTextFieldExample({super.key});
@override
State<EmojiTextFieldExample> createState() => _EmojiTextFieldExampleState();
}
class _EmojiTextFieldExampleState extends State<EmojiTextFieldExample> {
final TextEditingController _messageController = TextEditingController();
final TextEditingController _commentController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey[50],
appBar: AppBar(
title: const Text('Emoji Text Field Demo'),
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
// Enhanced TextField
EmojiTextField(
controller: _messageController,
hintText: 'Type a message with emojis...',
decoration: const InputDecoration(
border: OutlineInputBorder(),
filled: true,
fillColor: Colors.white,
),
),
const SizedBox(height: 16),
// Multiline TextField
EmojiTextField(
controller: _commentController,
hintText: 'Write a comment...',
maxLines: 4,
decoration: const InputDecoration(
border: OutlineInputBorder(),
alignLabelWithHint: true,
filled: true,
fillColor: Colors.white,
),
),
const SizedBox(height: 24),
// Manual Controls
Row(
children: [
Expanded(
child: ElevatedButton.icon(
onPressed: () {
EmojiTextFieldView.showEmojiKeyboard(
context: context,
textController: _messageController,
);
},
icon: const Icon(Icons.emoji_emotions),
label: const Text('Bottom Sheet'),
),
),
const SizedBox(width: 12),
Expanded(
child: ElevatedButton.icon(
onPressed: () {
EmojiTextFieldView.showEmojiOverlay(
context: context,
textController: _commentController,
textFieldKey: GlobalKey(),
);
},
icon: const Icon(Icons.layers),
label: const Text('Overlay'),
),
),
],
),
],
),
),
);
}
}
๐จ Customization Options
| Property | Type | Default | Description |
|---|---|---|---|
height |
double |
300 |
Height of emoji picker |
backgroundColor |
Color |
Color(0xFFF2F2F2) |
Background color |
indicatorColor |
Color |
Colors.blue |
Tab indicator color |
categoryIconColor |
Color |
Colors.grey |
Category icon color |
emojiTextStyle |
TextStyle |
TextStyle(fontSize: 24) |
Emoji text style |
columns |
int |
7 |
Number of emoji columns |
showRecentTab |
bool |
true |
Show recent emojis tab |
maxRecents |
int |
28 |
Maximum recent emojis |
enableSearch |
bool |
true |
Enable search functionality |
searchHintText |
String |
'Search emojis' |
Search placeholder text |
hapticFeedback |
bool |
true |
Enable haptic feedback |
animationDuration |
Duration |
Duration(milliseconds: 250) |
Animation duration |
๐ Emoji Categories (35+)
The plugin includes comprehensive emoji organization:
- ๐ Smileys & People - All face expressions and emotions
- ๐ Gestures & Body - Hand gestures and body parts
- ๐ฅ People & Professions - Different people and jobs
- ๐ถ Animals & Nature - Animals, plants, and nature
- ๐ Food & Drink - All food items and beverages
- โฝ Activities & Sports - Sports, games, and activities
- ๐ Travel & Places - Buildings, transportation, locations
- ๐ค๏ธ Weather & Environment - Weather conditions and climate
- ๐ฑ Objects & Tools - Everyday objects and tools
- โค๏ธ Symbols - Hearts, symbols, and signs
- ๐ Flags - Country and regional flags
- ๐ข Office & Stationery - Work and office items
- ๐ป Technology & Devices - Electronics and gadgets
- ๐ Clothing & Accessories - Fashion and accessories
- ๐ Celebration & Events - Party and celebration items
- ๐ฐ Commerce & Money - Business and financial symbols
- ๐จ Culture & Heritage - Cultural and traditional items
- โค๏ธ Love & Relationships - Romance and relationships
- ๐ฎ Gaming & Entertainment - Games and entertainment
- ๐ Education & Learning - School and education
- โ ๏ธ Danger & Warnings - Safety and warning symbols
- ๐ Buildings & Landmarks - Architecture and landmarks
- ๐ Religious & Spiritual - Religion and spirituality
- ๐งฌ Science & Medical - Science and healthcare
- ๐ Home & Household - Home and domestic items
- ๐ช Health & Wellness - Health and fitness
- ๐จ Tools & Construction - Construction and repair
- ๐ Awards & Achievements - Trophies and recognition
- โบ Outdoors & Adventure - Outdoor activities
- โ๏ธ Cold & Winter - Winter and cold weather
- โ๏ธ Hot & Summer - Summer and hot weather
- ๐งผ Cleaning & Hygiene - Cleaning and personal care
- ๐ผ Business & Work Life - Professional and work life
๐ Search Keywords
The emoji picker includes smart search with keywords:
- Emotions: happy, sad, love, angry, excited, confused
- Actions: wave, clap, thumbs, peace, pray, write
- Objects: phone, car, house, food, drink, music
- Nature: sun, moon, fire, water, tree, flower
- Activities: party, sport, travel, work, study, game
๐ฑ Platform Support
| Platform | Support |
|---|---|
| Android | โ |
| iOS | โ |
| Web | โ |
| macOS | โ |
| Windows | โ |
| Linux | โ |
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Development Setup
git clone https://github.com/mudasir13cs/emoji_text_field.git
cd emoji_text_field
flutter pub get
Running Tests
flutter test
Running Example
cd example
flutter pub get
flutter run
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Flutter team for the amazing framework
- The Flutter community for inspiration and feedback
- All contributors who help improve this package
๐ Support
If you like this package, please give it a โญ on GitHub and a ๐ on pub.flutter-io.cn.
For issues and feature requests, please use the GitHub issue tracker.