Is there way to get a callback after StreamBuilder completely load?

Viewed 190

I'm trying get a callback after my context build, i already tried with "WidgetsBinding.instance!.addPostFrameCallback", but not works because i have a StreamBuilder and the first load of snapshot data it is null.

I expected exists a callback of StreamBuilder after data completely load and build loaded, here is my code:

StreamBuilder(
  stream: this.paymentInfoFormPresenter.key,
  builder: (context, snapshot) {
    final _formKey = snapshot.data;

    if (_formKey == null) {
      return Container();
    }

    return Text('example');
  }
);

And i don't find anything about on internet... i hope someone can help me.

1 Answers

To resolve this issue, i needed change the "Text('example')" to an external widget, and added "WidgetsBinding.instance!.addPostFrameCallback" inside of this external widget

Related