search_bar_bloc 1.0.1 copy "search_bar_bloc: ^1.0.1" to clipboard
search_bar_bloc: ^1.0.1 copied to clipboard

A Flutter package for creating a SearchBar that uses bloc package to handle the state.

SearchBar with Bloc

This package a SearchBar with Bloc state management.

The purpose of this package is to give an easy way to implement a search bar in a stateless widget.

Features #

The composition of the search bar is customizable and more parameters will be handled in the future.

Getting started #

If you're not familiar with bloc state management and the flutter_bloc package here are the resources you need :

Usage #

Here is a quick example of how to implement the search bar with a BlocProvider.

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (_) => SearchBarCubit(),
      child: Column(
        children: [
          const SearchBar(hintText: "Search something..."),
          BlocBuilder<SearchBarCubit, SearchBarState>(
              buildWhen: (previous, current) => previous.content != current.content,
              builder: (context, state) {
                return Text("You are searching : ${state.content}");
              }),
        ],
      ),
    );
  }
0
likes
130
pub points
0%
popularity

Publisher

unverified uploader

A Flutter package for creating a SearchBar that uses bloc package to handle the state.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

bloc, equatable, flutter, flutter_bloc

More

Packages that depend on search_bar_bloc