Question: I have the following code to create Row widgets based on a returned items from Future Builder

```
 for (int i = 0; i < snapshot.data.length; i++)  Row( ) ,

```

the above will create Rows based on the number of items from `snapshot.data`
what I'm trying to achieve is create multiple widget based on the length of items returned

```
for (int i = 0; i < snapshot.data.length; i++) {
    // for each item create two rows for example 
      Row( ) ,
      Row( ) ,
    } 

```

but I get the following error !

```
the element Type 'set<Row>' can't be assigned to the list 'Widget'

```

Answer: 
This should be achievable with TFF's [`tff.simulation.FileCheckpointManager`](https://www.tensorflow.org/federated/api_docs/python/tff/simulation/FileCheckpointManager). In particular, the [usage in Google Research's `federated` repo](https://github.com/google-research/federated/blob/7b6c011a2c0513d1d87f5609600b87e82760699b/fedopt_guide/training_loop.py#L200) was originally written to support restarting from checkpoints when using [learning rate scheduling and adaptive optimization on the server](https://github.com/google-research/federated/blob/7b6c011a2c0513d1d87f5609600b87e82760699b/optimization/shared/fed_avg_schedule.py) , an application for which correctly restoring the optimizer state is crucial.

As long as your [`tff.templates.IterativeProcess`](https://www.tensorflow.org/federated/api_docs/python/tff/templates/IterativeProcess) returns the appropriate optimizer state, simply using the `FileCheckpointManager` out of the box should just work.
Piggybacking off of Keith's answer: The checkpoint manager is no longer available in Google's [federated research repository](https://github.com/google-research/federated). It has been upstreamed to TFF (see it on GitHub [here](https://github.com/tensorflow/federated/blob/master/tensorflow_federated/python/simulation/checkpoint_manager.py)).

You can access it either through the [`tensorflow-federated-nightly`](https://pypi.org/project/tensorflow-federated-nightly/) pip package, or else by cloning the repository.

The code essentially delegates to [`tf.saved_model.save`](https://www.tensorflow.org/api_docs/python/tf/saved_model/save), so you could alternatively simply use this.