如何在扩展图块上执行持久状态?

时间:2018-07-07 18:11:09

标签: android dart flutter

崩溃时如何将状态保存在扩展图块上?我遇到了这个问题,因为我要保留的状态是尾随字段上的图标... 在扩展磁贴上有我的代码:

new ExpansionTile(
 // key: PageStorageKey('${child.map((units) => units['id'])}'),
  title: new Text(
    title ?? 'ROOT',
    textScaleFactor: 1.5,
  ),
  children: child.map((courseUnits) {
    ///
    Folders folder = Folders.fromJson(courseUnits);
    return new ListTile(
      title: Container(
        decoration: new BoxDecoration(
            shape: BoxShape.rectangle,
            border: Border.all(style: BorderStyle.solid, color: cAppBlackish),
            color: cAppBlueAccent),
        child: new ListTile(
          trailing: Trailing(folder: folder,canAdd: courseUnits['clearances']['addFiles']),
          onTap: () => !homeBloc.connectionStatus.contains('none')
            ? Navigator.of(context).push(MaterialPageRoute(
              builder: (context) =>
              new Content(unitContent: courseUnits)))
            : homeBloc.errorDialog('Sem acesso a Internet', context),
          title: new Text(courseUnits['title'].toString().split('-').first,
              textScaleFactor: 0.95),
        ),
      ),
    );
  }).toList(),
);

有人知道如何存储它吗?因为这是我要保存的Icon按钮值...还是有其他方法可以实现?

Trailing类仅返回一个ButtonIcon。

0 个答案:

没有答案