Open simranjeet09 opened 1 year ago
I do not know if this is related but when running PhoneNumber().validate(number) I receive the following exception:
I/SurfaceView(14659): surfaceview vote min fps
E/flutter (14659): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(InvalidNumber, Number 971502126543 is invalid, null, null)
E/flutter (14659): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652:7)
E/flutter (14659): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18)
E/flutter (14659): <asynchronous suspension>
E/flutter (14659): #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:510:43)
E/flutter (14659): <asynchronous suspension>
E/flutter (14659): #3 PhoneNumberUtil.validate (package:phone_number/src/phone_number_util.dart:110:20)
E/flutter (14659): <asynchronous suspension>
Is there an existing issue for this?
Package/Plugin version
2.0.1
Platforms
Flutter doctor
Flutter doctor
``` [✓] Flutter (Channel stable, 3.13.4, on macOS 13.5.1 22G90 darwin-arm64, locale en-CA) • Flutter version 3.13.4 on channel stable at /Users/simranjeet/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 367f9ea16b (3 weeks ago), 2023-09-12 23:27:53 -0500 • Engine revision 9064459a8b • Dart version 3.1.2 • DevTools version 2.25.0 [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) • Android SDK at /Users/simranjeet/Library/Android/sdk • Platform android-34, build-tools 33.0.1 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14E300c • CocoaPods version 1.12.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301) [✓] VS Code (version 1.78.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [✓] Connected device (4 available) • SM A226B (mobile) • R9ZT204EAXD • android-arm64 • Android 13 (API 33) • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 13 (API 33) (emulator) • macOS (desktop) • macos • darwin-arm64 • macOS 13.5.1 22G90 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 117.0.5938.149 ! Error: To use Simar for development, enable Developer Mode in Settings → Privacy & Security. (code 6) [✓] Network resources • All expected network resources are available. • No issues found! ```Minimal code example
Code sample
``` bool validNumber = await PhoneNumberUtil().validate(emailController.text); ```Current Behavior
In ios this code works perfectly fine. it returns true/false based on the input and further i am able to get region code using
PhoneNumberUtil().parse(emailController.text);
. This same functionality does not works in Android.Expected Behavior
Functionality should be same as the ios one. User should be able to validate if the number is valid without region code.
Steps To Reproduce
Test the below code snippet in an Android device
Aditional information
Example code snippet