V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
cxxnullptr
V2EX  ›  Flutter

Flutter 如何优雅的实现一个 KeyboardBar?

  •  
  •   cxxnullptr · 13 天前 · 404 次点击

    参考 这个回答, 我用 Scaffold + bottomSheet 简单实现了一个,但有个问题,就是使用 image_picker 选取图片后,自定义的 KeyboardBarbottomSheet)会被键盘遮住一部分,具体可以看我提的 issue

    参考 这个回答 重新实现了一下,也是一模一样的问题,似乎是 Flutter 的 MediaQuery.of(context).viewInsets.bottom 出现了 BUG 。

    相关 issue:

    现在 App 着急上线,但不知道 Flutter 什么时候能修复这个 BUG ,是否还有其它方式能实现相同的功能呢?

    2 条回复    2024-04-28 13:09:58 +08:00
    binhb
        1
    binhb  
       13 天前
    选取完图片你把键盘隐藏掉,不就避免了吗
    (如果键盘需要打开的话,让输入框重新 focus )
    cxxnullptr
        2
    cxxnullptr  
    OP
       13 天前
    @binhb 是个好的思路,我尝试一下,感谢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2903 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 13:07 · PVG 21:07 · LAX 06:07 · JFK 09:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.