Flutter DropdownSearch

Overview

Flutter DropdownSearch

Flutter simple and robust DropdownSearch with item search feature, making it possible to use an offline item list or filtering URL for easy customization.

Build

Key FeaturesExamplesLicense

Dropdown search

Key Features

  • Sync and/or Async items (online, offline, DB, ...)
  • Searchable dropdown
  • Three dropdown mode: Menu/ BottomSheet/ Dialog
  • Single & multi selection
  • Material dropdown
  • Easy customizable UI
  • Handle Light and Dark theme
  • Easy implementation into statelessWidget

packages.yaml

dropdown_search: 
   

Import

import 'package:dropdown_search/dropdown_search.dart';

Simple implementation

s.startsWith('I'), onChanged: print, selectedItem: "Brazil"), DropdownSearch .multiSelection( mode: Mode.MENU, showSelectedItem: true, items: ["Brazil", "Italia (Disabled)", "Tunisia", 'Canada'], label: "Menu mode", hint: "country in menu mode", popupItemDisabled: (String s) => s.startsWith('I'), onChanged: print, selectedItems: ["Brazil"]),">
DropdownSearch<String>(
    mode: Mode.MENU,
    showSelectedItem: true,
    items: ["Brazil", "Italia (Disabled)", "Tunisia", 'Canada'],
    label: "Menu mode",
    hint: "country in menu mode",
    popupItemDisabled: (String s) => s.startsWith('I'),
    onChanged: print,
    selectedItem: "Brazil"),
    
    
DropdownSearch<String>.multiSelection(
    mode: Mode.MENU,
    showSelectedItem: true,
    items: ["Brazil", "Italia (Disabled)", "Tunisia", 'Canada'],
    label: "Menu mode",
    hint: "country in menu mode",
    popupItemDisabled: (String s) => s.startsWith('I'),
    onChanged: print,
    selectedItems: ["Brazil"]),

customize showed field (itemAsString)

getData(filter), itemAsString: (UserModel u) => u.userAsStringByName(), onChanged: (UserModel data) => print(data), ), DropdownSearch ( label: "Name", onFind: (String filter) => getData(filter), itemAsString: (UserModel u) => u.userAsStringById(), onChanged: (UserModel data) => print(data), ),">
DropdownSearch<UserModel>(
  label: "Name",
  onFind: (String filter) => getData(filter),
  itemAsString: (UserModel u) => u.userAsStringByName(),
  onChanged: (UserModel data) => print(data),
),

DropdownSearch<UserModel>(
  label: "Name",
  onFind: (String filter) => getData(filter),
  itemAsString: (UserModel u) => u.userAsStringById(),
  onChanged: (UserModel data) => print(data),
),

customize Filter Function

user.userFilterByCreationDate(filter), onFind: (String filter) => getData(filter), itemAsString: (UserModel u) => u.userAsStringByName(), onChanged: (UserModel data) => print(data), ),">
DropdownSearch<UserModel>(
  label: "Name",
  filterFn: (user, filter) => user.userFilterByCreationDate(filter),
  onFind: (String filter) => getData(filter),
  itemAsString: (UserModel u) => u.userAsStringByName(),
  onChanged: (UserModel data) => print(data),
),

customize Search Mode

getData(filter), itemAsString: (UserModel u) => u.userAsString(), onChanged: (UserModel data) => print(data), ),">
DropdownSearch<UserModel>(
  mode: Mode.BOTTOM_SHEET,
  label: "Name",
  onFind: (String filter) => getData(filter),
  itemAsString: (UserModel u) => u.userAsString(),
  onChanged: (UserModel data) => print(data),
),

Validation

DropdownSearch(
  items: ["Brazil", "France", "Tunisia", "Canada"],
  label: "Country",
  onChanged: print,
  selectedItem: "Tunisia",
  validator: (String item) {
    if (item == null)
      return "Required field";
    else if (item == "Brazil")
      return "Invalid item";
    else
      return null;
  },
);

Endpoint implementation (using Dio package)

DropdownSearch<UserModel>(
  label: "Name",
  onFind: (String filter) async {
    var response = await Dio().get(
        "http://5d85ccfb1e61af001471bf60.mockapi.io/user",
        queryParameters: {"filter": filter},
    );
    var models = UserModel.fromJsonList(response.data);
    return models;
  },
  onChanged: (UserModel data) {
    print(data);
  },
);

