Skip to content

Image keyboard support #20796

Description

@netdur

It is possible to implement Commit Content API using Flutter's TextField or TextFormField or any widget?

https://developer.android.com/guide/topics/text/image-keyboard

I am not sure convert this line

layout.addView(createEditTextWithContentMimeTypes(new String[]{"image/gif"}));

from this code example

https://github.com/googlesamples/android-CommitContentSampleApp/blob/master/app/src/main/java/com/example/android/commitcontent/app/MainActivity.java

Activity

  1. added
    c: new featureNothing broken; request for a new capability
    frameworkflutter/packages/flutter repository. See also f: labels.
    engineflutter/engine related. See also e: labels.
    on Aug 19, 2018
  2. added
    a: text inputEntering text in a text field or keyboard related problems
    on Jan 3, 2019
  3. mehmetf commented on May 18, 2019

    @mehmetf
    Contributor

    This came up internally as well as a question. Could we get a comment on the difficulty of this request? It feels like a fairly large one to be able to insert an image to Flutter via IME.

  4. audkar commented on Jul 26, 2019

    @audkar

    Is there any known workarounds? This basically prevents using flutter in any app which has chat functionality for younger audience...

  5. gerry05 commented on Jul 29, 2019

    @gerry05

    Still having a problem with this one. I can't send a gif/sticker. I'm working with a chat app.

  6. wilburx9 commented on Oct 18, 2019

    @wilburx9

    Please is there any update on this?

  7. RuedigerMoeller commented on Jan 2, 2020

    @RuedigerMoeller

    would be fine to at least have a custom callback for special content on TextField. Not necessary to implement full blown richtext editor ..

  8. animeshjain commented on Jan 15, 2020

    @animeshjain

    +1 for the chat use case. Most keyboards have some way to search for GIFs and chat is no fun without all those memes!

  9. robert-virkus commented on Mar 4, 2020

    @robert-virkus

    I am also interested in a workaround. Not to be able to use images from the Android and iOS keyboards is a major constraint for any communication app.

  10. AxesandGrinds commented on Apr 15, 2020

    @AxesandGrinds

    I'm designing a chat app. Not having this feature just makes me feel like a fool for even attempting to use flutter for this app. And I have already gotten really far, I've developed most of the app, >70% and I can't send gifs or stickers, this is in fact evil of the flutter team.

  11. QuentinSc commented on May 6, 2020

    @QuentinSc

    +1 it's a use case Flutter must covered

  12. calistus commented on Jun 4, 2020

    @calistus

    Hi guys any solution on this yet? We are really waiting :)

  13. 64 remaining items

  14. tneotia commented on Sep 30, 2021

    @tneotia
    Contributor

    Yes, you need a Linux or macOS system to compile the engine and use it on release mode. Unfortunately Windows cannot compile so you would be out of luck to make a release build.

  15. justinmc commented on Oct 7, 2021

    @justinmc
    Contributor

    Related: #46418 and #67857

  16. fennelhans commented on Jun 3, 2022

    @fennelhans

    Really looking forward to this.

  17. zanderso commented on Nov 10, 2022

    @zanderso
    Member

    From new feature request scan: @justinmc @GaryQian What is the status of this issue? What is left after flutter-team-archive/engine#35619?

  18. justinmc commented on Nov 15, 2022

    @justinmc
    Contributor

    The framework PR (#110052) is all that remains, and I owe it a review. Will post one today or tomorrow.

  19. ash-hashtag commented on Dec 2, 2022

    @ash-hashtag

    Really waiting for this

  20. zlshames commented on Jan 27, 2023

    @zlshames

    Just an update, with Flutter 3.7, the GIF insertion code is now in the stable engine! All that's left is the merge into the flutter SDK repo here. But this also makes it much easier to manually implement the GIF insertion stuff on the SDK side of things (at least until the PR is merged). No more need to build the engine yourself.

    I'll share our merged 3.7 SDK code with GIF insertion here when we've completed the merge. Should be shortly.

  21. zlshames commented on Jan 27, 2023

    @zlshames

    Here is the SDK with the GIF insertion code merged into it: https://github.com/BlueBubblesApp/flutter

    To use it just follow these instructions:

    1. cd into your flutter repo code on your host (~/snap/flutter/common if you're on Linux)
    2. Run: git remote add upstream [email protected]:BlueBubblesApp/flutter.git
    3. Run: git pull upstream master

    And that should be it. Now you can use the custom GIF insertion code with your text fields by adding a new parameter, like so:

    contentInsertionConfiguration: ContentInsertionConfiguration(onContentInserted: (KeyboardInsertedContent content) {
        # ... your code handling the content
    })
    

    Edit: keep in mind, this is technically not merged into the stable branch of flutter, so it's still subject to changes. That said, I think all the changes that Google has requested, we've fulfilled. So there shouldn't be anything major needing to be changed, and should be compatible with the SDK when it eventually does get merged in.

    Also, to reset your flutter install (remove the GIF insertion code), just run git reset --hard origin/stable in your repo.

  22. zlshames commented on Jan 31, 2023

    @zlshames

    FYI to everyone, this has been merged into Flutter! Shout out to @tneotia for getting it done! #110052 (comment)

  23. haquex19 commented on Feb 8, 2023

    @haquex19

    Was really looking forward to this, nice to know it is now supported. Is the guidance to just use the master channel to use this feature for now until it is in the stable channel?

  24. justinmc commented on Feb 9, 2023

    @justinmc
    Contributor

    Yes, it's in 3.8.0-7.0.pre which is currently only available on master.

  25. vito-go commented on Feb 10, 2023

    @vito-go

    3. git pull upstream master

    very very thank you. It worked. You really did me a favor.
    But in fact the directory is "~/snap/flutter/common/flutter" on my computer(Ubuntu 20.04)

  26. github-actions commented on Mar 3, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  27. locked as resolved and limited conversation to collaborators on Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: text inputEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilitycustomer: crowdAffects or could affect many people, though not necessarily a specific customer.customer: googleVarious Google teamsengineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions