android - flutter : How to Fix SuffixIcon at the bottom of the Multiline Enable TextField?

标签 android ios flutter textfield

如何像 WhatsApp 一样修复多行启用 TextField 底部的 SuffixIcon?

这是当前场景:

enter image description here

这是我想要实现的目标:

enter image description here

我怎样才能做到这一点?

这是文本域的代码:

Container(
        width: 350,
        padding: EdgeInsets.symmetric(horizontal: 15),
        decoration: BoxDecoration(
            color: Color(0xffEDEDED),
            borderRadius: BorderRadius.circular(20)),
        child: TextFormField(
          keyboardType: TextInputType.multiline,
          maxLines: null,
          decoration: InputDecoration(
              border: InputBorder.none,
              hintText: 'Type here...',
              hintStyle: TextStyle(color: Color(0xff606060), fontSize: 12),
              suffixIcon: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                mainAxisSize: MainAxisSize.min,
                children: [
                  IconButton(
                      icon: Icon(Icons.camera_alt), onPressed: () {}),
                  IconButton(
                      icon: Icon(Icons.send), onPressed: sendMessage),
                ],
              )),
        ),
      )

最佳答案

让我知道这行得通。

Container(
              width: 350,
              padding: EdgeInsets.symmetric(horizontal: 15),
              decoration: BoxDecoration(
                  color: Color(0xffEDEDED),
                  borderRadius: BorderRadius.circular(20)),
              child: TextFormField(
                keyboardType: TextInputType.multiline,
                maxLines: null,
                decoration: InputDecoration(
                    border: InputBorder.none,
                    hintText: 'Type here...',
                    hintStyle: TextStyle(color: Color(0xff606060), fontSize: 12),
                    suffixIcon: Column(
                      mainAxisSize: MainAxisSize.max,
                      mainAxisAlignment: MainAxisAlignment.end,
                      children: [
                        Row(
                          crossAxisAlignment: CrossAxisAlignment.end,
                          mainAxisAlignment: MainAxisAlignment.spaceBetween,
                          mainAxisSize: MainAxisSize.min,
                          children: [
                            IconButton(
                                icon: Icon(Icons.camera_alt), onPressed: () {}),
                            IconButton(icon: Icon(Icons.send), onPressed: () {}),
                          ],
                        ),
                      ],
                    )),
              ),
            ),

关于android - flutter : How to Fix SuffixIcon at the bottom of the Multiline Enable TextField?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65612268/

相关文章:

iphone - UINavigationItem.titleView可以成为FirstResponder吗?

flutter - 错误:类 'QuerySnapshot'没有实例获取方法 'data'

android - 如何在应用栏中添加 Assets 图像作为 Flutter 应用程序中的操作图标?

Flutter,自定义键盘

android - 增加 Android 上 Maps API 的热图半径

android - LazyLoader imageLoader空指针异常?

android - SQLite 和 Android : unable to open database file - error 14

android - SMS 检索器 API SMS Broadcaster 问题

iOS Swift 二维数组排序

ios - 通过 URL 将 token 传递到 Webview IOS Swift