Skip to content

Commit 7d81786

Browse files
authored
fix(ui_auth): fix PhoneInputScreen layout (#10227)
1 parent 6380a27 commit 7d81786

File tree

2 files changed

+46
-41
lines changed

2 files changed

+46
-41
lines changed

Diff for: packages/firebase_ui_auth/lib/src/screens/phone_input_screen.dart

+2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class PhoneInputScreen extends StatelessWidget {
119119
child: Padding(
120120
padding: const EdgeInsets.all(20),
121121
child: Column(
122+
crossAxisAlignment: CrossAxisAlignment.stretch,
122123
children: [
123124
PhoneInputView(
124125
auth: auth,
@@ -129,6 +130,7 @@ class PhoneInputScreen extends StatelessWidget {
129130
multiFactorSession: multiFactorSession,
130131
mfaHint: mfaHint,
131132
),
133+
const SizedBox(height: 8),
132134
UniversalButton(
133135
text: l.goBackButtonLabel,
134136
variant: ButtonVariant.text,

Diff for: packages/firebase_ui_auth/lib/src/widgets/phone_input.dart

+44-41
Original file line numberDiff line numberDiff line change
@@ -287,49 +287,52 @@ class PhoneInputState extends State<PhoneInput> {
287287
const SizedBox(height: 16),
288288
Directionality(
289289
textDirection: TextDirection.ltr,
290-
child: Row(
291-
children: [
292-
SizedBox(
293-
width: 90,
294-
child: UniversalTextFormField(
295-
autofillHints: const [
296-
AutofillHints.telephoneNumberCountryCode
297-
],
298-
controller: countryController,
299-
prefix: const Text('+'),
300-
placeholder: l.countryCode,
301-
inputFormatters: [
302-
FilteringTextInputFormatter.digitsOnly,
303-
],
304-
keyboardType: TextInputType.phone,
305-
validator: NotEmpty('').validate,
306-
onSubmitted: (_) {
307-
numberFocusNode.requestFocus();
308-
},
290+
child: IntrinsicHeight(
291+
child: Row(
292+
crossAxisAlignment: CrossAxisAlignment.start,
293+
children: [
294+
SizedBox(
295+
width: 90,
296+
child: UniversalTextFormField(
297+
autofillHints: const [
298+
AutofillHints.telephoneNumberCountryCode
299+
],
300+
controller: countryController,
301+
prefix: const Text('+'),
302+
placeholder: l.countryCode,
303+
inputFormatters: [
304+
FilteringTextInputFormatter.digitsOnly,
305+
],
306+
keyboardType: TextInputType.phone,
307+
validator: NotEmpty('').validate,
308+
onSubmitted: (_) {
309+
numberFocusNode.requestFocus();
310+
},
311+
),
309312
),
310-
),
311-
const SizedBox(width: 8),
312-
Expanded(
313-
child: UniversalTextFormField(
314-
autofillHints: const [
315-
AutofillHints.telephoneNumberNational
316-
],
317-
autofocus: true,
318-
focusNode: numberFocusNode,
319-
controller: numberController,
320-
placeholder: l.phoneInputLabel,
321-
validator: Validator.validateAll([
322-
NotEmpty(l.phoneNumberIsRequiredErrorText),
323-
PhoneValidator(l.phoneNumberInvalidErrorText),
324-
]),
325-
onSubmitted: _onSubmitted,
326-
inputFormatters: [
327-
FilteringTextInputFormatter.digitsOnly,
328-
],
329-
keyboardType: TextInputType.phone,
313+
const SizedBox(width: 8),
314+
Expanded(
315+
child: UniversalTextFormField(
316+
autofillHints: const [
317+
AutofillHints.telephoneNumberNational
318+
],
319+
autofocus: true,
320+
focusNode: numberFocusNode,
321+
controller: numberController,
322+
placeholder: l.phoneInputLabel,
323+
validator: Validator.validateAll([
324+
NotEmpty(l.phoneNumberIsRequiredErrorText),
325+
PhoneValidator(l.phoneNumberInvalidErrorText),
326+
]),
327+
onSubmitted: _onSubmitted,
328+
inputFormatters: [
329+
FilteringTextInputFormatter.digitsOnly,
330+
],
331+
keyboardType: TextInputType.phone,
332+
),
330333
),
331-
),
332-
],
334+
],
335+
),
333336
),
334337
),
335338
],

0 commit comments

Comments
 (0)