diff --git a/README.md b/README.md index b167e02..9e5bf76 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ To use Arcane Framework in your Dart or Flutter project, follow these steps: runApp( ArcaneApp( services: [ - MyArcaneService.I, + MyArcaneService(), ], child: MainApp(), ), @@ -55,7 +55,7 @@ A service's purpose is to facilitate cross-feature communication of small pieces class FavoriteColorService extends ArcaneService { static final FavoriteColorService _instance = FavoriteColorService._internal(); - static FavoriteColorService get I => _instance; + factory FavoriteColorService() => I._instance; FavoriteColorService._internal(); diff --git a/lib/src/providers/service_provider.dart b/lib/src/providers/service_provider.dart index 0fb6dfc..7326e5b 100644 --- a/lib/src/providers/service_provider.dart +++ b/lib/src/providers/service_provider.dart @@ -157,33 +157,4 @@ extension ServiceProviderExtension on BuildContext { } /// An abstract class representing a service in the Arcane architecture. -/// -/// Classes that extend `ArcaneService` can use `ChangeNotifier` functionality -/// 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, ArcaneServiceLocators {} - -mixin ArcaneServiceLocators { - /// Retrieves a service of the specified type from the context. - /// - /// Returns null if no service of type `T` is found. - /// - /// Example: - /// ```dart - /// final myService = ArcaneService.of(context); - /// ``` - static T? of(BuildContext context) => - context.service(); - - /// Retrieves a service of the specified type from the context. - /// - /// Throws an assertion error if no service of type `T` is found. - /// - /// Example: - /// ```dart - /// final myService = ArcaneService.requiredOf(context); - /// ``` - static T requiredOf(BuildContext context) => - context.requiredService(); -} +abstract class ArcaneService with ChangeNotifier {}