flutter - 如何使用颤振将图标放在小吃店内
问题描述
我是新手,我不知道是否可以这样做。我想在文本的左侧放置一个图标。
SnackBar(
backgroundColor: Colors.red,
content: Text(_accion_toast + ". " + mensaje),
duration: Duration(milliseconds: 1500),
);
解决方案
您可以将 的内容参数更改为SnackBar
首先包含 的行Icon
,然后是Text
. 一个例子:
SnackBar(
backgroundColor: Colors.red,
content: Row(
children: <Widget>[
//Icon widget of your choice HERE,
Text(_accion_toast + ". " + mensaje)
]
),
duration: Duration(milliseconds: 1500),
);
推荐阅读
- ios - 如何从模型中的函数接收视图中的异步结果?
- android - 为什么我不能在 Android 的水平线性布局中添加超过 2 个元素?
- javascript - ActionSheet - Ionic 5 - 所有可用邮件 - Ios
- node.js - 错误 [ERR_PACKAGE_PATH_NOT_EXPORTED]:包子路径 './v4' 未由“exports”定义
- javascript - 我应该使用 eval() 来使变量声明动态化吗?
- python - 如何上传文件以避免“413 请求实体太大”错误消息?使用 Python,请求模块
- dataframe - 如何将我保存在 colab 项目中的 csv 文件访问到另一个 colab 项目
- validation - 忽略自定义 TYPO3 验证器中的禁用状态
- python - Django:TypeError:UserRegisterForm()缺少1个必需的位置参数:'UserCreationForm'
- c# - 添加带有委托的按钮侦听器以停止更新方法参数