migrate sample app

This commit is contained in:
Salvatore Giordano
2021-05-12 17:02:43 +02:00
parent 6d1db8d4bf
commit 0303e18945
15 changed files with 261 additions and 260 deletions
@@ -6,18 +6,18 @@ typedef OnChipAdded<T> = void Function(T chip);
typedef OnChipRemoved<T> = void Function(T chip);
class ChipsInputTextField<T> extends StatefulWidget {
final TextEditingController controller;
final FocusNode focusNode;
final ValueChanged<String> onInputChanged;
final TextEditingController? controller;
final FocusNode? focusNode;
final ValueChanged<String>? onInputChanged;
final ChipBuilder<T> chipBuilder;
final OnChipAdded<T> onChipAdded;
final OnChipRemoved<T> onChipRemoved;
final OnChipAdded<T>? onChipAdded;
final OnChipRemoved<T>? onChipRemoved;
final String hint;
const ChipsInputTextField({
Key key,
@required this.chipBuilder,
@required this.controller,
Key? key,
required this.chipBuilder,
required this.controller,
this.onInputChanged,
this.focusNode,
this.onChipAdded,
@@ -35,7 +35,7 @@ class ChipInputTextFieldState<T> extends State<ChipsInputTextField<T>> {
void addItem(T item) {
setState(() => _chips.add(item));
if (widget.onChipAdded != null) widget.onChipAdded(item);
if (widget.onChipAdded != null) widget.onChipAdded!(item);
}
void removeItem(T item) {
@@ -43,7 +43,7 @@ class ChipInputTextFieldState<T> extends State<ChipsInputTextField<T>> {
_chips.remove(item);
if (_chips.isEmpty) resumeItemAddition();
});
if (widget.onChipRemoved != null) widget.onChipRemoved(item);
if (widget.onChipRemoved != null) widget.onChipRemoved!(item);
}
void pauseItemAddition() {