apptive_grid_user_management 0.0.5-alpha.2 copy "apptive_grid_user_management: ^0.0.5-alpha.2" to clipboard
apptive_grid_user_management: ^0.0.5-alpha.2 copied to clipboard

outdated

Package to add UserManagement through ApptiveGrid to a Flutter App. This provides Login/Register Widgets and options to confirm accoutns

example/lib/main.dart

// ignore_for_file: public_member_api_docs

import 'package:apptive_grid_user_management/apptive_grid_user_management.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  MyApp({Key? key}) : super(key: key);

  final _navigatorKey = GlobalKey<NavigatorState>();

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return ApptiveGrid(
      options: const ApptiveGridOptions(
        environment: ApptiveGridEnvironment.alpha,
      ),
      child: Builder(
        builder: (context) {
          return ApptiveGridUserManagement(
            group: 'YOUR_USER_GROUP',
            clientId: 'app',
            redirectScheme: 'resetTest',
            confirmAccountPrompt: (confirmWidget) {
              // Show [confirmWidget] to allow Users to confirm their account
            },
            onAccountConfirmed: (loggedIn) {
              // Account was confirmed
              // go to login screen if [loggedIn] is false
            },
            resetPasswordPrompt: (resetPasswordWidget) {
              // Show [resetPasswordWidget] to allow Users to set a new password
              _navigatorKey.currentState?.push(
                MaterialPageRoute(
                  builder: (_) => Scaffold(
                    appBar: AppBar(
                      title: const Text('Reset Password'),
                    ),
                    body: SingleChildScrollView(
                      child: resetPasswordWidget,
                    ),
                  ),
                ),
              );
            },
            onPasswordReset: (loggedIn) async {
              // User reset their password
              // go to login screen
              debugPrint('Password reset success');
              debugPrint('User is now loggedIn: $loggedIn');
              _navigatorKey.currentState?.pop();
            },
            passwordRequirement: PasswordRequirement.safetyHint,
            child: MaterialApp(
              navigatorKey: _navigatorKey,
              title: 'Apptive Grid User Management Example',
              theme: ThemeData(
                primarySwatch: Colors.blue,
              ),
              home: const LoginRegistrationPage(),
            ),
          );
        },
      ),
    );
  }
}

class LoginRegistrationPage extends StatelessWidget {
  const LoginRegistrationPage({
    Key? key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Login/Register'),
      ),
      body: ListView(
        children: const [
          Padding(
            padding: EdgeInsets.all(8),
            child: Card(
              child: Padding(
                padding: EdgeInsets.all(8.0),
                child: ApptiveGridUserManagementContent(),
              ),
            ),
          ),
        ],
      ),
    );
  }
}
1
likes
0
points
369
downloads

Publisher

verified publisherapptivegrid.de

Weekly Downloads

Package to add UserManagement through ApptiveGrid to a Flutter App. This provides Login/Register Widgets and options to confirm accoutns

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

apptive_grid_core, flutter, http, intl, password_rule_check, uni_links

More

Packages that depend on apptive_grid_user_management