DramaPlayerNativeView class
内嵌原生短剧播放器视图
通过 PlatformView 将原生短剧播放器内嵌到 Flutter 中, 自动处理 Android 和 iOS 平台的差异,提供统一的接口。
使用前请确保:
- 已成功调用
PangrowthContent.initialize和PangrowthContent.start。 - GroMore(gromore_ads) SDK 完成初始化。
返回按钮行为:
- 原生SDK的返回按钮存在问题,因此使用Flutter层返回按钮替代
- 通过
config.hideBack参数控制返回按钮显示:hideBack: false或null:显示 Flutter 层返回按钮(默认)hideBack: true:完全隐藏返回按钮
- 点击返回按钮默认调用
Navigator.pop(context)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DramaPlayerNativeView
Constructors
-
DramaPlayerNativeView({Key? key, required DramaPlayerConfig config, DramaPlayerController? controller, DramaPlayerListener? listener, String? playerId, Map<
String, dynamic> ? extra, Set<Factory< gestureRecognizers = const <Factory<OneSequenceGestureRecognizer>>{}})OneSequenceGestureRecognizer> > -
const
Properties
- config → DramaPlayerConfig
-
播放器配置
final
- controller → DramaPlayerController?
-
播放器控制器(可选)
如果提供控制器,将自动初始化和管理播放器ID
final
-
extra
→ Map<
String, dynamic> ? -
传递给原生层的额外参数
final
-
gestureRecognizers
→ Set<
Factory< OneSequenceGestureRecognizer> > -
自定义手势识别器
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- listener → DramaPlayerListener?
-
播放器事件监听器
final
- playerId → String?
-
自定义播放器标识(用于事件过滤),默认自动生成
如果使用 controller,此参数会被忽略
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< DramaPlayerNativeView> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent 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, int wrapWidth = 65}) → 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.
inherited