flutter - 如何证明颤动列小部件中的文本?
问题描述
我想用填充垂直对齐左侧元素并且与右侧元素相同,这是我得到的结果,元素未对齐,我无法在第二行中插入填充,以便左侧元素对齐
return InkWell(
child: Column(
children: <Widget>[
Row(
children:<Widget> [
Padding(padding:EdgeInsets.fromLTRB(18.0, 0.0, 0.0, 0.0)),
Text(
product.libelle,
style: theme.textTheme.title,
maxLines: 1,
textAlign: TextAlign.left,
),]),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:<Widget> [
Text(
product.description,
style: theme.textTheme.subtitle,
maxLines: 1,
),
RaisedButton( onPressed: () {},
child: new Text("S\'abonner"),
)
]),
),
);
解决方案
使用文本小部件和 TextAlign.justify :)
Text('my String', textAlign: TextAlign.justify),
推荐阅读
- javascript - 如何配置卡片,让所有卡片的宽度相同,不管电影的标题在 React Native 中有多红?
- flutter - Flutter 模块可以充当插件/包吗?
- python - 在 python 中使用交互项进行多重线性回归
- reactjs - 路由器中的反应开关正在渲染所有匹配的路由元素
- python-3.x - 如何检查列表中的递增元素
- bash - 在 bash 中使用 md5sum 时重定向标准输出时出现意外行为
- angular - Angular Material DatePicker 未将日期转换为 UTC 格式
- flutter - 屏幕底部有多个 FAB
- npm - 构建 yii2 入门套件 webpack 部分时出错:EAI_AGAIN,XSym:未找到,0025:未找到,webpack.js:未找到
- cordova - Cordova 中的付款请求 API