text_tab_bar 0.1.0
text_tab_bar: ^0.1.0 copied to clipboard
Flutter package that implements a minimalistic tabbar widget with animated text
TextTabBar #
TextTabBar is an open-source Flutter package that provides a customizable tabbar where each element is an animated text. This will allow you to use a minimalistic and agreeable tab bar for your users.
Features #
- 📱 The behavior completely copies the behavior of the native tabbar;
- 🎨 Fully customizable styles for elements;
- ✈️ Various and smooth transition animations;
- 🐚 Simple and easy to use configuration.
Getting started #
To use TextTabBar in your Flutter project, follow these steps:
- Add the dependency to your
pubspec.yamlfile:
dependencies:
flutter:
sdk: flutter
text_tab_bar: ^0.1.0
- Run
flutter pub getto install the package.
Usage #
Import the package in your Dart file and customize the tab bar according to your needs:
DefaultTabController(
length: ...,
child: Builder(
builder: (context) {
final tabController = DefaultTabController.of(context);
return Column(
children: [
TextTabBar(
controller: tabController,
tabs: ...
),
Expanded(
child: TabBarView(
controller: tabController,
children: ...
),
),
],
);
},
),
)
Сustomizable text styles
You can override the default text styles to one that suits you better, for example like this:
TextTabBar(
...,
selectedTextStyle: TextStyle(
color: Colors.red,
fontSize: 24.0,
),
unselectedTextStyle: TextStyle(
color: Colors.green,
fontSize: 18.0,
),
)
Floating animation
You can use a floating animation that will look like a wave, flowing from one element to another:
TextTabBar(
...,
isFloatingAnimation: true,
)
Decorator
If you additionally want to customize the item, you can use a decorator:
TextTabBar(
...,
decorator: (index, child) {
if (index % 3 != 0) {
return child;
}
return Stack(
children: [
child,
ColoredBadge(color: Colors.red),
],
);
},
)
License #
This package is licensed under the MIT License. For more information, see the LICENSE.md file.
Additional information #
For more information, visit the TextTabBar GitHub repository.