पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv1.0.4

search_autocomplete

कस्टम ड्रॉपडाउन और क्यूबिट/ब्लॉक समर्थन के साथ फ्लटर स्वचालित पूर्णता खोज विशेषता।

AndroidiOSWebmacOSWindowsLinux
30-दिन डाउनलोड
1.3 हज़ार
लाइक
3
Pub अंक
150

पैकेज इंस्टॉल करें

flutter pub add search_autocomplete

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

एक ऐसा Flutter विजेट जो कस्टमाइज़ेबल ड्रॉपडाउन के साथ स्वचालित खोज कार्यक्षमता को लागू करने के लिए है और Cubit या BLoC राज्य प्रबंधन के साथ बिना किसी दिक्कत के एकीकृत है। यह उपयोगकर्ताओं को टेक्स्ट दर्ज करने और वास्तविक समय में सुझाव प्राप्त करने की अनुमति देता है, जिससे खोज-आधारित एप्लिकेशन में उपयोगकर्ता अनुभव को बढ़ाया जा सकता है। इस पैकेज का समर्थन एंड्रॉइड, आईओएस, वेब, मैकओएस, विंडोज और लिनक्स जैसे विभिन्न प्लेटफॉर्म के लिए है, जिससे यह क्रॉस-प्लेटफॉर्म विकास के लिए लचीला बन जाता है। साफ और मॉड्यूलर डिज़ाइन के साथ, यह प्रतिक्रियाशील और इंटरैक्टिव खोज इंटरफ़ेस के निर्माण को सरल बनाता है।

उपयोग

  • एप्स में रियल-टाइम सर्च
  • बड़े डेटासेट को फ़िल्टर करना
  • उपयोगकर्ता इनपुट अनुभव को बढ़ाना
  • नियंत्रित सुझाव ड्रॉपडाउन
  • क्रॉस-प्लेटफॉर्म सर्च यूआई

मुख्य विशेषताएँ

  • कस्टमाइज़ किए गए ड्रॉपडाउन UI
  • Cubit/BLoC एकीकरण
  • रियल-टाइम फ़िल्टरिंग
  • बहु-प्लेटफॉर्म समर्थन
  • त्वरित सेटअप के लिए सरल API

इनके लिए उपयुक्त

  • ई-कॉमर्स ऐप में खोज सुविधाएँ
  • डैशबोर्ड में डेटा फ़िल्टरिंग
  • उपयोगकर्ता-मित्रतापूर्ण इनपुट क्षेत्र
  • BLoC/Cubit का उपयोग करने वाले विकासकर्मी
  • क्रॉस-प्लेटफॉर्म Flutter प्रोजेक्ट्स

विचार योग्य बातें

  • राज्य प्रबंधन के ज्ञान की आवश्यकता है
  • शैली कस्टमाइजेशन की आवश्यकता हो सकती है
  • प्रदर्शन डेटा के आकार पर निर्भर करता है
  • सीमित आंतरिक थीम
  • मध्यम आकार के डेटासेट के लिए सबसे उपयुक्त

मूल README

संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।

Search Autocomplete Flutter Package

Video

Buy Me A Pizza

Overview

This Flutter package provides a SearchAutocomplete widget for implementing autocomplete functionality with a dropdown menu. The package offers extensive customization options for the search field, dropdown items, and includes hooks for search logic.

Installation

To use this package, add search_autocomplete as a dependency in your pubspec.yaml file:

dependencies:
  search_autocomplete: ^1.0.3

Features

  • Customizable search field
  • Customizable dropdown items
  • Hooks for search logic
  • Initial value support
  • Placeholder text support
  • Widget to display when the dropdown is empty
State Management Compatibility
  • Designed to work seamlessly with Cubit/Bloc and other orthodox state managers. Since the list updating logic resides higher up in the widget tree, it allows for a clean separation between UI and logic.

Usage

Here's a simple example demonstrating how to use the SearchAutocomplete widget:

Basic example:
SearchAutocomplete<String>(
  options: state.filteredItems, // Like: ['Apple', 'Banana', 'Orange'],
  initValue: state.currentItem, // Like: 'Apple',
  getString: (item) => item,
  onSearch: (query) {
    // Call your Bloc/Cubit/Provider method to filter options based on the query
    context.read<SearchCubit>().search(query);
  },
  onSelected: (item) {
    // Update your Bloc/Cubit/Provider state when an item is selected
    context.read<SearchCubit>().select(item);
  },
  hintText: 'Search fruits...',
)
Customization example:

You can customize both the search field and dropdown items appearance using provided builders:

SearchAutocomplete<String>(
  options: state.filteredItems,
  initValue: state.currentItem,
  getString: (item) => item,

  onSearch: (query) {
    context.read<SearchCubit>().search(query);
  },

  onSelected: (item) {
    context.read<SearchCubit>().select(item);
  },

  fieldBuilder: (controller, onFieldTap, showDropdown, onPressed) {
    return TextFormField(
      controller: controller,
      onTap: onFieldTap,
      decoration: InputDecoration(
        hintText: 'Custom search...',
        suffixIcon: IconButton(
          icon: Icon(
            showDropdown ? Icons.arrow_drop_up : Icons.arrow_drop_down,
          ),
          onPressed: () => onPressed(showDropdown),
        ),
      ),
    );
  },

  dropDownBuilder: (options, onSelected, controller) {
    return ListView.builder(
      itemCount: options.length,
      itemBuilder: (context, index) {
        final option = options[index];
        return ListTile(
          leading: Icon(Icons.star),
          title: Text(option),
          onTap: () => onSelected(option),
        );
      },
    );
  },

  emptyDropDown: (controller, close) {
    return Center(child: Text('No results found.'));
  },
)

License

This package is licensed under the MIT License. See the LICENSE.md file for details.

श्रेणियाँ

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।