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

Decouple Tray & Player #3

Closed jtkeyva closed 2 years ago

jtkeyva commented 2 years ago

Is your feature request related to a problem? Please describe. What if you don't want to display a tray? or You only have a single story to play. What do you do?

Describe the solution you'd like Decouple the Tray and the Story Player so that you can simply play a single story without using the tray. Or have a standalone Story Player.

Describe alternatives you've considered Hacking your code

Additional context N/A Just wanted to thank you again and say great job. Caching works great and skipping slides is flawless!

ertgrulll commented 2 years ago

I was actually thinking about this. I can add some methods to show story view without adding tray list to the tree. You're welcome, happy hacks! Also, thanks for your good highlights.

jtkeyva commented 2 years ago

That would be awesome! I really think you're onto a special package here. It's a batteries included approach to stories which is great. Even greater if developers can have fine grain control over functionality and presentation.

Although it's gonna take me some time to understand your code, I will do my best to contribute any ideas or code.

Cheers

ps: perhaps some info on how caching works or a clear cache function could be of use

ertgrulll commented 2 years ago

This feature takes some time to implement and I'm currently working on another project. I will try to make time for this in the near future, but I would appreciate it if you open a pr for this feature anyway.

Syntax can be AdvStory.headless() for without tray list and AdvStory() for with trays. Looks like animation controllers should be moved to cluster widget and tray view should be moved to a separate class. Flow can be started from AdvStoryController or from a new controller that extends AdvStoryController. Controller has preloadMediaFile method, this can be used to load media file before opening story view.

After adding this feature I (or you) can add "batteries included" to the readme 🎉

jtkeyva commented 2 years ago

Got it, I've never done a PR so I'll see what I can do.

Yeah, naming depends on your goals. Other Story packages are limiting because they force you into using a tray. I would consider the tray an add-on module to the core story player. I feel your player is the meat and potatoes of the package that harnesses the power so to me something like: AdvStory() or AdvStory.player() for the Story Player and AdvStory.tray() for the tray.

It's your package, I just really appreciate the performance of the player and feel that if things were modular and had some optional add-ons it could be a force to be reckoned with!

jtkeyva commented 2 years ago

I think this is beyond me to handle, I will buy you a mega coffee to complete ☕️ 😀

BTW: i suggested advstory to syntacops flutter package reviews and it got featured! hopefully your package picks up some new users, fans & contributors!

https://www.youtube.com/watch?v=Drr48OiB91Y

ertgrulll commented 2 years ago

Something great is about to come 🚀 Took a really long time but AdvStory is much faster, customizable and advanced now, thanks for your support.

jtkeyva commented 2 years ago

Great to hear! Wow, you have been cranking 😮 Can't wait to try it out and contribute 🥳

ertgrulll commented 2 years ago

Hello, I decoupled tray list and player in version 0.2.0. Now, you can customize almost anything about story view. You can see usage in player example. Some minor changes in this version may affect your project, please have a look at the changelog.

jtkeyva commented 2 years ago

Awesome! Thanks for the hard work. Look forward to trying it out :)