Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many questions regarding selected status and tab widget #5

Closed
zjjt opened this issue Sep 23, 2021 · 4 comments
Closed

Many questions regarding selected status and tab widget #5

zjjt opened this issue Sep 23, 2021 · 4 comments
Labels
question Further information is requested

Comments

@zjjt
Copy link

zjjt commented Sep 23, 2021

First of all thanks for the great package. I was hoping to find something regarding this kind of widget on pub.dev and im glad i found it.
However ,i haven't been able to do certain stuff to get consistent with the app i am currently working on (web,and mobile).So i guess the followings are mainly enhancements demands as i wouldn't like to have to modify a fork of your work so as to stay consistent with your upcoming releases

Although if this can be done currently, please point me to the right way to do them without modifying your code:

-customize the textstyle for a tab when it is selected (like changing the weight to bold)

  • possibility to pass a custom widget as a TabButton/closeButton instead of only an icon (for style customizations and further functionalities)
  • possibility to show close button on hover
  • possibility to have a custom preceding text of each tab

Please help if some of the above queries can currently be done.

Regards

@zjjt
Copy link
Author

zjjt commented Sep 23, 2021

This isn't related but i'd like to bring this to your attention:

When setting the tabArea middle gap to a negative value, i somehow expected that the first tab will be positioned on top of the second and so on but it seems not to be the case.
So i observed this weird behaviour:
when selecting tab 2 it is the normal expected behaviour,
Screen Shot 2021-09-23 at 13 41 45

when selecting tab 1 it becomes like this:
Screen Shot 2021-09-23 at 13 47 21

Tab 1 should be the one positioned on top
any solution to this ?

@caduandrade caduandrade added the question Further information is requested label Sep 23, 2021
@caduandrade
Copy link
Owner

Hi! Thanks for getting in touch. I will try to answer everything. If I forget something, let me know.

A little context: My focus on this project is Web/Desktop. I come from Swing/JavaFX, so I missed Desktop components in Flutter. This project is a prerequisite for my other project (Docking). Something might not be very functional in Mobile. Example: button touch area because of small padding.

I always try to allow maximum customization, so new ideas are welcome. I'm currently changing it to allow customizing the BoxDecoration of the buttons.

I can create Issues for each item. I'll just finish the current change I'm doing ok?

1) custom textStyle for selected tab

It is currently possible to change the textStyle in TabThemeData but it does not exist in TabStatusThemeData which allows overwriting properties according to status. A point of attention for your example is that when starting the hover, the bold style will require a larger area for the tab. It may be necessary to rebuild the layout.

2) possibility to pass a custom widget

It is currently not possible. This was a design decision that I sometimes think about changing but there are pros and cons. I thought of using only Widgets to add buttons but it would be more complicated to implement the close and menu button. Not impossible but it would have more boilerplates. Maybe it would need builders. I didn't discard the idea, maybe a 2.0.0 version.

3) possibility to show close button on hover

It's not possible. I hadn't thought about it. Good idea. Will the space for the button be reserved? Maybe even this should be customized. The same concern is to rebuild the layout when the size is changed.

4) possibility to have a custom preceding text of each tab

It's not possible either. I think in this case it could be any Widget, right? Another design decision to be made:

  • Just a precedingWidget parameter in TabData
  • Some preceding Widget builder that receives the tab and its state (if you want to change the widget in the hover)
  • Both? Builder overriding the TabData parameter.

5) selected tab render bug

This is probably happening because the tab area is a layout made from scratch. The children are painted in the order they are added. The funny thing is that this could be a bug that became a feature. I think I could have a parameter like drawOnTopWhenSelected (default value is TRUE), but that would allow you to keep that effect you noticed (maybe it's something someone wants).

@zjjt
Copy link
Author

zjjt commented Sep 28, 2021

Hello @caduandrade ,Thanks for replying thoroughly. I'll make do with what is currently available and in subsequent releases use what will be added. As for the 5)Selected tab render bug, as you mentioned this could be something wanted by someone else. So as for now ill just go with the default gap so that it doesn't affect my design at all.(the bool? drawOnTopWhenSelected suggestion would be nice to have though lol )

Thanks again for the great plugin, and please do excuse me for the delay i ve taken to reply.

Regards.

@zjjt zjjt closed this as completed Sep 28, 2021
@zjjt
Copy link
Author

zjjt commented Oct 20, 2021

hello @caduandrade ....i just ran an upgrade on my dependencies and i saw you released a new version of your package 1.10.0 ....great work ....Im thrilled to use it and modify the deprecated things i have in my current version..Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants