mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 02:19:08 +02:00
Made the switchEnvironment field in ArcaneEnvironment private (_switchEnvironment)
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -9,15 +9,16 @@ class ArcaneEnvironment extends InheritedWidget {
|
|||||||
/// The current application environment.
|
/// The current application environment.
|
||||||
final Environment environment;
|
final Environment environment;
|
||||||
|
|
||||||
final ValueChanged<Environment> switchEnvironment;
|
final ValueChanged<Environment> _switchEnvironment;
|
||||||
|
|
||||||
/// Creates an `ArcaneEnvironment` widget.
|
/// Creates an `ArcaneEnvironment` widget.
|
||||||
const ArcaneEnvironment({
|
const ArcaneEnvironment({
|
||||||
required this.environment,
|
required this.environment,
|
||||||
required Widget child,
|
required Widget child,
|
||||||
required this.switchEnvironment,
|
required void Function(Environment) switchEnvironment,
|
||||||
Key? key,
|
Key? key,
|
||||||
}) : super(key: key, child: child);
|
}) : _switchEnvironment = switchEnvironment,
|
||||||
|
super(key: key, child: child);
|
||||||
|
|
||||||
/// Retrieves the `ArcaneEnvironment` instance from the nearest ancestor.
|
/// Retrieves the `ArcaneEnvironment` instance from the nearest ancestor.
|
||||||
///
|
///
|
||||||
@@ -42,8 +43,8 @@ class ArcaneEnvironment extends InheritedWidget {
|
|||||||
return environment != oldWidget.environment;
|
return environment != oldWidget.environment;
|
||||||
}
|
}
|
||||||
|
|
||||||
void enableDebugMode() => switchEnvironment(Environment.debug);
|
void enableDebugMode() => _switchEnvironment(Environment.debug);
|
||||||
void disableDebugMode() => switchEnvironment(Environment.normal);
|
void disableDebugMode() => _switchEnvironment(Environment.normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A `StatefulWidget` that manages and provides the `ArcaneEnvironment`.
|
/// A `StatefulWidget` that manages and provides the `ArcaneEnvironment`.
|
||||||
|
|||||||
Reference in New Issue
Block a user