reusable_tab_bar 0.0.1 copy "reusable_tab_bar: ^0.0.1" to clipboard
reusable_tab_bar: ^0.0.1 copied to clipboard

A Flutter package for reusable and customizable tab bars with state management support using ChangeNotifier and Bloc. Includes flexible options for app bar, tab styling, and more.

example/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:reusable_tab_bar/reusable_tab_bar.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MultiBlocProvider(
      providers: [
        BlocProvider<TabBarCubit>(create: (_) => TabBarCubit()),
      ],
      child: MaterialApp(
        title: 'Reusable Tab Bar Example',
        theme: ThemeData(primarySwatch: Colors.blue),
        home: const HomePage(),
      ),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return AppTabBar(
      tabScreens: const [
        Center(child: Text('Home Screen')),
        Center(child: Text('Search Screen')),
        Center(child: Text('Profile Screen')),
      ],
      tabHeaders: const [
        Tab(icon: Icon(Icons.home), text: 'Home'),
        Tab(icon: Icon(Icons.search), text: 'Search'),
        Tab(icon: Icon(Icons.person), text: 'Profile'),
      ],
      titleTxt: 'Reusable TabBar',
      backgroundColor: Colors.blue,
      selectedLabelColor: Colors.white,
      unselectedLabelColor: Colors.white70,
      indicatorColor: Colors.white,
      appBarHeight: 0,
      preferredSize: 100,
      fabButtons: const [
        FloatingActionButton(onPressed: null, child: Icon(Icons.home)),
        FloatingActionButton(onPressed: null, child: Icon(Icons.search)),
        FloatingActionButton(onPressed: null, child: Icon(Icons.person)),
      ],
    );
  }
}
0
likes
140
points
42
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for reusable and customizable tab bars with state management support using ChangeNotifier and Bloc. Includes flexible options for app bar, tab styling, and more.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

app_style, bloc, equatable, flutter, flutter_bloc

More

Packages that depend on reusable_tab_bar