SimplePip constructor
SimplePip({
- VoidCallback? onPipEntered,
- VoidCallback? onPipExited,
- dynamic onPipAction()?,
Implementation
SimplePip({this.onPipEntered, this.onPipExited, this.onPipAction}) {
if (onPipEntered != null || onPipExited != null || onPipAction != null) {
_channel.setMethodCallHandler(
(call) async {
switch (call.method) {
case 'onPipEntered':
onPipEntered?.call();
break;
case 'onPipExited':
onPipExited?.call();
break;
case 'onPipAction':
String arg = call.arguments;
PipAction action =
PipAction.values.firstWhere((e) => e.name == arg);
onPipAction?.call(action);
break;
}
},
);
}
}