Nikita
Nikita

Reputation: 765

How to override an ExpansionPanel in flutter

How the title already suggests, I want to have my own ExpansionPanel, where, contrary to the default one, the elevation is set to zero. I already found this in flutter.dev: https://api.flutter.dev/flutter/material/ExpansionPanelList/ExpansionPanelList.html I have been trying to implement this but haven't succeeded yet, how do I do it?

So Im talking about these Elevation marks of each ElevationPanel:

enter image description here

Upvotes: 0

Views: 156

Answers (1)

Robert Sandberg
Robert Sandberg

Reputation: 8597

Maybe I misunderstood you, but it is as simple as just setting the elevation parameter when you build the widget, as such:

As such:

ExpansionPanelList(
  elevation: 0,
  children: [ ... ],
)

Edit:

After comments, problem has to do with divider color. Do something like this:

ExpansionPanelList(
  dividerColor: Colors.transparent,
  children: [...]
)

Upvotes: 1

Related Questions