Giter Site home page Giter Site logo

yaw_phonenumber's Introduction

Yet another wrapper for libphonenumber

It is yet another wrapper to be used with Flutter projects to format and validate phone numbers. It only provides a scarse subset of available methods from original libraries it wraps around. Currently there are such methods:

formatIncomplete('+799988');                //  +7 999 88
formatAsInternational('+79998887766');      //  +7 999 888 77 66
isValidNumber('+79998887766');              //  true
isInternationallyDialable('+79998887766');  //  true

* please note that number is made up for example purpose only and doesn't ment to be a real number.

For now there are only Android and JS versions wrapped with this library.

How to use

This library is immature to be published on pub.dev and may be added to pubspec.yml from GitHib directly.

  yaw_phonenumber_platform_interface:
    git:
      url: https://github.com/illabo/yaw_phonenumber.git
      path: yaw_phonenumber_platform_interface
  yaw_phonenumber_web:
    git:
      url: https://github.com/illabo/yaw_phonenumber.git
      path: yaw_phonenumber_web

To be able to use it on web please add something like this to your project's index.html:

<script src="https://unpkg.com/[email protected]/bundle/libphonenumber-min.js" />

The actual script to use you can choose according to original script author's documentation as may be found here: https://gitlab.com/catamphetamine/libphonenumber-js

Underlying libraries

The libraries used aren't the Google's libphonenumber but rather Google acknowliged ports known for some improvements for an end user of a library. E.g. libphonenumber-js utilized here is in its minimal version is just ~80 kb (Google's full metadata is almost 10x bigger), doesn't require recompiling and is served from cdn. And libphonenumber-android is simply works faster then Google's implementation on Android devices and also is nicely repacked for easy importing.

Further developement

This library is planned to only be extended accrding to my very own needs. Currently it meets my minimal requirements. However I don't mind if any PRs would be made and would happily accept it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.