简体   繁体   English

Flutter 用按钮创建特殊表

[英]Flutter create special table with button

I have a small task, however, I've been trying to reproduce this in Flutter for 2 days, but can't manage it, unfortunately.我有一个小任务,但是,我一直试图在 Flutter 中重现这个 2 天,但不幸的是无法管理它。 Would ask you to help me a little.会请你帮我一点忙。 It should be a table with buttons where you can book as a customer at a certain time, but if someone has already booked something in between, you can only book up to the date or after, see the video.它应该是一个带有按钮的表格,您可以在特定时间以客户身份预订,但如果有人已经预订了两者之间的东西,您只能预订该日期或之后的日期,请参阅视频。 And I'm sorry if this is a bit of an unusual question, however, I'm getting desperate Thank you in advance.如果这是一个不寻常的问题,我很抱歉,但是,我很绝望 提前谢谢你。

PS: It would be important to mention that the design is not as important as the functionality PS:重要的是要提到设计不如功能重要

Video 视频

You can use the Table widget and ElevatedButton within your Table widget like this:您可以在 Table 小部件中使用Table小部件和ElevatedButton ,如下所示:

    Table(
      border: TableBorder.all(),
      columnWidths: const <int, TableColumnWidth>{
        0: FixedColumnWidth(96),
        1: FixedColumnWidth(96),
        2: FixedColumnWidth(96),
        3: FixedColumnWidth(96),
        4: FixedColumnWidth(96),
      },
      defaultVerticalAlignment: TableCellVerticalAlignment.middle,
      children: <TableRow>[
        TableRow(
          children: <Widget>[
            Container(
              height: 64,
              color: Colors.grey[200],
            ),
            Container(
              height: 64,
              color: Colors.grey[200],
            ),
            Container(
              height: 64,
              color: Colors.grey[200],
            ),
            Container(
              height: 64,
              color: Colors.grey[200],
            ),
            Container(
              height: 64,
              color: Colors.grey[200],
            ),
          ],
        ),
        TableRow(
          decoration: const BoxDecoration(
            color: Colors.grey,
          ),
          children: <Widget>[
            Container(
              height: 64,
              color: Colors.grey[200],
            ),
            SizedBox(
              height: 64,
              child: ElevatedButton(
                onPressed: () {},
                style: ElevatedButton.styleFrom(
                  backgroundColor: Colors.orange,
                ),
                child: const Icon(
                  Icons.check,
                  color: Colors.white,
                ),
              ),
            ),
            SizedBox(
              height: 64,
              child: ElevatedButton(
                onPressed: () {},
                style: ElevatedButton.styleFrom(
                  backgroundColor: Colors.grey[400],
                ),
                child: Icon(
                  Icons.dangerous,
                  color: Colors.grey[600],
                ),
              ),
            ),
            SizedBox(
              height: 64,
              child: ElevatedButton(
                onPressed: () {},
                style: ElevatedButton.styleFrom(
                  backgroundColor: Colors.white,
                ),
                child: Container(),
              ),
            ),
            SizedBox(
              height: 64,
              child: ElevatedButton(
                onPressed: () {},
                style: ElevatedButton.styleFrom(
                  backgroundColor: Colors.white,
                ),
                child: Container(),
              ),
            ),
          ],
        ),
      ],
    )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Flutter 中创建一个按钮表并从中随机选择任何按钮? - How to create a Table of buttons in Flutter and randomly select any button from it? 如何在颤振中创建三次单击按钮 - How to create triple click button in flutter 如何在 flutter 中创建具有动态内容的表? - How to Create table in flutter with dynamic content? 在 kotlin 中使用添加新列按钮创建表 - Create a table with add new column button in kotlin 有没有办法在 flutter 中创建带有停靠操作按钮的自定义进度条? - Is there a way to create this custom progress bar with docked action button in flutter? 如何在颤动中创建每周每月的日期选择按钮 - How to create a weekly monthly date picking button in flutter 根据条款在 Flutter 中创建 Sign-in-with-Google 按钮 - Create Sign-in-with-Google button in Flutter in accordance with the terms Android:按钮名称中的特殊字符 - Android: Special charaters in button names 在 flutter 中创建五个按钮 单击按钮时,应立即按下一个按钮,其颜色应更改,同时重构小部件 - create five button in flutter only one button should be pressed at once when clicked the button its color should change also refactor the widget Android:以编程方式创建特殊的RadioButton - Android: Create special RadioButton programmatically
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM