From a04038afc33f1cdecd4357ec1ea0fc5d332cc81a Mon Sep 17 00:00:00 2001 From: Hans Kokx Date: Tue, 29 Apr 2025 16:40:20 +0200 Subject: [PATCH] Put service locators in an extension Signed-off-by: Hans Kokx --- lib/src/providers/service_provider.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/src/providers/service_provider.dart b/lib/src/providers/service_provider.dart index 3a0cb21..4eb06fa 100644 --- a/lib/src/providers/service_provider.dart +++ b/lib/src/providers/service_provider.dart @@ -162,7 +162,9 @@ extension ServiceProviderExtension on BuildContext { /// to notify listeners of changes. Services are typically registered in /// `ArcaneServiceProvider` and can be accessed using the `service` /// method on `BuildContext`. -abstract class ArcaneService with ChangeNotifier { +abstract class ArcaneService with ChangeNotifier {} + +extension ArcaneServiceLocators on ArcaneService { /// Retrieves a service of the specified type from the context. /// /// Returns null if no service of type `T` is found.