buttons_tabbar
2.0.0, released 5 weeks ago by afonsoraposo.com
A Flutter TabBar where each tab indicator is a toggle button.
What it does
Implements a customizable TabBar widget where each tab acts as an interactive toggle button with individual styles, background colors, borders, and smooth transition animations. It integrates with TabController and DefaultTabController from the material_ui package.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want a tab bar styled as toggle buttons rather than standard underlined tabs
- You need custom backgrounds, borders, or gradients per tab state
Skip it when
- Your project relies strictly on package:flutter/material.dart and you cannot migrate to material_ui
- You require the default platform-native tab styling without button wrappers
Strengths
- Highly customizable tab appearance with support for gradients, borders, and rounded corners
- Smooth transition animations between states
- Easy integration with standard TabBarView and TabController workflows
Weaknesses
- Requires the standalone material_ui package and Flutter 3.47.0+ in version 2.0.0
- Not compatible out-of-the-box with apps using standard package:flutter/material.dart without staying on older versions
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add dependencies for buttons_tabbar and material_ui to pubspec.yaml, and ensure your app meets the minimum Flutter version requirement of 3.47.0.
DefaultTabController(
length: 3,
child: Column(
children: <Widget>[
ButtonsTabBar(
backgroundColor: Colors.red,
tabs: [
Tab(text: "Tab 1"),
Tab(text: "Tab 2"),
Tab(text: "Tab 3"),
],
),
Expanded(
child: TabBarView(
children: [
Center(child: Text("1")),
Center(child: Text("2")),
Center(child: Text("3")),
],
),
),
],
),
)Alternatives
Packages that do the same job and could replace buttons_tabbar.
- m3e_buttons
Material 3 Expressive button components for Flutter with spring motion and toggle groups.
76Compare
Works with
Packages commonly used together with buttons_tabbar: ones it builds on, ones built on it, and its own family.