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

outdated

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
0
pub points
45%
popularity

Publisher

unverified uploader

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.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on simple_search_bar