【问题标题】:Is it possible to build side-by-side feature comparison table using flutter dart? how?是否可以使用颤振飞镖构建并排特征比较表?如何?
【发布时间】:2019-04-05 16:26:51
【问题描述】:

只是想知道标准库(以及如何)Flutter dart 是否可以构建并排的列式表(例如那些功能比较表,用于表示不同型号的 android 手机等)。请注意,我们还需要它是网络可访问性,因此对讲/旁白需要逐列阅读屏幕。

【问题讨论】:

标签: dart flutter


【解决方案1】:

您可以使用它并根据需要进行修改。

@override
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(title: Text("Testing")),
    body: Padding(
      padding: const EdgeInsets.all(4),
      child: Table(
        columnWidths: {
          0: FlexColumnWidth(),
          1: FlexColumnWidth(0.02),
          2: FlexColumnWidth(),
        },
        children: [
          TableRow(children: [_buildBox("Android is cool"), SizedBox(), _buildBox("iOS is hot")]),
          TableRow(children: [_buildBox("Android is flexible"), SizedBox(), _buildBox("iOS isn't")]),
          TableRow(children: [_buildBox("Android is dashing"), SizedBox(), _buildBox("No comments")]),
        ],
      ),
    ),
  );
}

Widget _buildBox(String title) {
  return Container(
    decoration: BoxDecoration(
      color: Colors.blue,
      border: Border(top: BorderSide(color: Colors.black)),
    ),
    height: 44,
    alignment: Alignment.center,
    child: Text(
      title,
      style: TextStyle(fontSize: 20, color: Colors.white),
    ),
  );
}

【讨论】:

  • 感谢您的贡献。顺便说一句,如果以您建议的方式实施,对讲是否会按列读取(即先读取所有第 1 列,然后是第 2 列)
  • 很抱歉我之前没有使用过这个选项,所以我不能告诉你这是否可行,但我认为它会。
猜你喜欢
  • 1970-01-01
  • 2019-11-21
  • 2022-11-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-11-28
  • 2022-01-16
  • 1970-01-01
相关资源
最近更新 更多