search_key_value_dropdown 0.0.2 copy "search_key_value_dropdown: ^0.0.2" to clipboard
search_key_value_dropdown: ^0.0.2 copied to clipboard

This searchable dropdown is used with key value pairs.

search_key_value_dropdown #

A Flutter package for creating searchable dropdowns with key-value pairs.

Introduction #

The search_key_value_dropdown package provides a widget that allows users to select items from a dropdown menu with search functionality. It is particularly useful when dealing with key-value pairs, where users need to select a value associated with a specific key.

Features #

  • Create searchable dropdown menus with key-value pairs.
  • Customize dropdown appearance and behavior.
  • Easy integration into Flutter apps.

Getting Started #

To use this package, add search_key_value_dropdown as a dependency in your pubspec.yaml file. For more information on how to add dependencies, visit the official documentation.

Usage #

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Searchable Dropdown Demo'),
        ),
        body: Center(
          child: SearchableDropDown().constantSearchDropdownButtonFormField2(
            items: [
              DropdownMenuItem(
                value: 'key1',
                child: Text('Item 1'),
              ),
              DropdownMenuItem(
                value: 'key2',
                child: Text('Item 2'),
              ),
              DropdownMenuItem(
                value: 'key3',
                child: Text('Item 3'),
              ),
            ],
            selectedValue: 'key1',
            onChanged: (value) {
              print(value);
            },
            searchController: TextEditingController(),
            hintText: 'Select an item',
            labelText: 'Items',
          ),
        ),
      ),
    );
  }
}
1
likes
105
points
7
downloads

Publisher

unverified uploader

Weekly Downloads

This searchable dropdown is used with key value pairs.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

dropdown_button2, flutter

More

Packages that depend on search_key_value_dropdown