Select2dot1 bietet Ihnen eine vollständig anpassbare Single/Multiple-Auswahlbox mit Unterstützung für Suche, Gruppenoptionen, zusätzliche Informationen und Avatare. Funktioniert über Overlay und Modal.
Aus öffentlichen Paketdaten erstellte Orientierung.
Select2dot1 ist ein hochgradig anpassbarer Flutter-Paket zur Erstellung einzelner oder mehrfacher Auswahlfelder mit erweiterten Funktionen wie Suchfunktion, gruppierte Optionen, benutzerdefinierte Optionendetails und Avatar-Unterstützung. Auf Basis von Überlagerungen und Modals bietet es eine nahtlose Benutzererfahrung über alle Plattformen hinweg. Das Paket ist ideal für Formulare und Datenauswahl-Schnittstellen, die reichhaltige Interaktion und visuelle Anpassung erfordern. Es unterstützt alle wichtigen Plattformen, darunter Android, iOS, Web, macOS, Windows und Linux.
Anwendungsfälle
Formularingaben mit durchsuchbaren Optionen
Mehrfachauswahl-Menüs in Dashboards
Gruppierte Kategorieauswahl
Benutzerprofilauswahl mit Avataren
Dynamische Filterung großer Datensätze
Hauptmerkmale
suchbare Dropdowns
Unterstützung für gruppierte Optionen
anpassbare Optionen-Widgets
Avatar- und Zusatzinformationen-Anzeige
Overlay-basierte Modal-Implementierung
Geeignet für
Entwickler, die reichhaltige Auswahlkomponenten benötigen
Apps mit komplexen Anforderungen an die Datenauswahl
Plattformübergreifende Anwendungen
UI-intensive Formulare und Admin-Panels
Hinweise
Erfordert sorgfältige Gestaltung für eine optimale Benutzererfahrung
Kann bei sehr großen Datensätzen eine Leistungsoptimierung erforderlich sein
Das Overlay-Verhalten erfordert möglicherweise plattformspezifische Anpassungen
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
Select2dot1
Introduction
Select2dot1 gives you a customizable single/multiple select box with support for searching, group option, extra info and avatar. Select2dot1 utilizes overlays on (web, desktop) and modal for mobile. Its entirely customizable through settings and builder.
ScrollController is used to control anchor position of dropdown menu. You can pass your own ScrollController to Select2dot1 widget.
Fully Customizable
If you want to change something that is not available in settings, you will have to make your own component through using the builder option.
Check the customization section for more information.
Components and Settings
Components View
In this section you can see how the components of Select2dot1 widget look like as well as their hierarchy. You can also see how to customize them by settings and builder. For more details hierarchy of components , go to Tree View Components with Settings section.
If you want to see treeview components with all settings you can access here.
Miro is an absolutely wonderful app that im familiar with, i would highly recommend you checking it outTree View was created by . If you want to customize any of the components of Select2dot1 widget, you can use Tree View to see all the components and settings.
Customization
If you want to customize Select2dot1 widget you can do it through utilizing the settings and builder.
The first option you can try to use is to use settings to customize, if you have a hard time with that you can use builder.
By Settings
Use global settings to customize all components of Select2dot1 widget
You can pass global settings to Select2dot1 widget. Global settings will be used by the components of Select2dot1 widget.
In the following example you will be shown how to customize mainColor and fontFamily for all the components of Select2dot1 widget.
Use single component settings to customize only one component of Select2dot1 widget
You can pass the single component settings to Select2dot1 widget. Single component settings will be used only by one component of Select2dot1 widget.
In the following example you will be shown how to customize the CategoryNameOverlay component and CategoryItemOverlay component in Dropdown (modification of the design only be done through desktop overlay).
Using builder you can customize all components of Select2dot1 widget. You can use your own components or you can use the default components that are available in Select2dot1 widget.
Create your own component completely
You can create your own component by using Select2dot1Builder class. You have to pass your own component to Select2dot1Builder class and then pass this class to Select2dot1 widget. When you are using builder you have access to all data that you need to create your own component.
If you want to change the layout of your component you can utilize other component templates, so you can use the default components that are available.
Remember that when using this builder, you must make sure that the code thats written is correct before you do anything else.
ATTENTION: For better performance create SelectDataController as field in class not in build
class_BasicExample1StateextendsState<BasicExample1> {
finalSelectDataController selectDataController = SelectDataController(
data: ExampleData.exampleData1,
);
@overrideWidgetbuild(BuildContext context) {
// Do not create SelectDataController in build method!// return Select2dot1(selectDataController: SelectDataController(data: ExampleData.exampleData1))returnSelect2dot1(selectDataController: selectDataController);
}
}
SelectDataController is a controller that is used to manage the data in Select2dot1 widget. You can use it to add, remove, select and deselect data. All the data that you want to display in Select2dot1 widget must be added to SelectDataController
Remember that when isMultiple is false, you can add only one position to initialSelectedData.
In SelectDataController you can also set:
inital selected data
multiple select or single select
Select2dot1(
selectDataController:
SelectDataController(
data: exampleData,
isMultiple: false,
initialSelectedData: [ // Remember that when isMultiple is false, you can add only one position to initialSelectedData.SingleItemCategoryModel(
nameSingleItem: 'Stuart Resch',
value: 'Stuart Resch 1',
),
],
),
);
Contributing
Pull requests (the pull request template is available for use) are welcome. For major changes, please open an issue first to discuss what you would like to change. More information about contributing you can find here. Remember to follow the code of conduct.
Issues
If you find any issues (bug, feature, performance or other), please report them here.
Please do not ask questions in the issue tracker. Use Q&A section instead.
Please do not report security vulnerabilities on the public issue tracker. The SECURITY page details the procedure for disclosing security issues.
Security
If you discover any security related issues, please go to SECURITY page.
Contributors
Roman Dykyj (@romanjrdykyj)
QA
If you have any questions, feel free to ask them here.
FAQ
How to get selected item?
Use 'onChanged' Callback Function
You can pass callback function to Select2dot1 widget. This function will be called every time when user select an item.
Select2dot1(
selectDataController: SelectDataController(data: exampleData),
onChanged: (value) {
print(value); // value is a list of selected items
},
),
How to used only overlay or modal mode on all platforms?
It is not possible to use only overlay or modal mode on all platforms. It is automatically set by the package. Overlay mode is used on desktop and modal mode is used on mobile.
How to set NO group select?
If you dont want to group select, you dont need to use name parameter in SingleCategoryModel.
staticconstList<SingleCategoryModel> exampleData3 = [
SingleCategoryModel(
nameCategory: null, // If you dont want to group select, you dont need to use name parameter in SingleCategoryModel or set it to null.
singleItemCategoryList: [
SingleItemCategoryModel(nameSingleItem: 'Alabama',),
SingleItemCategoryModel(nameSingleItem: 'Arkansas'),
SingleItemCategoryModel(nameSingleItem: 'Illonois'),
],
),
];
License
This package is licensed under the MIT license. To see the full license text, see the LICENSE file.