How to make a phone call from a flutter app


I try to make a phone call from my Flutter app. With the following code:

UrlLauncher.launch('tel: xxxxxxxx');

I found this Function on the GitHub flutter repo:

But this doesn’t work for me. Is this Function still in Flutter and in which package? Or is there a better option to do a phone call from my app?


Call the launch method from url_launcher package:


Here’s the complete code:

import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      home: new Home(),

class Home extends StatelessWidget {
  Home({Key key}) : super(key: key);

  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() {
    new MyApp(),

Also you can import it and then use

import 'package:url_launcher/url_launcher.dart' as UrlLauncher;

Be sure to include an entry for it in the pubspec.yaml file, in the dependencies section:

url_launcher: ^1.0.2

Answered By – German Saprykin

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published