phone_otp_verification 1.0.0
phone_otp_verification: ^1.0.0 copied to clipboard
This Flutter package is a comprehensive solution designed for applications requiring country selection with phone codes and OTP (One-Time Password) verification. It offers a seamless and efficient use [...]
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:phone_otp_verification/phone_verification.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return PhoneVerification(
isFirstPage: true,
enableLogo: false,
themeColor: Colors.green,
onSend: (String value) {
print('Phone number: $value');
},
onVerification: (String value) {
print('OTP: $value');
},
);
}
}