PlayerController class
Controller of a PlayerView.
- Inheritance
-
- Object
- GetLifeCycle
- DisposableInterface
- GetxController
- PlayerController
Constructors
-
PlayerController.new(AbstractSettingsRepository _settingsRepository, ChatService? _chatService, {void shouldClose()?, required Paginated<
String, MediaItem> source, String initialKey = '', int initialIndex = 0, ResourceId? resourceId})
Properties
- expanded → RxBool
-
Indicator whether Post.description and meta information should be
expanded.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
no setterinherited
- hasNextPage → RxBool
-
Indicator whether vertical has next page.
final
- hasPreviousPage → RxBool
-
Indicator whether vertical has previous page.
final
- includePhotos → RxBool
-
Indicator whether posts displayed should include photos.
final
- includeVideos → RxBool
-
Indicator whether posts displayed should include videos.
final
- index ↔ RxInt
-
Index of the currently displayed Post from posts.
latefinal
- initialIndex → int
-
Initial index of a Post.horizontal controller.
final
- initialized → bool
-
Checks whether the controller has already been initialized.
no setterinherited
- initialKey → String
-
Initial Post.id of the vertical controller.
final
- interface → RxBool
-
Indicator whether interface should be visible.
final
- isClosed → bool
-
Checks whether the controller has already been closed.
no setterinherited
- item → PostItem?
-
Returns the currently displayed item,
no setter
- itemPositionsListener → ItemPositionsListener
-
ItemPositionsListenerof aScrollablePositionedListlistening for side gallery changes.final - itemScrollController → ItemScrollController
-
ItemScrollControllerof aScrollablePositionedListof side gallery.final - key → RxString
-
Post.id of the currently displayed Post from posts.
final
- latestVolume ↔ double?
-
Latest volume value for VideoPlayerController being displayed.
getter/setter pair
- listeners → int
-
no setterinherited
-
notifications
→ RxList<
PlayerNotification> -
List of the currently active PlayerNotifications.
final
-
onDelete
→ InternalFinalCallback<
void> -
Internal callback that starts the cycle of this controller.
finalinherited
-
onStart
→ InternalFinalCallback<
void> -
Called at the exact moment the widget is allocated in memory.
It uses an internal "callable" type, to avoid any @overrides in subclases.
This method should be internal and is required to define the
lifetime cycle of the subclass.
finalinherited
- post → Post?
-
Returns the currently displayed post,
no setter
-
posts
→ RxList<
Post> -
Posts to display.
final
- resource → Resource
-
Resource from where the source is coming from.
final
- resourceId → ResourceId?
-
ResourceId from where the source is coming from.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scrollableKey
→ GlobalKey<
State< StatefulWidget> > -
GlobalKey of a
ScrollablePositionedListfor side gallery used to keep rebuilds from rebuilding the list.final - scrollController → ScrollController
-
ScrollController to pass to a
ScrollablePositionedListfor side gallery.final -
settings
→ Rx<
ApplicationSettings?> -
Returns the current ApplicationSettings.
no setter
- shouldClose → void Function()?
-
Callback, called when a PlayerView this controller attached to should
close.
final
- side → RxBool
-
Indicator whether side gallery should be displayed.
final
-
source
→ Paginated<
String, MediaItem> -
Paginated of MediaItems being the source of posts.
final
-
thumbnails
→ Map<
String, GlobalKey< State< >StatefulWidget> > -
Map of GlobalKeys used to prevent VideoThumbnails from rebuilding.
final
- transformationController → TransformationController
-
TransformationController of a InteractiveViewer.
final
- vertical ↔ PageController
-
PageController controlling the PageView of posts.
latefinal
- viewportIsTransformed → RxBool
-
Indicator whether InteractiveViewer has any transformations.
final
Methods
-
$configureLifeCycle(
) → void -
inherited
-
addListener(
GetStateUpdate listener) → Disposer -
Register a closure to be called when the object notifies its listeners.
inherited
-
addListenerId(
Object? key, GetStateUpdate listener) → Disposer -
inherited
-
copy(
Post post, PostItem item) → Future< void> - Puts the provided PostItem to the copy buffer.
-
dispose(
) → void -
inherited
-
disposeId(
Object id) → void -
To dispose an
idfrom future updates(), this ids are registered byGetBuilder()or similar, so is a way to unlink the state change with the Widget from the Controller.inherited -
download(
PostItem item, {String? to}) → Future< void> - Downloads the provided PostItem.
-
downloadAs(
PostItem item) → Future< void> -
Downloads the provided PostItem using
save asdialog. -
keepActive(
) → void -
Starts
_activityTimerthat would set interface tofalseafter_activityTimeout. -
next(
) → Future< void> - Moves the vertical to a next Post.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
PlayerNotification e) → void - Adds the provided PlayerNotification to the notifications.
-
notifyChildrens(
) → void -
inherited
-
onClose(
) → void -
Called before onDelete method. onClose might be used to
dispose resources used by the controller. Like closing events,
or streams before the controller is destroyed.
Or dispose objects that can potentially create some memory leaks,
like TextEditingControllers, AnimationControllers.
Might be useful as well to persist some data on disk.
override
-
onInit(
) → void -
Called immediately after the widget is allocated in memory.
You might use this to initialize something for the controller.
override
-
onReady(
) → void -
Called 1 frame after onInit(). It is the perfect place to enter
navigation events, like snackbar, dialogs, or a new route, or
async request.
inherited
-
openPopup(
) → Future< void> - Opens this PlayerView as a separate window.
-
playPause(
) → void - Plays or pauses the currently displayed video, if any.
-
previous(
) → Future< void> - Moves the vertical to a previous Post.
-
refresh(
) → void -
inherited
-
refreshGroup(
Object id) → void -
inherited
-
reload(
Post post) → Future< void> -
Fetches the ChatItem of the provided
postto update its Attachments. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that the
object notifies.
inherited
-
removeListenerId(
Object id, VoidCallback listener) → void -
inherited
-
saveToGallery(
PostItem item) → Future< void> - Downloads the provided PostItem and saves it to the gallery.
-
setVideoVolume(
double volume) → Future< void> -
Stores the provided
volumeas the default one for all video players. -
Invokes PlatformUtilsImpl.share for the provided
item. -
toggleFullscreen(
) → Future< void> - Toggles fullscreen of the application on and off.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
[List< Object> ? ids, bool condition = true]) → void -
Rebuilds
GetBuildereach time you callupdate(); Can take a List ofids, that will only update the matchingGetBuilder( id: ),idscan be reused amongGetBuilderslike group tags. The update will only notify the Widgets, ifconditionis true.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited