https://github.com/abdalftahsalem/phone_util
H helps you to build a phone input field with easy steps, you can change the country and separate the country box style as you want and the phone input field as you want. you can add empty space between the country and phone field.
https://github.com/abdalftahsalem/phone_util
dart flutter package
Last synced: 4 months ago
JSON representation
H helps you to build a phone input field with easy steps, you can change the country and separate the country box style as you want and the phone input field as you want. you can add empty space between the country and phone field.
- Host: GitHub
- URL: https://github.com/abdalftahsalem/phone_util
- Owner: AbdAlftahSalem
- License: mit
- Created: 2023-06-17T14:20:20.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-20T12:01:36.000Z (almost 2 years ago)
- Last Synced: 2025-01-12T23:27:55.863Z (5 months ago)
- Topics: dart, flutter, package
- Language: Dart
- Homepage: https://pub.dev/packages/phone_util
- Size: 629 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# phone_util
This package helps you to build a phone input field with easy steps, you can change the country and separate the country box style as you want and the phone input field as you want. you can add empty space between the country and phone field.
## installation
you can manually add phone_util into the dependencies section in your pubspec.yaml:
```bash
dependencies:
phone_util: ^replace-with-latest-version
```Or you can use the command to add phone_util as a dependency with the latest stable version:
```bash
dart pub phone_util
```## Country box type
- Dialog
```bash
countryBoxType : PhoneInputSelectorType.DIALOG,
```- Bottom sheet
```bash
countryBoxType : PhoneInputSelectorType.BOTTOM_SHEET,
```## Required Parameters
| Parameter | Type | Description |
|:------------------|:--------------------------------|:--------------------------------|
| onInputChanged | `Function( PhoneNumber value )` | To get every number input |
| countryDecoration | `CountryBox` | To add style to the country box |## Example
```dart
import 'package:phone_util/view/phone_util.dart';PhoneUtil(
onInputChanged: (PhoneNumber value) {},
countryBoxType: PhoneInputSelectorType.BOTTOM_SHEET,
separatedWidth: 12,
inputDecoration: InputDecoration(
fillColor: Colors.white10,
filled: true,
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: const BorderSide(
color: Colors.white,
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: const BorderSide(
color: Colors.white,
),
),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
borderSide: const BorderSide(
color: Colors.red,
),
),
contentPadding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 18,
),
),
countryDecoration: CountryBox(),
)
```## Authors
- Github : [@AbdAlftahSalem](https://github.com/AbdAlftahSalem)
- LinkedIn : [Abd Alftah Salem](https://www.linkedin.com/in/abd-alftah-salem-a3ba0b1bb/)