yichahucha/tform

怎么刷新单个cell

Opened this issue · 2 comments

jhfkf commented

使用场景: 密码显示和隐藏

可以使用 TForm.of(context).reload(); 刷新表单,新增了一个密码输入示例可以参考一下。

TFormRow.input(
      title: "密码",
      value: "123456",
      obscureText: true,
      state: false,
      placeholder: "请输入密码",
      suffixWidget: (context, row) {
        return GestureDetector(
          onTap: () {
            row.state = !row.state;
            row.obscureText = !row.obscureText;
            TForm.of(context).reload();
          },
          child: Image.asset(
            row.state ? "lib/src/eyes_open.png" : "lib/src/eyes_close.png",
            width: 20,
            height: 20,
          ),
        );
      },
    ),
jhfkf commented

好的 万分感谢!!!