If you want to Make a phone call from flutter app? I tried on Android/iOS this launch("tel://214324234")
and it works well. You need to install package url_launcher
and import it
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return new MaterialApp( title: 'Flutter Demo', home: new Home(), ); } } class Home extends StatelessWidget { Home({Key key}) : super(key: key); @override Widget build(BuildContext context) => new Scaffold( appBar: new AppBar( title: new Text("View"), ), body: new Center( child: new FlatButton( onPressed: () => launch("tel://21213123123"), child: new Text("Call me")), ), ); } void main() { runApp( new MyApp(), ); } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.