ertgrulll / advstory

An advanced, complete story viewer for Flutter. Has support for images, videos, custom widget contents, gestures, interceptors, listeners, manipulators and much more.
https://advstory.sourcekod.com
MIT License
41 stars 33 forks source link

Tweaking to behave a little more like an image gallery #31

Open edwardaux opened 1 year ago

edwardaux commented 1 year ago

Firstly, thanks for what looks to be an awesome package. It looks really well designed and implemented.

This is probably more of a question than a feature request... my application is more of an "image gallery" than a "story viewer", but your implementation looks super flexible and has a lot of the features I think I am likely to need (eg. playing videos and showing cached images and swiping between them).

I've done a very quick POC using AdvStory.player() and it was pretty simple to get me about80% of the way there.

A few challenges I see in re-purposing advstory as a more general-purpose image gallery are:

I'm happy to fork and add my own custom logic, but I'd prefer to use the built-in features if I can. However, if you think that trying to use advstory in this way is a terrible idea, I'd also be keen to know that before I get too far down the investigation path.

jtkeyva commented 1 year ago

@edwardaux Hey did you end up forking or doing anything? Project seems to be abandoned unfortunately

edwardaux commented 1 year ago

Nah, I tried a bunch of other packages that all had their own pros/cons. I ended up going with a forked version of https://pub.dev/packages/interactiveviewer_gallery ... that package mostly does what I need and I just tweaked a few little things to make it work how I need it to.

jtkeyva commented 1 year ago

Oh cool that's one package I have not seen. Does it handle preloading and caching? Unlimited content?

What did you end up tweaking?

Thanks

edwardaux commented 1 year ago

It has been a while since I looked into it... I'm pretty sure it doesn't deal with caching because it just takes a builder that returns a widget - which is kind of nice, because it means I can sometimes embed an image and sometimes a video.

I'm using cached_network_image in combination with flutter_cache_manager under the covers to manage my own caching. I haven't bothered doing any preloading yet... I just rely on it being in the cache or the user sees a spinner while I go fetch it.

TBH, I can't really remember exactly what I tweaked. From memory, I found a gist somewhere where someone had done some tweaks to cater for the situation where double-tapping zooms, but then when you pan left/right, when you get to the "edge", it should then scroll into the next item. From memory(?), this package doesn't do that quite right.

What I should have done is fork it and then applied the gist that I found... but I was in a rush, so I ended up just copying the code from the gist. So, now I'm in the position where I can't find the original gist and don't have a local copy of the original package to compare it to.

jtkeyva commented 1 year ago

Got it thanks for explaining :)