├── ios
├── Assets
│ └── .gitkeep
├── Classes
│ ├── LibphonenumberPlugin.h
│ └── LibphonenumberPlugin.m
├── .gitignore
└── libphonenumber.podspec
├── android
├── gradle.properties
├── settings.gradle
├── src
│ └── main
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── com
│ │ └── codeheadlabs
│ │ └── libphonenumber
│ │ └── LibphonenumberPlugin.java
├── .gitignore
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── build.gradle
├── example
├── .gitignore
├── ios
│ ├── Flutter
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── AppFrameworkInfo.plist
│ ├── Runner
│ │ ├── AppDelegate.h
│ │ ├── Assets.xcassets
│ │ │ ├── LaunchImage.imageset
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ ├── README.md
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── Contents.json
│ │ ├── main.m
│ │ ├── AppDelegate.m
│ │ ├── Info.plist
│ │ └── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── LaunchScreen.storyboard
│ ├── Runner.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── Runner.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ └── project.pbxproj
│ ├── .gitignore
│ └── Podfile
├── android
│ ├── app
│ │ ├── src
│ │ │ └── main
│ │ │ │ ├── res
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ └── values
│ │ │ │ │ └── styles.xml
│ │ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── mathrawk
│ │ │ │ │ └── libphonenumberexample
│ │ │ │ │ └── MainActivity.java
│ │ │ │ └── AndroidManifest.xml
│ │ └── build.gradle
│ ├── .gitignore
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── build.gradle
│ └── settings.gradle
├── README.md
├── .metadata
├── .flutter-plugins-dependencies
├── test
│ └── widget_test.dart
├── pubspec.yaml
└── lib
│ └── main.dart
├── README.md
├── pubspec.yaml
├── LICENSE
├── CHANGELOG.md
├── .gitignore
└── lib
└── libphonenumber.dart
/ios/Assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'libphonenumber'
2 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
9 | .flutter-plugins
10 |
--------------------------------------------------------------------------------
/ios/Classes/LibphonenumberPlugin.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface LibphonenumberPlugin : NSObject
4 | @end
5 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.class
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | GeneratedPluginRegistrant.java
11 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.defaults.buildfeatures.buildconfig=true
4 | android.nonTransitiveRClass=false
5 | android.nonFinalResIds=false
6 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/emostar/flutter-libphonenumber/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # libphonenumber_example
2 |
3 | Demonstrates how to use the libphonenumber plugin.
4 |
5 | ## Getting Started
6 |
7 | For help getting started with Flutter, view our online
8 | [documentation](https://flutter.io/).
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/example/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char* argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
4 | networkTimeout=10000
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/example/android/app/src/main/java/com/mathrawk/libphonenumberexample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.mathrawk.libphonenumberexample;
2 |
3 | import io.flutter.embedding.android.FlutterActivity;
4 | import io.flutter.embedding.engine.FlutterEngine;
5 |
6 | public class MainActivity extends FlutterActivity {
7 | }
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: e4b989bf3dbefc61f11bce298d16f92ebd9cde41
8 | channel: master
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | }
7 |
8 | rootProject.buildDir = '../build'
9 | subprojects {
10 | project.buildDir = "${rootProject.buildDir}/${project.name}"
11 | }
12 | subprojects {
13 | project.evaluationDependsOn(':app')
14 | }
15 |
16 | tasks.register("clean", Delete) {
17 | delete rootProject.buildDir
18 | }
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # libphonenumber
2 |
3 | This is a Flutter implementation of libphonenumber. It includes only a few
4 | features at the moment, and are added when more functionality is desired.
5 |
6 | ## Getting Started
7 |
8 | For help getting started with Flutter, view our online
9 | [documentation](https://flutter.io/).
10 |
11 | For help on editing plugin code, view the [documentation](https://flutter.io/developing-packages/#edit-plugin-package).
12 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application
7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8 | [GeneratedPluginRegistrant registerWithRegistry:self];
9 | // Override point for customization after application launch.
10 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
11 | }
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/Generated.xcconfig
37 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/.flutter-plugins-dependencies:
--------------------------------------------------------------------------------
1 | {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"libphonenumber","path":"/home/jon/dev/mathrawk/flutter-libphonenumber/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"libphonenumber","path":"/home/jon/dev/mathrawk/flutter-libphonenumber/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"libphonenumber","dependencies":[]}],"date_created":"2025-02-25 18:58:03.895804","version":"3.29.0","swift_package_manager_enabled":{"ios":false,"macos":false}}
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: libphonenumber
2 | description: This is a Flutter implementation of libphonenumber. It includes only a few features at the moment, and are added when more functionality is desired.
3 | version: 3.0.0
4 | homepage: https://github.com/emostar/flutter-libphonenumber
5 |
6 | dependencies:
7 | flutter:
8 | sdk: flutter
9 | meta: ^1.15.0
10 |
11 | flutter:
12 | plugin:
13 | platforms:
14 | android:
15 | package: com.codeheadlabs.libphonenumber
16 | pluginClass: LibphonenumberPlugin
17 | ios:
18 | pluginClass: LibphonenumberPlugin
19 |
20 | environment:
21 | sdk: ">=3.0.0 <4.0.0"
22 | flutter: ">=3.0.0"
23 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/app.flx
37 | /Flutter/app.zip
38 | /Flutter/flutter_assets/
39 | /Flutter/App.framework
40 | /Flutter/Flutter.framework
41 | /Flutter/Generated.xcconfig
42 | /ServiceDefinitions.json
43 |
44 | Pods/
45 | .symlinks/
46 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | def flutterSdkPath = {
3 | def properties = new Properties()
4 | file("local.properties").withInputStream { properties.load(it) }
5 | def flutterSdkPath = properties.getProperty("flutter.sdk")
6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7 | return flutterSdkPath
8 | }()
9 |
10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11 |
12 | repositories {
13 | google()
14 | mavenCentral()
15 | gradlePluginPortal()
16 | }
17 | }
18 |
19 | plugins {
20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21 | id "com.android.application" version "8.0.2" apply false
22 | }
23 |
24 | include ":app"
--------------------------------------------------------------------------------
/ios/libphonenumber.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
3 | #
4 | Pod::Spec.new do |s|
5 | s.name = 'libphonenumber'
6 | s.version = '0.0.1'
7 | s.summary = 'Simple implementation of libphonenumber'
8 | s.description = <<-DESC
9 | Simple implementation of libphonenumber
10 | DESC
11 | s.homepage = 'http://example.com'
12 | s.license = { :file => '../LICENSE' }
13 | s.author = { 'Your Company' => 'email@example.com' }
14 | s.source = { :path => '.' }
15 | s.source_files = 'Classes/**/*'
16 | s.public_header_files = 'Classes/**/*.h'
17 | s.dependency 'Flutter'
18 | s.dependency 'libPhoneNumber-iOS'
19 |
20 | s.ios.deployment_target = '8.0'
21 | end
22 |
23 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | group 'com.mathrawk.libphonenumber'
2 | version '1.0-SNAPSHOT'
3 |
4 | buildscript {
5 | repositories {
6 | google()
7 | mavenCentral()
8 | }
9 |
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.5.4'
12 | }
13 | }
14 |
15 | rootProject.allprojects {
16 | repositories {
17 | google()
18 | mavenCentral()
19 | }
20 | }
21 |
22 | apply plugin: 'com.android.library'
23 |
24 | android {
25 | compileSdkVersion 33
26 | namespace 'com.mathrawk.libphonenumber'
27 |
28 | defaultConfig {
29 | minSdkVersion 16
30 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
31 | }
32 | lintOptions {
33 | disable 'InvalidPackage'
34 | }
35 | dependencies {
36 | api 'com.googlecode.libphonenumber:libphonenumber:8.13.55'
37 | api 'com.googlecode.libphonenumber:carrier:1.239'
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/example/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | // To perform an interaction with a widget in your test, use the WidgetTester utility that Flutter
3 | // provides. For example, you can send tap and scroll gestures. You can also use WidgetTester to
4 | // find child widgets in the widget tree, read text, and verify that the values of widget properties
5 | // are correct.
6 |
7 | import 'package:flutter/material.dart';
8 | import 'package:flutter_test/flutter_test.dart';
9 |
10 | import 'package:libphonenumber_example/main.dart';
11 |
12 | void main() {
13 | testWidgets('Verify Platform version', (WidgetTester tester) async {
14 | // Build our app and trigger a frame.
15 | await tester.pumpWidget(new MyApp());
16 |
17 | // Verify that platform version is retrieved.
18 | expect(
19 | find.byWidgetPredicate(
20 | (Widget widget) =>
21 | widget is Text && widget.data!.startsWith('Running on:'),
22 | ),
23 | findsOneWidget);
24 | });
25 | }
26 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Codehead Labs, LLC
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## 3.0.0 (20230705)
4 |
5 | * Update Gradle 8.0.2
6 | * Update libphonenumber java dep to latest version (8.13.15)
7 | * Update carrier java dep to latest version (1.199)
8 | * Update Flutter version minimum to 3.0.0
9 | * Update example Gradle 8.0.2
10 |
11 | ## 2.0.2 (20210912)
12 |
13 | * Switch to v2 Android embedding
14 | * Update libphonenumber java dep to latest version (8.12.32)
15 | * Update carrier java dep to latest version (1.158)
16 |
17 | ## 2.0.1 (20210613)
18 |
19 | * Fix unhandled exception ()
20 |
21 | ## 2.0.0 (20210316)
22 |
23 | * nullsafety ()
24 | * Update libphonenumber java dep to latest version (8.12.19)
25 | * Update carrier java dep to latest version (1.145)
26 |
27 | ## 1.0.2 (20201001)
28 |
29 | * Add getNameFromNumber to get the carrier name for a phone number (carrier java dep 1.136)
30 | * Update libphonenumber java dep to latest version (8.10.12)
31 |
32 | ## 1.0.1 (20191217)
33 |
34 | * Add format as you type ()
35 | * Add getNumberType ()
36 |
37 | ## 1.0.0
38 |
39 | * AndroidX support
40 | * Bump libphonenumber java dep to latest version
41 |
42 | ## 0.0.4
43 |
44 | * Another iOS fix, this time for getRegionInfo
45 |
46 | ## 0.0.3
47 |
48 | * iOS fix for parsing phone numbers
49 |
50 | ## 0.0.2
51 |
52 | * Fix Android package name issue
53 |
54 | ## 0.0.1
55 |
56 | * Initial version
57 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | libphonenumber_example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | *.iml
5 | *.ipr
6 | *.iws
7 | .idea/
8 |
9 | pubspec.lock
10 |
11 | **/flutter_export_environment.sh
12 |
13 | # Visual Studio Code related
14 | .vscode/
15 |
16 | # Flutter repo-specific
17 | /bin/cache/
18 | /bin/mingit/
19 | /dev/benchmarks/mega_gallery/
20 | /dev/bots/.recipe_deps
21 | /dev/bots/android_tools/
22 | /dev/docs/doc/
23 | /dev/docs/flutter.docs.zip
24 | /dev/docs/lib/
25 | /dev/docs/pubspec.yaml
26 | /packages/flutter/coverage/
27 | version
28 |
29 | # Flutter/Dart/Pub related
30 | **/doc/api/
31 | .dart_tool/
32 | .flutter-plugins
33 | .packages
34 | .pub-cache/
35 | .pub/
36 | build/
37 | flutter_*.png
38 | linked_*.ds
39 | unlinked.ds
40 | unlinked_spec.ds
41 |
42 | # Android related
43 | **/android/**/gradle-wrapper.jar
44 | **/android/.gradle
45 | **/android/captures/
46 | **/android/gradlew
47 | **/android/gradlew.bat
48 | **/android/local.properties
49 | **/android/**/GeneratedPluginRegistrant.java
50 |
51 | # iOS/XCode related
52 | **/ios/**/*.mode1v3
53 | **/ios/**/*.mode2v3
54 | **/ios/**/*.moved-aside
55 | **/ios/**/*.pbxuser
56 | **/ios/**/*.perspectivev3
57 | **/ios/**/*sync/
58 | **/ios/**/.sconsign.dblite
59 | **/ios/**/.tags*
60 | **/ios/**/.vagrant/
61 | **/ios/**/DerivedData/
62 | **/ios/**/Icon?
63 | **/ios/**/Pods/
64 | **/ios/**/.symlinks/
65 | **/ios/**/profile
66 | **/ios/**/xcuserdata
67 | **/ios/.generated/
68 | **/ios/Flutter/App.framework
69 | **/ios/Flutter/Flutter.framework
70 | **/ios/Flutter/Generated.xcconfig
71 | **/ios/Flutter/app.flx
72 | **/ios/Flutter/app.zip
73 | **/ios/Flutter/flutter_assets/
74 | **/ios/ServiceDefinitions.json
75 | **/ios/Runner/GeneratedPluginRegistrant.*
76 |
77 | # Exceptions to above rules.
78 | !**/ios/**/default.mode1v3
79 | !**/ios/**/default.mode2v3
80 | !**/ios/**/default.pbxuser
81 | !**/ios/**/default.perspectivev3
82 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
83 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "com.android.application"
3 | id "dev.flutter.flutter-gradle-plugin"
4 | }
5 |
6 | def localProperties = new Properties()
7 | def localPropertiesFile = rootProject.file('local.properties')
8 | if (localPropertiesFile.exists()) {
9 | localPropertiesFile.withReader('UTF-8') { reader ->
10 | localProperties.load(reader)
11 | }
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | android {
25 | namespace 'com.mathrawk.libphonenumberexample'
26 | compileSdkVersion 34
27 |
28 | defaultConfig {
29 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
30 | applicationId "com.mathrawk.libphonenumberexample"
31 | minSdkVersion flutter.minSdkVersion
32 | targetSdkVersion 34
33 | versionCode flutterVersionCode.toInteger()
34 | versionName flutterVersionName
35 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
36 | }
37 |
38 | buildTypes {
39 | release {
40 | // TODO: Add your own signing config for the release build.
41 | // Signing with the debug keys for now, so `flutter run --release` works.
42 | signingConfig signingConfigs.debug
43 | }
44 | }
45 |
46 | lint {
47 | disable 'InvalidPackage'
48 | }
49 | }
50 |
51 | flutter {
52 | source '../..'
53 | }
54 |
55 | dependencies {
56 | testImplementation 'junit:junit:4.13.2'
57 | androidTestImplementation 'androidx.test:runner:1.5.2'
58 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
59 | }
60 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
14 |
15 |
16 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def parse_KV_file(file, separator='=')
14 | file_abs_path = File.expand_path(file)
15 | if !File.exists? file_abs_path
16 | return [];
17 | end
18 | pods_ary = []
19 | skip_line_start_symbols = ["#", "/"]
20 | File.foreach(file_abs_path) { |line|
21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22 | plugin = line.split(pattern=separator)
23 | if plugin.length == 2
24 | podname = plugin[0].strip()
25 | path = plugin[1].strip()
26 | podpath = File.expand_path("#{path}", file_abs_path)
27 | pods_ary.push({:name => podname, :path => podpath});
28 | else
29 | puts "Invalid plugin specification: #{line}"
30 | end
31 | }
32 | return pods_ary
33 | end
34 |
35 | target 'Runner' do
36 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
37 | # referring to absolute paths on developers' machines.
38 | system('rm -rf .symlinks')
39 | system('mkdir -p .symlinks/plugins')
40 |
41 | # Flutter Pods
42 | generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig')
43 | if generated_xcode_build_settings.empty?
44 | puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
45 | end
46 | generated_xcode_build_settings.map { |p|
47 | if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
48 | symlink = File.join('.symlinks', 'flutter')
49 | File.symlink(File.dirname(p[:path]), symlink)
50 | pod 'Flutter', :path => File.join(symlink, File.basename(p[:path]))
51 | end
52 | }
53 |
54 | # Plugin Pods
55 | plugin_pods = parse_KV_file('../.flutter-plugins')
56 | plugin_pods.map { |p|
57 | symlink = File.join('.symlinks', 'plugins', p[:name])
58 | File.symlink(p[:path], symlink)
59 | pod p[:name], :path => File.join(symlink, 'ios')
60 | }
61 | end
62 |
63 | post_install do |installer|
64 | installer.pods_project.targets.each do |target|
65 | target.build_configurations.each do |config|
66 | config.build_settings['ENABLE_BITCODE'] = 'NO'
67 | end
68 | end
69 | end
70 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: libphonenumber_example
2 | description: Demonstrates how to use the libphonenumber plugin.
3 |
4 | # The following defines the version and build number for your application.
5 | # A version number is three numbers separated by dots, like 1.2.43
6 | # followed by an optional build number separated by a +.
7 | # Both the version and the builder number may be overridden in flutter
8 | # build by specifying --build-name and --build-number, respectively.
9 | # Read more about versioning at semver.org.
10 | version: 1.0.0+1
11 | environment:
12 | sdk: ">=3.0.0 <4.0.0"
13 | dependencies:
14 | flutter:
15 | sdk: flutter
16 |
17 | # The following adds the Cupertino Icons font to your application.
18 | # Use with the CupertinoIcons class for iOS style icons.
19 | cupertino_icons: 1.0.5
20 |
21 | dev_dependencies:
22 | flutter_test:
23 | sdk: flutter
24 |
25 | libphonenumber:
26 | path: ../
27 |
28 | # For information on the generic Dart part of this file, see the
29 | # following page: https://www.dartlang.org/tools/pub/pubspec
30 |
31 | # The following section is specific to Flutter.
32 | flutter:
33 | # The following line ensures that the Material Icons font is
34 | # included with your application, so that you can use the icons in
35 | # the material Icons class.
36 | uses-material-design: true
37 |
38 | # To add assets to your application, add an assets section, like this:
39 | # assets:
40 | # - images/a_dot_burr.jpeg
41 | # - images/a_dot_ham.jpeg
42 |
43 | # An image asset can refer to one or more resolution-specific "variants", see
44 | # https://flutter.io/assets-and-images/#resolution-aware.
45 |
46 | # For details regarding adding assets from package dependencies, see
47 | # https://flutter.io/assets-and-images/#from-packages
48 |
49 | # To add custom fonts to your application, add a fonts section here,
50 | # in this "flutter" section. Each entry in this list should have a
51 | # "family" key with the font family name, and a "fonts" key with a
52 | # list giving the asset and other descriptors for the font. For
53 | # example:
54 | # fonts:
55 | # - family: Schyler
56 | # fonts:
57 | # - asset: fonts/Schyler-Regular.ttf
58 | # - asset: fonts/Schyler-Italic.ttf
59 | # style: italic
60 | # - family: Trajan Pro
61 | # fonts:
62 | # - asset: fonts/TrajanPro.ttf
63 | # - asset: fonts/TrajanPro_Bold.ttf
64 | # weight: 700
65 | #
66 | # For details regarding fonts from package dependencies,
67 | # see https://flutter.io/custom-fonts/#from-packages
68 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/lib/libphonenumber.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/services.dart';
4 |
5 | class RegionInfo {
6 | String? regionPrefix;
7 | String? isoCode;
8 | String? formattedPhoneNumber;
9 |
10 | RegionInfo({this.regionPrefix, this.isoCode, this.formattedPhoneNumber});
11 |
12 | @override
13 | String toString() {
14 | return '[RegionInfo prefix=$regionPrefix, iso=$isoCode, formatted=$formattedPhoneNumber]';
15 | }
16 | }
17 |
18 | enum PhoneNumberFormat { E164, INTERNATIONAL, NATIONAL, RFC3966 }
19 |
20 | enum PhoneNumberType {
21 | fixedLine,
22 | mobile,
23 | fixedLineOrMobile,
24 | tollFree,
25 | premiumRate,
26 | sharedCost,
27 | voip,
28 | personalNumber,
29 | pager,
30 | uan,
31 | voicemail,
32 | unknown
33 | }
34 |
35 | class PhoneNumberUtil {
36 | static const MethodChannel _channel =
37 | const MethodChannel('codeheadlabs.com/libphonenumber');
38 |
39 | static Future isValidPhoneNumber({
40 | required String phoneNumber,
41 | required String isoCode,
42 | }) async {
43 | try {
44 | return await _channel.invokeMethod('isValidPhoneNumber', {
45 | 'phone_number': phoneNumber,
46 | 'iso_code': isoCode,
47 | });
48 | } catch (e) {
49 | // Sometimes invalid phone numbers can cause exceptions, e.g. "+1"
50 | return false;
51 | }
52 | }
53 |
54 | static Future getNameForNumber({
55 | required String phoneNumber,
56 | required String isoCode,
57 | }) async {
58 | return await _channel.invokeMethod('getNameForNumber', {
59 | 'phone_number': phoneNumber,
60 | 'iso_code': isoCode,
61 | });
62 | }
63 |
64 | static Future normalizePhoneNumber({
65 | required String phoneNumber,
66 | required String isoCode,
67 | }) async {
68 | return await _channel.invokeMethod('normalizePhoneNumber', {
69 | 'phone_number': phoneNumber,
70 | 'iso_code': isoCode,
71 | });
72 | }
73 |
74 | static Future getRegionInfo({
75 | required String phoneNumber,
76 | required String isoCode,
77 | }) async {
78 | Map result =
79 | await (_channel.invokeMethod('getRegionInfo', {
80 | 'phone_number': phoneNumber,
81 | 'iso_code': isoCode,
82 | }));
83 |
84 | return RegionInfo(
85 | regionPrefix: result['regionCode'],
86 | isoCode: result['isoCode'],
87 | formattedPhoneNumber: result['formattedPhoneNumber'],
88 | );
89 | }
90 |
91 | static Future getNumberType({
92 | required String phoneNumber,
93 | required String isoCode,
94 | }) async {
95 | int? result = await _channel.invokeMethod('getNumberType', {
96 | 'phone_number': phoneNumber,
97 | 'iso_code': isoCode,
98 | });
99 | if (result == -1) {
100 | return PhoneNumberType.unknown;
101 | }
102 | return PhoneNumberType.values[result!];
103 | }
104 |
105 | static Future getExampleNumber(String isoCode) async {
106 | Map result =
107 | await _channel.invokeMethod('getExampleNumber', {
108 | 'iso_code': isoCode,
109 | });
110 | return result['formattedPhoneNumber'].toString();
111 | }
112 |
113 | static Future formatAsYouType({
114 | required String phoneNumber,
115 | required String isoCode,
116 | }) async {
117 | return await _channel.invokeMethod('formatAsYouType', {
118 | 'phone_number': phoneNumber,
119 | 'iso_code': isoCode,
120 | });
121 | }
122 |
123 | static Future format({
124 | required String phoneNumber,
125 | required String isoCode,
126 | required PhoneNumberFormat format,
127 | // If true, this removes the spaces between the digits in the number formats
128 | // that add them.
129 | bool removeSpacesBetweenDigits = true,
130 | }) async {
131 | final String? formatString = format.toString();
132 | if (formatString == null || formatString.isEmpty) {
133 | return phoneNumber;
134 | }
135 |
136 | final String formattedPhoneNumber = await _channel.invokeMethod('format', {
137 | 'phone_number': phoneNumber,
138 | 'iso_code': isoCode,
139 | 'format': formatString.substring(formatString.indexOf('.') + 1)
140 | });
141 |
142 | if (removeSpacesBetweenDigits) {
143 | return formattedPhoneNumber.replaceAll(' ', '');
144 | } else {
145 | return formattedPhoneNumber;
146 | }
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/ios/Classes/LibphonenumberPlugin.m:
--------------------------------------------------------------------------------
1 | #import "LibphonenumberPlugin.h"
2 |
3 | #import "NBPhoneNumberUtil.h"
4 | #import "NBAsYouTypeFormatter.h"
5 |
6 | @interface LibphonenumberPlugin ()
7 | @property(nonatomic, retain) NBPhoneNumberUtil *phoneUtil;
8 | @end
9 |
10 | @implementation LibphonenumberPlugin
11 | + (void)registerWithRegistrar:(NSObject*)registrar {
12 | FlutterMethodChannel* channel = [FlutterMethodChannel methodChannelWithName:@"codeheadlabs.com/libphonenumber"
13 | binaryMessenger:[registrar messenger]];
14 |
15 | LibphonenumberPlugin* instance = [[LibphonenumberPlugin alloc] init];
16 | instance.phoneUtil = [[NBPhoneNumberUtil alloc] sharedInstance];
17 |
18 | [registrar addMethodCallDelegate:instance channel:channel];
19 | }
20 |
21 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
22 | NSError *err = nil;
23 |
24 | NSString *phoneNumber = call.arguments[@"phone_number"];
25 | NSString *isoCode = call.arguments[@"iso_code"];
26 | NSString *formatEnumString = call.arguments[@"format"];
27 | NBPhoneNumber *number = nil;
28 |
29 | // Call formatAsYouType before parse below because a partial number will not be parsable.
30 | if ([@"formatAsYouType" isEqualToString:call.method]) {
31 | NBAsYouTypeFormatter *f = [[NBAsYouTypeFormatter alloc] initWithRegionCode:isoCode];
32 | result([f inputString:phoneNumber]);
33 | return;
34 | }
35 |
36 | if (phoneNumber != nil) {
37 | number = [self.phoneUtil parse:phoneNumber defaultRegion:isoCode error:&err];
38 | if (err != nil) {
39 | result([FlutterError errorWithCode:@"invalid_phone_number" message:@"Invalid Phone Number" details:nil]);
40 | return;
41 | }
42 | }
43 |
44 | if ([@"isValidPhoneNumber" isEqualToString:call.method]) {
45 | NSNumber *validNumber = [NSNumber numberWithBool:[self.phoneUtil isValidNumber:number]];
46 | result(validNumber);
47 | } else if ([@"normalizePhoneNumber" isEqualToString:call.method]) {
48 | NSString *normalizedNumber = [self.phoneUtil format:number
49 | numberFormat:NBEPhoneNumberFormatE164
50 | error:&err];
51 | if (err != nil) {
52 | result([FlutterError errorWithCode:@"invalid_national_number"
53 | message:@"Invalid phone number for the country specified"
54 | details:nil]);
55 | return;
56 | }
57 |
58 | result(normalizedNumber);
59 | } else if ([@"getRegionInfo" isEqualToString:call.method]) {
60 | NSString *regionCode = [self.phoneUtil getRegionCodeForNumber:number];
61 | NSNumber *countryCode = [self.phoneUtil getCountryCodeForRegion:regionCode];
62 | NSString *formattedNumber = [self.phoneUtil format:number
63 | numberFormat:NBEPhoneNumberFormatNATIONAL
64 | error:&err];
65 | if (err != nil ) {
66 | result([FlutterError errorWithCode:@"invalid_national_number"
67 | message:@"Invalid phone number for the country specified"
68 | details:nil]);
69 | return;
70 | }
71 |
72 | result(@{
73 | @"isoCode": regionCode == nil ? @"" : regionCode,
74 | @"regionCode": countryCode == nil ? @"" : [countryCode stringValue],
75 | @"formattedPhoneNumber": formattedNumber == nil ? @"" : formattedNumber,
76 | });
77 | } else if([@"getExampleNumber" isEqualToString:call.method]) {
78 | NBPhoneNumber *exampleNumber = [self.phoneUtil getExampleNumber:isoCode error:&err];
79 | NSString *regionCode = [self.phoneUtil getRegionCodeForNumber:exampleNumber];
80 | NSString *formattedNumber = [self.phoneUtil format:exampleNumber
81 | numberFormat:NBEPhoneNumberFormatNATIONAL
82 | error:&err];
83 | if (err != nil ) {
84 | result([FlutterError errorWithCode:@"invalid_national_number"
85 | message:@"Invalid phone number for the country specified"
86 | details:nil]);
87 | return;
88 | }
89 |
90 | result(@{
91 | @"isoCode": regionCode == nil ? @"" : regionCode,
92 | @"formattedPhoneNumber": formattedNumber == nil ? @"" : formattedNumber,
93 | });
94 | } else if ([@"getNumberType" isEqualToString:call.method]) {
95 | NSNumber *numberType = [NSNumber numberWithInteger:[self.phoneUtil getNumberType:number]];
96 | result(numberType);
97 | } else if ([@"getNameForNumber" isEqualToString:call.method]) {
98 | NSString *name = @"";
99 | result(name);
100 | } else if ([@"format" isEqualToString:call.method]) {
101 | NSString *formattedNumber;
102 | if ([@"NATIONAL" isEqualToString:formatEnumString]) {
103 | formattedNumber = [self.phoneUtil format:number numberFormat:NBEPhoneNumberFormatNATIONAL error:&err];
104 | } else if([@"INTERNATIONAL" isEqualToString:formatEnumString]) {
105 | formattedNumber = [self.phoneUtil format:number numberFormat:NBEPhoneNumberFormatINTERNATIONAL error:&err];
106 | } else if([@"E164" isEqualToString:formatEnumString]) {
107 | formattedNumber = [self.phoneUtil format:number numberFormat:NBEPhoneNumberFormatE164 error:&err];
108 | } else if([@"RFC3966" isEqualToString:formatEnumString]) {
109 | formattedNumber = [self.phoneUtil format:number numberFormat:NBEPhoneNumberFormatRFC3966 error:&err];
110 | }
111 |
112 | if (err != nil ) {
113 | result([FlutterError errorWithCode:[NSString stringWithFormat:@"Error %ld", err.code]
114 | message:err.domain
115 | details:err.localizedDescription]);
116 | return;
117 | }
118 | result(formattedNumber);
119 | } else {
120 | result(FlutterMethodNotImplemented);
121 | }
122 | }
123 |
124 | @end
125 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'package:libphonenumber/libphonenumber.dart';
4 |
5 | void main() => runApp(new MyApp());
6 |
7 | class MyApp extends StatefulWidget {
8 | @override
9 | _MyAppState createState() => _MyAppState();
10 | }
11 |
12 | class _MyAppState extends State {
13 | final TextEditingController _textController = TextEditingController();
14 | bool _isValid = false;
15 | String _normalized = '';
16 | RegionInfo? _regionInfo;
17 | String _carrierName = '';
18 | String _exampleNumber = '';
19 | Map _numberMap = {};
20 |
21 | @override
22 | void dispose() {
23 | _textController.dispose();
24 | super.dispose();
25 | }
26 |
27 | _showDetails() async {
28 | var s = _textController.text;
29 |
30 | bool? isValid =
31 | await PhoneNumberUtil.isValidPhoneNumber(phoneNumber: s, isoCode: 'US');
32 | String? normalizedNumber = await PhoneNumberUtil.normalizePhoneNumber(
33 | phoneNumber: s, isoCode: 'US');
34 | RegionInfo regionInfo =
35 | await PhoneNumberUtil.getRegionInfo(phoneNumber: s, isoCode: 'US');
36 | String? carrierName =
37 | await PhoneNumberUtil.getNameForNumber(phoneNumber: s, isoCode: 'US');
38 | String exampleNumber = await PhoneNumberUtil.getExampleNumber('US');
39 |
40 | final Map numberMap =
41 | {};
42 | for (var format in PhoneNumberFormat.values) {
43 | final String formattedNumber = await PhoneNumberUtil.format(
44 | format: format,
45 | phoneNumber: s,
46 | isoCode: 'US',
47 | removeSpacesBetweenDigits: false,
48 | );
49 | numberMap[format] = formattedNumber;
50 | }
51 |
52 | setState(() {
53 | _isValid = isValid ?? false;
54 | _normalized = normalizedNumber ?? "N/A";
55 | _regionInfo = regionInfo;
56 | _numberMap = numberMap;
57 | _carrierName = carrierName ?? "N/A";
58 | _exampleNumber = exampleNumber;
59 | });
60 | }
61 |
62 | @override
63 | Widget build(BuildContext context) {
64 | var phoneText = Padding(
65 | padding: EdgeInsets.all(16.0),
66 | child: TextFormField(
67 | decoration: InputDecoration(
68 | hintText: "Phone Number",
69 | ),
70 | controller: _textController,
71 | keyboardType: TextInputType.phone,
72 | ),
73 | );
74 |
75 | var submitButton = MaterialButton(
76 | color: Colors.blueAccent,
77 | textColor: Colors.white,
78 | onPressed: _showDetails,
79 | child: Text('Show Details'),
80 | );
81 |
82 | var outputTexts = Column(
83 | children: [
84 | Row(
85 | mainAxisAlignment: MainAxisAlignment.center,
86 | children: [
87 | Text('Is Valid?'),
88 | Padding(
89 | padding: EdgeInsets.only(left: 12.0),
90 | child: Text(
91 | _isValid ? 'YES' : 'NO',
92 | style: TextStyle(fontWeight: FontWeight.bold),
93 | ),
94 | ),
95 | ],
96 | ),
97 | Row(
98 | mainAxisAlignment: MainAxisAlignment.center,
99 | children: [
100 | Text('Normalized:'),
101 | Padding(
102 | padding: EdgeInsets.only(left: 12.0),
103 | child: Text(
104 | _normalized,
105 | style: TextStyle(fontWeight: FontWeight.bold),
106 | ),
107 | ),
108 | ],
109 | ),
110 | Column(
111 | children: _numberMap.entries
112 | .map(
113 | (MapEntry entry) =>
114 | _NumberFormatEntry(
115 | format: entry.key,
116 | formattedNumber: entry.value,
117 | ),
118 | )
119 | .toList(),
120 | ),
121 | Row(
122 | mainAxisAlignment: MainAxisAlignment.center,
123 | children: [
124 | Text('Region Info:'),
125 | Padding(
126 | padding: EdgeInsets.only(left: 12.0),
127 | child: Text(
128 | 'Prefix=${_regionInfo?.regionPrefix}, ISO=${_regionInfo?.isoCode}, Formatted=${_regionInfo?.formattedPhoneNumber}',
129 | style: TextStyle(fontWeight: FontWeight.bold),
130 | ),
131 | ),
132 | ],
133 | ),
134 | Row(
135 | mainAxisAlignment: MainAxisAlignment.center,
136 | children: [
137 | Text('Carrier'),
138 | Padding(
139 | padding: EdgeInsets.only(left: 12.0),
140 | child: Text(
141 | 'Carrier Name=$_carrierName',
142 | style: TextStyle(fontWeight: FontWeight.bold),
143 | ),
144 | ),
145 | ],
146 | ),
147 | Row(
148 | mainAxisAlignment: MainAxisAlignment.center,
149 | children: [
150 | Text('Example'),
151 | Padding(
152 | padding: EdgeInsets.only(left: 12.0),
153 | child: Text(
154 | '$_exampleNumber',
155 | style: TextStyle(fontWeight: FontWeight.bold),
156 | ),
157 | ),
158 | ],
159 | ),
160 | ],
161 | );
162 |
163 | return MaterialApp(
164 | home: Scaffold(
165 | appBar: AppBar(
166 | title: Text('Plugin example app'),
167 | ),
168 | body: Container(
169 | child: Column(
170 | mainAxisAlignment: MainAxisAlignment.start,
171 | children: [
172 | phoneText,
173 | submitButton,
174 | Padding(padding: EdgeInsets.all(10.0)),
175 | Padding(
176 | padding: EdgeInsets.all(10.0),
177 | child: Text(
178 | 'Details for ${_textController.text}',
179 | style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
180 | ),
181 | ),
182 | outputTexts,
183 | ],
184 | ),
185 | ),
186 | ),
187 | );
188 | }
189 | }
190 |
191 | class _NumberFormatEntry extends StatelessWidget {
192 | const _NumberFormatEntry(
193 | {required this.format, required this.formattedNumber});
194 | final PhoneNumberFormat format;
195 | final String formattedNumber;
196 |
197 | @override
198 | Widget build(BuildContext context) {
199 | final String rawEnumString = format.toString();
200 | final String formatDisplayValue =
201 | rawEnumString.substring(rawEnumString.lastIndexOf('.') + 1);
202 |
203 | return Padding(
204 | padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 4.0),
205 | child: Row(
206 | mainAxisAlignment: MainAxisAlignment.center,
207 | children: [
208 | Text('$formatDisplayValue Format:'),
209 | Padding(
210 | padding: EdgeInsets.only(left: 12.0),
211 | child: Text(
212 | formattedNumber,
213 | style: TextStyle(fontWeight: FontWeight.bold),
214 | ),
215 | ),
216 | ],
217 | ),
218 | );
219 | }
220 | }
221 |
--------------------------------------------------------------------------------
/android/src/main/java/com/codeheadlabs/libphonenumber/LibphonenumberPlugin.java:
--------------------------------------------------------------------------------
1 | package com.codeheadlabs.libphonenumber;
2 |
3 | import androidx.annotation.NonNull;
4 |
5 | import io.flutter.embedding.engine.plugins.FlutterPlugin;
6 | import io.flutter.plugin.common.MethodCall;
7 | import io.flutter.plugin.common.MethodChannel;
8 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
9 | import io.flutter.plugin.common.MethodChannel.Result;
10 |
11 | import com.google.i18n.phonenumbers.AsYouTypeFormatter;
12 | import com.google.i18n.phonenumbers.NumberParseException;
13 | import com.google.i18n.phonenumbers.PhoneNumberToCarrierMapper;
14 | import com.google.i18n.phonenumbers.PhoneNumberUtil;
15 | import com.google.i18n.phonenumbers.Phonenumber;
16 |
17 | import java.util.HashMap;
18 | import java.util.Locale;
19 | import java.util.Map;
20 |
21 | /**
22 | * LibphonenumberPlugin
23 | *
24 | * A Flutter plugin for native phone number functionality on Android.
25 | * Implements the new Flutter Plugin API (v2) while maintaining backward compatibility.
26 | */
27 | public class LibphonenumberPlugin implements FlutterPlugin, MethodCallHandler {
28 | private static final String CHANNEL_NAME = "codeheadlabs.com/libphonenumber";
29 |
30 | // The MethodChannel used to communicate with the Flutter engine
31 | private MethodChannel channel;
32 |
33 | // PhoneNumberUtil instance used for phone number operations
34 | private static PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
35 |
36 | // Mapper to get carrier information for phone numbers
37 | private static PhoneNumberToCarrierMapper phoneNumberToCarrierMapper = PhoneNumberToCarrierMapper.getInstance();
38 |
39 | /**
40 | * Plugin registration method for apps using the v2 embedding
41 | */
42 | @Override
43 | public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {
44 | setupChannel(binding.getBinaryMessenger());
45 | }
46 |
47 | /**
48 | * Clean up resources when the plugin is detached from the engine
49 | */
50 | @Override
51 | public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {
52 | teardownChannel();
53 | }
54 |
55 | /**
56 | * Sets up the method channel and registers this instance as the handler
57 | */
58 | private void setupChannel(Object messenger) {
59 | channel = new MethodChannel((io.flutter.plugin.common.BinaryMessenger) messenger, CHANNEL_NAME);
60 | channel.setMethodCallHandler(this);
61 | }
62 |
63 | /**
64 | * Cleans up the method channel
65 | */
66 | private void teardownChannel() {
67 | channel.setMethodCallHandler(null);
68 | channel = null;
69 | }
70 |
71 | @Override
72 | public void onMethodCall(MethodCall call, Result result) {
73 | switch (call.method) {
74 | case "isValidPhoneNumber":
75 | handleIsValidPhoneNumber(call, result);
76 | break;
77 | case "normalizePhoneNumber":
78 | handleNormalizePhoneNumber(call, result);
79 | break;
80 | case "getRegionInfo":
81 | handleGetRegionInfo(call, result);
82 | break;
83 | case "getNumberType":
84 | handleGetNumberType(call, result);
85 | break;
86 | case "getExampleNumber":
87 | handleGetExampleNumber(call, result);
88 | break;
89 | case "formatAsYouType":
90 | formatAsYouType(call, result);
91 | break;
92 | case "getNameForNumber":
93 | handleGetNameForNumber(call, result);
94 | break;
95 | case "format":
96 | handleFormat(call, result);
97 | break;
98 | default:
99 | result.notImplemented();
100 | break;
101 | }
102 | }
103 |
104 | private void handleGetNameForNumber(MethodCall call, Result result) {
105 | final String phoneNumber = call.argument("phone_number");
106 | final String isoCode = call.argument("iso_code");
107 |
108 | try {
109 | Phonenumber.PhoneNumber p = phoneUtil.parse(phoneNumber, isoCode.toUpperCase());
110 | result.success(phoneNumberToCarrierMapper.getNameForNumber(p, Locale.getDefault()));
111 | } catch (NumberParseException e) {
112 | result.error("NumberParseException", e.getMessage(), null);
113 | }
114 | }
115 |
116 | private void handleFormat(MethodCall call, Result result) {
117 | final String phoneNumber = call.argument("phone_number");
118 | final String isoCode = call.argument("iso_code");
119 | final String format = call.argument("format");
120 |
121 | try {
122 | Phonenumber.PhoneNumber p = phoneUtil.parse(phoneNumber, isoCode.toUpperCase());
123 | PhoneNumberUtil.PhoneNumberFormat phoneNumberFormat = PhoneNumberUtil.PhoneNumberFormat.valueOf(format);
124 | result.success(phoneUtil.format(p, phoneNumberFormat));
125 | } catch (Exception e) {
126 | result.error("Exception", e.getMessage(), null);
127 | }
128 | }
129 |
130 | private void handleIsValidPhoneNumber(MethodCall call, Result result) {
131 | final String phoneNumber = call.argument("phone_number");
132 | final String isoCode = call.argument("iso_code");
133 |
134 | try {
135 | Phonenumber.PhoneNumber p = phoneUtil.parse(phoneNumber, isoCode.toUpperCase());
136 | result.success(phoneUtil.isValidNumber(p));
137 | } catch (NumberParseException e) {
138 | result.error("NumberParseException", e.getMessage(), null);
139 | }
140 | }
141 |
142 | private void handleNormalizePhoneNumber(MethodCall call, Result result) {
143 | final String phoneNumber = call.argument("phone_number");
144 | final String isoCode = call.argument("iso_code");
145 |
146 | try {
147 | Phonenumber.PhoneNumber p = phoneUtil.parse(phoneNumber, isoCode.toUpperCase());
148 | final String normalized = phoneUtil.format(p, PhoneNumberUtil.PhoneNumberFormat.E164);
149 | result.success(normalized);
150 | } catch (NumberParseException e) {
151 | result.error("NumberParseException", e.getMessage(), null);
152 | }
153 | }
154 |
155 | private void handleGetRegionInfo(MethodCall call, Result result) {
156 | final String phoneNumber = call.argument("phone_number");
157 | final String isoCode = call.argument("iso_code");
158 |
159 | try {
160 | Phonenumber.PhoneNumber p = phoneUtil.parse(phoneNumber, isoCode.toUpperCase());
161 | String regionCode = phoneUtil.getRegionCodeForNumber(p);
162 | String countryCode = String.valueOf(p.getCountryCode());
163 | String formattedNumber = phoneUtil.format(p, PhoneNumberUtil.PhoneNumberFormat.NATIONAL);
164 |
165 | Map resultMap = new HashMap();
166 | resultMap.put("isoCode", regionCode);
167 | resultMap.put("regionCode", countryCode);
168 | resultMap.put("formattedPhoneNumber", formattedNumber);
169 | result.success(resultMap);
170 | } catch (NumberParseException e) {
171 | result.error("NumberParseException", e.getMessage(), null);
172 | }
173 | }
174 |
175 | private void handleGetExampleNumber(MethodCall call, Result result) {
176 | final String isoCode = call.argument("iso_code");
177 | Phonenumber.PhoneNumber p = phoneUtil.getExampleNumber(isoCode);
178 | String regionCode = phoneUtil.getRegionCodeForNumber(p);
179 | String formattedNumber = phoneUtil.format(p, PhoneNumberUtil.PhoneNumberFormat.NATIONAL);
180 |
181 | Map resultMap = new HashMap();
182 | resultMap.put("isoCode", regionCode);
183 | resultMap.put("formattedPhoneNumber", formattedNumber);
184 | result.success(resultMap);
185 |
186 | }
187 |
188 | private void handleGetNumberType(MethodCall call, Result result) {
189 | final String phoneNumber = call.argument("phone_number");
190 | final String isoCode = call.argument("iso_code");
191 |
192 | try {
193 | Phonenumber.PhoneNumber p = phoneUtil.parse(phoneNumber, isoCode.toUpperCase());
194 | PhoneNumberUtil.PhoneNumberType t = phoneUtil.getNumberType(p);
195 |
196 | switch (t) {
197 | case FIXED_LINE:
198 | result.success(0);
199 | break;
200 | case MOBILE:
201 | result.success(1);
202 | break;
203 | case FIXED_LINE_OR_MOBILE:
204 | result.success(2);
205 | break;
206 | case TOLL_FREE:
207 | result.success(3);
208 | break;
209 | case PREMIUM_RATE:
210 | result.success(4);
211 | break;
212 | case SHARED_COST:
213 | result.success(5);
214 | break;
215 | case VOIP:
216 | result.success(6);
217 | break;
218 | case PERSONAL_NUMBER:
219 | result.success(7);
220 | break;
221 | case PAGER:
222 | result.success(8);
223 | break;
224 | case UAN:
225 | result.success(9);
226 | break;
227 | case VOICEMAIL:
228 | result.success(10);
229 | break;
230 | case UNKNOWN:
231 | result.success(-1);
232 | break;
233 | }
234 | } catch (NumberParseException e) {
235 | result.error("NumberParseException", e.getMessage(), null);
236 | }
237 | }
238 |
239 | private void formatAsYouType(MethodCall call, Result result) {
240 | final String phoneNumber = call.argument("phone_number");
241 | final String isoCode = call.argument("iso_code");
242 |
243 | AsYouTypeFormatter asYouTypeFormatter = phoneUtil.getAsYouTypeFormatter(isoCode.toUpperCase());
244 | String res = null;
245 | for (int i = 0; i < phoneNumber.length(); i++) {
246 | res = asYouTypeFormatter.inputDigit(phoneNumber.charAt(i));
247 | }
248 | result.success(res);
249 | }
250 | }
251 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; };
12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
18 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
19 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
20 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
21 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
22 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
23 | /* End PBXBuildFile section */
24 |
25 | /* Begin PBXCopyFilesBuildPhase section */
26 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
27 | isa = PBXCopyFilesBuildPhase;
28 | buildActionMask = 2147483647;
29 | dstPath = "";
30 | dstSubfolderSpec = 10;
31 | files = (
32 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
33 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
34 | );
35 | name = "Embed Frameworks";
36 | runOnlyForDeploymentPostprocessing = 0;
37 | };
38 | /* End PBXCopyFilesBuildPhase section */
39 |
40 | /* Begin PBXFileReference section */
41 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
42 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
43 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; };
44 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
45 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
46 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
47 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
48 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
49 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
50 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
51 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
52 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
54 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
55 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
56 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
57 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
58 | /* End PBXFileReference section */
59 |
60 | /* Begin PBXFrameworksBuildPhase section */
61 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
62 | isa = PBXFrameworksBuildPhase;
63 | buildActionMask = 2147483647;
64 | files = (
65 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
66 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
67 | );
68 | runOnlyForDeploymentPostprocessing = 0;
69 | };
70 | /* End PBXFrameworksBuildPhase section */
71 |
72 | /* Begin PBXGroup section */
73 | 9740EEB11CF90186004384FC /* Flutter */ = {
74 | isa = PBXGroup;
75 | children = (
76 | 2D5378251FAA1A9400D5DBA9 /* flutter_assets */,
77 | 3B80C3931E831B6300D905FE /* App.framework */,
78 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
79 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
80 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
81 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
82 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
83 | );
84 | name = Flutter;
85 | sourceTree = "";
86 | };
87 | 97C146E51CF9000F007C117D = {
88 | isa = PBXGroup;
89 | children = (
90 | 9740EEB11CF90186004384FC /* Flutter */,
91 | 97C146F01CF9000F007C117D /* Runner */,
92 | 97C146EF1CF9000F007C117D /* Products */,
93 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */,
94 | );
95 | sourceTree = "";
96 | };
97 | 97C146EF1CF9000F007C117D /* Products */ = {
98 | isa = PBXGroup;
99 | children = (
100 | 97C146EE1CF9000F007C117D /* Runner.app */,
101 | );
102 | name = Products;
103 | sourceTree = "";
104 | };
105 | 97C146F01CF9000F007C117D /* Runner */ = {
106 | isa = PBXGroup;
107 | children = (
108 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
109 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
110 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
111 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
112 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
113 | 97C147021CF9000F007C117D /* Info.plist */,
114 | 97C146F11CF9000F007C117D /* Supporting Files */,
115 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
116 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
117 | );
118 | path = Runner;
119 | sourceTree = "";
120 | };
121 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
122 | isa = PBXGroup;
123 | children = (
124 | 97C146F21CF9000F007C117D /* main.m */,
125 | );
126 | name = "Supporting Files";
127 | sourceTree = "";
128 | };
129 | /* End PBXGroup section */
130 |
131 | /* Begin PBXNativeTarget section */
132 | 97C146ED1CF9000F007C117D /* Runner */ = {
133 | isa = PBXNativeTarget;
134 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
135 | buildPhases = (
136 | 9740EEB61CF901F6004384FC /* Run Script */,
137 | 97C146EA1CF9000F007C117D /* Sources */,
138 | 97C146EB1CF9000F007C117D /* Frameworks */,
139 | 97C146EC1CF9000F007C117D /* Resources */,
140 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
141 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
142 | );
143 | buildRules = (
144 | );
145 | dependencies = (
146 | );
147 | name = Runner;
148 | productName = Runner;
149 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
150 | productType = "com.apple.product-type.application";
151 | };
152 | /* End PBXNativeTarget section */
153 |
154 | /* Begin PBXProject section */
155 | 97C146E61CF9000F007C117D /* Project object */ = {
156 | isa = PBXProject;
157 | attributes = {
158 | LastUpgradeCheck = 0910;
159 | ORGANIZATIONNAME = "The Chromium Authors";
160 | TargetAttributes = {
161 | 97C146ED1CF9000F007C117D = {
162 | CreatedOnToolsVersion = 7.3.1;
163 | };
164 | };
165 | };
166 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
167 | compatibilityVersion = "Xcode 3.2";
168 | developmentRegion = English;
169 | hasScannedForEncodings = 0;
170 | knownRegions = (
171 | en,
172 | Base,
173 | );
174 | mainGroup = 97C146E51CF9000F007C117D;
175 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
176 | projectDirPath = "";
177 | projectRoot = "";
178 | targets = (
179 | 97C146ED1CF9000F007C117D /* Runner */,
180 | );
181 | };
182 | /* End PBXProject section */
183 |
184 | /* Begin PBXResourcesBuildPhase section */
185 | 97C146EC1CF9000F007C117D /* Resources */ = {
186 | isa = PBXResourcesBuildPhase;
187 | buildActionMask = 2147483647;
188 | files = (
189 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
190 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
191 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
192 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
193 | 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */,
194 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | };
198 | /* End PBXResourcesBuildPhase section */
199 |
200 | /* Begin PBXShellScriptBuildPhase section */
201 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
202 | isa = PBXShellScriptBuildPhase;
203 | buildActionMask = 2147483647;
204 | files = (
205 | );
206 | inputPaths = (
207 | );
208 | name = "Thin Binary";
209 | outputPaths = (
210 | );
211 | runOnlyForDeploymentPostprocessing = 0;
212 | shellPath = /bin/sh;
213 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
214 | };
215 | 9740EEB61CF901F6004384FC /* Run Script */ = {
216 | isa = PBXShellScriptBuildPhase;
217 | buildActionMask = 2147483647;
218 | files = (
219 | );
220 | inputPaths = (
221 | );
222 | name = "Run Script";
223 | outputPaths = (
224 | );
225 | runOnlyForDeploymentPostprocessing = 0;
226 | shellPath = /bin/sh;
227 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
228 | };
229 | /* End PBXShellScriptBuildPhase section */
230 |
231 | /* Begin PBXSourcesBuildPhase section */
232 | 97C146EA1CF9000F007C117D /* Sources */ = {
233 | isa = PBXSourcesBuildPhase;
234 | buildActionMask = 2147483647;
235 | files = (
236 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
237 | 97C146F31CF9000F007C117D /* main.m in Sources */,
238 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
239 | );
240 | runOnlyForDeploymentPostprocessing = 0;
241 | };
242 | /* End PBXSourcesBuildPhase section */
243 |
244 | /* Begin PBXVariantGroup section */
245 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
246 | isa = PBXVariantGroup;
247 | children = (
248 | 97C146FB1CF9000F007C117D /* Base */,
249 | );
250 | name = Main.storyboard;
251 | sourceTree = "";
252 | };
253 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
254 | isa = PBXVariantGroup;
255 | children = (
256 | 97C147001CF9000F007C117D /* Base */,
257 | );
258 | name = LaunchScreen.storyboard;
259 | sourceTree = "";
260 | };
261 | /* End PBXVariantGroup section */
262 |
263 | /* Begin XCBuildConfiguration section */
264 | 97C147031CF9000F007C117D /* Debug */ = {
265 | isa = XCBuildConfiguration;
266 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
267 | buildSettings = {
268 | ALWAYS_SEARCH_USER_PATHS = NO;
269 | CLANG_ANALYZER_NONNULL = YES;
270 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
271 | CLANG_CXX_LIBRARY = "libc++";
272 | CLANG_ENABLE_MODULES = YES;
273 | CLANG_ENABLE_OBJC_ARC = YES;
274 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
275 | CLANG_WARN_BOOL_CONVERSION = YES;
276 | CLANG_WARN_COMMA = YES;
277 | CLANG_WARN_CONSTANT_CONVERSION = YES;
278 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
279 | CLANG_WARN_EMPTY_BODY = YES;
280 | CLANG_WARN_ENUM_CONVERSION = YES;
281 | CLANG_WARN_INFINITE_RECURSION = YES;
282 | CLANG_WARN_INT_CONVERSION = YES;
283 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
284 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
285 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
286 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
287 | CLANG_WARN_STRICT_PROTOTYPES = YES;
288 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
289 | CLANG_WARN_UNREACHABLE_CODE = YES;
290 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
291 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
292 | COPY_PHASE_STRIP = NO;
293 | DEBUG_INFORMATION_FORMAT = dwarf;
294 | ENABLE_STRICT_OBJC_MSGSEND = YES;
295 | ENABLE_TESTABILITY = YES;
296 | GCC_C_LANGUAGE_STANDARD = gnu99;
297 | GCC_DYNAMIC_NO_PIC = NO;
298 | GCC_NO_COMMON_BLOCKS = YES;
299 | GCC_OPTIMIZATION_LEVEL = 0;
300 | GCC_PREPROCESSOR_DEFINITIONS = (
301 | "DEBUG=1",
302 | "$(inherited)",
303 | );
304 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
305 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
306 | GCC_WARN_UNDECLARED_SELECTOR = YES;
307 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
308 | GCC_WARN_UNUSED_FUNCTION = YES;
309 | GCC_WARN_UNUSED_VARIABLE = YES;
310 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
311 | MTL_ENABLE_DEBUG_INFO = YES;
312 | ONLY_ACTIVE_ARCH = YES;
313 | SDKROOT = iphoneos;
314 | TARGETED_DEVICE_FAMILY = "1,2";
315 | };
316 | name = Debug;
317 | };
318 | 97C147041CF9000F007C117D /* Release */ = {
319 | isa = XCBuildConfiguration;
320 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
321 | buildSettings = {
322 | ALWAYS_SEARCH_USER_PATHS = NO;
323 | CLANG_ANALYZER_NONNULL = YES;
324 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
325 | CLANG_CXX_LIBRARY = "libc++";
326 | CLANG_ENABLE_MODULES = YES;
327 | CLANG_ENABLE_OBJC_ARC = YES;
328 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
329 | CLANG_WARN_BOOL_CONVERSION = YES;
330 | CLANG_WARN_COMMA = YES;
331 | CLANG_WARN_CONSTANT_CONVERSION = YES;
332 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
333 | CLANG_WARN_EMPTY_BODY = YES;
334 | CLANG_WARN_ENUM_CONVERSION = YES;
335 | CLANG_WARN_INFINITE_RECURSION = YES;
336 | CLANG_WARN_INT_CONVERSION = YES;
337 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
338 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
339 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
340 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
341 | CLANG_WARN_STRICT_PROTOTYPES = YES;
342 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
343 | CLANG_WARN_UNREACHABLE_CODE = YES;
344 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
345 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
346 | COPY_PHASE_STRIP = NO;
347 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
348 | ENABLE_NS_ASSERTIONS = NO;
349 | ENABLE_STRICT_OBJC_MSGSEND = YES;
350 | GCC_C_LANGUAGE_STANDARD = gnu99;
351 | GCC_NO_COMMON_BLOCKS = YES;
352 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
353 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
354 | GCC_WARN_UNDECLARED_SELECTOR = YES;
355 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
356 | GCC_WARN_UNUSED_FUNCTION = YES;
357 | GCC_WARN_UNUSED_VARIABLE = YES;
358 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
359 | MTL_ENABLE_DEBUG_INFO = NO;
360 | SDKROOT = iphoneos;
361 | TARGETED_DEVICE_FAMILY = "1,2";
362 | VALIDATE_PRODUCT = YES;
363 | };
364 | name = Release;
365 | };
366 | 97C147061CF9000F007C117D /* Debug */ = {
367 | isa = XCBuildConfiguration;
368 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
369 | buildSettings = {
370 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
371 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
372 | ENABLE_BITCODE = NO;
373 | FRAMEWORK_SEARCH_PATHS = (
374 | "$(inherited)",
375 | "$(PROJECT_DIR)/Flutter",
376 | );
377 | INFOPLIST_FILE = Runner/Info.plist;
378 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
379 | LIBRARY_SEARCH_PATHS = (
380 | "$(inherited)",
381 | "$(PROJECT_DIR)/Flutter",
382 | );
383 | PRODUCT_BUNDLE_IDENTIFIER = com.mathrawk.libphonenumberExample;
384 | PRODUCT_NAME = "$(TARGET_NAME)";
385 | VERSIONING_SYSTEM = "apple-generic";
386 | };
387 | name = Debug;
388 | };
389 | 97C147071CF9000F007C117D /* Release */ = {
390 | isa = XCBuildConfiguration;
391 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
392 | buildSettings = {
393 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
394 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
395 | ENABLE_BITCODE = NO;
396 | FRAMEWORK_SEARCH_PATHS = (
397 | "$(inherited)",
398 | "$(PROJECT_DIR)/Flutter",
399 | );
400 | INFOPLIST_FILE = Runner/Info.plist;
401 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
402 | LIBRARY_SEARCH_PATHS = (
403 | "$(inherited)",
404 | "$(PROJECT_DIR)/Flutter",
405 | );
406 | PRODUCT_BUNDLE_IDENTIFIER = com.mathrawk.libphonenumberExample;
407 | PRODUCT_NAME = "$(TARGET_NAME)";
408 | VERSIONING_SYSTEM = "apple-generic";
409 | };
410 | name = Release;
411 | };
412 | /* End XCBuildConfiguration section */
413 |
414 | /* Begin XCConfigurationList section */
415 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
416 | isa = XCConfigurationList;
417 | buildConfigurations = (
418 | 97C147031CF9000F007C117D /* Debug */,
419 | 97C147041CF9000F007C117D /* Release */,
420 | );
421 | defaultConfigurationIsVisible = 0;
422 | defaultConfigurationName = Release;
423 | };
424 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
425 | isa = XCConfigurationList;
426 | buildConfigurations = (
427 | 97C147061CF9000F007C117D /* Debug */,
428 | 97C147071CF9000F007C117D /* Release */,
429 | );
430 | defaultConfigurationIsVisible = 0;
431 | defaultConfigurationName = Release;
432 | };
433 | /* End XCConfigurationList section */
434 | };
435 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
436 | }
437 |
--------------------------------------------------------------------------------