emoji_pick 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 60

Flutter Emoji #

pub package

A Flutter package that provides an Emoji.

Usage #

To use this plugin, add emoji_pick as dependency in your pubspec.yaml file.

Output #

![](https://raw.githubusercontent.com/asif4483/emoji_pick/master/emoji_pick3`enter code here`.jpg)

Sample Usage #

import 'package:flutter/material.dart';  
  
import 'emojis.dart';  
  
void main() {  
  runApp(MaterialApp(  
    home: MyApp(),  
  ));  
}  
  
class MyApp extends StatefulWidget {  
  @override  
  _MyAppState createState() => _MyAppState();  
}  
  
class _MyAppState extends State<MyApp> {  
  
  
  
  
  List<String> _messages = [];  
  String _message = '';  
  
  //MOST IMP
  var emojiheight = 0.0;  
  
  TextEditingController textFieldController;  
  
  
  
  @override  
  void initState() {  
    // TODO: implement initState  
  super.initState();  
  
    textFieldController = new TextEditingController()  
      ..addListener(() {  
        setState(() {  
          _message = textFieldController.text;  
        });  
      });  
  }  
  
  
  @override  
  Widget build(BuildContext context) {  
  
    List<String> _tabsname = [  
      "Face",  
      "Fruits",  
      "Fruits",  
      "Asif"];  
    List<dynamic> _tabsemoji = [  
      ["☕","❤","☕","☕","☕","❤"],  
      ["☕","❤","☕","☕","☕","❤","☕","❤","☕","☕","☕","❤"],  
      ["☕","❤","☕","☕","☕","❤","☕","❤","☕","☕","☕","❤","☕","❤","☕","☕","☕","❤","☕","❤","☕","☕","☕","❤"]  
    ];  
  
  
  
    return Scaffold(  
      backgroundColor: Colors.white,  
      appBar: AppBar(title: Text("Emoji Demo"),),  
      body: Column(  
        children: <Widget>[  
  
          Expanded(child: _messages.length !=0 ? ListView.builder(itemBuilder: (BuildContext contx,int index){  
  
            return Container(  
              padding: EdgeInsets.all(10),  
              child: Text(_messages.elementAt(index),style: TextStyle(fontSize: 27),),  
            );  
  
          },itemCount: _messages.length,)   
              : Center(child: Text("Send some MSG"),)),  
  
          Padding(  
            padding: const EdgeInsets.all(8.0),  
            child: Row(  
              mainAxisSize: MainAxisSize.max,  
              children: <Widget>[  
                Flexible(  
                  flex: 1,  
                  child: Container(  
                    decoration: BoxDecoration(  
                      borderRadius:  
                      BorderRadius.all(const Radius.circular(30.0)),  
                      color: Colors.white,  
                      boxShadow: [  
                        new BoxShadow(color: Colors.black12,blurRadius: 10,spreadRadius: 4)  
                      ]  
                    ),  
                    child: Row(  
                      children: <Widget>[  
                        IconButton(  
                          padding: const EdgeInsets.all(0.0),  
                          splashColor: Colors.white,  
                          hoverColor: Colors.white,  
                          highlightColor: Colors.white,  
                          disabledColor: Colors.grey,  
                          color: Colors.blue,  
                          icon: Icon(Icons.insert_emoticon),  
                          onPressed: () {  
                          
                          //MOST IMP
                            if(emojiheight == 0.0){  
                              setState(() {  
                                emojiheight = 255.0;  
                              });  
                            }  
                            else{  
                              setState(() {  
                                emojiheight = 0.0;  
                              });  
                            }  
  
  
                          },  
                        ),  
                        Flexible(  
                          child: TextField(  
                            controller: textFieldController,  
                            onTap: (){  
                            //MOST IMP
                              setState(() {  
                                emojiheight = 0.0;  
                              });  
                            },  
                            textCapitalization: TextCapitalization.sentences,  
                            decoration: InputDecoration(  
                              border: InputBorder.none,  
                              contentPadding: const EdgeInsets.all(0.0),  
                              hintText: 'Type a message',  
                              hintStyle: TextStyle(  
                                fontSize: 16.0,  
                              ),  
                              counterText: '',  
                            ),  
                            keyboardType: TextInputType.multiline,  
                            maxLines: null,  
                            maxLength: 100,  
                          ),  
                        ),  
  
  
                      ],  
                    ),  
                  ),  
                ),  
                Padding(  
                  padding: const EdgeInsets.only(left: 4.0),  
                  child: FloatingActionButton(  
                    elevation: 2.0,  
                    backgroundColor: Colors.blue,  
                    foregroundColor: Colors.white,  
                    child: Icon(Icons.send),  
                    onPressed: (){  
  
                      setState(() {  
                        _messages.add(textFieldController.text.toString());  
                      });  
  
                      textFieldController.clear();  
                    },  
                  ),  
                )  
              ],  
            ),  
          ),  
  
	 //MOST IMP
          Emojies(  
            tabsname: _tabsname,  
            tabsemoji: _tabsemoji,  
            maxheight: emojiheight,  
            inputtext: textFieldController,  
            bgcolor: Colors.white),  
  
  
  
        ],  
      ),  
    );  
  }  
  
  
  
  
}

See the example directory for the complete sample app.

[0.1.0] - 07/06/2020 #

  • Added documentation

example/main.dart

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



void main() {
  runApp(MaterialApp(
    home: MyApp(),
  ));
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {




  List<String> _messages = [];
  String _message = '';

  var emojiheight = 0.0;
  TextEditingController textFieldController;



  @override
  void initState() {
    // TODO: implement initState
    super.initState();

    textFieldController = new TextEditingController()
      ..addListener(() {
        setState(() {
          _message = textFieldController.text;
        });
      });
  }


  @override
  Widget build(BuildContext context) {

    List<String> _tabsname = [
      "Face",
      "Fruits",
      "Fruits",
      "Asif"];
    List<dynamic> _tabsemoji = [
      ["☕","❤","☕","☕","☕","❤"],
      ["☕","❤","☕","☕","☕","❤","☕","❤","☕","☕","☕","❤"],
      ["☕","❤","☕","☕","☕","❤","☕","❤","☕","☕","☕","❤","☕","❤","☕","☕","☕","❤","☕","❤","☕","☕","☕","❤"]
    ];



    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(title: Text("Emoji Demo"),),
      body: Column(
        children: <Widget>[

          Expanded(child: _messages.length !=0 ? ListView.builder(itemBuilder: (BuildContext contx,int index){

            return Container(
              padding: EdgeInsets.all(10),
              child: Text(_messages.elementAt(index),style: TextStyle(fontSize: 27),),
            );

          },itemCount: _messages.length,) 
              : Center(child: Text("Send some MSG"),)),

          Padding(
            padding: const EdgeInsets.all(8.0),
            child: Row(
              mainAxisSize: MainAxisSize.max,
              children: <Widget>[
                Flexible(
                  flex: 1,
                  child: Container(
                    decoration: BoxDecoration(
                      borderRadius:
                      BorderRadius.all(const Radius.circular(30.0)),
                      color: Colors.white,
                      boxShadow: [
                        new BoxShadow(color: Colors.black12,blurRadius: 10,spreadRadius: 4)
                      ]
                    ),
                    child: Row(
                      children: <Widget>[
                        IconButton(
                          padding: const EdgeInsets.all(0.0),
                          splashColor: Colors.white,
                          hoverColor: Colors.white,
                          highlightColor: Colors.white,
                          disabledColor: Colors.grey,
                          color: Colors.blue,
                          icon: Icon(Icons.insert_emoticon),
                          onPressed: () {

                            if(emojiheight == 0.0){
                              setState(() {
                                emojiheight = 255.0;
                              });
                            }
                            else{
                              setState(() {
                                emojiheight = 0.0;
                              });
                            }


                          },
                        ),
                        Flexible(
                          child: TextField(
                            controller: textFieldController,
                            onTap: (){
                              setState(() {
                                emojiheight = 0.0;
                              });
                            },
                            textCapitalization: TextCapitalization.sentences,
                            decoration: InputDecoration(
                              border: InputBorder.none,
                              contentPadding: const EdgeInsets.all(0.0),
                              hintText: 'Type a message',
                              hintStyle: TextStyle(
                                fontSize: 16.0,
                              ),
                              counterText: '',
                            ),
                            onSubmitted: (String text) {
                              /*if(_textInputAction == TextInputAction.send) {
                                _sendMessage();
                              }*/
                            },
                            keyboardType: TextInputType.multiline,
                            maxLines: null,
                            maxLength: 100,
                          ),
                        ),


                      ],
                    ),
                  ),
                ),
                Padding(
                  padding: const EdgeInsets.only(left: 4.0),
                  child: FloatingActionButton(
                    elevation: 2.0,
                    backgroundColor: Colors.blue,
                    foregroundColor: Colors.white,
                    child: Icon(Icons.send),
                    onPressed: (){

                      setState(() {
                        _messages.add(textFieldController.text.toString());
                      });

                      textFieldController.clear();
                    },
                  ),
                )
              ],
            ),
          ),



          Emojies(
            tabsname: _tabsname,
            tabsemoji: _tabsemoji,
            maxheight: emojiheight,
            inputtext: textFieldController,
            bgcolor: Colors.white),



        ],
      ),
    );
  }




}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  emoji_pick: ^0.1.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:emoji_pick/emoji_pick.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
20
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

Because:

  • emoji_pick that is a package requiring null.

Health suggestions

Fix lib/emoji_pick.dart. (-0.50 points)

Analysis of lib/emoji_pick.dart reported 1 hint:

line 8 col 7: This class (or a class that this class inherits from) is marked as '@immutable', but one or more of its instance fields aren't final: Emojies.maxheight

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.2
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test