Closed fisforfaheem closed 7 months ago
You can refer to this migration guide, which has detailed migration steps.
ZegoUIKitPrebuiltCall(
...
events: ZegoUIKitPrebuiltCallEvents(
onCallEnd: (
ZegoCallEndEvent event,
/// defaultAction to return to the previous page
VoidCallback defaultAction,
) {
model.onDisconnect(context);
},
),
);
I can't understand that, kindly help me with this
On Thu, Mar 14, 2024, 12:04 PM yoer @.***> wrote:
ZegoUIKitPrebuiltCall( ... events: ZegoUIKitPrebuiltCallEvents( onCallEnd: ( ZegoCallEndEvent event,
/// defaultAction to return to the previous page VoidCallback defaultAction, ) { model.onDisconnect(context); }, ),
);
— Reply to this email directly, view it on GitHub https://github.com/ZEGOCLOUD/zego_uikit_prebuilt_call_flutter/issues/35#issuecomment-1996694790, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIRXJSDHNETCSP26GMBFYK3YYFDYVAVCNFSM6AAAAABESDAL32VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJWGY4TINZZGA . You are receiving this because you authored the thread.Message ID: @.*** com>
move your code inonHangUp
and onOnlySelfInRoom
from config
to events
in ZegoUIKitPrebuiltCall
before:
ZegoUIKitPrebuiltCall(
...
config: ZegoUIKitPrebuiltCallConfig(
onHangUp: () {
model.onDisconnect(context);
},
onOnlySelfInRoom: () {
model.onDisconnect(context);
},
),
);
after:
ZegoUIKitPrebuiltCall(
...
events: ZegoUIKitPrebuiltCallEvents(
onCallEnd: (
ZegoCallEndEvent event,
/// defaultAction to return to the previous page VoidCallback defaultAction,
) {
model.onDisconnect(context);
},
),
);
what about : ..onOnlySelfInRoom = (context) { model.onDisconnect(context); }
and
..onHangUp = () => model.onDisconnect(context)
onDispose: () => model.onDisconnect(context),
currently i have done this only: events: ZegoUIKitPrebuiltCallEvents(onCallEnd: ( ZegoCallEndEvent event,
/// defaultAction to return to the previous page
VoidCallback defaultAction,
) {
model.onDisconnect(context);
debugPrint('onCallEnd, do whatever you want');
/// you can call this defaultAction to return to the previous page,
defaultAction.call();
}
how to use this: ..onOnlySelfInRoom = (context) { // model.onDisconnect(context); // }
ZegoUIKitPrebuiltCallConfig
to ZegoUIKitPrebuiltCallEvents.onCallEnd(ZegoUIKitCallEndEvent(reason:ZegoUIKitCallEndReason.remoteHangUp), defaultAction)/// The default behavior is to return to the previous page.
///
/// If you override this callback, you must perform the page navigation
/// yourself to return to the previous page!!!
/// otherwise the user will remain on the current call page !!!!!
enum ZegoCallEndReason {
/// the call ended due to a local hang-up
localHangUp,
/// the call ended when the remote user hung up, leaving only one local user in the call
remoteHangUp,
/// the call ended due to being kicked out
kickOut,
}
when event.reason
is ZegoCallEndReason.remoteHangUp
, that's mean onOnlySelfInRoom
ZegoUIKitPrebuiltCall(
events: ZegoUIKitPrebuiltCallEvents(
onCallEnd: (
ZegoCallEndEvent event,
/// defaultAction to return to the previous page
VoidCallback defaultAction,
) {
model.onDisconnect(context);
defaultAction.call();
switch (event.reason) {
case ZegoCallEndReason.localHangUp:
/// onHangUp
break;
case ZegoCallEndReason.remoteHangUp:
/// onOnlySelfInRoom
break;
case ZegoCallEndReason.kickOut:
/// onMeRemovedFromRoom
break;
}
},
),
);
ZegoUIKitPrebuiltCall( appID: 2123453149, appSign: 'dsadasdasdasd', userID: AuthProvider.getUserDetails().email, userName: AuthProvider.getUserDetails().displayName, callID: model.channelNAme, config: ZegoUIKitPrebuiltCallConfig.oneOnOneVideoCall() ..onOnlySelfInRoom = (context) { model.onDisconnect(context); } ..onHangUp = () => model.onDisconnect(context)