Skip to content

Commit

Permalink
feat: add userdata opaque in FijkValue
Browse files Browse the repository at this point in the history
  • Loading branch information
befovy committed Dec 4, 2019
1 parent 1062282 commit cdd8014
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/core/fijkvalue.dart
Expand Up @@ -162,6 +162,9 @@ class FijkValue {

final FijkException exception;

/// Userdata, set and get by fijkplayer's user.
final dynamic opaque;

/// A constructor requires all value.
const FijkValue({
@required this.prepared,
Expand All @@ -174,6 +177,7 @@ class FijkValue {
@required this.duration,
@required this.fullScreen,
@required this.exception,
@required this.opaque,
});

/// Construct FijkValue with uninitialized value
Expand All @@ -189,6 +193,7 @@ class FijkValue {
duration: const Duration(),
fullScreen: false,
exception: FijkException.noException,
opaque: null,
);

/// Return new FijkValue which combines the old value and the assigned new value
Expand All @@ -203,6 +208,7 @@ class FijkValue {
Duration duration,
bool fullScreen,
FijkException exception,
dynamic opaque,
}) {
return FijkValue(
prepared: prepared ?? this.prepared,
Expand All @@ -214,6 +220,7 @@ class FijkValue {
rotate: rotate ?? this.rotate,
duration: duration ?? this.duration,
fullScreen: fullScreen ?? this.fullScreen,
opaque: opaque ?? this.opaque,
exception: exception ?? this.exception,
);
}
Expand All @@ -227,7 +234,7 @@ class FijkValue {

@override
int get hashCode => hashValues(prepared, completed, state, size, rotate,
duration, fullScreen, exception);
duration, fullScreen, exception, opaque);

@override
String toString() {
Expand Down

0 comments on commit cdd8014

Please sign in to comment.