mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 02:19:08 +02:00
Added additional documentation and removed Logger dependency
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -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;
|
library arcane_framework;
|
||||||
|
|
||||||
export "package:arcane_framework/src/arcane.dart";
|
export "package:arcane_framework/src/arcane.dart";
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ class ArcaneFeatureFlags extends ArcaneService {
|
|||||||
///
|
///
|
||||||
/// Each feature is represented as an `Enum`. The list holds the features that are
|
/// Each feature is represented as an `Enum`. The list holds the features that are
|
||||||
/// currently enabled.
|
/// currently enabled.
|
||||||
final List<Enum> _enabledFeatures = [];
|
|
||||||
List<Enum> get enabledFeatures => _enabledFeatures;
|
List<Enum> get enabledFeatures => _enabledFeatures;
|
||||||
|
final List<Enum> _enabledFeatures = [];
|
||||||
|
|
||||||
/// Indicates whether the feature flags have been initialized.
|
/// Indicates whether the feature flags have been initialized.
|
||||||
bool _initialized = false;
|
bool _initialized = false;
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
import "dart:async";
|
import "dart:async";
|
||||||
|
|
||||||
import "package:arcane_framework/arcane_framework.dart";
|
|
||||||
import "package:arcane_helper_utils/arcane_helper_utils.dart";
|
import "package:arcane_helper_utils/arcane_helper_utils.dart";
|
||||||
import "package:flutter/foundation.dart";
|
import "package:flutter/foundation.dart";
|
||||||
|
|
||||||
export "package:logger/logger.dart" show Level;
|
part "logging_enums.dart";
|
||||||
|
|
||||||
part "logging_interface.dart";
|
part "logging_interface.dart";
|
||||||
|
|
||||||
/// A singleton class that manages logging to one or more logging interfaces
|
/// A singleton class that manages logging to one or more logging interfaces
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ dependencies:
|
|||||||
flutter_bloc: ^8.1.6
|
flutter_bloc: ^8.1.6
|
||||||
flutter_secure_storage: ^9.2.2
|
flutter_secure_storage: ^9.2.2
|
||||||
get_it: ^7.7.0
|
get_it: ^7.7.0
|
||||||
logger: ^2.4.0
|
|
||||||
result_monad: ^2.3.2
|
result_monad: ^2.3.2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
|||||||
Reference in New Issue
Block a user