dot_auth 1.2.0 copy "dot_auth: ^1.2.0" to clipboard
dot_auth: ^1.2.0 copied to clipboard

A powerful Flutter authentication package with phone OTP and email/password verification using Firebase. Plug-and-play, Riverpod-powered, go_router-ready.

example/lib/main.dart

import 'package:dot_auth/dot_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'router.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();

  // Bundle the font rather than fetching it on first launch — a lot of this
  // app gets opened on a weak connection.
  DotAuthTypography.fontFamily = 'Urbanist';

  runApp(
    ProviderScope(
      overrides: [
        dotAuthConfigProvider.overrideWithValue(
          const DotAuthConfig(
            // dot_auth navigates to these paths. Nothing is hardcoded.
            routes: DotAuthRoutes(
              home: '/dashboard',
              terms: '/legal/terms',
              privacy: '/legal/privacy',
            ),
            resendCooldown: Duration(seconds: 45),
            sendVerificationEmailOnSignUp: true,
          ),
        ),
      ],
      child: const ExampleApp(),
    ),
  );
}

class ExampleApp extends ConsumerWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    return ScreenUtilInit(
      designSize: const Size(375, 812),
      minTextAdapt: true,
      builder: (context, _) {
        return MaterialApp.router(
          title: 'dot_auth example',
          debugShowCheckedModeBanner: false,
          theme: authTheme(),
          routerConfig: ref.watch(routerProvider),
        );
      },
    );
  }
}
1
likes
160
points
181
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A powerful Flutter authentication package with phone OTP and email/password verification using Firebase. Plug-and-play, Riverpod-powered, go_router-ready.

Repository (GitHub)

License

MIT (license)

Dependencies

animations, firebase_auth, firebase_core, flutter, flutter_form_builder, flutter_riverpod, flutter_screenutil, form_builder_validators, go_router, google_fonts, mocktail, phone_form_field, pinput

More

Packages that depend on dot_auth