Story Block (Flutter)
For android:
StoryBlock is a heavy object containing multiple instances of the player, Heavy-lifting UI elements, and intensive background tasks, Beware that the recommended number of the StoryBlock being used in a single screen is 1. However, in a wide range of new Android devices, 2 instances might work alright. Any number of StoryBlock above this limitation is not recommended by the Firework team and is not supported.
Currently, there are eight source types of the story block:
Discover
Channel
Playlist
Dynamic Content
Hashtag Playlist
SKU
Single Content
Integration
Configure corner radius
Story block loading result callback
StoryBlock
widget provides onStoryBlockLoadFinished
property for setting story block loading result callback.
Story block empty callback
StoryBlock
widget provides onStoryBlockEmpty
property for setting story block empty callback. The callback is triggered when there are no items in the story block. For example, you could hide the widget when the callback is triggered. The callback is triggered in the following scenarios:
Load successfully but the back end returns an empty list
The load failed and the list is empty
Play or pause story block programmatically
Open fullscreen story block programmatically (Android)
Enable PiP(Picture in Picture)
Set up the iOS project
To enable PiP outside the iOS app, you also need to add "Audio, Airplay, and Picture in Picture" background mode via Signing & Capabilities in your iOS project settings(as shown in the following screenshot). More information about this can be found here: Apple Documentation
Set enablePictureInPicture to true on Dart side
Keep alive when scrolling the widget out of the view box
Generally, if you put the story block widget as the child of ListView, it will be rebuilt when scrolling the widget out of the view box. You could set wantKeepAlive
as true
to make the story block widget keep alive when scrolling the widget out of the view box.
Reference
Last updated
Was this helpful?