changes local
parent
ecaf503f8b
commit
3b8332ce21
@ -1,199 +1,199 @@
|
|||||||
import 'dart:ui';
|
// import 'dart:ui';
|
||||||
|
//
|
||||||
import 'package:diplomaticquarterapp/voipcall/consts.dart';
|
// import 'package:diplomaticquarterapp/voipcall/consts.dart';
|
||||||
import 'package:diplomaticquarterapp/voipcall/model/call.dart';
|
// import 'package:diplomaticquarterapp/voipcall/model/call.dart';
|
||||||
import 'package:diplomaticquarterapp/voipcall/provider/chat_call_provider.dart';
|
// import 'package:diplomaticquarterapp/voipcall/provider/chat_call_provider.dart';
|
||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_svg/flutter_svg.dart';
|
// import 'package:flutter_svg/flutter_svg.dart';
|
||||||
import 'package:flutter_webrtc/flutter_webrtc.dart';
|
// import 'package:flutter_webrtc/flutter_webrtc.dart';
|
||||||
import 'package:provider/provider.dart';
|
// import 'package:provider/provider.dart';
|
||||||
|
//
|
||||||
class OutGoingCall extends StatefulWidget {
|
// class OutGoingCall extends StatefulWidget {
|
||||||
CallDataModel? outGoingCallData;
|
// CallDataModel? outGoingCallData;
|
||||||
bool isVideoCall;
|
// bool isVideoCall;
|
||||||
|
//
|
||||||
OutGoingCall({Key? key, this.outGoingCallData, this.isVideoCall = false}) : super(key: key);
|
// OutGoingCall({Key? key, this.outGoingCallData, this.isVideoCall = false}) : super(key: key);
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
_OutGoingCallState createState() => _OutGoingCallState();
|
// _OutGoingCallState createState() => _OutGoingCallState();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
class _OutGoingCallState extends State<OutGoingCall> {
|
// class _OutGoingCallState extends State<OutGoingCall> {
|
||||||
ChatCallProvider? callProvider;
|
// ChatCallProvider? callProvider;
|
||||||
//late ChatProviderModel chatProvider;
|
// //late ChatProviderModel chatProvider;
|
||||||
bool loader = true;
|
// bool loader = true;
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
void initState() {
|
// void initState() {
|
||||||
super.initState();
|
// super.initState();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
Future<void> init() async {
|
// Future<void> init() async {
|
||||||
// widget.isVideoCall ? callProvider!.isVideoCall = true : callProvider!.isVideoCall = false;
|
// // widget.isVideoCall ? callProvider!.isVideoCall = true : callProvider!.isVideoCall = false;
|
||||||
widget.isVideoCall = true;
|
// widget.isVideoCall = true;
|
||||||
callProvider!.isOutGoingCall = true;
|
// callProvider!.isOutGoingCall = true;
|
||||||
// IosCallPayload payload = IosCallPayload(
|
// // IosCallPayload payload = IosCallPayload(
|
||||||
// incomingCallerId: widget.outGoingCallData.callerId.toString(),
|
// // incomingCallerId: widget.outGoingCallData.callerId.toString(),
|
||||||
// incomingCallerName: widget.outGoingCallData.callerName,
|
// // incomingCallerName: widget.outGoingCallData.callerName,
|
||||||
// incomingCallReciverId: widget.outGoingCallData.receiverId.toString(),
|
// // incomingCallReciverId: widget.outGoingCallData.receiverId.toString(),
|
||||||
// incomingCallType: widget.outGoingCallData.callType,
|
// // incomingCallType: widget.outGoingCallData.callType,
|
||||||
// uuid: "",
|
// // uuid: "",
|
||||||
// callData: widget.outGoingCallData.toRawJson());
|
// // callData: widget.outGoingCallData.toRawJson());
|
||||||
// await Utils.saveStringFromPrefs("iosCallPayload", jsonEncode(payload));
|
// // await Utils.saveStringFromPrefs("iosCallPayload", jsonEncode(payload));
|
||||||
await callProvider!.initLocalCamera(callData: widget.outGoingCallData);
|
// await callProvider!.initLocalCamera(callData: widget.outGoingCallData);
|
||||||
loader = false;
|
// loader = false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
void dispose() {
|
// void dispose() {
|
||||||
super.dispose();
|
// super.dispose();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
callProvider = Provider.of<ChatCallProvider>(context, listen: false);
|
// callProvider = Provider.of<ChatCallProvider>(context, listen: false);
|
||||||
init();
|
// init();
|
||||||
return Scaffold(
|
// return Scaffold(
|
||||||
body: Consumer<ChatCallProvider>(builder: (BuildContext context, ChatCallProvider chatcp, Widget? child) {
|
// body: Consumer<ChatCallProvider>(builder: (BuildContext context, ChatCallProvider chatcp, Widget? child) {
|
||||||
return loader
|
// return loader
|
||||||
? const Center(
|
// ? const Center(
|
||||||
child: CircularProgressIndicator(),
|
// child: CircularProgressIndicator(),
|
||||||
)
|
// )
|
||||||
: Stack(
|
// : Stack(
|
||||||
alignment: FractionalOffset.center,
|
// alignment: FractionalOffset.center,
|
||||||
children: <Widget>[
|
// children: <Widget>[
|
||||||
if (chatcp.isVideoCall)
|
// if (chatcp.isVideoCall)
|
||||||
Positioned.fill(
|
// Positioned.fill(
|
||||||
child: RTCVideoView(
|
// child: RTCVideoView(
|
||||||
chatcp.localVideoRenderer!,
|
// chatcp.localVideoRenderer!,
|
||||||
objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitCover,
|
// objectFit: RTCVideoViewObjectFit.RTCVideoViewObjectFitCover,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Positioned.fill(
|
// Positioned.fill(
|
||||||
child: ClipRect(
|
// child: ClipRect(
|
||||||
child: BackdropFilter(
|
// child: BackdropFilter(
|
||||||
filter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),
|
// filter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),
|
||||||
child: Container(
|
// child: Container(
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
color: MyColors.grey57Color.withOpacity(
|
// color: MyColors.grey57Color.withOpacity(
|
||||||
0.3,
|
// 0.3,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
child: Column(
|
// child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.max,
|
// mainAxisSize: MainAxisSize.max,
|
||||||
children: <Widget>[
|
// children: <Widget>[
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 40,
|
// height: 40,
|
||||||
),
|
// ),
|
||||||
Row(
|
// Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
// children: <Widget>[
|
||||||
Container(
|
// Container(
|
||||||
margin: const EdgeInsets.all(21.0),
|
// margin: const EdgeInsets.all(21.0),
|
||||||
child: Container(
|
// child: Container(
|
||||||
margin: const EdgeInsets.only(
|
// margin: const EdgeInsets.only(
|
||||||
left: 10.0,
|
// left: 10.0,
|
||||||
right: 10.0,
|
// right: 10.0,
|
||||||
),
|
// ),
|
||||||
child: Column(
|
// child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
mainAxisSize: MainAxisSize.min,
|
// mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
// mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: <Widget>[
|
// children: <Widget>[
|
||||||
SvgPicture.asset(
|
// SvgPicture.asset(
|
||||||
"assets/images/user.svg",
|
// "assets/images/user.svg",
|
||||||
height: 70,
|
// height: 70,
|
||||||
width: 70,
|
// width: 70,
|
||||||
fit: BoxFit.cover,
|
// fit: BoxFit.cover,
|
||||||
),
|
// ),
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
height: 10,
|
// height: 10,
|
||||||
),
|
// ),
|
||||||
Text(
|
// Text(
|
||||||
widget.outGoingCallData!.receiverName.toString().replaceAll(".", " "),
|
// widget.outGoingCallData!.receiverName.toString().replaceAll(".", " "),
|
||||||
style: const TextStyle(
|
// style: const TextStyle(
|
||||||
fontSize: 21,
|
// fontSize: 21,
|
||||||
fontWeight: FontWeight.bold,
|
// fontWeight: FontWeight.bold,
|
||||||
color: MyColors.white,
|
// color: MyColors.white,
|
||||||
letterSpacing: -1.26,
|
// letterSpacing: -1.26,
|
||||||
height: 23 / 12,
|
// height: 23 / 12,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
const Text(
|
// const Text(
|
||||||
"Ringing...",
|
// "Ringing...",
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontSize: 16,
|
// fontSize: 16,
|
||||||
fontWeight: FontWeight.w600,
|
// fontWeight: FontWeight.w600,
|
||||||
color: Color(
|
// color: Color(
|
||||||
0xffC6C6C6,
|
// 0xffC6C6C6,
|
||||||
),
|
// ),
|
||||||
letterSpacing: -0.48,
|
// letterSpacing: -0.48,
|
||||||
height: 23 / 24,
|
// height: 23 / 24,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
const SizedBox(
|
// const SizedBox(
|
||||||
height: 2,
|
// height: 2,
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
const Spacer(),
|
// const Spacer(),
|
||||||
Container(
|
// Container(
|
||||||
margin: const EdgeInsets.only(
|
// margin: const EdgeInsets.only(
|
||||||
bottom: 70.0,
|
// bottom: 70.0,
|
||||||
left: 49,
|
// left: 49,
|
||||||
right: 49,
|
// right: 49,
|
||||||
),
|
// ),
|
||||||
child: Row(
|
// child: Row(
|
||||||
mainAxisSize: MainAxisSize.max,
|
// mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
// children: <Widget>[
|
||||||
RawMaterialButton(
|
// RawMaterialButton(
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
chatcp.endCall(isUserOnline: chatcp.isUserOnline).then((bool value) {
|
// chatcp.endCall(isUserOnline: chatcp.isUserOnline).then((bool value) {
|
||||||
if (value) {
|
// if (value) {
|
||||||
Navigator.of(context).pop();
|
// Navigator.of(context).pop();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
elevation: 2.0,
|
// elevation: 2.0,
|
||||||
fillColor: MyColors.redA3Color,
|
// fillColor: MyColors.redA3Color,
|
||||||
padding: const EdgeInsets.all(
|
// padding: const EdgeInsets.all(
|
||||||
15.0,
|
// 15.0,
|
||||||
),
|
// ),
|
||||||
shape: const CircleBorder(),
|
// shape: const CircleBorder(),
|
||||||
child: const Icon(
|
// child: const Icon(
|
||||||
Icons.call_end,
|
// Icons.call_end,
|
||||||
color: MyColors.white,
|
// color: MyColors.white,
|
||||||
size: 35.0,
|
// size: 35.0,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
);
|
// );
|
||||||
}),
|
// }),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
BoxDecoration cardRadius(double radius, {Color? color, double? elevation}) {
|
// BoxDecoration cardRadius(double radius, {Color? color, double? elevation}) {
|
||||||
return BoxDecoration(
|
// return BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
// shape: BoxShape.rectangle,
|
||||||
color: color ?? Colors.white,
|
// color: color ?? Colors.white,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(radius)),
|
// borderRadius: BorderRadius.all(Radius.circular(radius)),
|
||||||
boxShadow: <BoxShadow>[BoxShadow(color: const Color(0xff000000).withOpacity(.05), blurRadius: elevation ?? 27, offset: const Offset(-2, 3))],
|
// boxShadow: <BoxShadow>[BoxShadow(color: const Color(0xff000000).withOpacity(.05), blurRadius: elevation ?? 27, offset: const Offset(-2, 3))],
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue