flutter_phone_dialer 0.0.5 flutter_phone_dialer: ^0.0.5 copied to clipboard
Calls Made Simple: Integrate Phone Number Dialing into Your Flutter App Effortlessly!
import 'package:flutter/material.dart';
import 'package:flutter_phone_dialer/flutter_phone_dialer.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final TextEditingController _numberCtrl = TextEditingController();
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Dialer Example'),
),
body: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(8.0),
child: TextField(
controller: _numberCtrl,
decoration: const InputDecoration(labelText: "Phone Number"),
keyboardType: TextInputType.number,
),
),
ElevatedButton(
child: const Text("Call"),
onPressed: () async {
FlutterPhoneDialer.dialNumber(_numberCtrl.text);
},
),
],
),
),
);
}
@override
void initState() {
super.initState();
_numberCtrl.text = "*400#";
}
}