Skip to content

Conversation

@tnsoftbear
Copy link

Hi Gaurav Yadav,
thank you very much for the implementing this useful VerticalTabs widget.
I've noticed an issue, when I wanted to apply transparency to Tabs block of it.
This PR contains my idea of fixing this case.
Since I'm new in flutter, I cannot be sure that this solution is completely right. Please review and decide.

  • Add materialType property that defines the value of Material.type used for piece of material definition, when the Material widget is configured inside of VerticalTabs widget. By default this value is set to MaterialType.canvas. Set it to MaterialType.transparency value, so it could be possible to apply opacity for widgets used for rendering bars block.

  • Add example in example/lib/transparent.dart for illustrating the issue I've fixed by this PR. This example displays picture in the background of the VerticalTabs widget.
    The top one implementation sets the MaterialType.canvas value for the materialType property, as it is expected as default value of the Material widget. As you can see, this way we cannot achieve correct transparency of the Tab block (content block is fine).
    The bottom VerticalTabs implementation sets the MaterialType.transparency value for the materialType property, and it helps us to achieve expected transparency.

image

Add materialType property that defines the value of Material.type used for piece of material definition, when the Material widget is configured inside of VerticalTabs widget.
By default this value is set to MaterialType.canvas. Set it to MaterialType.transparency value, so it could be possible to apply opacity for widgets used for rendering bars block.
@gauravmehta13
Copy link
Owner

gauravmehta13 commented May 22, 2023

Thanks for the contribution @tnsoftbear
Will review this weekend.

@tnsoftbear
Copy link
Author

Hi @gauravmehta13 did you get a chance to review this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants