Future Builder flutter — Part Two

What you do today, determines your future.

Future Builder

Website : http://flatteredwithflutter.com/

Part Two

In my previous post, Future Builder (part one), we were able to call a future asynchronously and render the widget upon the response from the api call.

However, I was not able to make the future builder call upon an event listener. For instance, you may require that a api to be called on button click (async) and render the result on the UI (async).

That’s why this part two is introduced…..

So, in this program (at the bottom), I have implemented a future which will be called on the button click. Until then, the text widget appears with default value (“no data yet”).

As soon as response is returned, builder part of the future gets called which renders the text widget with the response.

In my program, I have called below api :


Future Builder — Part 2

(All programming failures keeping with myself. :p)…

For complete source code, please refer below :