simple_search_bar 0.1.7 copy "simple_search_bar: ^0.1.7" to clipboard
simple_search_bar: ^0.1.7 copied to clipboard

A simple yet functional flutter search bar. It's an AppBar that You can turn on a SearchBar. You could make that clicking on any element You want using the Controller Stream.

example/main.dart

import 'package:flutter/material.dart';
import 'package:simple_search_bar/simple_search_bar.dart';

class MySearchBar extends StatelessWidget{

  final AppBarController appBarController = AppBarController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: SearchAppBar(
        primary: Theme.of(context).primaryColor,
        appBarController: appBarController,
        // You could load the bar with search already active
        autoSelected: true,
        searchHint: "Pesquise aqui...",
        mainTextColor: Colors.white,
        onChange: (String value) {
          //Your function to filter list. It should interact with
          //the Stream that generate the final list
        },
        //Will show when SEARCH MODE wasn't active
        mainAppBar: AppBar(
          title: Text("Yout Bar Title"),
          actions: <Widget>[
            InkWell(
              child: Icon(
                Icons.search,
              ),
              onTap: () {
                //This is where You change to SEARCH MODE. To hide, just
                //add FALSE as value on the stream
                appBarController.stream.add(true);
              },
            ),
          ],
        ),
      ),
      body: Container(),
    );

  }
}
13
likes
40
points
36
downloads

Publisher

unverified uploader

Weekly Downloads

A simple yet functional flutter search bar. It's an AppBar that You can turn on a SearchBar. You could make that clicking on any element You want using the Controller Stream.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on simple_search_bar