flutter_tabbar_lite 0.0.1 flutter_tabbar_lite: ^0.0.1 copied to clipboard
A custom tab bar widget with animation and dynamic features.
Here's a complete README.md for your Flutter Tab Bar library:
# Flutter Tab Bar
A fully customizable and animated tab bar widget for Flutter applications. Designed to make navigation intuitive and visually appealing, this package is perfect for creating modern and dynamic tab interfaces.
---
## Features
- **Customizable Titles**: Add unique titles to each tab.
- **Icon Support**: Include prefix and suffix icons for enhanced aesthetics.
- **Scrollable & Fixed Layouts**: Choose between scrollable and fixed tab bar layouts.
- **Gradient Backgrounds**: Apply gradients for a modern look.
- **Responsive Design**: Fully responsive for various screen sizes.
- **Tab Change Callback**: Get notified when the user switches tabs.
---
## Installation
Add the following to your `pubspec.yaml` file:
```yaml
dependencies:
flutter_tab_bar: ^0.0.1
Run the command to fetch the package:
flutter pub get
Usage #
Basic Example #
import 'package:flutter/material.dart';
import 'package:flutter_tab_bar/flutter_tabbar_lite.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text("Flutter Tab Bar Example")),
body: Column(
children: [
FlutterTabBar(
enableScroll: false,
titles: ["Home", "Profile", "Settings"],
onTabChange: (index) {
print("Selected Tab: $index");
},
),
],
),
),
);
}
}
Advanced Example #
FlutterTabBar(
enableScroll: true,
titles: ["Home", "Profile", "Settings"],
suffixIcons: [Icons.home, Icons.person, Icons.settings],
prefixIcons: [Icons.star, Icons.account_circle, Icons.lock],
gradient: const LinearGradient(
colors: [Colors.teal, Colors.green],
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
backgroundColor: Colors.blue.shade100,
selectedTextColor: Colors.black,
unselectedItemTextColor: Colors.grey,
onTabChange: (index) {
print("You switched to tab $index");
},
);
API Reference #
| Property | Type | Default Value | Description |
|---------------------------|------------------------|--------------------------|
| enableScroll
| bool
| false
| Enables horizontal scrolling for tabs. |
| titles
| List<String>
| ["Tab 1", "Tab 2"]
| Titles for each tab. |
| prefixIcons
| List<IconData>?
| null
| Icons before titles. |
| suffixIcons
| List<IconData>?
| null
| Icons after titles. |
| backgroundColor
| Color?
| Colors.blue
| Tab bar background color. |
| selectedTextColor
| Color
| Colors.black87
| Color for the selected tab's text. |
| unselectedItemTextColor
| Color
| Colors.white
| Color for unselected tab's text. |
| gradient
| LinearGradient?
| null
| Gradient applied to the tab bar. |
| onTabChange
| Function(int)?
| null
| Callback function invoked on tab change. |
Screenshots #
Contributions #
Contributions are welcome! Please fork the repository, make your changes, and submit a pull request. Refer to the CONTRIBUTING.md
for more details.
License #
This project is licensed under the MIT License. See the LICENSE file for details.
Author #
Developed with ❤️ by Khandakar Amir Hamza
GitHub Profile | Portfolio
Example App #
Check the example
directory for a fully functional implementation. Run it locally using:
cd example
flutter run
Feedback #
If you encounter any issues or have suggestions, feel free to create an issue in the GitHub repository.
---
This README file is comprehensive, visually structured, and includes all the necessary details to make your library easy to understand and use. Let me know if you want further customizations!