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/)
Edit: take `awk` out of the loop, and it can maintain the count:

```
for ... do ... done | awk 'BEGIN { x = 0; } { printf("%.1f %s\n", x, $2); x += 0.2; }'

```

Output in my test:

```
0.0 -1261.21295697266896
0.2 -1261.21748935324558
0.4 -1261.21885728710254
0.6 -1261.21737642551761
0.8 -1261.21337619301949
1.0 -1261.20719583615892

```

You can increment `x` by whatever you want. For example to make them a series of even numbers, start with 0 and increment by 2.