otpify 0.1.2 copy "otpify: ^0.1.2" to clipboard
otpify: ^0.1.2 copied to clipboard

Otpify is a customizable OTP input field widget for Flutter, adapts to different mobile screen sizes. It includes a resend code timer button for added convenience.

example/lib/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:otpify/otpify.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Home(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Otpify(
        fields: 5,
        resendSecond: 10,
        borderRadiusValue: 24,
        fieldColor: Colors.transparent,
        fieldTextColor: Colors.black,
        borderColor: Colors.blueGrey,
        focusedBorderColor: Colors.purple,
        resendAlignment: ResendAlignment.start,
        resendText: "Resend code",
        onChanged: (value) {
          if (kDebugMode) {
            print("onChanged value : $value");
          }
        },
        onResend: () {
          if (kDebugMode) {
            print("Resend button pressed");
          }
        },
        onCompleted: (value) {
          if (kDebugMode) {
            print("onCompleted value is $value");
          }
        },
      ),
    );
  }
}
5
likes
0
points
45
downloads

Publisher

unverified uploader

Weekly Downloads

Otpify is a customizable OTP input field widget for Flutter, adapts to different mobile screen sizes. It includes a resend code timer button for added convenience.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on otpify