Solution: Fetching Movies at App Startup

In this lesson, you'll explore the solution to the "Fetching Movies at App Startup" challenge.

Solution: Fetching data at startup

The initState() method is called only once when a state object is created.

Check out the value of counter when fetchMovies() is moved to initState() which is called only once.

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

Get hands-on with 1400+ tech skills courses.