Skip to content

sorry there was an error loading media data #26

Closed
@alexlovar

Description

@alexlovar

after apply the changes suggested by pull request #24 opened on 10 May by @kkpenaranda
the app runs on android studio 3.4.2.
but in media_list.dart

 Widget _getContentSection() {
    print("_getContentSection");
    print(_loadingState);
    switch (_loadingState) {
      case LoadingState.DONE:
        return ListView.builder(
            itemCount: _movies.length,
            itemBuilder: (BuildContext context, int index) {
              if (!_isLoading && index > (_movies.length * 0.7)) {
                _loadNextPage();
              }

              return MediaListItem(_movies[index]);
            });
      case LoadingState.ERROR:
        return const Text('Sorry, there was an error loading the data!');
      case LoadingState.LOADING:
        return const CircularProgressIndicator();
      default:
        return Container();
    }
  }

on widget _getContentSection first print LoadingState.LOADING
then print LoadingState.ERROR
and get the text 'Sorry, there was an error loading the data!'
the api_key is working return results like:

{
    "page": 1,
    "total_results": 10000,
    "total_pages": 500,
    "results": [
        {
            "popularity": 481.769,
            "vote_count": 364,
            "video": false,
            "poster_path": "/zfE0R94v1E8cuKAerbskfD3VfUt.jpg",
            "id": 474350,
            "adult": false,
            "backdrop_path": "/p15fLYp0X04mS8cbHVj7mZ6PBBE.jpg",
            "original_language": "en",
            "original_title": "It Chapter Two",
            "genre_ids": [
                35,
                27
            ],
            "title": "It Chapter Two",
            "vote_average": 7.2,
            "overview": "27 years after overcoming the malevolent supernatural entity Pennywise, the former members of the Losers' Club, who have grown up and moved away from Derry, are brought back together by a devastating phone call.",
            "release_date": "2019-09-06"
        },

but i can't find why this doesn't show the list in the main screen.
some one can help to solve this?
thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions