flutter_emoji_keyboard 0.1.3 copy "flutter_emoji_keyboard: ^0.1.3" to clipboard
flutter_emoji_keyboard: ^0.1.3 copied to clipboard

A Fast and Light ⚡ Emoji Keyboard ✨ Widget (implements compatible emoji support)

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_emoji_keyboard/flutter_emoji_keyboard.dart';

void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Emoji Keyboard'),
        ),
        body: MainPage(),
      ),
    ),
  );
}

class MainPage extends StatelessWidget {
  final TextEditingController controller = TextEditingController();

  void onEmojiSelected(Emoji emoji) {
    controller.text += emoji.text;
  }

  void clearText() => controller.text = '';

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.black38,
      child: Column(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          TextField(
            enableInteractiveSelection: false,
            onTap: () {
              FocusScope.of(context).requestFocus(FocusNode());
            },
            maxLines: 4,
            controller: controller,
            style: TextStyle(
              fontSize: 28,
            ),
            decoration: InputDecoration(
              contentPadding: const EdgeInsets.all(20.0),
            ),
          ),
          FloatingActionButton(
            child: const Icon(Icons.clear),
            onPressed: clearText,
          ),
          EmojiKeyboard(
            onEmojiSelected: onEmojiSelected,
          ),
        ],
      ),
    );
  }
}
22
likes
40
pub points
56%
popularity

Publisher

unverified uploader

A Fast and Light ⚡ Emoji Keyboard ✨ Widget (implements compatible emoji support)

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

device_info, flutter

More

Packages that depend on flutter_emoji_keyboard