How to hide record button during calls in Flutter UI Kit

Guide Overview

Language/Framework: Flutter UI Kit

UI Kit Version:

"cometchat_chat_uikit: ^4.5.10"

This guide can be used to hide the record button during the call.

Define a variable for CometChatCallingExtension.

CometChatCallingExtension callingExtension;

Pass the CallSettingsBuilder configuration in the callingExtension.

callingExtension = CometChatCallingExtension(
          configuration: CallingConfiguration(
              ongoingCallConfiguration: OngoingCallConfiguration(
                  callSettingsBuilder: CallSettingsBuilder()
                    ..showCallRecordButton = false)));

Pass the callingExtension to the UIKitSettings.

UIKitSettings uiKitSettings = (UIKitSettingsBuilder()
          //Other Parameters
          ..callingExtension = callingExtension
          ).build();

If you want to hide the record button for iOS, use the below code -

CometChatCallingExtension callingExtension;
    if (Platform.isIOS) {
      callingExtension = CometChatCallingExtension(
          configuration: CallingConfiguration(
              ongoingCallConfiguration: OngoingCallConfiguration(
                  callSettingsBuilder: CallSettingsBuilder()
                    ..showCallRecordButton = false)));
    } else {
      callingExtension = CometChatCallingExtension(
          configuration: CallingConfiguration(
              ongoingCallConfiguration: OngoingCallConfiguration(
                  callSettingsBuilder: CallSettingsBuilder()
                    ..showCallRecordButton = true)));
    }

Similarly if you want to hide the record button for Android, use the below code -

CometChatCallingExtension callingExtension;
    if (Platform.isIOS) {
      callingExtension = CometChatCallingExtension(
          configuration: CallingConfiguration(
              ongoingCallConfiguration: OngoingCallConfiguration(
                  callSettingsBuilder: CallSettingsBuilder()
                    ..showCallRecordButton = true)));
    } else {
      callingExtension = CometChatCallingExtension(
          configuration: CallingConfiguration(
              ongoingCallConfiguration: OngoingCallConfiguration(
                  callSettingsBuilder: CallSettingsBuilder()
                    ..showCallRecordButton = false)));
    }

Before and After Hiding Record Button in Android:

    

                                              

Before and After Hiding Record Button in iOS: