caduandrade / tabbed_view

Widget inspired by the classic Desktop-style tab component.
MIT License
49 stars 16 forks source link

Separate widgets for tabs and content areas #13

Open ngugcx opened 2 years ago

ngugcx commented 2 years ago

Sometimes tab_area and content_area are not placed together. It will be more flexiable if they can be seperated.

caduandrade commented 2 years ago

Hi @ngugcx !

Sorry. I didn't really understand the problem. Could you describe it with an example?

Are you wanting to change the gap between content areas and tabs? If so, you can change the theme with something like this:

TabbedViewTheme(
        child: tabbedView,
        data: TabbedViewThemeData(
            tabsArea: TabsAreaThemeData(color: Colors.yellow),
            contentArea: ContentAreaThemeData(
                padding: EdgeInsets.zero,
                decoration: BoxDecoration(color: Colors.blue))));

It is also possible to have different settings for the selected tab. So only this one can have an extra gap.

ngugcx commented 2 years ago

Like Chrome, the tabs can be put together with the min/max/close buttons, and the content area can be put somewhere else. They are separated widgets, not tightly connected with each other in UI.

Just like the relationship of the Qt widgets, QTabBar and QStackedWidget.

caduandrade commented 2 years ago

Cool, got it. The current component doesn't allow instantiating its parts as separate widgets. I didn't think of that use case. I need to think about how I could do that.

caduandrade commented 2 years ago

Probably the biggest problem would be the dropdown menu.