Layout customization

You can customize the layout of the DropdownSearch and its items. EXAMPLE

Full documentation here

Attention

To use a template as an item type, and you don't want to use a custom function itemAsString and compareFn you need to implement toString, equals and hashcode, as shown below:

fromJsonList(List list) { if (list == null) return null; return list.map((item) => UserModel.fromJson(item)).toList(); } ///this method will prevent the override of toString String userAsString() { return '#${this.id} ${this.name}'; } ///this method will prevent the override of toString bool userFilterByCreationDate(String filter) { return this?.createdAt?.toString()?.contains(filter); } ///custom comparing function to check if two users are equal bool isEqual(UserModel model) { return this?.id == model?.id; } @override String toString() => name; }">
class UserModel {
  final String id;
  final DateTime createdAt;
  final String name;
  final String avatar;

  UserModel({this.id, this.createdAt, this.name, this.avatar});

  factory UserModel.fromJson(Map<String, dynamic> json) {
    if (json == null) return null;
    return UserModel(
      id: json["id"],
      createdAt:
          json["createdAt"] == null ? null : DateTime.parse(json["createdAt"]),
      name: json["name"],
      avatar: json["avatar"],
    );
  }

  static List<UserModel> fromJsonList(List list) {
    if (list == null) return null;
    return list.map((item) => UserModel.fromJson(item)).toList();
  }

  ///this method will prevent the override of toString
  String userAsString() {
    return '#${this.id} ${this.name}';
  }

  ///this method will prevent the override of toString
  bool userFilterByCreationDate(String filter) {
    return this?.createdAt?.toString()?.contains(filter);
  }

  ///custom comparing function to check if two users are equal
  bool isEqual(UserModel model) {
    return this?.id == model?.id;
  }

  @override
  String toString() => name;
}

View more Examples

Support

If this plugin was useful to you, helped you to deliver your app, saved you a lot of time, or you just want to support the project, I would be very grateful if you buy me a cup of coffee.

Buy Me A Coffee

License

MIT

