Question: I have the following screen:

```
import 'package:flutter/material.dart';
import '../models/patient.dart';
import '../components/patient_card.dart';
import '../services.dart';

class Home extends StatefulWidget {
  var patients = <Patient>[];

  @override
  _HomeState createState() => new _HomeState();
}

class _HomeState extends State<Home> {
  @override
  initState() {
    super.initState();
    Services.fetchPatients().then((p) => setState(() => widget.patients = p));
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Home'),
      ),
      body: new Container(
        child: new ListView(
          children: widget.patients.map(
            (patient) => new PatientCard(patient),
          ).toList()
        )
      )
    );
  }
}

```

As you can see I do the endpoint call when I overwrite `initState()` in `_HomeState`. But it only runs once initially when the app starts. I can't just type `r` in my terminal and let the app hot reload and call the endpoint again.. I have to use `Shift + r` to do a full restart first. 

So the question is, am I calling the web service in the recommended spot? And if it not... where does it go? Also, shouldn't `ListView` have a function / property that gets called on "pull to refresh" or something?

Answer: 
As mentioned by @aziza you can use a [Stream Builder](https://docs.flutter.io/flutter/widgets/StreamBuilder-class.html) or if you want to call a function every time widget gets built then you should call it in build function itself. Like in your case.

```
@override
Widget build(BuildContext context) {
Services.fetchPatients().then((p) => setState(() => widget.patients = p));
return new Scaffold(
  appBar: new AppBar(
    title: new Text('Home'),
  ),
  body: new Container(
    child: new ListView(
      children: widget.patients.map(
        (patient) => new PatientCard(patient),
      ).toList()
    )
  )
);

```

}

If you want to add pull-to-refresh functionality then wrap your widget in [refresh indicator](https://docs.flutter.io/flutter/material/RefreshIndicator-class.html) widget. Add your call in `onRefresh` property.

```
return new RefreshIndicator(child: //Your Widget Tree,
                            onRefresh: handleRefresh);

```

Note that this widget only works with vertical scroll view.

Hope it helps.
Have a look on [`StreamBuilder`](https://docs.flutter.io/flutter/widgets/StreamBuilder-class.html). This widget will allow you to deal with async data that are frequently updated and will update the UI accordingly by listening `onValue` at the end of your stream.