phoneFormEntry method
Phone number form field
Implementation
Widget phoneFormEntry({
String title = 'Phone Number',
String subTitle = 'Enter phone number',
String? defaultValue,
bool verified = false,
bool showVerifyButton = true,
VoidCallback? onVerify,
Function(String?)? onSaved,
}) {
return formEntry(
title: title,
subTitle: subTitle,
inputWidget: Row(
children: [
Expanded(
child: PhoneField(
isRequired: false,
isEditable: isEdit,
defaultNumber: defaultValue,
onSaved: onSaved,
),
),
if (showVerifyButton &&
defaultValue != null &&
defaultValue.isNotEmpty) ...[
const SizedBox(width: 8),
if (verified)
const Icon(Icons.check_circle, color: Colors.green)
else
ElevatedButton(onPressed: onVerify, child: const Text('Verify')),
],
],
),
);
}