diff --git a/lib/arcane_framework.dart b/lib/arcane_framework.dart index 44ceef7..6915d1d 100644 --- a/lib/arcane_framework.dart +++ b/lib/arcane_framework.dart @@ -1,3 +1,40 @@ +/// The Arcane Framework is a comprehensive Dart package designed to provide a +/// scalable architecture for managing essential application services such as +/// logging, authentication, theming, feature flags, and more. +/// +/// The framework offers a centralized way to access and manage these services, +/// making it easy to build dynamic and feature-rich applications. It includes +/// a robust logging system, dynamic feature toggles, theming capabilities, and +/// user authentication handling. +/// +/// ## Key Features: +/// - **Service Management**: Centralized access to critical services like +/// logging, feature flags, and theming. +/// - **Feature Flags**: Dynamically enable or disable features using +/// `ArcaneFeatureFlags`. +/// - **Logging**: Flexible logging with different severity levels +/// (`debug`, `info`, `error`, etc.). +/// - **Theming**: Easy light/dark mode switching with `ArcaneReactiveTheme`. +/// - **Authentication**: Manage user login, sign up, and token-based +/// authentication. +/// +/// Example usage: +/// ```dart +/// import 'package:arcane_framework/arcane_framework.dart'; +/// +/// void main() { +/// runApp( +/// ArcaneApp( +/// services: [MyArcaneService.I], +/// child: MyApp(), +/// ), +/// ); +/// } +/// ``` +/// +/// This library is designed to simplify the development of complex, scalable +/// Flutter applications by offering a set of tools to manage core +/// functionalities efficiently. library arcane_framework; export "package:arcane_framework/src/arcane.dart"; diff --git a/lib/src/services/feature_flags/feature_flags_service.dart b/lib/src/services/feature_flags/feature_flags_service.dart index a20119d..4445ce5 100644 --- a/lib/src/services/feature_flags/feature_flags_service.dart +++ b/lib/src/services/feature_flags/feature_flags_service.dart @@ -29,8 +29,8 @@ class ArcaneFeatureFlags extends ArcaneService { /// /// Each feature is represented as an `Enum`. The list holds the features that are /// currently enabled. - final List _enabledFeatures = []; List get enabledFeatures => _enabledFeatures; + final List _enabledFeatures = []; /// Indicates whether the feature flags have been initialized. bool _initialized = false; diff --git a/lib/src/services/logging/logging_enums.dart b/lib/src/services/logging/logging_enums.dart new file mode 100644 index 0000000..b0d2b94 --- /dev/null +++ b/lib/src/services/logging/logging_enums.dart @@ -0,0 +1,57 @@ +part of "logging_service.dart"; + +/// Enum representing the different logging levels used to control logging +/// output. +/// +/// Each `Level` has an associated integer value that represents its severity. +/// Logging can be filtered to include only messages above a certain `Level`. +/// +/// Example usage: +/// ```dart +/// Arcane.log("This is an info message", level: Level.info); +/// ``` +/// +/// The levels are as follows: +/// - `all`: Logs all messages, regardless of level. +/// - `trace`: Used for very fine-grained debugging information. +/// - `debug`: Used for general debugging information. +/// - `info`: Used for informational messages. +/// - `warning`: Used for warnings that may indicate potential problems. +/// - `error`: Used for errors that prevent the normal flow of execution. +/// - `fatal`: Used for severe errors that may cause the application to crash. +/// - `off`: Disables logging output entirely. +enum Level { + /// Logs all messages, regardless of severity level. + all(0), + + /// Logs very fine-grained debugging information. + trace(1000), + + /// Logs general debugging information. + debug(2000), + + /// Logs informational messages. + info(3000), + + /// Logs warning messages that may indicate potential problems. + warning(4000), + + /// Logs error messages that prevent the normal flow of execution. + error(5000), + + /// Logs severe errors that may cause the application to crash. + fatal(6000), + + /// Disables all logging. + off(10000), + ; + + /// The integer value representing the severity of the logging level. + /// + /// Lower values represent lower severity, while higher values represent + /// higher severity. + final int value; + + /// Creates a `Level` with the specified [value]. + const Level(this.value); +} diff --git a/lib/src/services/logging/logging_service.dart b/lib/src/services/logging/logging_service.dart index 51a9361..f32e21a 100644 --- a/lib/src/services/logging/logging_service.dart +++ b/lib/src/services/logging/logging_service.dart @@ -1,11 +1,9 @@ import "dart:async"; -import "package:arcane_framework/arcane_framework.dart"; import "package:arcane_helper_utils/arcane_helper_utils.dart"; import "package:flutter/foundation.dart"; -export "package:logger/logger.dart" show Level; - +part "logging_enums.dart"; part "logging_interface.dart"; /// A singleton class that manages logging to one or more logging interfaces diff --git a/pubspec.yaml b/pubspec.yaml index 7c15e1d..6ffaa3d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,6 @@ dependencies: flutter_bloc: ^8.1.6 flutter_secure_storage: ^9.2.2 get_it: ^7.7.0 - logger: ^2.4.0 result_monad: ^2.3.2 dev_dependencies: