smart_otp_field_plus 1.0.0 copy "smart_otp_field_plus: ^1.0.0" to clipboard
smart_otp_field_plus: ^1.0.0 copied to clipboard

A smart and customizable Flutter OTP input field with autofill, paste support, resend timer, obscure text, backspace handling, and flexible theming.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:smart_otp_field_plus/smart_otp_field_plus.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: const Text("Smart OTP Field"),
          centerTitle: true,
        ),
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              SmartOtpFieldPlus(
                length: 6,
                obscureText: false,
                theme: OtpTheme(
                  boxWidth: 55,
                  boxHeight: 55,
                  spacing: 12,

                  borderRadius: BorderRadius.circular(16),

                  borderColor: Colors.grey,
                  focusedBorderColor: Colors.green,

                  borderWidth: 1,
                  focusedBorderWidth: 2,

                  fillColor: Colors.grey.shade100,
                  focusedFillColor: Colors.green.shade50,

                  cursorColor: Colors.green,

                  textStyle: const TextStyle(
                    fontSize: 22,

                    fontWeight: FontWeight.bold,
                    color: Colors.black,
                  ),
                ),
              ),

              const SizedBox(height: 20),

              ResendTimer(
                seconds: 30,
                onResend: () {

                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}
3
likes
150
points
12
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A smart and customizable Flutter OTP input field with autofill, paste support, resend timer, obscure text, backspace handling, and flexible theming.

Repository (GitHub)
View/report issues

Topics

#otp #pin #input #flutter

License

MIT (license)

Dependencies

flutter, sms_autofill

More

Packages that depend on smart_otp_field_plus