flutter - 如何添加容器小部件?我可以点击并得到答案
问题描述
我想将此容器保留为一个按钮,我可以单击它。
Container(
margin: const EdgeInsets.all(15.0),
padding: const EdgeInsets.all(3.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.blueAccent)
),
child: Text("AAAAAA"),
)
解决方案
用墨水瓶包裹它,
InkWell(
onTap:(){},//call your function here
child: Container(
margin: const EdgeInsets.all(15.0),
padding: const EdgeInsets.all(3.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.blueAccent)
),
child: Text("AAAAAA"),
),
),
推荐阅读
- r - 使用 ggplot2 创建均值分组条形图
- python-3.x - 我有我的作业代码。我不知道如何修复错误。我得到一个类型错误
- python-3.x - Ubuntu 上的 Tensorflowhub 负载问题
- python - 熊猫的 qcut 可能四舍五入?
- php - 如何在 php 或其框架中找到“::get”?
- c# - 如何在 TempDataDictionary 中使用另一个类的类型列表?
- java - 由于缺少 CSRF 令牌,带有 XSSFilter 的 SpringBoot 无法进行身份验证
- c++ - C++中new运算符的运算符重载
- php - 如何使用预填充的附件打开 Outlook 的新邮件窗口?(PHP)
- reactjs - React Redux Typescript 从函数调用调度操作