auth_totp
2.0.0, released 5 months ago by rohitchouhan.com
A time-based one-time password (TOTP) and HOTP authentication package for Flutter apps.
What it does
Generates and verifies time-based (TOTP) and counter-based (HOTP) one-time passwords, creates secret keys, parses otpauth:// URIs, and aids with QR code generation.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to implement multi-factor authentication (MFA) using authenticator apps like Google Authenticator.
- You want to generate and verify TOTP or HOTP codes directly within your Flutter app.
Skip it when
- You are looking for external hosted authentication backends like Firebase Auth or Supabase.
- You need biometric-only sign-in rather than time-based code verification.
Strengths
- Supports SHA-1, SHA-256, and SHA-512 algorithms.
- Includes offline QR code matrix generation for privacy.
- Supports backup/recovery codes and URI parsing.
Weaknesses
- Relies on third-party URL APIs if you use the online QR code generation helper.
- Limited to one-time password logic rather than full identity management.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
No special native permissions or build runner required. Just import and use.
String secret = AuthTOTP.createSecret(length: 16);
bool isValid = AuthTOTP.verifyCode(secretKey: secret, totpCode: '123456');Alternatives
Packages that do the same job and could replace auth_totp.
- dart_dash_otp
Generate and verify TOTP and HOTP one-time passwords for 2FA and MFA.
59Compare - smart_auth
Flutter wrapper for Android SMS autofill, phone number hints, and Credential Manager.
86Compare - firebase_auth
Flutter plugin for Firebase Authentication enabling passwords, phone numbers, and identity providers.
99Compare - google_sign_in_ios
iOS and macOS implementation of Google Sign-In for Flutter
90Compare
Works with
Packages commonly used together with auth_totp: ones it builds on, ones built on it, and its own family.