From b4a4dc54fc80791ab2c03b6dd410488da7e3aae9 Mon Sep 17 00:00:00 2001 From: pavanpodila Date: Wed, 18 Sep 2024 10:40:18 +0530 Subject: [PATCH] breaking: introducing a PluginDescriptor to describe all essential plugins --- .../system/vyuh_core/lib/plugin/auth/auth_plugin.dart | 3 +-- .../vyuh_core/lib/plugin/logger/logger_plugin.dart | 3 +-- .../vyuh_core/lib/plugin/navigation/navigation.dart | 3 +-- packages/system/vyuh_core/lib/plugin/storage_plugin.dart | 6 ++---- .../vyuh_core/lib/runtime/platform/vyuh_platform.dart | 9 +++------ 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/packages/system/vyuh_core/lib/plugin/auth/auth_plugin.dart b/packages/system/vyuh_core/lib/plugin/auth/auth_plugin.dart index 2803349..e547d0b 100644 --- a/packages/system/vyuh_core/lib/plugin/auth/auth_plugin.dart +++ b/packages/system/vyuh_core/lib/plugin/auth/auth_plugin.dart @@ -13,8 +13,7 @@ abstract class AuthPlugin 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(); diff --git a/packages/system/vyuh_core/lib/plugin/logger/logger_plugin.dart b/packages/system/vyuh_core/lib/plugin/logger/logger_plugin.dart index 6143b6a..2e2da91 100644 --- a/packages/system/vyuh_core/lib/plugin/logger/logger_plugin.dart +++ b/packages/system/vyuh_core/lib/plugin/logger/logger_plugin.dart @@ -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); diff --git a/packages/system/vyuh_core/lib/plugin/navigation/navigation.dart b/packages/system/vyuh_core/lib/plugin/navigation/navigation.dart index 0ad6503..3e5d996 100644 --- a/packages/system/vyuh_core/lib/plugin/navigation/navigation.dart +++ b/packages/system/vyuh_core/lib/plugin/navigation/navigation.dart @@ -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, diff --git a/packages/system/vyuh_core/lib/plugin/storage_plugin.dart b/packages/system/vyuh_core/lib/plugin/storage_plugin.dart index dd15696..d48ca2f 100644 --- a/packages/system/vyuh_core/lib/plugin/storage_plugin.dart +++ b/packages/system/vyuh_core/lib/plugin/storage_plugin.dart @@ -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 read(String key); Future write(String key, dynamic value); @@ -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 read(String key); Future write(String key, dynamic value); diff --git a/packages/system/vyuh_core/lib/runtime/platform/vyuh_platform.dart b/packages/system/vyuh_core/lib/runtime/platform/vyuh_platform.dart index 322e5cc..a249648 100644 --- a/packages/system/vyuh_core/lib/runtime/platform/vyuh_platform.dart +++ b/packages/system/vyuh_core/lib/runtime/platform/vyuh_platform.dart @@ -59,8 +59,7 @@ extension NamedPlugins on VyuhPlatform { LoggerPlugin? get log => getPlugin(); /// The analytics plugin. - AnalyticsPlugin get analytics => - getPlugin()!; + AnalyticsPlugin get analytics => getPlugin()!; /// The network plugin. NetworkPlugin get network => getPlugin()!; @@ -69,10 +68,8 @@ extension NamedPlugins on VyuhPlatform { AuthPlugin get auth => getPlugin()!; /// The navigation plugin. - NavigationPlugin get router => - getPlugin()!; + NavigationPlugin get router => getPlugin()!; /// The feature flag plugin. - FeatureFlagPlugin? get featureFlag => - getPlugin(); + FeatureFlagPlugin? get featureFlag => getPlugin(); }