getDuration method

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

Implementation

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