categorized_dropdown

Creator: coderz1093

Last updated:

0 purchases

categorized_dropdown Image
categorized_dropdown Images

Languages

Categories

Add to Cart

Description:

categorized dropdown

categorized_dropdown #
Categorized dropdown created using base dropdown widget of the Flutter.



Dropdown Field
Dropdown Items









Getting Started #
Depend on it #
Run this command:
With Flutter:
$ flutter pub add categorised_dropdown
copied to clipboard
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):
dependencies:
categorized_dropdown: 1.0.0
copied to clipboard
Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.
Import it #
Now in your Dart code, you can use:
import 'package:categorized_dropdown/categorised_dropdown.dart';
copied to clipboard
Example #
final List<CategorizedDropdownItem<String>>? items = [
CategorizedDropdownItem(text: 'Exhaust', subItems: [
SubCategorizedDropdownItem(text: 'Pipes', value: 'pipes'),
SubCategorizedDropdownItem(text: 'Mufflers', value: 'mufflers'),
SubCategorizedDropdownItem(text: 'Gaskets', value: 'gaskets'),
]),
CategorizedDropdownItem(text: 'Engine Parts', subItems: [
SubCategorizedDropdownItem(text: 'Engine mounts', value: 'engine-mounts'),
SubCategorizedDropdownItem(text: 'Oil Filters', value: 'oil-filters'),
]),
CategorizedDropdownItem(text: 'Fuel & Emission', subItems: [
SubCategorizedDropdownItem(text: 'Fuel Injection', value: 'fuel-incection'),
SubCategorizedDropdownItem(text: '02 Sensor', value: 'o2-sensor'),
]),
CategorizedDropdownItem(text: 'Other', value: 'Other'),
];
copied to clipboard
String? value;
copied to clipboard
CategorizedDropdown(
items: items,
value: value,
hint: const Text('Select auto parts'),
onChanged: (v) {
setState(() {
value = value;
});
},
),
copied to clipboard
Contributions #
Contributions of any kind are more than welcome! Feel free to fork and improve in any way you want, make a pull request, or open an issue.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.