All Projects → amorenew → Flutter-Mobile-Number-Plugin

amorenew / Flutter-Mobile-Number-Plugin

Licence: other
Flutter Plugin to get the mobile number

Programming Languages

java
68154 projects - #9 most used programming language
dart
5743 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Flutter-Mobile-Number-Plugin

Flutter plugin record
flutter 仿微信录制语音功能 支持android和ios
Stars: ✭ 214 (+872.73%)
Mutual labels:  flutter-plugin
firebase dart sdk
Unofficial Firebase Flutter SDK. Maintainer: @long1eu
Stars: ✭ 84 (+281.82%)
Mutual labels:  flutter-plugin
flutter opencv
Flutter plug-in providing (a few) basic bindings to OpenCV-4.x. OpenCV methods implemented without the Core packages. WIP.
Stars: ✭ 119 (+440.91%)
Mutual labels:  flutter-plugin
Betterplayer
Better video player for Flutter, with multiple configuration options. Solving typical use cases!
Stars: ✭ 205 (+831.82%)
Mutual labels:  flutter-plugin
Flutter Nfc Reader
Flutter NFC reader plugin for iOS and Android
Stars: ✭ 240 (+990.91%)
Mutual labels:  flutter-plugin
playify
Playify is a Flutter plugin for play/pause/seek songs, fetching music metadata, and browsing music library.
Stars: ✭ 32 (+45.45%)
Mutual labels:  flutter-plugin
Scratcher
Scratch card widget which temporarily hides content from user.
Stars: ✭ 210 (+854.55%)
Mutual labels:  flutter-plugin
flutter ume
UME is an in-app debug kits platform for Flutter. Produced by Flutter Infra team of ByteDance
Stars: ✭ 1,792 (+8045.45%)
Mutual labels:  flutter-plugin
flutter bolg manage
Flutter实战项目,采用Getx框架管理,遵循Material design设计风格,适合您实战参考或练手
Stars: ✭ 373 (+1595.45%)
Mutual labels:  flutter-plugin
flutter sliding tutorial
User onboarding library with smooth animation of objects and background colors
Stars: ✭ 127 (+477.27%)
Mutual labels:  flutter-plugin
Flutter fluid slider
A fluid design slider that works just like the Slider material widget.
Stars: ✭ 232 (+954.55%)
Mutual labels:  flutter-plugin
Sqfentity
SqfEntity ORM for Flutter/Dart lets you build and execute SQL commands on SQLite database easily and quickly with the help of fluent methods similar to .Net Entity Framework. SqfEntity also generates add/edit forms with validations and special controls (DropDown List, DateTime pickers, Checkboxes.. etc) for your table.
Stars: ✭ 237 (+977.27%)
Mutual labels:  flutter-plugin
flutter wechat
flutter wechat
Stars: ✭ 76 (+245.45%)
Mutual labels:  flutter-plugin
Flutter rating bar
A simple ratingbar for flutter which also include a rating bar indicator, supporting any fraction of rating.
Stars: ✭ 211 (+859.09%)
Mutual labels:  flutter-plugin
flutter cameraview
A Flutter plugin for Android and iOS allowing access to the device cameras, a bit deeper!!
Stars: ✭ 18 (-18.18%)
Mutual labels:  flutter-plugin
App review
App Review - Request and Write Reviews and Open Store Listing for Android and iOS in Flutter. Maintainer: @rodydavis
Stars: ✭ 213 (+868.18%)
Mutual labels:  flutter-plugin
FlutterToastPlugin
A new Flutter plugin for showing toast in android and ios.
Stars: ✭ 21 (-4.55%)
Mutual labels:  flutter-plugin
flutter-scankit
Flutter QR code scanning
Stars: ✭ 107 (+386.36%)
Mutual labels:  flutter-plugin
scalable image
A widget that shows an image which can be scaled and dragged using gestures.
Stars: ✭ 15 (-31.82%)
Mutual labels:  flutter-plugin
flutter shortcuts
Flutter plugin for creating static & dynamic app shortcuts on the home screen.
Stars: ✭ 47 (+113.64%)
Mutual labels:  flutter-plugin

mobile_number

This is a FLutter Plugin to get the device mobile number.

Note: It works for Android only because getting mobile number of sim card is not supported in iOS.

Note: If the mobile number is not pre-exist on sim card it will not return te phone number.

Installation

Link on Flutter plugins

https://pub.dev/packages/mobile_number

Note:

if you still using depecated FlutterActivty on MainActivity.java which is import of

  • import io.flutter.app.FlutterActivity;

not

  • import io.flutter.embedding.android.FlutterActivity;

then you need to add the following to your MainActivity.java

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MobileNumberPlugin.registerWith(registrarFor("com.amorenew.mobile_number.MobileNumberPlugin()"));
    }

Usage

Check Phone Permission

await MobileNumber.hasPhonePermission

Request Phone Permission

await MobileNumber.requestPhonePermission

Listen to widget resume after Phone Permission request

      if (isPermissionGranted) {
        //Get mobile number
      } else {
        //Request Phone Permission
      }
    });

Get first sim card number

    final String mobileNumber = await MobileNumber.mobileNumber;
    return mobileNumber;
  }

Get List of sim cards for dual sim cards

    final List<SimCard> simCards = await MobileNumber.getSimCards;
    return simCards;
  }

alt text

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].