Komal Thakkar
Sep 2, 2024

--

@Randal

Both methods work fine but _fetchData creates a Future right when the widget is instantiated, so it starts immediately. On the other hand, the Future in fetchData() only starts when you call the method, creating a new Future each time.

Thanks a lot for bringing this up. I appreciate it :)

--

--

Komal Thakkar
Komal Thakkar

Written by Komal Thakkar

Android Developer, Flutter Developer, Blogger

Responses (1)