v2.0.6: Remove export of Error and Ok from result_monad (#12)

* Update Logging feature to replace @LoggingFeature annotation with LoggerName mixin for runtime accessibility

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>

* Bump version to 2.0.2 in pubspec.yaml and update CHANGELOG to reflect the new version

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>

* Add migration steps for replacing @LoggingFeature annotation with LoggerName mixin in CHANGELOG

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>

* Fix class declaration in migration example for LoggerName mixin

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>

* Enhance CI workflow, coverage enforcement, and environment tests (#10)

* Enhance CI workflow and coverage enforcement; update tests and add new environment tests

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>

* Revert version bump in pubspec.yaml and remove test coverage note from CHANGELOG

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>

* Update test to expect a thrown exception when no interfaces are registered

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>

* Add ArcaneEnvironmentModeController and related tests for debug mode management

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>

* Refactor theme switcher tests to use platform dispatcher for brightness change simulation

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>

---------

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>

* refactor(api): Remove export of Error and Ok from result_monad (#11)

The `Error` and `Ok` symbols from the `result_monad` package are no longer
re-exported directly by `arcane_framework`. Consumers needing these
symbols must now explicitly import them from `package:result_monad`.
This clarifies dependency ownership and reduces `arcane_framework`'s
public API surface.

---------

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-06-19 20:28:24 +02:00
committed by GitHub
parent cbb1a78473
commit 0078e344fd
23 changed files with 1294 additions and 12 deletions
+1 -1
View File
@@ -52,4 +52,4 @@ export "package:arcane_framework/src/services/theme/arcane_theme.dart";
export "package:arcane_framework/src/services/theme/theme_extensions.dart";
export "package:arcane_framework/src/services/theme/theme_service.dart";
export "package:arcane_framework/src/services/theme/theme_switcher.dart";
export "package:result_monad/result_monad.dart";
export "package:result_monad/result_monad.dart" hide Error, Ok;
@@ -3,6 +3,18 @@ import "package:flutter/widgets.dart";
import "environment_interface.dart";
/// Typed API for mutating environment mode from provider state.
abstract interface class ArcaneEnvironmentModeController {
/// Enables debug mode by setting the environment to `Environment.debug`.
void enableDebugMode();
/// Disables debug mode by setting the environment to `Environment.normal`.
void disableDebugMode();
/// Sets the current environment.
void setEnvironment(Environment environment);
}
/// An `InheritedWidget` that provides access to the application environment.
///
/// The `ArcaneEnvironment` widget holds the current environment and allows
@@ -77,7 +89,8 @@ class ArcaneEnvironmentProvider extends StatefulWidget {
_ArcaneEnvironmentProviderState();
}
class _ArcaneEnvironmentProviderState extends State<ArcaneEnvironmentProvider> {
class _ArcaneEnvironmentProviderState extends State<ArcaneEnvironmentProvider>
implements ArcaneEnvironmentModeController {
late Environment _environment;
void _handleEnvironmentChange() {
@@ -111,17 +124,20 @@ class _ArcaneEnvironmentProviderState extends State<ArcaneEnvironmentProvider> {
}
/// Enables debug mode by setting the environment to `Environment.debug`.
@override
void enableDebugMode() {
if (_environment == Environment.debug) return;
setEnvironment(Environment.debug);
}
/// Disables debug mode by setting the environment to `Environment.normal`.
@override
void disableDebugMode() {
if (_environment == Environment.normal) return;
setEnvironment(Environment.normal);
}
@override
void setEnvironment(Environment environment) {
Arcane.environment.setEnvironment(environment);
}
@@ -225,11 +225,9 @@ class ArcaneLogger {
...?parts?.split("(package:").lastOrNull?.split(":"),
];
if (fileAndLineParts.length < 2) {
filenameAndLineNumber = fileAndLineParts.firstOrNull;
} else {
filenameAndLineNumber = "${fileAndLineParts[0]}:${fileAndLineParts[1]}";
}
final String parsedFilenameAndLine = fileAndLineParts.take(2).join(":");
filenameAndLineNumber =
parsedFilenameAndLine.isEmpty ? null : parsedFilenameAndLine;
}
// Module management