Files
phone_login/lib/auth/phone_input_screen.dart

34 lines
1021 B
Dart
Raw Normal View History

import 'package:flutter/material.dart';
import 'package:intl_phone_field/intl_phone_field.dart';
class PhoneInputScreen extends StatelessWidget {
const PhoneInputScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Enter Phone Number')),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
IntlPhoneField(
decoration: const InputDecoration(
labelText: 'Phone Number',
border: OutlineInputBorder(borderSide: BorderSide()),
),
initialCountryCode: 'US',
onChanged: (phone) {
// TODO: Handle phone number changes
},
),
const SizedBox(height: 20),
ElevatedButton(onPressed: () {}, child: const Text('Send OTP')),
],
),
),
);
}
}