Skip to content

Commit

Permalink
Merge pull request #321 from Scheph-96/scheph96-updates
Browse files Browse the repository at this point in the history
TextFormField key added
  • Loading branch information
marcaureln authored Oct 15, 2023
2 parents 366e539 + 9358de2 commit 118341a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/intl_phone_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import './countries.dart';
import './phone_number.dart';

class IntlPhoneField extends StatefulWidget {
/// The TextFormField key.
final GlobalKey<FormFieldState>? formFieldKey;

/// Whether to hide the text being edited (e.g., for passwords).
final bool obscureText;

Expand Down Expand Up @@ -245,6 +248,7 @@ class IntlPhoneField extends StatefulWidget {

const IntlPhoneField({
Key? key,
this.formFieldKey,
this.initialCountryCode,
this.languageCode = 'en',
this.disableAutoFillHints = false,
Expand Down Expand Up @@ -374,6 +378,7 @@ class _IntlPhoneFieldState extends State<IntlPhoneField> {
@override
Widget build(BuildContext context) {
return TextFormField(
key: widget.formFieldKey,
initialValue: (widget.controller == null) ? number : null,
autofillHints: widget.disableAutoFillHints ? null : [AutofillHints.telephoneNumberNational],
readOnly: widget.readOnly,
Expand Down

0 comments on commit 118341a

Please sign in to comment.