【问题标题】:how to return CheckBoxTile tital as my code returning only true or false when is select checkbox如何返回复选框标题标题作为我的代码在选择复选框时仅返回真或假
【发布时间】:2022-01-21 08:14:14
【问题描述】:

CheckBoxTile.. CheckboxListTile( 标题:文本(“绘画”), 值:_checkBox1, onChanged:(值){ 设置状态((){ _checkBox1=值!; )

从列表中打印它.. 返回 CardItems(

                Person.personsList[index].intrest1,
                
          }),

enter image description here

【问题讨论】:

  • 请提供完整代码。所以,可以了解一下。
  • 您能否详细解释一下 code-sn-p、您要归档什么、出了什么问题以及到目前为止您尝试了什么?
  • 请查看“How to Ask”以及链接页面和“minimal reproducible example”。

标签: flutter flutter-layout flutter-dependencies flutter-web flutter-test


【解决方案1】:

对于列表中的项目,您添加一个布尔变量来检查它是否被选中。

class Model {
  String name;
  bool isSelected;
}

【讨论】:

    猜你喜欢
    • 2015-12-01
    • 1970-01-01
    • 2014-06-20
    • 2023-03-03
    • 2015-10-06
    • 1970-01-01
    • 2016-10-01
    • 2015-03-28
    • 1970-01-01
    相关资源
    最近更新 更多