getCurrentCallDuration method

  1. @override
Future<int?> getCurrentCallDuration()
override

This method is used to get current call duration only for Android.

Implementation

@override
Future<int?> getCurrentCallDuration() async {
  if (Platform.isAndroid) {
    int? res;
    try {
      res = await mirrorFlyCallMethodChannel
          .invokeMethod('getCurrentCallDuration');
      LogMessage.d('getCurrentCallDuration', '$res');
      return res;
    } on PlatformException catch (e) {
      LogMessage.d("Platform Exception =", " $e");
      rethrow;
    } on Exception catch (error) {
      LogMessage.d("Exception ", " $error");
      rethrow;
    }
  } else {
    return null;
  }
}