Flutter OTP Screen UI Example – OTP TextField Code

Basics, Flutter Login App, Flutter UI / UX, UI UX

In this flutter UI tutorial, we will learn how to design a beautiful modern and minimal Flutter OTP Screen UI. To design this OTP screen we will use Flutter OTP TextField.

There are two mainly used Flutter OTP Packages and dependencies on pub.dev.

  1. flutter_otp_text_field
  2. otp_text_field

Among all these, we will use flutter otp text field package (first one).

We will also learn how to get single box value from OTP and also whole OTP entered by the user.

In our previous tutorials, we already learned how to design Flutter Login, Signup, Forget Password and Welcome Screen UI. So, In this tutorial, I will explain the OTP Screen UI for Signup, Forget Password including Email and Phone No.

You can watch recent playlist tutorials and all the related tutorials to this Tutorial.

Watch Youtube tutorial

 

class OTPScreen extends StatelessWidget {
const OTPScreen({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
padding: const EdgeInsets.all(tDefaultSize),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
tOtpTitle,
style: GoogleFonts.montserrat(fontWeight: FontWeight.bold, fontSize: 80.0),
),
Text(tOtpSubTitle.toUpperCase(), style: Theme.of(context).textTheme.headline6),
const SizedBox(height: 40.0),
const Text("$tOtpMessage support@codingwitht.com", textAlign: TextAlign.center),
const SizedBox(height: 20.0),
OtpTextField(
mainAxisAlignment: MainAxisAlignment.center,
numberOfFields: 6,
fillColor: Colors.black.withOpacity(0.1),
filled: true,
onSubmit: (code) => print("OTP is => $code")),
const SizedBox(height: 20.0),
SizedBox(
width: double.infinity,
child: ElevatedButton(onPressed: () {}, child: const Text(tNext)),
),
],
),
),
);
}
}

Let's Connect

Videos are always a better source for in-depth knowledge. So, connect with me at YouTube.

Download Project

Flutter Login App UI Source Code- How to Create a complete Flutter app - Flutter education app - Flutter app UI Design - Flutter Course - Flutter Complete App 2022
Dashboard Source COde - Dashboard design in flutter - flutter dashoard - flutter app design 2022 - Flutter UI - Flutter homepage

Latest Courses

Flutter Login App UI Source Code- How to Create a complete Flutter app - Flutter education app - Flutter app UI Design - Flutter Course - Flutter Complete App 2022
Learn flutter from scratch in 4 hours - Flutter Crash Course - Coding with T

Latest Tutorials

Flutter Profile page UI Design - Flutter app design 2023 - Profile Screen Flutter UI - Flutter 2023
Flutter Firebase phone authentication - Firebase Phone auth tutorial in flutter - Flutter Firebase phone number authentication 2022
Firebase Authentication in flutter - Flutter firebase authentication 2022 - firebase auth tutorial 2022 - firebase flutter auth
How to setup firebase in flutter 2022 - Flutter firebase setup
Dashboard Source COde - Dashboard design in flutter - flutter dashoard - flutter app design 2022 - Flutter UI - Flutter homepage

Join Our Mailing List

Join our mailing list to receive the latest, Free Courses, Video Tutorials, free codes and updates regarding Tutorials and services. You will also start getting coupons on the related services.

You have Successfully Subscribed!

FLUTTER APP

Learn Flutter App development from scratch. Create LOGIN APP that can be used with any application which requires Login Sign Up functionality.

You can watch it on YouTube or read and get source code from Blog Post.

You have Successfully Subscribed!