Is your feature request related to a problem? Please describe.
There is no problem, only opportunity.
The widget type is limitless which is great, but what if you want different widget types for say "Image with text" or "3 image rows" or "Video with scrolling text" or "Video with image overlay"?
Describe the solution you'd like
Allow devs to define custom content types with templates. Could be as simple as placing dart files within a content_type or content_template folder: image_with_text.dart
, three_image_rows.dart
, video_with_scrolling_text.dart
or video_with_image_overlay.dart
The syntax in the template file could look something like:
ContentTypeVideoWithScrollingText
or
ContentType.videoWithScrollingText
or
SlideTemplateVideoWithScrollingText
or
SlideTemplate.videoWithScrollingText
Then in the "cluster" json that populates the stories, you could simply specify what content type / content template will be used for each individual slide. ex ImageWithTextSlide
, VideoWithScrollingTextSlide
, MyCustomTemplateSlide
or ContentType.myCustomTemplate
or Slide.myNewSlideTemplate
along with your built in ImageSlide
VideoSlide
WidgetContent
.
`ContentType: 'VideoWithScrollingText' {
videoUrl: 'https://mysite.com/linktovideo.mp4'
scrollingText: 'this is the text i want to scroll'
}
`
or
`SlideType: 'ImageWithText' {
videoUrl: 'https://mysite.com/linktovideo.mp4'
scrollingText: 'this is the text i want to scroll'
}
`
or
`Template: 'Advertisement' {
videoUrl: 'https://mysite.com/linktovideo.mp4'
Text: 'Order Now!'
link: 'https://mylink.com/ordernow'
backgroundImageUrl: 'https://mysite.com/bgimage.png'
}
`
Describe alternatives you've considered
Hacking and breaking your code
Additional context
Your story player outperforms all other packages I've tried. I appreciate your built in functionality and your opinionated approach as is. I think if you break it up a bit and modularize it a bit, it could become one of the more powerful packages for content display, particularly in this full screen story format. Not sure of your goals with this package though.
Not sure how much I can help with code, I'm not an expert. I've never done a PR and still wrapping my head around your code. I can do product development and map things out no problem, but implementing them into your code might be tough.
I can do a $ bounty to get this implemented with the other features if it can become a priority.