dimanche 23 mai 2021

Swap Position of ListTileIcon and Checkbox in Flutter

I'm greenhorn using flutter and stackoverflow (active) as well. So, I'm sorry about any unusal behavior. And because of this, I'm sure, I share too much code... just to make sure.

Problem: I have to swap positions of dropdown arrow and checkbox.

...
      body: Container(
          margin: EdgeInsets.all(12.0),
          decoration: BoxDecoration(
            borderRadius: BorderRadius.all(Radius.circular(12)),
          ),
          child: Container(
              child: ListView.builder(
                itemCount: entries.length,
                itemBuilder: (BuildContext context, int index) {
                  return new Column(
                      children: <Widget>[
                        CheckboxListTile(
                            value: true,
                            title: DataPopUp(entries[index]),
                            onChanged: null,

...

...
      Widget _buildTiles(DataList root) {
        if (root.children.isEmpty)
          return ListTile(
              title: Text(root.title)
          );
        return ExpansionTile(
          key: PageStorageKey<DataList>(root),
          title: Text(
            root.title,
            style: AppTheme.appTextStyles.dropdownTourText,
          ),
          children: root.children.map(_buildTiles).toList(),
        );
...

screenshot of list with checkbox




Aucun commentaire:

Enregistrer un commentaire