flutter
nexauth_flutter
The integration that should have existed elsewhere — first-class, documented, customizable.
pubspec.yaml
dependencies:
nexauth_flutter: ^0.1.0Drop-in screen
login.dart
final auth = NexAuth(publishableKey: 'pk_live_...');
Navigator.push(context, MaterialPageRoute(
builder: (_) => NexOtpScreen(
auth: auth,
channel: NexChannel.whatsapp,
branding: NexBranding(
appName: 'Acme Health',
logo: AssetImage('assets/logo.png'),
primaryColor: Color(0xFF7C6CFF),
securedBy: true, // free tier — remove on Scale
),
onSuccess: (s) => context.go('/home'),
),
));NexOtpInput — animated boxes
custom ui
NexOtpInput(
length: 6,
autoRetrieveSms: true, // Android SMS Retriever
autoReadOtp: true, // listens for the message
boxDecoration: NexOtpStyle.filled,
cursorColor: Color(0xFF7C6CFF),
activeBorderColor: Color(0xFF7C6CFF),
animation: NexOtpAnimation.scale, // scale | shake | none
onCompleted: (code) => auth.otp.verify(...),
)
// iOS: UITextContentType.oneTimeCode set automaticallyPhone number hint — one tap, no typing
hint
// Wraps Google Credential Manager Phone Number Hint —
// shows a bottom sheet of the device's numbers:
final phone = await auth.hintPhoneNumber(); // "+9199XXXXXXXX"
if (phone != null) await auth.otp.send(channel: NexChannel.whatsapp, to: phone);Customization contract
NexBranding.appName | header text |
.logo | AssetImage/NetworkImage |
.primaryColor | buttons + active otp border |
.theme | dark | light |
.securedBy | 'Secured by NexAuth' footer (free = forced) |
NexOtpStyle | box: outlined | filled | underline |
NexOtpAnimation | scale | shake | none |