Future Builder flutter — Part Two

Aseem Wangoo
Apr 25, 2018 · 2 min read

What you do today, determines your future.

Future Builder

All in one Flutter Resource: https://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 :

https://jsonplaceholder.typicode.com/posts

Future Builder — Part 2

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

For complete source code, please refer below :

P.S………………………….


The Flutter Pub is a medium publication to bring you the latest and amazing resources such as articles, videos, codes, podcasts etc. about this great technology to teach you how to build beautiful apps with it. You can find us on Facebook, Twitter, and Medium or learn more about us here. We’d love to connect! And if you are a writer interested in writing for us, then you can do so through these guidelines.

FlutterPub

The Pub(lication) for all about the Flutter and its magic

Aseem Wangoo

Written by

Mobile Application Developer | Founder of Flatteredwithflutter.com | Flutter, Java enthusiast | Medium writer | YouTuber | Writer at FlutterPub

FlutterPub

The Pub(lication) for all about the Flutter and its magic