Skip to content

Commit

Permalink
breaking: introducing a PluginDescriptor to describe all essential pl…
Browse files Browse the repository at this point in the history
…ugins
  • Loading branch information
pavanpodila committed Sep 18, 2024
1 parent 3ffa6da commit b4a4dc5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
3 changes: 1 addition & 2 deletions packages/system/vyuh_core/lib/plugin/auth/auth_plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ abstract class AuthPlugin<TUser extends User> extends Plugin {
var _initialized = false;

/// Creates an instance of [AuthPlugin].
AuthPlugin({required super.name, required super.title})
: super();
AuthPlugin({required super.name, required super.title}) : super();

/// The current user that is signed in.
TUser get currentUser => throw UnimplementedError();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:vyuh_core/vyuh_core.dart';

abstract class LoggerPlugin extends Plugin {
LoggerPlugin({required super.name, required super.title})
: super();
LoggerPlugin({required super.name, required super.title});

/// trace
void t(dynamic message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ abstract class NavigationPlugin extends Plugin {
pageBuilder: fallbackRoutePageBuilder,
);

NavigationPlugin({required super.name, required super.title})
: super();
NavigationPlugin({required super.name, required super.title});

void initRouter({
String? initialLocation,
Expand Down
6 changes: 2 additions & 4 deletions packages/system/vyuh_core/lib/plugin/storage_plugin.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import 'package:vyuh_core/vyuh_core.dart';

abstract class StoragePlugin extends Plugin {
StoragePlugin({required super.name, required super.title})
: super();
StoragePlugin({required super.name, required super.title});

Future<dynamic> read(String key);
Future<dynamic> write(String key, dynamic value);
Expand All @@ -11,8 +10,7 @@ abstract class StoragePlugin extends Plugin {
}

abstract class SecureStoragePlugin extends Plugin {
SecureStoragePlugin({required super.name, required super.title})
: super();
SecureStoragePlugin({required super.name, required super.title});

Future<dynamic> read(String key);
Future<dynamic> write(String key, dynamic value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ extension NamedPlugins on VyuhPlatform {
LoggerPlugin? get log => getPlugin<LoggerPlugin>();

/// The analytics plugin.
AnalyticsPlugin get analytics =>
getPlugin<AnalyticsPlugin>()!;
AnalyticsPlugin get analytics => getPlugin<AnalyticsPlugin>()!;

/// The network plugin.
NetworkPlugin get network => getPlugin<NetworkPlugin>()!;
Expand All @@ -69,10 +68,8 @@ extension NamedPlugins on VyuhPlatform {
AuthPlugin get auth => getPlugin<AuthPlugin>()!;

/// The navigation plugin.
NavigationPlugin get router =>
getPlugin<NavigationPlugin>()!;
NavigationPlugin get router => getPlugin<NavigationPlugin>()!;

/// The feature flag plugin.
FeatureFlagPlugin? get featureFlag =>
getPlugin<FeatureFlagPlugin>();
FeatureFlagPlugin? get featureFlag => getPlugin<FeatureFlagPlugin>();
}

0 comments on commit b4a4dc5

Please sign in to comment.