flt_telephony_info 0.1.3 copy "flt_telephony_info: ^0.1.3" to clipboard
flt_telephony_info: ^0.1.3 copied to clipboard

A new Flutter plugin , get telephony info ,based on TelephonyManager in Android and based on CoreTelephony in iOS

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:flt_telephony_info/flt_telephony_info.dart';

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

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

class _MyAppState extends State<MyApp> {
  TelephonyInfo _info;

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

  Future<void> getTelephonyInfo() async {
    TelephonyInfo info;
    try {
      info = await FltTelephonyInfo.info;
    } on PlatformException {}

    if (!mounted) return;

    setState(() {
      _info = info;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Phone Number: ${_info?.line1Number}\n'),
        ),
      ),
    );
  }
}
11
likes
40
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter plugin , get telephony info ,based on TelephonyManager in Android and based on CoreTelephony in iOS

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flt_telephony_info