Can we make a WhatsApp video call on the click a button in flutter app ?
Asked
Active
Viewed 1,546 times
2 Answers
2
you can refer to WhatsApp official website and use universal link (see more). for example, you can send a sample text
using this URL:
const url = "https://wa.me/<number>?text=SAMPLE TEXT";
if you try to open this URL and the user has WhatsApp in his/her phone, this message would open in this application. You can replace text
with given keywords to start a phone call.

Abbasihsn
- 2,075
- 1
- 7
- 17
1
Add this Dependency then :
dependencies:
call_with_whatsapp: ^0.0.1
Then :
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:call_with_whatsapp/call_with_whatsapp.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
void _requestPermission() {
CallWithWhatsapp.requestPermissions().then((x){
print("success");
}).catchError((e){
print(e);
});
}
void _openStore() {
CallWithWhatsapp.openInPlayStore().then((x){
print("success");
}).catchError((e){
print(e);
});
}
void _initiateCall() {
CallWithWhatsapp.initiateCall("01753230535").then((x){
print("success");
}).catchError((e){
print(e);
});
}
void _createNewContact() {
CallWithWhatsapp.createContact("AAAAA AAAA", "0111111").then((x){
print("success");
}).catchError((e){
print(e);
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body:SafeArea(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
RaisedButton(
onPressed: _requestPermission,
child: Text(
"Request permission",
),
),
RaisedButton(
onPressed: _openStore,
child: Text(
"Open In Playstore",
),
),
RaisedButton(
onPressed: _initiateCall,
child: Text(
"Initiate Call",
),
),
RaisedButton(
onPressed: _createNewContact,
child: Text(
"Create contact",
),
),
],
),
),
),
),
);
}
}

Tasnuva Tavasum oshin
- 1
- 1
- 17
- 28