simple_chips_input 0.4.0 simple_chips_input: ^0.4.0 copied to clipboard
Flutter package for creating chips while typing like in Gmail app.
simple_chips_input #
Contents #
- Create chips from user's text input and get the value after form submission
- Select pre-defined chips to get the value of selected chips
Importing the package #
import 'package:simple_chips_input/simple_chips_input.dart';
import 'package:simple_chips_input/select_chips_input.dart';
Working #
Example usage, refer API reference for full documentation #
SimpleChipsInput(
separatorCharacter: ",",
validateInput: true,
validateInputMethod: (String value) {
//some function to validate the input
},
widgetContainerDecoration: BoxDecoration(
//how the main widget container looks
),
onSubmitted: (p0) {
//something
},
//....other properties
)
SelectChipsInput(
chipsText: const ['sun', 'cloud', 'moon'],
separatorCharacter: ",",
selectedChipTextStyle: const TextStyle(
//some text style
),
unselectedChipTextStyle: const TextStyle(
//some style
),
onTap: (output) {
//output contains the end value
},
prefixIcons: const [null, Icon(Icons.cloud), null],
suffixIcons: const [Icon(Icons.sunny), null, Icon(Icons.circle)],
unselectedChipDecoration: BoxDecoration(
//some decoration
),
selectedChipDecoration: BoxDecoration(
//some decoration
),
),