我想创建Facebook创建帖子屏幕.

用户界面图像:

enter image description here

我的代码是:

Column(
  children: [
    Row(
      children: [
        CircleAvatar(
          backgroundImage: NetworkImage(userAvatarUrl),
        ),
        Expanded(
          child: Column(
            children: [
              Text(userName),
              Row(
                children: [
                  MaterialButton(
                    …
                  ),
                  MaterialButton(
                    …
                  ),
                ],
              ),
            ],
          ),
        ),
      ],
    ),
    TextFormField(
      …
    ),
  ],
),

如果您需要更多信息,请随时留言.

如何创建Facebook创建帖子屏幕?如果有任何帮助,我将不胜感激.提前谢谢您!

推荐答案

试一下下面的代码,我已经试过和你的设计一样,希望对你有帮助

Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      Row(
        children: [
          Icon(Icons.arrow_back),
          const SizedBox(
            width: 20,
          ),
          Text('Create Post'),
          Spacer(),
          ElevatedButton(
            style: ElevatedButton.styleFrom(backgroundColor: Colors.grey),
            onPressed: () {},
            child: Text('Post'),
          )
        ],
      ),
      Divider(
        thickness: 1,
      ),
      const SizedBox(
        height: 20,
      ),
      ListTile(
        contentPadding: EdgeInsets.zero,
        leading: Image.network(
            'https://upload.wikimedia.org/wikipedia/commons/4/44/Facebook_Logo.png'),
        title: Text("Username Here"),
        subtitle: Padding(
          padding: EdgeInsets.only(top: 10),
          child: Row(
            children: [
              Expanded(
                child: OutlinedButton.icon(
                  style: OutlinedButton.styleFrom(
                      foregroundColor: Colors.grey),
                  onPressed: () {},
                  icon: Icon(Icons.group),
                  label: Row(
                    children: [
                      Text('Friends'),
                      Expanded(
                        child: Icon(
                          Icons.arrow_drop_down,
                        ),
                      )
                    ],
                  ),
                ),
              ),
              const SizedBox(
                width: 20,
              ),
              Expanded(
                child: OutlinedButton.icon(
                  style: OutlinedButton.styleFrom(
                      foregroundColor: Colors.grey),
                  onPressed: () {},
                  icon: Icon(Icons.add),
                  label: Row(
                    children: [
                      Text('Album'),
                      Expanded(
                        child: Icon(
                          Icons.arrow_drop_down,
                        ),
                      ),
                    ],
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
      const SizedBox(
        height: 20,
      ),
      TextFormField(
        maxLines: 5,
        decoration: InputDecoration(
          border: InputBorder.none,
          hintText: 'What\'s on your Mind?',
          hintStyle: TextStyle(fontSize: 20),
        ),
      ),
    ],
  ),

Result-> image

Flutter相关问答推荐

Android Studio中的Ffltter&;Couchbase:进程C:/Program Files/Git/bin/bash以非零退出值35结束

material 3芯片,不能go 除输入芯片小部件上的轮廓

如何使用Dio/Ffltter(前端)和amp;Go(后端)向API发送正确的请求

为什么PUT方法没有发出任何响应?

如何从RealmResults获取Flutter Flutter 流?

Android工作室Flutter 热重新加载更新后不工作

如何处理平台游戏的对象冲突?

使用 forLoops 在 Dart 中进行单元测试会返回 stackoverflow

Flutter CarouselSlider中如何防止右图与放大的中心图重叠?

Select 文本时如何更改 Flutter 中的光标 colored颜色 ?

Flutter列顶部和底部出现不必要的边距问题

Flutter - firebase_auth_web 5.4.0 依赖于 intl ^0.17.0 但我必须使用更高版本 (intl ^0.18.0)

更改 flutter listview 中的布局

MediaQuery 在不同手机上不一致

如何在 GridView.builder 中设置 textform 字段并在 flutter 中将 12 个 textformfield 作为单个字符串获取?

alert 对话框内的 ListView 显示空的透明窗口

如何从 Flutter Slider Widget 中移除发光效果?

有什么方法可以将 ChangeNotifier 与 ValueListenableBuilder 一起使用

Flutter - 异步文件读取异常处理

如何将 pushNamed 与 Dismissible Widget 一起使用并查看背景透明第一页