|
|
|
|
@ -23,7 +23,6 @@ class StartCallPage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _StartCallPageState extends State<StartCallPage> {
|
|
|
|
|
DragController dragController = DragController();
|
|
|
|
|
ChatCallProvider? cProv;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
@ -122,17 +121,6 @@ class _StartCallPageState extends State<StartCallPage> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
cProv = context.read<ChatCallProvider>();
|
|
|
|
|
// if (!cProv!.isOutGoingCall) {
|
|
|
|
|
// if (Platform.isAndroid) {
|
|
|
|
|
// // startCall();
|
|
|
|
|
// } else if (Platform.isIOS) {
|
|
|
|
|
// // cProv!.buildHubConnection();
|
|
|
|
|
// // startIosCall();
|
|
|
|
|
// // startIosCall();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
extendBody: true,
|
|
|
|
|
body: Consumer<ChatCallProvider>(
|
|
|
|
|
@ -143,467 +131,230 @@ class _StartCallPageState extends State<StartCallPage> {
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
child: Center(child: CircularProgressIndicator()),
|
|
|
|
|
)
|
|
|
|
|
: prov.isIncomingCall
|
|
|
|
|
? Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
child: Stack(
|
|
|
|
|
alignment: FractionalOffset.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
if (!prov.isAudioCall && prov.isVideoCall)
|
|
|
|
|
RTCVideoView(
|
|
|
|
|
prov.remoteRenderer!,
|
|
|
|
|
objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitContain,
|
|
|
|
|
key: const Key('remote'),
|
|
|
|
|
: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
child: Stack(
|
|
|
|
|
alignment: FractionalOffset.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
if (!prov.isAudioCall && prov.isVideoCall)
|
|
|
|
|
RTCVideoView(
|
|
|
|
|
prov.remoteRenderer!,
|
|
|
|
|
objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitContain,
|
|
|
|
|
key: const Key('remote'),
|
|
|
|
|
),
|
|
|
|
|
if (prov.isVideoCall)
|
|
|
|
|
DraggableWidget(
|
|
|
|
|
bottomMargin: 20,
|
|
|
|
|
topMargin: 40,
|
|
|
|
|
intialVisibility: true,
|
|
|
|
|
horizontalSpace: 20,
|
|
|
|
|
shadowBorderRadius: 50,
|
|
|
|
|
initialPosition: AnchoringPosition.topLeft,
|
|
|
|
|
dragController: dragController,
|
|
|
|
|
normalShadow: const BoxShadow(spreadRadius: 0.0, blurRadius: 0.0),
|
|
|
|
|
draggingShadow: const BoxShadow(spreadRadius: 0.0, blurRadius: 0.0),
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 200,
|
|
|
|
|
width: 140,
|
|
|
|
|
child: RTCVideoView(
|
|
|
|
|
prov.localVideoRenderer!,
|
|
|
|
|
mirror: true,
|
|
|
|
|
// filterQuality: FilterQuality.high,
|
|
|
|
|
objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitCover,
|
|
|
|
|
),
|
|
|
|
|
if (prov.isVideoCall)
|
|
|
|
|
DraggableWidget(
|
|
|
|
|
bottomMargin: 20,
|
|
|
|
|
topMargin: 40,
|
|
|
|
|
intialVisibility: true,
|
|
|
|
|
horizontalSpace: 20,
|
|
|
|
|
shadowBorderRadius: 50,
|
|
|
|
|
initialPosition: AnchoringPosition.topLeft,
|
|
|
|
|
dragController: dragController,
|
|
|
|
|
normalShadow: const BoxShadow(spreadRadius: 0.0, blurRadius: 0.0),
|
|
|
|
|
draggingShadow: const BoxShadow(spreadRadius: 0.0, blurRadius: 0.0),
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 200,
|
|
|
|
|
width: 140,
|
|
|
|
|
child: RTCVideoView(
|
|
|
|
|
prov.localVideoRenderer!,
|
|
|
|
|
mirror: true,
|
|
|
|
|
// filterQuality: FilterQuality.high,
|
|
|
|
|
objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitCover,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (!prov.isVideoCall)
|
|
|
|
|
Positioned.fill(
|
|
|
|
|
child: ClipRect(
|
|
|
|
|
child: BackdropFilter(
|
|
|
|
|
filter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: MyColors.grey57Color.withOpacity(
|
|
|
|
|
0.3,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (!prov.isVideoCall)
|
|
|
|
|
Positioned.fill(
|
|
|
|
|
child: ClipRect(
|
|
|
|
|
child: BackdropFilter(
|
|
|
|
|
filter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: MyColors.grey57Color.withOpacity(
|
|
|
|
|
0.3,
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 40,
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 40,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: const EdgeInsets.all(21.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: const EdgeInsets.only(
|
|
|
|
|
left: 10.0,
|
|
|
|
|
right: 10.0,
|
|
|
|
|
Container(
|
|
|
|
|
margin: const EdgeInsets.all(21.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: const EdgeInsets.only(
|
|
|
|
|
left: 10.0,
|
|
|
|
|
right: 10.0,
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
"assets/images/user.svg",
|
|
|
|
|
height: 70,
|
|
|
|
|
width: 70,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
"assets/images/user.svg",
|
|
|
|
|
height: 70,
|
|
|
|
|
width: 70,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
prov.incomingCallData!.doctorname ?? "",
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 21,
|
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
letterSpacing: -1.26,
|
|
|
|
|
height: 23 / 12,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Text(
|
|
|
|
|
"On Call",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Color(
|
|
|
|
|
0xffC6C6C6,
|
|
|
|
|
),
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
height: 23 / 24,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 2,
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
prov.incomingCallData!.doctorname ?? "",
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 21,
|
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
letterSpacing: -1.26,
|
|
|
|
|
height: 23 / 12,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Text(
|
|
|
|
|
"On Call",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Color(
|
|
|
|
|
0xffC6C6C6,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
height: 23 / 24,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 2,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Align(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
|
bottom: 20,
|
|
|
|
|
left: 40,
|
|
|
|
|
right: 40,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
// if (provider.isVideoCall)
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.loudOn();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isLoudSpeaker ? MyColors.textMixColor : Colors.grey,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.volume_up,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (prov.isVideoCall)
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.camOff();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isCamOff ? MyColors.textMixColor : Colors.grey,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: Icon(
|
|
|
|
|
prov.isCamOff ? Icons.videocam_off : Icons.videocam,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (prov.isVideoCall)
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.switchCamera();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isFrontCamera ? Colors.grey : MyColors.textMixColor,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: Icon(
|
|
|
|
|
prov.isFrontCamera ? Icons.switch_camera_outlined : Icons.switch_camera,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.micOff();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isMicOff ? MyColors.textMixColor : Colors.grey,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: Icon(
|
|
|
|
|
prov.isMicOff ? Icons.mic_off : Icons.mic,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// prov.endCall(isUserOnline: prov.isUserOnline).then((bool value) {
|
|
|
|
|
// if (value) {
|
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: MyColors.redA3Color,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.call_end,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: prov.isOutGoingCall
|
|
|
|
|
? Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
height: double.infinity,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
child: Stack(
|
|
|
|
|
alignment: FractionalOffset.center,
|
|
|
|
|
),
|
|
|
|
|
Align(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
|
bottom: 20,
|
|
|
|
|
left: 40,
|
|
|
|
|
right: 40,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
if (!prov.isAudioCall && prov.isVideoCall)
|
|
|
|
|
RTCVideoView(
|
|
|
|
|
prov.remoteRenderer!,
|
|
|
|
|
objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitContain,
|
|
|
|
|
key: const Key('remote'),
|
|
|
|
|
// if (provider.isVideoCall)
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.loudOn();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isLoudSpeaker ? MyColors.textMixColor : Colors.grey,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.volume_up,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (prov.isVideoCall)
|
|
|
|
|
DraggableWidget(
|
|
|
|
|
bottomMargin: 20,
|
|
|
|
|
topMargin: 40,
|
|
|
|
|
intialVisibility: true,
|
|
|
|
|
horizontalSpace: 20,
|
|
|
|
|
shadowBorderRadius: 50,
|
|
|
|
|
initialPosition: AnchoringPosition.topLeft,
|
|
|
|
|
dragController: dragController,
|
|
|
|
|
normalShadow: const BoxShadow(spreadRadius: 0.0, blurRadius: 0.0),
|
|
|
|
|
draggingShadow: const BoxShadow(spreadRadius: 0.0, blurRadius: 0.0),
|
|
|
|
|
child: SizedBox(
|
|
|
|
|
height: 200,
|
|
|
|
|
width: 140,
|
|
|
|
|
child: RTCVideoView(
|
|
|
|
|
prov.localVideoRenderer!,
|
|
|
|
|
mirror: true,
|
|
|
|
|
objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitCover,
|
|
|
|
|
),
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.camOff();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isCamOff ? MyColors.textMixColor : Colors.grey,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (!prov.isVideoCall)
|
|
|
|
|
Positioned.fill(
|
|
|
|
|
child: ClipRect(
|
|
|
|
|
child: BackdropFilter(
|
|
|
|
|
filter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: MyColors.grey57Color.withOpacity(
|
|
|
|
|
0.3,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 40,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
margin: const EdgeInsets.all(21.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: const EdgeInsets.only(
|
|
|
|
|
left: 10.0,
|
|
|
|
|
right: 10.0,
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
"assets/images/user.svg",
|
|
|
|
|
height: 70,
|
|
|
|
|
width: 70,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
prov.outGoingCallData!.receiverName!,
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 21,
|
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
letterSpacing: -1.26,
|
|
|
|
|
height: 23 / 12,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Text(
|
|
|
|
|
"On Call",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
color: Color(
|
|
|
|
|
0xffC6C6C6,
|
|
|
|
|
),
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
height: 23 / 24,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(
|
|
|
|
|
height: 2,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: Icon(
|
|
|
|
|
prov.isCamOff ? Icons.videocam_off : Icons.videocam,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Align(
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: const EdgeInsets.only(
|
|
|
|
|
bottom: 20,
|
|
|
|
|
left: 40,
|
|
|
|
|
right: 40,
|
|
|
|
|
if (prov.isVideoCall)
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.switchCamera();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isFrontCamera ? Colors.grey : MyColors.textMixColor,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
// if (provider.isVideoCall)
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.loudOn();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isLoudSpeaker ? MyColors.textMixColor : Colors.grey,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.volume_up,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
if (prov.isVideoCall)
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.camOff();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isCamOff ? MyColors.textMixColor : Colors.grey,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: Icon(
|
|
|
|
|
prov.isCamOff ? Icons.videocam_off : Icons.videocam,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (prov.isVideoCall)
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.switchCamera();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isFrontCamera ? Colors.grey : MyColors.textMixColor,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: Icon(
|
|
|
|
|
prov.isFrontCamera ? Icons.switch_camera_outlined : Icons.switch_camera,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.micOff();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isMicOff ? MyColors.textMixColor : Colors.grey,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: Icon(
|
|
|
|
|
prov.isMicOff ? Icons.mic_off : Icons.mic,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
// prov.endCall(isUserOnline: prov.isUserOnline).then(
|
|
|
|
|
// (bool value) {
|
|
|
|
|
// if (value) {
|
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: MyColors.redA3Color,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.call_end,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: Icon(
|
|
|
|
|
prov.isFrontCamera ? Icons.switch_camera_outlined : Icons.switch_camera,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.micOff();
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: prov.isMicOff ? MyColors.textMixColor : Colors.grey,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: Icon(
|
|
|
|
|
prov.isMicOff ? Icons.mic_off : Icons.mic,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
RawMaterialButton(
|
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
prov.handleCallComplete([{}]);
|
|
|
|
|
},
|
|
|
|
|
elevation: 2.0,
|
|
|
|
|
fillColor: MyColors.redA3Color,
|
|
|
|
|
padding: const EdgeInsets.all(
|
|
|
|
|
10.0,
|
|
|
|
|
),
|
|
|
|
|
shape: const CircleBorder(),
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.call_end,
|
|
|
|
|
color: MyColors.white,
|
|
|
|
|
size: 30.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox();
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|