showCallOverlay function

void showCallOverlay(
  1. BuildContext context,
  2. String callId
)

显示音视频通话弹窗

Implementation

void showCallOverlay(BuildContext context, String callId) {
  _callOverlayEntry?.remove();
  _callOverlayEntry = null;

  _callOverlayEntry = OverlayEntry(
    builder: (context) => Positioned(
      right: 20,
      top: 20,
      width: 160,
      height: 240,
      child: TweenAnimationBuilder<double>(
        tween: Tween(begin: 0.0, end: 1.0),
        duration: const Duration(milliseconds: 300),
        builder: (c, opacity, child) {
          return Opacity(
            opacity: opacity,
            child: child,
          );
        },
        child: CallContainer(
          containerId: 'call-${ImState.callTypeNotifier.value?.name ?? ''}-$callId',
          doClose: () {
            hideCallOverlay();
          },
        ),
      ),
    ),
  );

  Overlay.of(context).insert(_callOverlayEntry!);
}