call_number 0.0.1 copy "call_number: ^0.0.1" to clipboard
call_number: ^0.0.1 copied to clipboard

Call a number directly from your Flutter App

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:call_number/call_number.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {

  final TextEditingController _controller = new TextEditingController();

  @override
  initState() {
    super.initState();
  }

  _initCall() async {
    if(_controller.text != null)
      await new CallNumber().callNumber('+91' + _controller.text);
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        ),
        body: new Column(
          children: 
            <Widget>[
              new TextField(
                controller: _controller,
                keyboardType: TextInputType.phone,
                decoration: new InputDecoration(
                  hintText: 'Enter the Number',
                ),
              ),
              new IconButton(onPressed: _initCall, icon: new Icon(Icons.call)),
            ]
        ),
      ),
    );
  }
}
6
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Call a number directly from your Flutter App

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on call_number