MovaPlatform class abstract

Platform contract behind mova's native features (system PiP, system volume). Platform implementations extend this class and register themselves through instance; capability members have safe defaults, so a platform without a native side reports "unsupported" for capability calls. getPlatformVersion instead throws when not implemented.

mova 原生能力(系统画中画、系统音量)背后的平台契约。各平台实现继承本类, 并通过 instance 注册;能力成员有安全默认值,没有原生侧的平台会回报 能力调用的“不支持”;getPlatformVersion 未实现时抛出异常。

Inheritance
  • Object
  • PlatformInterface
  • MovaPlatform
Implementers

Constructors

MovaPlatform()
Constructs a MovaPlatform.

Properties

hashCode → int
The hash code for this object.
no setterinherited
pipChanges → Stream<bool>
PiP mode changes pushed by the platform (true = entered, false = left). Empty on platforms without a native PiP listener.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

enterPip({int? width, int? height}) → Future<bool>
Requests system PiP with an optional width/height aspect hint. Returns whether PiP was entered.
getPlatformVersion() → Future<String?>
Returns the host platform's version string, e.g. Android 12.
getSystemVolume() → Future<double?>
Reads the system media volume as a percentage in [0, 100], or null when the platform has no implementation.
isPipSupported() → Future<bool>
Whether this platform can enter system picture-in-picture.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setSystemVolume(double percent) → Future<bool>
Sets the system media volume to percent ([0, 100]). Returns whether the platform applied it.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

instance ↔ MovaPlatform
The default instance of MovaPlatform to use.
getter/setter pair