telephony_info_plus 0.0.2 copy "telephony_info_plus: ^0.0.2" to clipboard
telephony_info_plus: ^0.0.2 copied to clipboard

It a package that returns sim infos

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:telephony_info_plus/telephony_info_plus.dart';
import 'package:telephony_info_plus/telephony_info_plus_platform_interface.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';
  final _telephonyInfoPlusPlugin = TelephonyInfoPlus();

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

  Future<void> initPlatformState() async {
    List<TelephonyInfo>? platformVersion;
    try {
      platformVersion =
          await _telephonyInfoPlusPlugin.getSimInfos();
    } catch(e) {
      print(e.toString());
    }

    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion.toString();
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}
4
likes
130
points
76
downloads

Publisher

unverified uploader

Weekly Downloads

It a package that returns sim infos

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on telephony_info_plus

Packages that implement telephony_info_plus