phone_otp_verification 1.0.3
phone_otp_verification: ^1.0.3 copied to clipboard
This Flutter package is a one-stop solution for apps requiring seamless phone verification and efficient OTP (One-Time Password) verification.
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.blueAccent,
backgroundColor: Colors.black,
initialPageText: "Verify Phone Number",
initialPageTextStyle: const TextStyle(
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.bold,
),
textColor: Colors.white,
onSend: (String value) {
print('Phone number: $value');
},
onVerification: (String value) {
print('OTP: $value');
},
);
}
}