Skip to content

Instantly share code, notes, and snippets.

@mulieriq
Created August 6, 2020 20:36
Show Gist options
  • Save mulieriq/e842f777a43d59560b56d16eb57b2975 to your computer and use it in GitHub Desktop.
Save mulieriq/e842f777a43d59560b56d16eb57b2975 to your computer and use it in GitHub Desktop.
Placing A Video Call
////////////////////////PLaced on click call nutton
generateChannelid<String>() {
return Random().nextInt(1000).toString();
}
String channelid;
placeVideoCall() {
///place instance to callers db
Firestore.instance
.collection("personalvideocalls")
.document(widget.senderId)
// .collection(widget.receiverid)
.setData({
"callerId": null,
"callerDeleteId": widget.senderId,
"callerName": widget.senderName,
"callerImage": widget.senderImage,
"iscaller": true, // used to identify who s placing the call
"callingChannel": channelid,
"receiverId": widget.receiverid,
"receiverName": widget.receverName,
"receiverImage": widget.receiverImage,
"received_by_recepient":
false, //used to determine if the receiver picked the call
"outgoing": true, //haitumiki sawa ..to show he made the call
"time": DateTime.now().millisecondsSinceEpoch.toString(),
}).then((r) {
Firestore.instance
.collection("personalvideocalls")
.document(widget.receiverid)
//.collection(widget.senderId)
.setData({
"callerId": widget.senderId,
"callerDeleteId": widget.senderId,
"callerName": widget.senderName,
"callerImage": widget.senderImage,
"iscaller": false,
"callingChannel": channelid,
"receiverId": widget.receiverid,
"receiverName": widget.receverName,
"receiverImage": widget.receiverImage,
"received_by_recepient": false, //kwa receiver this haitumiki
"incoming": true,
"time": DateTime.now().millisecondsSinceEpoch.toString(),
}).then((r) {
// Navigator.push(
// context,
// CupertinoPageRoute(
// builder: (BuildContext context) => OutgoingVideoCall(
// recipientid: widget.receiverid,
// recipientname: widget.receverName,
// recipientphoto: widget.receiverImage,
// channelName: channelid,
// )));
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment