phone_input_text_field

A Flutter widget for input phone number.

Screenshoot

drawingdrawingdrawing

Getting Started

In your flutter project add the dependency:

dependencies:
  ...
  phone_input_text_field: ^0.0.1

For help getting started with Flutter, view the online documentation.

How to use

Import phone_input_text_field.dart

import 'package:phone_input_text_field/phone_input_text_field.dart';

All it needs is a callback function

/// 
/// Callback type define
/// Called when textcontroller get whole phone number
///
typedef void OnPhoneNumberComplete(String phoneNum);

Then the phone input textfield can be easily used as a widget.

PhoneInputTextField(onPhoneNumComplete: (String phoneNum) {
    //do what ever you want with phoneNum
});

Future Plans

  • Change default country support
  • Search countries
  • TextField style
  • Country picker style
  • Include or exclude countries And more...

Conception

This package is inspired by https://github.com/chronotruck/FlagPhoneNumber

Libraries

country_list_tile
phone_input_text_controller
phone_input_text_field
phone_input_text_field
phone_input_widget

Dart

VM

dart:ffi
Foreign Function Interface for interoperability with the C programming language. [...]

Web

dart:html
HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model). [...]
dart:js
Low-level support for interoperating with JavaScript. [...]
dart:js_util
Utility methods to efficiently manipulate typed JSInterop objects in cases where the name to call is not known at runtime. You should only use these methods when the same effect cannot be achieved with @JS annotations. These methods would be extension methods on JSObject if Dart supported extension methods.