Flutter Whatsapp Feedback :
In this tutorial we will be going through the implementation of whatsapp reach us/ feedback button within your flutter app so that the app users can easily post their query’s releated to your app.
Whats app is the most used social media app to connect with others its easy and used by almost everyone so integrating your feedback on this platform is a big plus.
So not only feedback you can share data from your app through whatsapp i.e., text messages by defining them in your app and can leave the phone number field so that user can enter accordingly.
You can also make service related communication through this option like receiving order’s / bookings through what’s app for your business.
So why late let’s get started in adding this amazing Flutter Whatsapp Feedback feature to your app and improve your app performance by going through the below video tutorial.
pubspec.yaml :
You can add a url launcher library so that you can launch whatsapp from you app when you click so. Make sure you added the latest library so that there are no code level issues.
dependencies: flutter: sdk: flutter url_launcher: ^6.0.9
main.dart :
Providing the full code for Flutter Whatsapp Feedback reach us button integration.
import 'dart:io'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; void main(){ runApp(MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar(title: Text('Contact Us'),), body: Container( child: TextButton( onPressed: (){ reachUs(); }, child: Text('Reach Us'), ), ), ), ); } } reachUs() async{ var contact = "+919849412345"; var android_url = "whatsapp://send?phone=" + contact +"&text= Hi, I need some help"; var iOS_url = "https://wa.me/$contact?text=${Uri.parse("Hi, I need some help")}"; if(Platform.isIOS){ if(await canLaunch(iOS_url)){ await launch(iOS_url, forceSafariVC: false); }else{ print('Whatsapp is not installed'); } }else{ if(await canLaunch(android_url)){ await launch(android_url); }else{ print('Whatsapp is not installed'); } } } /* openwhatsapp() async{ var whatsapp ="+919144040888"; var whatsappURl_android = "whatsapp://send?phone="+whatsapp+"&text=hello"; var whatappURL_ios ="https://wa.me/$whatsapp?text=${Uri.parse("hello")}"; if(Platform.isIOS){ // for iOS phone only if( await canLaunch(whatappURL_ios)){ await launch(whatappURL_ios, forceSafariVC: false); }else{ ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: new Text("whatsapp no installed"))); } }else{ // android , web if( await canLaunch(whatsappURl_android)){ await launch(whatsappURl_android); }else{ ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: new Text("whatsapp no installed"))); } } }*/
output :
The screen below depicts the usage of Flutter Whatsapp Feedback reach us button integration.
If you have any query’s in the implementation of flutter whatsapp feedback do let us know in the comment section below.If you like this tutorial do like and share us for more interesting updates.