blossom_tabs 1.0.0 copy "blossom_tabs: ^1.0.0" to clipboard
blossom_tabs: ^1.0.0 copied to clipboard

outdated

Blossom Tab Manger Package for Flutter Blossom and related projects.

Tabs manager for flutter-blossom project.

Features #

  • You can drag and drop tabs and reorder them.
  • dynamically add tabs at runtime.
  • save the current state of tab manger for later use (i.e- at next app restart).
  • customize appearance and behavior.

Getting started #

first add it to your project

flutter pub add blossom_tabs: ^1.0.0

then import it

import 'package:blossom_tabs/blossom_tabs.dart';

Usage #

You can add in widget tree like this -

// configure `controller`
var _controller = BlossomTabController<int>(tabs: []); // infer data type for easy access

return BlossomTabControllerScope(
  controller: _controller,
  child: Scaffold(
    appBar: BlossomTabBar<int>(
      height: 48,
      selectedColor: Colors.blue,
      stickyColor: Colors.white,
      backgroundColor: Colors.blue.withOpacity(0.3),
      dividerColor: Colors.blue,
    ),
    body: BlossomTabView<int>(
      builder: (context, data) {
        return Center(
            child: Text(
          data.toString(),
          style: const TextStyle(color: Colors.white, fontSize: 18),
        ));
      },
    ),
  ),
);

Additional information #

Additionally you can listen to tabs state changes using BlossomTabControllerScopeDescendant. like this -

BlossomTabControllerScopeDescendant<int>(
  builder: (context, controller) {
  return Container(
    color: controller.currentTab == 'd' ? Colors.white : Colors.blue,
  );
});
8
likes
0
pub points
0%
popularity

Publisher

verified publisherflutterblossom.com

Blossom Tab Manger Package for Flutter Blossom and related projects.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, json_annotation, scoped_model

More

Packages that depend on blossom_tabs