AppConfig class

A configuration class for managing application-wide BLoC instances.

The AppConfig class serves as a central point for initializing and managing all the required BLoC modules in an application. It facilitates the organization of application state and provides a BlocCore for accessing all registered BLoCs.

Example

import 'package:jocaaguraarchetype/app_config.dart';

void main() {
  final appConfig = AppConfig(
    blocTheme: BlocTheme(ProviderTheme(ServiceTheme())),
    blocUserNotifications: BlocUserNotifications(),
    blocLoading: BlocLoading(),
    blocMainMenuDrawer: BlocMainMenuDrawer(),
    blocSecondaryMenuDrawer: BlocSecondaryMenuDrawer(),
    blocResponsive: BlocResponsive(),
    blocOnboarding: BlocOnboarding([]),
    blocNavigator: BlocNavigator(PageManager()),
  );

  final blocCore = appConfig.blocCore();
  print('Registered BLoCs: ${blocCore.modules.keys}');
}

Constructors

AppConfig({required BlocTheme blocTheme, required BlocUserNotifications blocUserNotifications, required BlocLoading blocLoading, required BlocMainMenuDrawer blocMainMenuDrawer, required BlocSecondaryMenuDrawer blocSecondaryMenuDrawer, required BlocResponsive blocResponsive, required BlocOnboarding blocOnboarding, required BlocNavigator blocNavigator, Map<String, BlocModule> blocModuleList = const <String, BlocModule>{}})
Creates an instance of AppConfig.
const

Properties

blocLoading BlocLoading
The BLoC responsible for managing loading states.
final
blocMainMenuDrawer BlocMainMenuDrawer
The BLoC responsible for managing the main menu drawer.
final
blocModuleList Map<String, BlocModule>
A map of additional custom BLoC modules to include in the configuration.
final
blocNavigator BlocNavigator
The BLoC responsible for managing navigation.
final
blocOnboarding BlocOnboarding
The BLoC responsible for managing the onboarding process.
final
blocResponsive BlocResponsive
The BLoC responsible for managing responsive layouts.
final
blocSecondaryMenuDrawer BlocSecondaryMenuDrawer
The BLoC responsible for managing the secondary menu drawer.
final
blocTheme BlocTheme
The BLoC responsible for managing the application's theme.
final
blocUserNotifications BlocUserNotifications
The BLoC responsible for managing user notifications.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

blocCore() → BlocCore
Combines all registered BLoC modules into a BlocCore instance.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited