小编ILi*_*Lii的帖子

flutter :单击小部件内的按钮后如何将小部件更改为另一个小部件

我在容器内有这个按钮,如下所示:\n在此处输入图像描述

\n

我想在单击该按钮后将该容器更改为同一容器中的文本字段,如下所示:

\n

在此输入图像描述

\n

所以,请 !有什么想法可以帮忙!谢谢

\n
Container(\n                height: 96,\n                width: MediaQuery.of(context).size.width - 24,\n                decoration: BoxDecoration(\n                    borderRadius: BorderRadius.circular(5),\n                    color: colorPrimary,\n                    border:\n                        Border.all(width: 0.5, color: Colors.redAccent)),\n                child: Padding(\n                    padding: const EdgeInsets.all(8.0),\n                    child: Row(\n                      children: <Widget>[\n                        Column(\n                          mainAxisAlignment: MainAxisAlignment.center,\n                          children: <Widget>[\n                        Column(\n                          mainAxisAlignment: MainAxisAlignment.center,\n                          children: <Widget>[\n                            InkWell(\n                              onTap: () {\n                                setState(() {});\n                              },\n                              child: Container(\n                                  height: 62,\n                                  width: 62,\n                                  decoration: BoxDecoration(\n                                      color: Colors.white,\n                                      borderRadius:\n                                          BorderRadius.circular(60),\n                                      border: Border.all(\n                                        width: 0.5,\n                                        color: Colors.grey[300],\n                                      )),\n                                  child: Icon(\n                                    Icons.phone,\n                                    size: 30,\n                                    color: Colors.purple[100],\n …
Run Code Online (Sandbox Code Playgroud)

widget button setstate dart flutter

2
推荐指数
1
解决办法
8971
查看次数

标签 统计

button ×1

dart ×1

flutter ×1

setstate ×1

widget ×1