Buttons TabBar

Open source Flutter package, tabbar where each tab indicator is a toggle button.

Made by Afonso Raposo.

See the full example here

Screenshots

Install and import the package. Then just customize its parameters.

dependencies:
  flutter:
    sdk: flutter
  buttons_tabbar: ^0.1.1+1

Default

ButtonsTabBar screen
ButtonsTabBar screen animation

Example

ButtonsTabBar - Example

ButtonsTabBar - Example
DefaultTabController(
          length: ...,
          child: Column(
            children: <Widget>[
              ButtonsTabBar(
                unselectedBackgroundColor: Colors.grey[300],
                unselectedLabelStyle: TextStyle(color: Colors.black),
                labelStyle:
                    TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
                tabs: ...,
              ),
              Expanded(
                child: TabBarView(
                  children: ...,
                ),
              ),
            ],
          ),
        )


ButtonsTabBar Parameters

ParameterTypeDescriptionDefault
tabsList<Widget>The tabs to display. Typically a list of two or more Tab widgets.@required
controllerTabControllerThis widget's selection and animation state.DefaultTabController.of
durationintThe duration in milliseconds of the transition animation.250
backgroundColorColorThe background color of the button on its selected state.Colors.blueAccent
unselectedBackgroundColorColorThe background color of the button on its unselected state.Colors.grey
labelStyleTextStyleThe TextStyle] of the button's Text on its selected state. The color provided on the TextStyle will be used for the Icon's color.TextStyle(color: Colors.white)
unselectedLabelStyleTextStyleThe TextStyle] of the button's Text on its unselected state. The color provided on the TextStyle will be used for the Icon's color.TextStyle(color: Colors.black)
physicsScrollPhysicsThe physics used for the ScrollControllerof the tabs list.BouncingScrollPhysics
contentPaddingEdgeInsetsThe EdgeInsets used for the Padding of the buttons' content.EdgeInsets.all(4)
buttonMarginEdgeInsetsThe EdgeInsets used for the Margin of the buttons.EdgeInsets.all(4)
labelSpacingdoubleThe spacing between the Icon and the Text. If only one of those is provided, no spacing is applied.4.0
radiusdoubleThe value of the BorderRadius.circular applied to each button.7.0

Future

If you have any suggestion or problem, let me know and I'll try to improve or fix it.

Versioning

  • v0.1.1+1 - 16 May 2020
  • v0.1.0+2 - 24 April 2020
  • v0.1.0+1 - 24 April 2020

License

GNU General Public License v3.0, see the LICENSE.md file for details.

Libraries

buttons_tabbar