All Projects → apgapg → Search_widget

apgapg / Search_widget

Licence: mit
Flutter package: Search Widget for selecting an option from a data list.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Search widget

Gosearch
🔍 Search the Go packages via command-line
Stars: ✭ 48 (-74.47%)
Mutual labels:  search, package
ci4-album
🔥 CodeIgniter 4 example Album module uses Domain Driven Design Architecture with Tactical Pattern
Stars: ✭ 67 (-64.36%)
Mutual labels:  search, query
Lara Eye
Filter your Query\Builder using a structured query language
Stars: ✭ 39 (-79.26%)
Mutual labels:  search, query
Autocomplete
🔮 Fast and full-featured autocomplete library
Stars: ✭ 1,268 (+574.47%)
Mutual labels:  search, query
Npmarket
🛒 More efficient search for node packages.
Stars: ✭ 91 (-51.6%)
Mutual labels:  search, package
Laravel Api Handler
Package providing helper functions for a Laravel REST-API
Stars: ✭ 150 (-20.21%)
Mutual labels:  search, query
Lucenenet
Apache Lucene.NET
Stars: ✭ 1,704 (+806.38%)
Mutual labels:  search, query
Query Translator
Query Translator is a search query translator with AST representation
Stars: ✭ 165 (-12.23%)
Mutual labels:  search, query
Emoji
💌 Find the emoji that echoes your mind.
Stars: ✭ 2,072 (+1002.13%)
Mutual labels:  search
Sortrecyclerviewlist
Recyclerview实现字母排序,过滤搜索,顶部悬浮,波浪形的侧边栏
Stars: ✭ 179 (-4.79%)
Mutual labels:  search
Jkes
A search framework and multi-tenant search platform based on java, kafka, kafka connect, elasticsearch
Stars: ✭ 173 (-7.98%)
Mutual labels:  search
Searchview
This a view that waiting for network connection to resolve with cool animation .
Stars: ✭ 174 (-7.45%)
Mutual labels:  search
Vim Ags
Silver searcher plugin for vim
Stars: ✭ 179 (-4.79%)
Mutual labels:  search
Laravel Messenger
Simple user messaging package for Laravel
Stars: ✭ 2,140 (+1038.3%)
Mutual labels:  package
Laravel Feature
A package to manage feature flagging in a Laravel project.
Stars: ✭ 184 (-2.13%)
Mutual labels:  package
Roadrunner Laravel
RoadRunner ⇆ Laravel bridge
Stars: ✭ 167 (-11.17%)
Mutual labels:  package
Keyvi
Keyvi - a key value index that powers Cliqz search engine. It is an in-memory FST-based data structure highly optimized for size and lookup performance.
Stars: ✭ 171 (-9.04%)
Mutual labels:  search
Rabbit
⚡️ A lightweight service that will build and store your go projects binaries, Integrated with Github, Gitlab, Bitbucket and Bitbucket Server.
Stars: ✭ 185 (-1.6%)
Mutual labels:  package
Search Server
⭐️ Our core search API repository
Stars: ✭ 181 (-3.72%)
Mutual labels:  search
Mcfly
Fly through your shell history. Great Scott!
Stars: ✭ 3,206 (+1605.32%)
Mutual labels:  search

Search Widget Cirrus CI - Base Branch Build Status GitHub stars Twitter Follow GitHub last commit Website shields.io Open Source Love style: effective dart

This Flutter package provides a Search Widget for selecting an option from a data list. Provides filtering of items based on the search text.

PieChart

💻 Installation

In the dependencies: section of your pubspec.yaml, add the following line:

Version

dependencies:
  search_widget: <latest version>

❔ Usage

Import this class

import 'package:search_widget/search_widget.dart';

Add Search Widget

  • Accepts data list as input
  • Option for getting selected item. Returns selected item or null if item is deleted
onItemSelected: (item) {
    //Do whatever you would like
    setState(() {
       _selectedItem = item;
    });
 },
  • Option for pop list item builder. This basically returns a widget to show as list item in popup
popupListItemBuilder: (LeaderBoard item) {
   return PopupListItem(item);
 }
  • Option for filtering data list based on search query
queryBuilder: (String query, List<LeaderBoard> list) {
   return list.where((LeaderBoard item) => item.username.toLowerCase().contains(query.toLowerCase())).toList();
 }
  • Option provided for selected list item builder which enables when a user selects an item from pop up list
selectedItemBuilder: (LeaderBoard selectedItem, deleteSelectedItem) {
   return SelectedItem(selectedItem,deleteSelectedItem);
 }
  • Option for providing custom TextField. Accepts TextEditingController and FocusNode as parameter
textFieldBuilder: (TextEditingController controller, FocusNode focusNode) {
    return TextField(
        controller: controller,
        focusNode: focusNode,
        //... Other customizations here
       );
  },

Full Implementation

SearchWidget<LeaderBoard>(
   dataList: list,
   hideSearchBoxWhenItemSelected: false,
   listContainerHeight: MediaQuery.of(context).size.height / 4,
   queryBuilder: (String query, List<LeaderBoard> list) {
     return list.where((LeaderBoard item) => item.username.toLowerCase().contains(query.toLowerCase())).toList();
   },
   popupListItemBuilder: (LeaderBoard item) {
     return PopupListItemWidget(item);
   },
   selectedItemBuilder: (LeaderBoard selectedItem, VoidCallback deleteSelectedItem) {
     return SelectedItemWidget(selectedItem, deleteSelectedItem);
   },
   // widget customization
   noItemsFoundWidget: NoItemsFound(),
   textFieldBuilder: (TextEditingController controller, FocusNode focusNode) {
     return MyTextField(controller, focusNode);
   },
 )

Key Highlights

  • Adaptive Popup Position to prevent popup getting hidden behind keyboard

PieChart PieChart

  • Popup to scroll with scroll gesture if this widget is used inside ScrollView
PieChart

TODO

  • [X] Give support for onItemSelected method to return selected item(s) directly
  • [ ] Add support for selecting multiple items
  • [ ] Add visibility bool to show selected item widget

⭐ My Flutter Packages

  • pie_chart GitHub stars Flutter Pie Chart with cool animation.
  • avatar_glow GitHub stars Flutter Avatar Glow Widget with glowing animation.
  • json_table GitHub stars Create Flutter Json Table from json map directly.
  • animating_location_pin GitHub stars Flutter Animating Location Pin Widget providing Animating Location Pin Widget which can be used while fetching device location.

⭐ My Flutter Apps

👍 Contribution

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].