getCurrentPosition method

  1. @override
Future<int> getCurrentPosition(
  1. int viewId
)
override

Implementation

@override
Future<int> getCurrentPosition(int viewId) async {
  try {
    var methodChannel = MethodChannel('${channelPrefix}_$viewId');
    return await methodChannel.invokeMethod<int>('currentPosition') ?? 0;
  } on PlatformException catch (e) {
    debugPrint('${e.code}: ${e.message}');
    return 0;
  }
}