flutter_tags
flutter_tags copied to clipboard
Add support for null-safety
I've been waiting for ages. You're probably better off creating it yourself like this:
...
Wrap(
children: widget.list.asMap().map(
(index, ingredient) => MapEntry(index, _buildChip(index, ingredient))
).values.toList(),
spacing: 6,
runSpacing: 3,
),
...
Widget _buildChip(int index, String ingredient){
return Chip(
label: Text(ingredient, style: regularTextStyle.copyWith(color: Colors.white)),
backgroundColor: themeOrangeColor,
deleteIcon: Icon(FontAwesomeIcons.timesCircle, size: 20),
labelPadding: EdgeInsets.fromLTRB(5,2,1,2),
elevation: 5,
onDeleted: (){
setState(() {
widget.list.removeAt(index);
});
},
);
}
This way you don't need to import any packages and it's not that many lines of code.
Yep, delete the framework and implement it by yourself.