DramaCardController class

短剧卡片控制器

封装卡片ID管理和控制方法,简化使用。 配合 DramaCardNativeView 使用,自动处理卡片生命周期。

使用示例:

final controller = DramaCardController();

DramaCardNativeView(
  config: DramaCardConfig(...),
  controller: controller,
)

// 控制播放
controller.play();    // 播放
controller.pause();   // 暂停
controller.stop();    // 停止
controller.setMute(true);  // 静音

// 销毁时自动调用
controller.dispose();

Constructors

DramaCardController()

Properties

cardId String?
获取卡片ID(如果需要直接访问)
no setter
hashCode int
The hash code for this object.
no setterinherited
isReady bool
卡片是否已准备就绪
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() Future<void>
清除卡片ID
getDramaInfo() Future<Map<String, dynamic>?>
获取卡片短剧信息
getGid() Future<String?>
获取卡片短剧 GID
getTitle() Future<String?>
获取卡片短剧标题
initialize(String cardId) → void
初始化卡片ID(由 Widget 内部调用)
isPlaying() Future<bool>
获取卡片播放状态
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() Future<void>
暂停卡片视频
play() Future<void>
播放卡片视频
refresh() Future<void>
刷新卡片数据
reportShow(int duration) Future<void>
上报卡片曝光埋点
retryLoadData() Future<bool>
重新加载数据
setMute(bool mute) Future<void>
设置卡片静音状态
stop() Future<void>
停止卡片视频
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited