ClosedCaption class Null safety

Widget for displaying closed captions on top of a video.

If text is null, this widget will not display anything.

If textStyle is supplied, it will be used to style the text in the closed caption.

Note: in order to have closed captions, you need to specify a VideoPlayerController.closedCaptionFile.

Usage:

Stack(children: <Widget>[
  VideoPlayer(_controller),
  ClosedCaption(text: _controller.value.caption.text),
]),
Inheritance

Constructors

ClosedCaption({Key? key, String? text, TextStyle? textStyle})
Creates a a new closed caption, designed to be used with VideoPlayerValue.caption. [...]
const

Properties

hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
key Key?
Controls how one widget replaces another widget in the tree. [...]
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
text String?
The text that will be shown in the closed caption, or null if no caption should be shown. If the text is empty the caption will not be shown.
final
textStyle TextStyle?
Specifies how the text in the closed caption should look. [...]
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget. [...]
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree. [...]
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep. [...]
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object. [...]
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants. [...]
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object. [...]
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
@nonVirtual, inherited