flutter-libphonenumber icon indicating copy to clipboard operation
flutter-libphonenumber copied to clipboard

isValidPhoneNumber returns false in case of MissingPluginException

Open ClemaX opened this issue 5 years ago • 1 comments
trafficstars

MissingPluginException: if the method has not been implemented by a platform plugin.

The try-catch block around the invokeMethod hides the MissingPluginException error to developers by returning false, maybe it would be better to catch only the PlatformException to notify developers instead of just returning false.

Example:

try {
     return await method();
} on PlatformException catch (_) {
     return false;
}

ClemaX avatar Oct 01 '20 10:10 ClemaX

I see there is no implementation for the web. Originally the library it's based on is a javascript library and dart compiles to js. Is there platform specific code ?

cedvdb avatar Mar 08 '21 14:03 cedvdb