mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 10:29:06 +02:00
Try using a mixin instead
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -162,9 +162,9 @@ extension ServiceProviderExtension on BuildContext {
|
|||||||
/// to notify listeners of changes. Services are typically registered in
|
/// to notify listeners of changes. Services are typically registered in
|
||||||
/// `ArcaneServiceProvider` and can be accessed using the `service`
|
/// `ArcaneServiceProvider` and can be accessed using the `service`
|
||||||
/// method on `BuildContext`.
|
/// method on `BuildContext`.
|
||||||
abstract class ArcaneService<T> with ChangeNotifier {}
|
abstract class ArcaneService with ChangeNotifier, ArcaneServiceLocators {}
|
||||||
|
|
||||||
extension ArcaneServiceLocators<T> on ArcaneService {
|
mixin ArcaneServiceLocators<T> {
|
||||||
/// Retrieves a service of the specified type from the context.
|
/// Retrieves a service of the specified type from the context.
|
||||||
///
|
///
|
||||||
/// Returns null if no service of type `T` is found.
|
/// Returns null if no service of type `T` is found.
|
||||||
|
|||||||
Reference in New Issue
Block a user