Question: I am building a fitness app (image here: [Fitness App example](https://i.stack.imgur.com/YWQCK.png)
) where the user can log their sets. I am having an issue when using the dismissible widget inside of my app. The swipe to delete functionality sends the following exception: **a dismissed dismissible widget is still part of the tree**

When swiping to delete a single set, I still need to retain the information the user has put into the other sets. I believe this is an issue with the key, however I've already tried UniqueKey() (which resets all of the other input fields) and the example below.

How can I remove a single set using dismissible and still retain the rest of the users data for the other sets? Thanks.

```
late List count = [0];

ListView.builder(
                shrinkWrap: true,
                itemCount: _count.length,
                itemBuilder: (context, index) {
                  // Create a new variable to display the set
                  int setNumber = index + 1;
                  return Dismissible(
                    key: ValueKey(_count[index]),
                    background: _swipeStyle(),
                    onDismissed: (direction) {
                      // Remove the item from the data source.
                      setState(() {
                        _count.removeAt(index);
                      });
                    },
                    child: Row(
                      children: [
                        Expanded(flex: 1, child: Text('Set $setNumber')),
                        Expanded(flex: 2, child: _buildWeight(index)),
                        const SizedBox(
                          width: 24.0,
                        ),
                        Expanded(flex: 2, child: _buildReps(index)),
                      ],
                    ),
                  );
                },
              ),

```

Answer: 
Remove

```
| awk '{print $2}'

```

and append after `done`

```
| awk '{printf("%.1f %s\n", (NR-1)/5, $2)}'

```

---

See: [8 Powerful Awk Built-in Variables – FS, OFS, RS, ORS, **NR**, NF, FILENAME, FNR](https://www.thegeekstuff.com/2010/01/8-powerful-awk-built-in-variables-fs-ofs-rs-ors-nr-nf-filename-fnr/)
Untested since you didn't prove any sample input but this:

```
awk 'ENDFILE{print (ARGIND-1)/5, $2}' $(find . -name "E_total_conv.txt")

```

might be all you need (using GNU awk for ENDFILE and ARGIND) assuming your file names don't contain spaces and there aren't so many of them that they exceed the shell max args limit.