Comments
  • build failed

    build failed

    /E:/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_search-0.6.3/lib/src/selectDialog.dart:193:23: Error: No named parameter with the name 'interactive'. interactive: widget.scrollbarProps?.interactive, ^^^^^^^^^^^ /E:/Flutter/flutter/packages/flutter/lib/src/material/scrollbar.dart:63:9: Context: Found this candidate, but the arguments don't match. const Scrollbar({ ^^^^^^^^^

    FAILURE: Build failed with an exception.

    • Where: Script 'E:\Flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991

    • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

    Process 'command 'E:\Flutter\flutter\bin\flutter.bat'' finished with non-zero exit value 1

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 49s Exception: Gradle task assembleDebug failed with exit code 1

    dropdown_search: ^0.6.3

    opened by AliEasy 16
  • Search bar works in simulator / running in debug on a physical device but not in built app

    Search bar works in simulator / running in debug on a physical device but not in built app

    The search bar/function of the Searchable.Dialog works fine when running my flutter app in simulator or on a physical device in debug mode (i.e. connected by a cable). However, when I distribute the app and open it using Firebase App Distribution, the search bar/function no longer works.

    image

    opened by phucgotecq 15
  • Can't add spaces in the search box when using Mode.MENU

    Can't add spaces in the search box when using Mode.MENU

    Hi,

    I'm using dropdown_search version 1.0.0 to build a dropdown whose items contain spaces. However, if I can't type a space within the search box.

    The code I'm using is the following:

    DropdownSearch<Address>(
            mode: Mode.MENU,
            showSelectedItems: false,
            showSearchBox: true,
            selectedItem: _address,
            items: _addressChoices,
            emptyBuilder: (BuildContext context, String? searchEntry) {
              return Center(
                  child: Text(
                'Sin resultados.',
                style: TextStyle(color: WardColors.textLight),
              ));
            },
            searchFieldProps: TextFieldProps(
                decoration: InputDecoration(
                    border: OutlineInputBorder(
                        borderRadius: BorderRadius.circular(6.0),
                        borderSide: BorderSide(color: WardColors.light)))),
            dropDownButton: Icon(
              Icons.arrow_drop_down,
              size: 24,
              color: WardColors.textGrey,
            ),
            itemAsString: (Address? a) => a!.description,
            popupBackgroundColor: WardColors.dark,
            onChanged: (Address? value) {
              setState(() {
                _address = value;
              });
            },
            validator: (value) {
              if (value == null || _address != value) {
                return 'Este campo es obligatorio.';
              }
            },
          )
    

    In the code, there are obviously some things specific to my project. But I'd like to know if there's a way for the user to type a space in the search bar?

    Thank you for your help.

    opened by jaimevaqueiro 14
  • Deselecting an item which was defined as selected Item ends up duplicating item in list.

    Deselecting an item which was defined as selected Item ends up duplicating item in list.

    Here is simplified code with defined items as well as defined selectedItem.

    On load, it correctly shows the selected Item. image

    In bringing up list, it correctly shows Item selected: image

    I then click to de-select, the item, but upon closing, it's added the item twice. image

    DropdownSearch<dynamic>.multiSelection(
                    items: [{"data":"Shooter","optionid":1,"attributes":{"text":"white","color":"#009688"}},{"data":"Stategy","optionid":2,"attributes":{"text":"black","color":"#ff80ab"}},{"data":"Puzzle","optionid":3,"attributes":{"text":"#FFFFFF","color":"#F44336"}},{"data":"Platformer","optionid":4,"attributes":{"text":"#000000","color":"#FFEBEE"}},{"data":"RPG","optionid":5,"attributes":{"text":"black","color":"#ff8a80"}},{"data":"Open World","optionid":6,"attributes":{"text":"black","color":"#03A9F4"}},{"data":"Metrovania","optionid":7,"attributes":{"text":"#FFFFFF","color":"#C79702"}},{"data":"Simulation","optionid":8,"attributes":{"text":"#FFFFFF","color":"#DD2C00"}},{"data":"Horror","optionid":9,"attributes":{"text":"#FFFFFF","color":"#E91E63"}}],
                    // maxHeight: 300,
                    searchFieldProps: TextFieldProps(decoration: InputDecoration(labelText: 'Filter...')),
                    isFilteredOnline: false,
                     compareFn: (item, selectedItem) =>
                        item?['optionid'] == selectedItem?['optionid'],
                    showClearButton: true,
                    dropdownBuilder: _multiSelectDropDownRender,
                    popupItemBuilder: _multiSelectPopupBuilder,
                    label: e['header'].toString().toUpperCase(),
                    selectedItems: [{"data":"Shooter","optionid":1,"attributes":{"text":"white","color":"#009688"}}],
                    onChange: (dynamic s) async {
                        await widget.updateFieldValue(
                            widget.rowData['id'], e['data'], s, 6);
                      },
                    showSearchBox: true,
                  )
    
    opened by ElixirMike 13
  • set default select item

    set default select item

    hi , i'm using SearchableDropdown (flutter_form_builder package) everything work perfectly , but i got a small problem on my Edit Form i want to set a default select item but i don't know how to set it . data list i get from my backend service look like this

    Data :

    [ {'label':'Apple', value: 00001}, {'label':'Book', value: 00002} ]

    Backend Method

    class GlobalLookUpList{
    List<dynamic> _locationOpts;
      Future<List<dynamic>> locationOpts(
          {@required Map<String, dynamic> options}) async {
        print(options);
        _locationOpts =
            await meteor.call('microfis.selectOpts.locationVillage', [options]);
        return _locationOpts;
      }
    }
    

    Edit from

      FormBuilderSearchableDropdown(
                                mode: Mode.DIALOG,
                                name: "location",
                                decoration: fbTextFieldStyle(labelText: "Location"),
                                hint: 'Select Location',
                                validator: FormBuilderValidators.compose([
                                  FormBuilderValidators.required(context),
                                ]),
                                items: [],
                                isFilteredOnline: true,
                                onFind: (String filter) =>
                                    GlobalLookUpList().locationOpts(options: {
                                  'searchText': filter,
                                  'values': [],
                                  'params': {'branchId': '001'}
                                }),
                                itemAsString: ((u) {
                                  return "${u['label']}";
                                }),
                                onChanged: (data) {
                                  print(data);
                                },
                              ),
    

    can you show me how to set it ? thank in advance :)

    help wanted 
    opened by YouSour 13
  • clear and dropdown icon builders

    clear and dropdown icon builders

    Hi! Thanks for your work.

    I added some more functionality.

    Currently in IconButton expands widget a lot in case of UnderlineInputBorder - https://tppr.me/TlMM1 You can compare how two fields looks like with the same decoration.

    I added clearButtonBuilder and dropdownButtonBuilder to have an ability to override the buttons completely. And suffixIcons to add an ability to manage the where the icons are placed. Here how it looks now(with suffixIcons: true) - https://tppr.me/lnVzZ

    opened by vasilich6107 13
  • On error request data again

    On error request data again

    Hello!

    I'm using "onFind" and I'd like to have the ability to request data again if an error occurred during the latest request. I assume that "errorBuilder" can be used, but how to call "onFind" from there?

    Thanks in advance!

    opened by Vitaly-V 13
  • Fix for incorrect instantiation of TextEditingController

    Fix for incorrect instantiation of TextEditingController

    Fix for incorrect instantiation of TextEditingController inside TextFieldProps class. The original code causes a) disconnect of listener, which is incorrectly added only during initState and therefore missed if another instance of TextFieldProps is created, and b) as the library creates a TextEditingController, it should dispose of it... but doesn't, so this is always a memory leak.

    Anyway, this change avoids creating the TextEditingController and avoids both a) and b).

    opened by gslender 10
  • Unable to use dropdown_search within MaterialApp builder

    Unable to use dropdown_search within MaterialApp builder

    I am getting an error if I use this control directly within MaterialApp builder

      @override
      Widget build(BuildContext context) {
        return StreamBuilder<User>(
          stream: Modular.get<AuthService>().onAuthStateChanged,
          builder: (_, AsyncSnapshot<User> snapshot) {
            if (snapshot.connectionState == ConnectionState.active) {
              final bool isAuthenticated = snapshot.data != null;
    
              return MaterialApp(
                title: 'Example App',
                theme: _themeData(),
                initialRoute: isAuthenticated ? '/accounts' : '/login',
                builder: (context, child) {
                  return MasterPage(      <--- dropdown_search is located within the MasterPage
                    child: child,
                    isAuthenticated: isAuthenticated,
                  );
                },
                navigatorKey: Modular.navigatorKey,
                onGenerateRoute: (settings) =>
                    AppRouting(isAuthenticated).generateRoute(settings),
              );
            }
    
            return Container();
          },
        );
      }
    
    

    I have placed the dropdown_search widget within the MasterPage as I want the dropdown search control to be persistent so that when I push to navigator this won't get rendered.

    This render fine but when I press the dropdown and I get the following error

    TypeError: Cannot read property 'context' of null at _DropdownSearchState.new.[_openMenu] (http://127.0.0.1:8080/packages/dropdown_search/src/selectDialog.dart.lib.js:3455:72) at _DropdownSearchState.new._selectSearchMode (http://127.0.0.1:8080/packages/dropdown_search/src/selectDialog.dart.lib.js:3485:34) at _selectSearchMode.next () at runBody (http://127.0.0.1:8080/dart_sdk.js:37699:34) at Object._async [as async] (http://127.0.0.1:8080/dart_sdk.js:37730:7) at _DropdownSearchState.new.[_selectSearchMode] (http://127.0.0.1:8080/packages/dropdown_search/src/selectDialog.dart.lib.js:3482:22) at http://127.0.0.1:8080/packages/dropdown_search/src/selectDialog.dart.lib.js:3405:307 at tap.TapGestureRecognizer.new.invokeCallback (http://127.0.0.1:8080/packages/flutter/src/gestures/recognizer.dart.lib.js:189:18) at tap.TapGestureRecognizer.new.handleTapUp (http://127.0.0.1:8080/packages/flutter/src/gestures/tap.dart.lib.js:395:40) at tap.TapGestureRecognizer.new.[_checkUp] (http://127.0.0.1:8080/packages/flutter/src/gestures/tap.dart.lib.js:201:12) at tap.TapGestureRecognizer.new.handlePrimaryPointer (http://127.0.0.1:8080/packages/flutter/src/gestures/tap.dart.lib.js:148:23) at tap.TapGestureRecognizer.new.handleEvent (http://127.0.0.1:8080/packages/flutter/src/gestures/recognizer.dart.lib.js:448:16) at pointer_router.PointerRouter.new.[_dispatch] (http://127.0.0.1:8080/packages/flutter/src/gestures/pointer_router.dart.lib.js:74:9) at http://127.0.0.1:8080/packages/flutter/src/gestures/pointer_router.dart.lib.js:109:26 at LinkedMap.new.forEach (http://127.0.0.1:8080/dart_sdk.js:24816:11) at pointer_router.PointerRouter.new.[_dispatchEventToRoutes] (http://127.0.0.1:8080/packages/flutter/src/gestures/pointer_router.dart.lib.js:106:29) at pointer_router.PointerRouter.new.route (http://127.0.0.1:8080/packages/flutter/src/gestures/pointer_router.dart.lib.js:98:37) at binding$5.WidgetsFlutterBinding.new.handleEvent (http://127.0.0.1:8080/packages/flutter/src/gestures/binding.dart.lib.js:306:26) at binding$5.WidgetsFlutterBinding.new.dispatchEvent (http://127.0.0.1:8080/packages/flutter/src/gestures/binding.dart.lib.js:289:24) at binding$5.WidgetsFlutterBinding.new.dispatchEvent (http://127.0.0.1:8080/packages/flutter/src/rendering/layer.dart.lib.js:5973:13) at binding$5.WidgetsFlutterBinding.new.[_handlePointerEventImmediately] (http://127.0.0.1:8080/packages/flutter/src/gestures/binding.dart.lib.js:260:14) at binding$5.WidgetsFlutterBinding.new.handlePointerEvent (http://127.0.0.1:8080/packages/flutter/src/gestures/binding.dart.lib.js:233:43) at binding$5.WidgetsFlutterBinding.new.[_flushPointerEventQueue] (http://127.0.0.1:8080/packages/flutter/src/gestures/binding.dart.lib.js:222:14) at binding$5.WidgetsFlutterBinding.new.[_handlePointerDataPacket] (http://127.0.0.1:8080/packages/flutter/src/gestures/binding.dart.lib.js:212:65) at Object._invoke1 (http://127.0.0.1:8080/dart_sdk.js:176547:7) at _engine.EngineWindow.new.invokeOnPointerDataPacket (http://127.0.0.1:8080/dart_sdk.js:172276:15) at _engine.PointerBinding.__.[_onPointerData] (http://127.0.0.1:8080/dart_sdk.js:159053:24) at http://127.0.0.1:8080/dart_sdk.js:159442:26 at http://127.0.0.1:8080/dart_sdk.js:159401:16 at http://127.0.0.1:8080/dart_sdk.js:159154:11

    This is to do with the Overlay.of(context) returns null which I think its due to the context from MaterialApp builder I am not sure how to fix this... Could someone please help?

    opened by ckrc 10
  • InputDecorator isEmpty should not depend from assigned dropdownBuilder

    InputDecorator isEmpty should not depend from assigned dropdownBuilder

    Currently if dropdownBuilder is assigned, it's not possible to make label text shown as placeholder. To fix this problem minor change is needed:

    return InputDecorator(
                      isEmpty: value == null && widget.dropdownBuilder == null,
    

    Check && widget.dropdownBuilder == null should be deleted, otherwise no way to get label shown as placeholder.

    enhancement 
    opened by slavap 10
  • BOTTOM_SHEET doesn't work

    BOTTOM_SHEET doesn't work

    Hello, same issue here.

    return DropdownSearch<Stati>(
          mode: Mode.BOTTOM_SHEET, //Workd with dialog and menu, but no with BOTTOM_SHETT
          selectedItem: new Stati(id: 106, nome: "Italia"),
          isFilteredOnline: false,
          items: this.stati,
          showSearchBox: true,
          itemAsString: (Stati s) => s.nome,
          popupTitle: Text(
            ApplicationLocalizations.of(context).translate('cerca'),
            textAlign: TextAlign.center,
            style: TextStyle(fontWeight: FontWeight.bold),
          ),
          dropdownSearchDecoration: InputDecoration(
            labelText: ApplicationLocalizations.of(context).translate('stato'),
            labelStyle: TextStyle(fontWeight: FontWeight.bold),
            icon: Icon(
              Icons.search,
              color: Color.fromRGBO(91, 151, 181, 1),
            ),
          ),
          onChanged: (Stati data) {
            print(data);
          },
        );
    

    if I do the search the list is not updated, moreover I have noticed that if I do a search (the list is not updated) and if I click on an element in the list it is not selected

    Originally posted by @campio97 in https://github.com/salim-lachdhaf/searchable_dropdown/issues/358#issuecomment-1031384882

    opened by campio97 9
  • Selected items overflow Multiselection Dropdown

    Selected items overflow Multiselection Dropdown

    Describe the bug Dropdowns with multiSelection overflow the layout.

    To Reproduce Steps to reproduce the behavior:

    1. Create a DropdownSearch.multiSelection with many items
    2. Put this Dropdown inside a container with reasonable but limited space
    3. Select all the items
    4. Observe how the items go outside the Dropdown bar

    The following code reproduces the bug

    @override
    Widget build(BuildContext context) {
      return Container(
        height: 100,
        width: 400,
        child: DropdownSearch.multiSelection(
          items: const [
            'Avocado',
            'Banana',
            'Cashew',
            'Damasco',
            'Eggplant',
            'Fig',
          ],
        ),
      );
    }
    

    Expected behavior I believe the items inside the dropdown should be clipped by default.

    Screenshots image image

    Desktop (please complete the following information):

    • OS: linux ( but I'm pretty sure this will happen in all platforms )

    Additional context Add any other context about the problem here.

    opened by FelipeEmos 0
  • Can we have styling examples?

    Can we have styling examples?

    Styling is extremely complex, props are deeply nested, and they are not easy to edit.

    Can we have styling examples like the ones shown on the repo?

    Thanks

    image
    opened by mariopepe 0
  • Error: No named parameter with the name 'style'.

    Error: No named parameter with the name 'style'.

    ../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/dropdown_search-5.0.5/lib/dropdown_search.dart:476:13: Error: No named parameter with the name 'style'. style: widget.clearButtonProps.style, ^^^^^ /C:/flutter_sdks/flutter/packages/flutter/lib/src/material/icon_button.dart:117:9: Context: Found this candidate, but the arguments don't match. const IconButton({ ^^^^^^^^^^ ../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/dropdown_search-5.0.5/lib/dropdown_search.dart:501:13: Error: No named parameter with the name 'style'. style: widget.dropdownButtonProps.style, ^^^^^ /C:/flutter_sdks/flutter/packages/flutter/lib/src/material/icon_button.dart:117:9: Context: Found this candidate, but the arguments don't match. const IconButton({ ^^^^^^^^^^

    FAILURE: Build failed with an exception.

    • Where: Script 'C:\flutter_sdks\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156

    • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

    Process 'command 'C:\flutter_sdks\flutter\bin\flutter.bat'' finished with non-zero exit value 1

    • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 37s Exception: Gradle task assembleDebug failed with exit code 1

    opened by praveen0308 5
  • Checkbox at left side

    Checkbox at left side

    Hi. I m using this great package in my project and it really great. I know it's duplicate #458. But i did't see the solution there. My question is how can i set checkbox at left side in MultiSelect mode.

    opened by xakeppok 0
  • How to use errorBuilder

    How to use errorBuilder

    Hi I am using dropdown_search: ^3.0.1 and list of the data in dropdown is from api. So, what I would like to ask is.. when data from api is throwing error, I would like to show something like warning icon that there was an error while getting data from api. Here is part of the code

    DropdownSearch<String>(
          errorBuilder: (context, message, errorMessage) {
            print("error is running");
            return Center(
              child: Text("error")
            );
          },
          mode: Mode.MENU,
          maxHeight: 250,
          showSelectedItems: true,
          items: dataShow,
          onChanged: (value) {
           ...... // my function
          },
          selectedItem: valData
          showSearchBox: true,
        );
    

    I have used errorBuilder here but don't know when it is fired I also open this question on https://stackoverflow.com/questions/74779609/how-to-do-error-handling-in-dropdown-flutter

    opened by wahyu-handayani 0
Owner
Salim Lachdhaf
Mobile Developer
Salim Lachdhaf
Flutter Carousel Pro - A Flutter Carousel widget

Carousel Extended A Flutter Carousel widget. Usage As simple as using any flutter Widget. Based on Carousel Pro but extended to be able to navigate be

omid habibi 3 Dec 7, 2020
Flutter-useful-widgets - Flutter Useful Widgets

useful_widgets This package makes it easy to build apps by providing a list of simple and useful widgets. import 'package:useful_widgets/useful_widget

Ricardo Crescenti 6 Jun 20, 2022
Flutter Duration Button - Create auto-click button likes Netflix's Skip Intro button in Flutter

Flutter Duration Button - Create auto-click button likes Netflix's Skip Intro button in Flutter

Kim Seung Hwan 7 Dec 7, 2022
Various Flutter widgets that are developed by Google but not by the core Flutter team

Flutter widgets This repository contains the source code for various Flutter widgets that are developed by Google but not by the core Flutter team. Is

Google 1.1k Jan 7, 2023
🟥 A flutter widget that flashes when flutter fails to render a frame in a certain timeframe

?? A flutter widget that flashes when flutter fails to render a frame in a certain timeframe

Andrei Lesnitsky 32 Oct 8, 2022
A Flutter plugin that makes it easier to make floating/overlay windows for Android with pure Flutter

flutter_floatwing A Flutter plugin that makes it easier to make floating/overlay windows for Android with pure Flutter. Android only Features Pure Flu

Zoe 116 Dec 21, 2022
Flutter Application to test basic flutter understanding

Flutter Application to test basic flutter understanding Getting Started Before you start with the application have a look at what

null 0 Apr 16, 2022
Flutter UI Widgets Flutter Package

Flutter UI Widgets Flutter Package This package makes different Flutter UI widgets implementation easy for you. Flutter UI Widgets The list of widgets

Hassan Ur Rahman 0 May 6, 2022
React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.

English | Português Flutter Hooks A Flutter implementation of React hooks: https://medium.com/@dan_abramov/making-sense-of-react-hooks-fdbde8803889 Ho

Remi Rousselet 2.6k Dec 29, 2022
Simple form maker for Flutter Framework

Flutter FormBuilder - flutter_form_builder This package helps in creation of data collection forms in Flutter by removing the boilerplate needed to bu

Danvick Miller 1.2k Jan 3, 2023
A credit card widget for Flutter application.

A credit card widget for Flutter application.

Simform Solutions 281 Dec 27, 2022
Code generation for Flutter Padding widgets based on your constants

Code generation for Flutter Padding widgets based on your constants

Emanuele 14 Oct 20, 2022
A simple Flutter widget library that helps us to select days in a week.

A simple Flutter widget library that helps us to select days in a week.

Shan Shaji 4 Oct 9, 2022
Flutter debug helper widget with common and custom actions

Flutter debug helper widget with common and custom actions

Stanislav Ilin 43 Dec 7, 2022
A flutter plugin which provides Crop Widget for cropping images.

A flutter plugin which provides Crop Widget for cropping images.

Chooyan 97 Jan 5, 2023
Flutter Easy Getx Implementations .

People ask me how I manage state,dependency,routes etc when I work with flutter,Here is the Simple Brief About GetX which I used for Dummy Basic Ecommerce Concept based flutter app development .

Tasnuva Tabassum oshin 13 Oct 18, 2022
The Chicago widget set for Flutter

Chicago widget library The Chicago widget set is a retro 32-bit desktop design language for Flutter. It was discussed in the Building a desktop design

Todd Volkert 404 Dec 26, 2022
A draggable Flutter widget that makes implementing a Sliding up and fully-stretchable much easier.

Draggable Home A draggable Flutter widget that makes implementing a Sliding up and fully-stretchable much easier! Based on the Scaffold and Sliver. Us

Devs On Flutter 106 Dec 12, 2022
Flutter | Snap physics for your scrollview

Snap Scroll Physics When building scrollable views, sometimes you would prefer that the scroll stopped at a given offset, or that it avoids to stop in

Jaime Blasco 46 Nov 21, 2022