Is there a way to have the rotating expansion arrow on a Flutter ExpansionTile widget as leading rather than trailing?
2 Answers
const ExpansionTile(
title: Text('ExpansionTile 3'),
subtitle: Text('Leading expansion arrow icon'),
controlAffinity: ListTileControlAffinity.leading,
children: <Widget>[
ListTile(title: Text('This is tile number 3')),
],
),
The controlAffinity property helps you put it in the leading position, to place it before the title
Source: https://api.flutter.dev/flutter/material/ExpansionTile-class.html
-
mine is error when i add this code: controlAffinity: ListTileControlAffinity.leading, Dec 18, 2021 at 20:37
You can just copy the source code of the widget and create your own customized version.
-
I have written an extension of the ExpansionTile based on the source code. Maybe this can help you: stackoverflow.com/questions/58047537/… Sep 24, 2019 at 7:37