Dn-a / flutter_tags

With flutter tags you can create selectable or input tags that automatically adapt to the screen width
https://pub.dartlang.org/packages/flutter_tags
MIT License
508 stars 124 forks source link

Add support for null-safety #82

Open ripetrescu opened 3 years ago

SeriousMonk commented 3 years ago

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.

app-arianamini commented 1 year ago

Yep, delete the framework and implement it by yourself.