StyledSearchBar
16/01/2026Moins de 1 minuteGuide
StyledSearchBar
Description :
Le style d'une barre de recherche
Utilisation :
Utilisation rare (7 fois).
A utiliser pour mettre en place une barre de recherche.
Paramètres :
label (String)obligatoire: Le texte de la barre de recherche (au dessus du texte de recherche)color (Color)optionel : La couleur de fond du bouton (par défaut gris)onChanged (Future Function(String))optionel : La fonction à lancer quand le texte changesuffixIcon (Widget)optionel : Un widget qui sera tout à droite (typiquement un icône de recherchepadding (EdgeInsetsGeometry)optionel : Le padding autour de la barre de recherche (par défaut 30px horizontal)onSuffixIconTap (void Function(FocusNode focusNode, TextEditingController controller))optionel : La fonction à lancer quand on clic sur le suffixIcon (il faut donc précisez le suffixIcon)
Exemple :
loaners_items.dart
StyledSearchBar(
label: LoanTextConstants.itemHandling,
onChanged: (value) async {
if (editingController.text.isNotEmpty) {
loanersItemsNotifier.setTData(
loaner,
await itemListNotifier
.filterItems(editingController.text));
} else {
loanersItemsNotifier.setTData(loaner, itemList);
}
},
)