Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not update image in gridview #34

Closed
neckaros opened this issue Apr 14, 2018 · 6 comments
Closed

Does not update image in gridview #34

neckaros opened this issue Apr 14, 2018 · 6 comments

Comments

@neckaros
Copy link

Hello,

If i use CachedNetworkImage in a grid view and the content changes the images does not get updated (the footer title is updated correctly)

return new GridView.count(
              crossAxisCount: (orientation == Orientation.portrait) ? 3 : 6,
              childAspectRatio: 0.7,
              padding: const EdgeInsets.all(4.0),
              mainAxisSpacing: 4.0,
              crossAxisSpacing: 4.0,
              children: movies.map((var movie) {
                return new GridTile(
                    footer: new Text(movie.title),
                    child: new GestureDetector(
                        onTap: () => Navigator.of(context).push(
                                new MaterialPageRoute(
                                    builder: (BuildContext context) => new MovieDetailPage(movie)
                            )
                            ),
                        child: new CachedNetworkImage(
                            imageUrl: MoviesService.getImagePath(movie.id),
                            fit: BoxFit.cover,
                            placeholder: new Container(color: Colors.black12),
                            errorWidget: new Icon(Icons.error),
                        ),             
                       ));
              }).toList(),
            );

if i use a FadeInImage it works correctly:

...
child: new FadeInImage.memoryNetwork(
                        fit: BoxFit.cover,
                      placeholder: kTransparentImage,
                      image:
                          MoviesService.getImagePath(movie.id),
                    )
...

I'm using latest version

@renefloor
Copy link
Contributor

Are you using version 0.4.0 I published today? I thought that should have fixed that..
Could you give me an example I can directly test?

@neckaros
Copy link
Author

Maybe i was to fast in saying latest! did update early this morning european time. Will try again and revert back to you :)

@neckaros
Copy link
Author

I still have the issue with: ".pub-cache\hosted\pub.dartlang.org\cached_network_image-0.4.0\lib\cached_network_image.dart"

@renefloor
Copy link
Contributor

I'll try to find what's going wrong

@neckaros
Copy link
Author

Using the library as an image provider work tho:

child: new FadeInImage(
                        image: new CachedNetworkImageProvider(MoviesService.getImagePath(movie.id)),
                        fit: BoxFit.cover,
                      placeholder: new MemoryImage(kTransparentImage)     
                    )

@renefloor
Copy link
Contributor

Yes, I expect something with didChangeDependencies or didUpdateWidget or something. I am not completely aware how they should work yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants