【问题标题】:How to pass String value to a Boolean variable in flutter?如何在 flutter 中将字符串值传递给布尔变量?
【发布时间】:2022-12-31 14:20:33
【问题描述】:

在我的代码中,我从数据库中获取数据并像这样在 UI 中显示。

代码

输出界面

我想将其传递给布尔变量,如果为真,则应激活加入按钮

布尔变量

  bool active = data![index].doctor_in.toString();

错误

加入按钮

如何在 flutter 中将字符串变量传递给布尔变量(“活动”变量)?

【问题讨论】:

    标签: flutter


    【解决方案1】:

    删除 bool active = data![index].doctor_in.toString() 中的 toString()bool active = data![index].doctor_in

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-16
      • 2016-07-22
      • 2023-01-20
      • 1970-01-01
      相关资源
      最近更新 更多