cerbere_admin 0.1.0+5 copy "cerbere_admin: ^0.1.0+5" to clipboard
cerbere_admin: ^0.1.0+5 copied to clipboard

Flutter admin package for roles and permissions with Firebase. Companion to cerbere; requires Firebase Admin SDK for user management.

example/lib/main.dart

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

void main() {
  runApp(const CerbereAdminExampleApp());
}

/// Example app for cerbere_admin.
///
/// In a real app, initialize Firebase and Firebase Admin SDK, then wrap
/// your app with [CerbereAdminInitWidget] and use [CerbereUtilisateursPage]
/// or [CerbereRolesPage].
class CerbereAdminExampleApp extends StatelessWidget {
  /// Creates the example app.
  const CerbereAdminExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Cerbère Admin Example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const _ExampleHomePage(),
    );
  }
}

class _ExampleHomePage extends StatelessWidget {
  const _ExampleHomePage();

  @override
  Widget build(BuildContext context) {
    // References to package widgets for the example (use them in a real app
    // after wrapping with CerbereAdminInitWidget).
    const rolesPage = CerbereRolesPage();
    const usersPage = CerbereUtilisateursPage();

    return Scaffold(
      appBar: AppBar(
        title: const Text('Cerbère Admin Example'),
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.all(24),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              const Text(
                'Configure Firebase Auth, Firestore and Firebase Admin SDK, '
                'then wrap your app with CerbereAdminInitWidget. '
                'You can then navigate to CerbereUtilisateursPage and '
                'CerbereRolesPage.',
                textAlign: TextAlign.center,
              ),
              const SizedBox(height: 16),
              Text(
                'Available: ${rolesPage.runtimeType}, '
                '${usersPage.runtimeType}',
                style: Theme.of(context).textTheme.bodySmall,
                textAlign: TextAlign.center,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
150
points
0
downloads
screenshot

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Flutter admin package for roles and permissions with Firebase. Companion to cerbere; requires Firebase Admin SDK for user management.

Repository (GitHub)
View/report issues

Topics

#firebase #admin #roles #permissions #flutter

License

MIT (license)

Dependencies

bloc, cerbere, cloud_firestore, dart_firebase_admin, equatable, firebase_auth, flutter, flutter_bloc, uuid

More

Packages that depend on cerbere_admin