auth_management 0.3.1 copy "auth_management: ^0.3.1" to clipboard
auth_management: ^0.3.1 copied to clipboard

Collection of auth service with advanced controlling system.

example/lib/main.dart

import 'package:auth_management/core.dart';
import 'package:example/home_page.dart';
import 'package:example/login_page.dart';
import 'package:example/oauth_delegates.dart';
import 'package:example/startup.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';

import 'backup_delegate.dart';
import 'user_model.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return AuthProvider<UserModel>(
      initialCheck: true,
      controller: AuthController.getInstance<UserModel>(
        backup: UserBackupDelegate(),
        oauth: oauthDelegates,
      ),
      child: const MaterialApp(
        title: 'Auth Management',
        onGenerateRoute: routes,
      ),
    );
  }
}

Route<T> routes<T>(RouteSettings settings) {
  final name = settings.name;
  if (name == "home") {
    return MaterialPageRoute(
      builder: (_) {
        return const HomePage();
      },
    );
  } else if (name == "login") {
    return MaterialPageRoute(
      builder: (_) {
        return const LoginPage();
      },
    );
  } else {
    return MaterialPageRoute(
      builder: (_) {
        return const StartupPage();
      },
    );
  }
}
4
likes
100
pub points
42%
popularity

Publisher

unverified uploader

Collection of auth service with advanced controlling system.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

auth_management_delegates, connectivity_plus, firebase_auth, flutter, flutter_entity, shared_preferences

More

Packages that depend on auth_management