4

Is there a way to have the rotating expansion arrow on a Flutter ExpansionTile widget as leading rather than trailing?

2 Answers 2

4
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

1
  • mine is error when i add this code: controlAffinity: ListTileControlAffinity.leading, Dec 18, 2021 at 20:37
2

You can just copy the source code of the widget and create your own customized version.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.