Async UI: ProgressIndicator widget

ProgressIndicator widget

view in your UI while executing a long running task on a background thread.

Class _SampleAppPageState extends State<SampleAppPage> {
  List widgets = [];

  @override
  void initState() {
    super.initState();
    loadData();
  }

  showLoadingDialog() {
    return widgets.length == 0;
  }

  getBody() {
    if (showLoadingDialog()) {
      return getProgressDialog();
    } else {
      return getListView();
    }
  }

  getProgressDialog() {
    return Center(child: CircularProgressIndicator());
  }

Related concepts

ProgressIndicator widget

Async UI: ProgressIndicator widget — Structure map

Clickable & Draggable!

Async UI: ProgressIndicator widget — Related pages: