Last updated:
0 purchases
phonenumber input
PhoneNumberInput Flutter Widget 📱 #
Welcome to the initial release of PhoneNumberInput, a Flutter widget that allows users to input phone numbers with country code selection. Stay tuned for more exciting features in future releases!🚀
Example 🌈 #
PhoneNumberInput(
labelText: 'Phone Number',
isDarkMode: false,
onCountryCodeChanged: (code) {
print('Country code changed: $code');
},
onPhoneNumberChanged: (phoneNumber) {
print('Phone number changed: $phoneNumber');
},
)
copied to clipboard
PhoneNumberInput(
labelText: 'Phone Number',
isDarkMode: true,
onCountryCodeChanged: (code) {
print('Country code changed: $code');
},
onPhoneNumberChanged: (phoneNumber) {
print('Phone number changed: $phoneNumber');
},
)
copied to clipboard
Features 🌟 #
Phone number input with country code selection
Customizable label, styles, and dark mode support
Callbacks for country code and phone number changes.
Installation 🛠️ #
To use this widget in your Flutter project, add the following to your pubspec.yaml file:
dependencies:
phonenumber_input: ^1.0.0
copied to clipboard
Then, run:
flutter pub get
copied to clipboard
Usage 🚨 #
import 'package:flutter/material.dart';
import 'package:phonenumber_input/phonenumber_input.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('PhoneNumberInput Demo'),
),
body: Center(
child: PhoneNumberInput(
labelText: 'Phone Number',
isDarkMode: false,
onCountryCodeChanged: (code) {
print('Country code changed: $code');
},
onPhoneNumberChanged: (phoneNumber) {
print('Phone number changed: $phoneNumber');
},
),
),
),
);
}
}
copied to clipboard
Widget Properties 🎨 #
labelText (String): The label text for the phone number input.
padding (EdgeInsetsGeometry): Padding for the widget.
labelStyle (TextStyle): Style for the label text.
countryCodeStyle (TextStyle): Style for the country code text.
isDarkMode (bool): Set to true for dark mode, false for light mode.
onCountryCodeChanged (Function(String)?): Callback for country code changes.
onPhoneNumberChanged (Function(String)?): Callback for phone number changes.
Thank you for using PhoneNumberInput! Feel free to contribute, report issues, or suggest new features. Enjoy coding with Flutter! 🎉
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.