skip to Main Content

i have the following column

 late  final TextEditingController controller = TextEditingController();
    Column(
    children:[
     GestureDetector(
         onTap: (){
          // 1- here How can i copy the emoji 
          // 2- add it to controller (locate it to the current location where text field cursor located )
         },
        child: Text('🙂')
       ),
        TextField(
        controller: controller ,
        )
     ]
    )

1- here How can i copy the emoji

2- add it to controller (fitting it to the current location where text field cursor located )

2

Answers


  1. Emoji Picker

    You can use this library.

    Login or Signup to reply.
  2. try this

     GestureDetector(
              onTap: () {
                String text = controller.text + '🙂';
                setState(() {
                  controller.value = TextEditingValue(
                      text: text,
                      selection: TextSelection(
                          baseOffset: text.length, extentOffset: text.length));
                });
              },
              child: Text('🙂')),
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search