otpify 0.1.7 copy "otpify: ^0.1.7" to clipboard
otpify: ^0.1.7 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/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,
      darkTheme: ThemeData.dark(
        useMaterial3: true,
      ),
      theme: ThemeData.light(
        useMaterial3: true,
      ),
      home: Home(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Otpify Demo'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16),
        child: Otpify(
          fields: 5,
          resendSecond: 15,
          fieldColor: Colors.amber,
          borderRadiusValue: 16,
          resendAlignment: ResendAlignment.start,
          resendText: 'Resend code',
          resendDisableColor: Colors.grey[600],
          onChanged: (value) {
            /// Perform action on field change.
          },
          onCompleted: (code) {
            /// Assign [code] to your TextController to get the full code.
          },
          onResend: () {
            /// Initiate OnResendEvent()
          },
        ),
      ),
    );
  }
}
5
likes
160
points
79
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)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on otpify