Git Product home page Git Product logo

search_page's Introduction

Search Page

Package Build Patreon License

Fast and easy way to build a custom search experience in you app.

This package aims to provide a simple way to build a search view, using available resources from the Flutter framework. It uses SearchDelegate as its fondation, in oder to build a 'material' experience.

One of the special features of this package is the filter parameter. It's a very simple way to filter out items inside a list, using different string representations.

Also, you can customize suggestion and on-error widgets, provide custom search filters, change AppBar's theme...

Example

Here is a example on how to use this package. You'd need to call the SearchPage class using the showSearch function built in.

If you want to take a deeper look at the example, take a look at the example folder provided with the project.

FloatingActionButton(
  child: Icon(Icons.search),
  tooltip: 'Search people',
  onPressed: () => showSearch(
    context: context,
    delegate: SearchPage<Person>(
      items: people,
      searchLabel: 'Search people',
      suggestion: Center(
        child: Text('Filter people by name, surname or age'),
      ),
      failure: Center(
        child: Text('No person found :('),
      ),
      filter: (person) => [
        person.name,
        person.surname,
        person.age.toString(),
      ],
      builder: (person) => ListTile(
        title: Text(person.name),
        subtitle: Text(person.surname),
        trailing: Text('${person.age} yo'),
      ),
    ),
  ),
),

Getting Started

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Built with

Authors

License

This project is licensed under the GNU GPL v3 License - see the LICENSE file for details.

search_page's People

Contributors

jesusrp98 avatar obrunsmann avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.