vyuh_core
Compose features with FeatureDescriptor, choose shared capabilities with PluginDescriptor, and launch through runApp. This package owns platform lifecycle, base plugin contracts, navigation integration, content base types, dependency injection, events, localization, analytics, and telemetry.
How the pieces fit together
Choose a declaration
ActionFailure · AnalyticsPlugin · AnalyticsProvider · AppBuilder · AppRunner · AsyncLazyDI · AuthException · AuthPlugin · CMSPathResolver · CMSRoute · Category · ConditionFailure · ContainerItem · ContentFailure · ContentItem · ContentItemFailure · ContentModifierConfiguration · ContentPlugin · ContentProvider · CreateUserFailure · DIPlugin · DefaultEnvPlugin · DefaultEventPlugin · DefaultNavigationPlugin · DeferredFeatureLoader · DeleteAccountFailure · DisposeFunction · DocumentItem · EnvPlugin · ErrorViewBuilder · EventPlugin · ExtensionBuilder · ExtensionDescriptor · FeatureDescriptor · FeatureFlagPlugin · FeaturesBuilder · FieldName · FileReference · FromJsonConverter · GetItDIPlugin · HttpNetworkConfig · HttpNetworkPlugin · ImagePlaceholderBuilder · ImageReference · InitOncePlugin · InitState · LayoutConfiguration · LayoutFailure · LazyFeatureDescriptor · LazyFeaturesBuilder · LiveContentProvider · Loader · LocalContentProvider · LocaleConfiguration · LocalePlugin · LogLevel · Logger · LoggerInterface · LoginMethod · LoginMethodCanceled · LoginMethodFailure · LogoutFailure · ModifierFailure · NamedBindings · NamedPlugins · NavigationPlugin · NetworkPlugin · NoOpAnalyticsProvider · NoOpContentPlugin · NoOpContentProvider · NoOpLiveContentProvider · NoOpTelemetryProvider · NoOpTrace · OAuthType · ObjectReference · PlatformLoggerInterface · PlatformWidgetBuilder · Plugin · PluginDescriptor · PreloadedPlugin · Restartable · RootItem · RouteBase · RouteBuilderFunction · RouteErrorViewBuilder · RouteLifecycleConfiguration · RouteLoader · RouteObservers · RouteTypeConfiguration · RoutingConfigNotifier · SchemaItem · SecureStoragePlugin · SendEmailLinkFailure · SendPasswordResetEmailFailure · StoragePlugin · SystemInitTracker · SystemReadyEvent · TelemetryPlugin · TelemetryProvider · Trace · TranslationRegistration · TypeDescriptor · UnknownContentBuilder · UnknownContentItem · UnknownPlaceholderFactory · User · VoidFutureFunction · VyuhBinding · VyuhEvent · VyuhEventListener · VyuhPlatform · debugAssertOneOfPathOrRouteId · defaultAppRunner · defaultRoutePageBuilder · fieldKeyMap · listFromJson · messages · readValue · runApp · setUnknownPlaceholderFactory · typeFromFirstOfListJson · vyuh
ActionFailure
Failure when an action configuration registration is missing.
final class ActionFailure extends ContentFailureDirectly declared public members:
final Map<String, dynamic>? actionConfig;The action configuration that failed to resolve
const ActionFailure({required super.schemaType, this.actionConfig, super.jsonPayload, super.description, super.suggestions});AnalyticsPlugin
The default implementation of analytics tracking in Vyuh applications.
final class AnalyticsPlugin extends Plugin with PreloadedPlugin, InitOncePlugin, RouteObservers implements AnalyticsProviderDirectly declared public members:
final List<AnalyticsProvider> providers;The list of analytics providers managed by this plugin.
String get description;List<NavigatorObserver> get observers;Navigation observers for automatic route tracking.
AnalyticsPlugin({required this.providers});Creates a new AnalyticsPlugin with the given providers.
Future<void> initOnce();Initializes all analytics providers.
Future<void> disposeOnce();Disposes all analytics providers.
Future<void> reportEvent(String name, {Map<String, dynamic>? params});Reports an analytics event to all providers.
Future<void> identifyUser(String userId, {Map<String, dynamic>? traits});Identifies a user across all analytics providers.
Future<void> resetUser();Resets the user identity across all analytics providers.
AnalyticsProvider
The base interface for an Analytics Provider. The provider is responsible for reporting analytics events, errors, and messages.
abstract interface class AnalyticsProviderDirectly declared public members:
List<NavigatorObserver> get observers;The list of observers for the provider. These are added to the navigator, as part of the router setup.
String get name;The name of the provider.
String get title;The title of the provider.
String get description;The description of the provider.
Future<void> init();Initializes the provider.
Future<void> dispose();Disposes the provider.
Future<void> reportEvent(String name, {Map<String, dynamic>? params});Reports an event with a specific name and optional parameters.
Future<void> identifyUser(String userId, {Map<String, dynamic>? traits});Identifies a user with the given ID and optional traits. The traits can include any user properties like email, name, etc.
Future<void> resetUser();Clears the current user identification and associated traits. This should be called when the user logs out.
AppBuilder
A builder for root Widget of the application. Typically this would be a MaterialApp or CupertinoApp.
typedef AppBuilder = Widget Function(BuildContext context, VyuhPlatform platform);AppRunner
A function that takes a Widget and runs the application.
typedef AppRunner = void Function(Widget app);AsyncLazyDI
An extension on the DIPlugin class to provide asynchronous lazy dependency injection.
extension AsyncLazyDI on DIPluginDirectly declared public members:
void registerAsync<T extends Object>(Future<T> Function() fn, {String? name});Registers a lazily initialized asynchronous dependency in the dependency injection container.
Future<T> getAsync<T extends Object>({String? name});Retrieves an asynchronously initialized dependency from the dependency injection container.
AuthException
Base type for all Authentication related exceptions.
abstract class AuthException implements ExceptionDirectly declared public members:
const AuthException(this.error);Create an exception with the given error.
final Object error;The error that caused this exception.
String toString();AuthPlugin
An authentication plugin that supports various authentication methods.
abstract class AuthPlugin extends PluginDirectly declared public members:
var dynamic controller;The controller for the user changes stream.
String get token;String get refreshToken;AuthPlugin({required super.name, required super.title});Creates an instance of AuthPlugin.
User get currentUser;The current user that is signed in.
Stream<User> get userChanges;A stream of user changes.
void setCurrentUser(User user);Future<void> dispose();Future<void> init();Future<void> loginAnonymously();Future<void> sendOtp({required String phoneNumber});Future<void> loginWithPhoneOtp({required String phoneNumber, required String otp});Future<void> loginWithEmailPassword({required String email, required String password});Future<void> registerWithEmailPassword({required String email, required String password});Future<void> sendEmailLink({required String email, required String clientId});Future<void> sendPasswordResetEmail({required String email});Future<void> loginWithEmailLink({required String email, required String link});Future<void> loginWithOAuth(OAuthType type);Future<void> logout();Logs out the current user.
Future<bool> refreshSession();Attempts to refresh the current session token.
Future<void> deleteAccount();Deletes the current user account.
CMSPathResolver
A function that resolves a CMS path from a local path. This is useful when multiple local routes use a single template path on the CMS. For example: (Local path) /blog/:slug -> /blog (CMS path)
typedef CMSPathResolver = String Function(String path);CMSRoute
A route purely meant to identify CMS pages. Use it to distinguish between the way local routes and CMS routes are handled.
final class CMSRoute extends GoRouteDirectly declared public members:
final CMSPathResolver cmsPathResolver;A function that resolves a CMS path from a local path.
CMSRoute({required super.path, this.cmsPathResolver = _identityPathResolver, super.builder, GoRouterPageBuilder? pageBuilder, super.parentNavigatorKey, super.name, super.onExit, super.redirect, super.routes});Creates a new CMS route.
Category
A category for organizing routes.
class Category implements SchemaItemDirectly declared public members:
String get schemaType;final String identifier;final String title;final LayoutConfiguration? layout;final List<ContentModifierConfiguration>? modifiers;static List<ContentModifierConfiguration>? modifierList(dynamic json);Category({required this.identifier, required this.title, this.layout, this.modifiers});factory Category.fromJson(Map<String, dynamic> json);ConditionFailure
Failure when a condition configuration registration is missing.
final class ConditionFailure extends ContentFailureDirectly declared public members:
final Map<String, dynamic>? conditionConfig;The condition configuration that failed to resolve
const ConditionFailure({required super.schemaType, this.conditionConfig, super.jsonPayload, super.description, super.suggestions});ContainerItem
Represents a container item that can contain other content items.
abstract interface class ContainerItem implements ContentItemContentFailure
Base class for content-related failures in the Vyuh framework.
abstract class ContentFailureDirectly declared public members:
final String schemaType;The schema type that failed to resolve
final Map<String, dynamic>? jsonPayload;The original JSON payload that caused the failure (if available)
final String? description;Human-readable description of the failure
final List<String>? suggestions;Optional suggestions for resolving the failure
const ContentFailure({required this.schemaType, this.jsonPayload, this.description, this.suggestions});ContentItem
The base class for all content items in Vyuh.
abstract class ContentItem implements SchemaItemDirectly declared public members:
final String schemaType;final LayoutConfiguration? layout;The layout configuration for the content item.
final List<ContentModifierConfiguration>? modifiers;static List<ContentModifierConfiguration>? modifierList(dynamic json);ContentItem? parent;The parent content item of this content item. This is used internally by the content system.
ContentItem({required this.schemaType, required this.layout, required this.modifiers});Creates an instance of ContentItem.
factory ContentItem.fromJson(Map<String, dynamic> json);Converts the JSON representation of the content item to an instance of ContentItem.
void setParent(Iterable<ContentItem?> children);Sets the parent content item for the given list of children.
LayoutConfiguration? getLayout();Gets the layout to use for the ContentItem. By default its the layout itself. However this acts as an extension point for custom ContentItems that may have a different strategy for applying layouts.
List<ContentModifierConfiguration>? getModifiers();Gets the modifiers to use for the ContentItem. By default its the modifiers itself. However this acts as an extension point for custom ContentItems that may have a different strategy for applying modifiers.
ContentItemFailure
Failure when a ContentItem type registration is missing.
final class ContentItemFailure extends ContentFailureDirectly declared public members:
const ContentItemFailure({required super.schemaType, super.jsonPayload, super.description, super.suggestions});ContentModifierConfiguration
Configuration for modifying content presentation.
abstract class ContentModifierConfiguration implements SchemaItemDirectly declared public members:
final String schemaType;ContentModifierConfiguration({required this.schemaType});factory ContentModifierConfiguration.fromJson(Map<String, dynamic> json);Widget build(BuildContext context, Widget child, ContentItem content);Builds the modifier widget tree for the given content item.
ContentPlugin
The base class for a Content Plugin
abstract class ContentPlugin extends PluginDirectly declared public members:
final ContentProvider provider;The ContentProvider for this plugin
ContentPlugin({required this.provider, required super.name, required super.title});Creates a new ContentPlugin with the given provider, name, and title
Map<Type, Map<String, TypeDescriptor>> get typeRegistry;The type registry that maps types to their descriptors. This stores the descriptors for LayoutConfiguration, ActionConfiguration, ConditionConfiguration and possibly others in the future.
Widget buildContent<T extends ContentItem>(BuildContext context, T content, {LayoutConfiguration<T>? layout});Builds a Widget for the given content. You can pass in an optional layout to override the default layout
Widget buildRoute(BuildContext context, {Uri? url, String? routeId});Builds a Widget for the given route url or id. This is used for top-level documents called routes. These could represent a page, dialog or a conditional-route.
void attach(ExtensionBuilder extBuilder);Sets up the plugin with the ContentExtensionBuilder. The plugin relies on the ContentExtensionBuilder to do its work.
T? fromJson<T>(Map<String, dynamic> json);Converts the given json to an item of type T
void register<T>(TypeDescriptor<T> descriptor);Registers the given type descriptor
bool isRegistered<T>(String schemaType);Checks if the given schema type is registered for type T
ContentProvider
Public declaration in this package.
abstract class ContentProviderDirectly declared public members:
final String name;final String title;final LiveContentProvider live;ContentProvider({required this.name, required this.title, this.live = const NoOpLiveContentProvider()});bool get supportsLive;String fieldValue(String key, Map<String, dynamic> json);String schemaType(Map<String, dynamic> json);Future<void> init();Future<void> dispose();ImageProvider? image(final ImageReference imageRef, {final int? width, final int? height, final int? devicePixelRatio, final int? quality, final String? format});Uri? fileUrl(final FileReference fileRef);Future<T?> fetchById<T>(String id, {required FromJsonConverter<T> fromJson, bool useCache = true});Future<T?> fetchSingle<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});Future<List<T>?> fetchMultiple<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});Future<RouteBase?> fetchRoute({String? path, String? routeId, bool useCache = true});CreateUserFailure
Exception thrown when creating a user fails.
final class CreateUserFailure extends AuthExceptionDirectly declared public members:
const CreateUserFailure(super.error);DIPlugin
DIPlugin is an abstract class that extends the Plugin class.
abstract class DIPlugin extends PluginDirectly declared public members:
DIPlugin({required super.name, required super.title});Constructs a DIPlugin instance with the given name and title.
void register<T extends Object>(T instance, {String? name});Registers an instance of any Object type with the DI container.
void registerLazy<T extends Object>(T Function() fn, {String? name});Registers a function that produces an instance of any Object type.
void registerFactory<T extends Object>(T Function() fn, {String? name});Registers a factory function that produces a new instance each time it is called.
void unregister<T extends Object>({String? name});Removes the instance of the specified type from the DI container.
T get<T extends Object>({String? name});Retrieves the registered instance of type T from the DI container.
bool has<T extends Object>({String? name});Checks if an instance of the specified type is registered in the DI container.
Future<void> reset();Clears all instances registered in the DI container.
DefaultEnvPlugin
Public declaration in this package.
final class DefaultEnvPlugin extends EnvPluginDirectly declared public members:
final String fileName;final Map<String, String> defaults;DefaultEnvPlugin({this.fileName = '.env', this.defaults = const {}});Future<void> init();Map<String, String> all();dynamic clear();Future<void> dispose();String get(String key, {String? fallback});String? maybeGet(String key, {String? fallback});DefaultEventPlugin
Default implementation of EventPlugin using the event_bus package.
final class DefaultEventPlugin extends EventPluginDirectly declared public members:
DefaultEventPlugin();void emit<T extends VyuhEvent>(T event);DisposeFunction on<T extends VyuhEvent>(VyuhEventListener<T> listener);void once<T extends VyuhEvent>(VyuhEventListener<T> listener);Future<void> dispose();Future<void> init();DefaultNavigationPlugin
Public declaration in this package.
final class DefaultNavigationPlugin extends NavigationPluginDirectly declared public members:
final bool includeFallbackRoute;DefaultNavigationPlugin({this.includeFallbackRoute = true, final bool urlReflectsImperativeAPIs = false, g.GoRouterRedirect? redirect});GoRouter get instance;static void enableURLReflectsImperativeAPIs();static void usePathStrategy();static void useHashStrategy();static void setRouterRedirect(g.GoRouterRedirect redirect);void initRouter({String? initialLocation, required List<g.RouteBase> routes, required GlobalKey<NavigatorState> rootNavigatorKey});dynamic replaceRoutes(List<g.RouteBase> routes);void appendInitialRoutes(List<g.RouteBase> routes);dynamic appendRoutes(List<g.RouteBase> routes);Future<void> init();Future<void> dispose();void go(String location, {Object? extra});void goNamed(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});void pop<T extends Object?>([T? result]);Future<T?> push<T extends Object?>(String location, {Object? extra});Future<T?> pushNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});Future<T?> pushReplacement<T extends Object?>(String location, {Object? extra});Future<T?> pushReplacementNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});Future<T?> replace<T extends Object?>(String location, {Object? extra});Future<T?> replaceNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});DeferredFeatureLoader
A callback that loads a FeatureDescriptor, potentially using Dart's deferred import mechanism for web code splitting.
typedef DeferredFeatureLoader = Future<FeatureDescriptor> Function();DeleteAccountFailure
Exception thrown when the account deletion fails.
final class DeleteAccountFailure extends AuthExceptionDirectly declared public members:
const DeleteAccountFailure(super.error);Create a new DeleteAccountFailure with the given error.
DisposeFunction
A function that can be called to dispose of (cancel) an event subscription.
typedef DisposeFunction = void Function();DocumentItem
The base interface for all schema-driven document items.
abstract interface class DocumentItem implements SchemaItemEnvPlugin
An abstract class representing an environment plugin. It provides methods to interact with environment variables.
abstract class EnvPlugin extends PluginDirectly declared public members:
EnvPlugin({required super.name, required super.title});Constructs an EnvPlugin with the given name and title.
Map<String, String?> all();Returns a map of all environment variables.
String get(String key, {String? fallback});Returns the value of the environment variable specified by key, or the fallback value if not found.
String? maybeGet(String key, {String? fallback});Returns the value of the environment variable specified by key, or the fallback value if not found, or null if neither is found.
void clear();Clears all the environment variables.
ErrorViewBuilder
A builder for an error view widget.
typedef ErrorViewBuilder = Widget Function( BuildContext context,EventPlugin
Base class for implementing event handling in Vyuh applications.
abstract class EventPlugin extends Plugin with PreloadedPluginDirectly declared public members:
EventPlugin({required super.name, required super.title});DisposeFunction on<T extends VyuhEvent>(VyuhEventListener<T> listener);Subscribe to events of type T.
void once<T extends VyuhEvent>(VyuhEventListener<T> listener);Subscribe to a single occurrence of an event of type T.
void emit<T extends VyuhEvent>(T event);Emit an event to all subscribers.
ExtensionBuilder
The base type for all extension builders. An extension builder is responsible for building an extension, by assembling all of the extension descriptors.
abstract class ExtensionBuilder<T extends ExtensionDescriptor>Directly declared public members:
final String title;The title of the extension.
final Type extensionType;The runtime Type of the extension.
String? get sourceFeature;The name of the feature which this extension belongs to. This is set by the bootstrapping process of Vyuh.
void setSourceFeature(String featureName);Sets the source feature for this extension builder. This is called by the Vyuh bootstrapping process.
ExtensionBuilder({required this.extensionType, required this.title});Creates a new ExtensionBuilder.
bool get isInitialized;Whether the extension is currently initialized.
bool get isDisposed;Whether the extension has been disposed.
Future<void> onInit(List<T> extensions);Protected method for subclasses to implement initialization logic.
Future<void> onDispose();Protected method for subclasses to implement disposal logic.
void registerLazy(ExtensionDescriptor descriptor);Registers extensions from a lazily-loaded feature. Override in subclasses that support incremental registration. By default this is a no-op.
Future<void> init(List<ExtensionDescriptor> extensions);Initializes the extension.
Future<void> dispose();Disposes the extension.
ExtensionDescriptor
The base type for all extension descriptors. An ExtensionDescriptor provides configurability for an extension.
abstract class ExtensionDescriptorDirectly declared public members:
final String title;The title of the extension.
String? get sourceFeature;The name of the feature which this extension belongs to. This is set by the Vyuh bootstrapping process
void setSourceFeature(String featureName);Sets the source feature for this extension. This is called by the Vyuh bootstrapping process.
ExtensionDescriptor({required this.title});Creates a new ExtensionDescriptor.
void onSourceFeatureUpdated();FeatureDescriptor
The essential descriptor for a feature. A feature descriptor provides the necessary information to register a feature within the framework.
final class FeatureDescriptorDirectly declared public members:
final String name;The name of the feature.
final String title;The title of the feature.
final String? description;The description of the feature.
final IconData? icon;The icon of the feature.
final VoidFutureFunction? init;The function to initialize the feature.
final VoidFutureFunction? dispose;The function to dispose the feature.
final List<ExtensionDescriptor>? extensions;The list of extensions for the feature.
final List<ExtensionBuilder>? extensionBuilders;The list of extension builders exposed by this feature.
final List<String> dependencies;Optional list of feature names that must be initialized before this feature. Used for ordering during initialization. If empty (the default), no ordering constraint is applied.
RouteBuilderFunction? get routes;The routes for the feature.
FeatureDescriptor({required this.name, required this.title, this.description, this.icon, this.init, this.dispose, required RouteBuilderFunction routes, this.extensions, this.extensionBuilders, this.dependencies = const []});Creates a new FeatureDescriptor.
FeatureFlagPlugin
The base class for a Feature Flag plugin. Feature Flags are useful to control the visibility of features in an application. They are setup on the server side and can be controlled by the server to enable/disable features for different users.
abstract class FeatureFlagPlugin<TSettings, TContext> extends PluginDirectly declared public members:
final TSettings settings;The settings for the feature flag plugin.
FeatureFlagPlugin({required this.settings, required super.name, required super.title});Future<bool> getBool(String featureName, {bool defaultValue = false});Returns the value of the feature flag as a boolean.
Future<String> getString(String featureName, {String defaultValue = ''});Returns the value of the feature flag as a string.
Future<int> getInt(String featureName, {int defaultValue = 0});Returns the value of the feature flag as an integer.
Future<double> getDouble(String featureName, {double defaultValue = 0.0});Returns the value of the feature flag as a double.
Future<Map<String, dynamic>> getJson(String featureName, {Map<String, dynamic> defaultValue = const {}});Returns the value of the feature flag as a JSON object represented by a Map.
Future<void> setDefaults(Map<String, dynamic> defaults);Sets the default values for the feature flags. This is useful when the plugin is first initialized and want to set defaults before fetching the actual values.
Future<void> updateContext(TContext context);Updates the context of the feature flag plugin. This could include setting the user id, user attributes, locale, etc.
Future<void> refresh();Refreshes the feature flags. This is useful to force an update on the feature flag values.
FeaturesBuilder
The builder function that creates a set of features.
typedef FeaturesBuilder = FutureOr<List<FeatureDescriptor>> Function();FieldName
Public declaration in this package.
enum FieldNameFileReference
A reference to a file asset in the content management system.
class FileReferenceDirectly declared public members:
final String type;final ObjectReference? asset;FileReference({required this.type, required this.asset});factory FileReference.fromJson(final Map<String, dynamic> json);FromJsonConverter
Function type for converting JSON data to a typed object.
typedef FromJsonConverter<T> = T? Function(Map<String, dynamic> json);GetItDIPlugin
GetItDIPlugin is a class that is final and it extends the DIPlugin. It uses the 'GetIt' package to manage dependency injection in the project.
final class GetItDIPlugin extends DIPluginDirectly declared public members:
final String? debugLabel;GetItDIPlugin({this.debugLabel});Future<void> init();Future<void> dispose();T get<T extends Object>({String? name});bool has<T extends Object>({String? name});void register<T extends Object>(T instance, {String? name});void registerFactory<T extends Object>(T Function() fn, {String? name});void registerLazy<T extends Object>(T Function() fn, {String? name});Future<void> reset();void unregister<T extends Object>({String? name});HttpNetworkConfig
Public declaration in this package.
final class HttpNetworkConfigDirectly declared public members:
final Duration timeout;final int maxRetryAttempts;final Duration maxRetryDelay;const HttpNetworkConfig({required this.timeout, required this.maxRetryAttempts, required this.maxRetryDelay});static const dynamic standard;HttpNetworkPlugin
Public declaration in this package.
final class HttpNetworkPlugin extends NetworkPluginDirectly declared public members:
HttpNetworkPlugin({Client? client, RetryOptions? retryOptions, Duration? timeout, this._webIncludeCredentials = true});Creates an HTTP network plugin.
Future<void> init();Future<void> dispose();Future<Response> get(Uri url, {Map<String, String>? headers});Future<Response> head(Uri url, {Map<String, String>? headers});Future<Response> post(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});Future<Response> put(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});Future<Response> delete(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});Future<Response> patch(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});void close();Future<String> read(Uri url, {Map<String, String>? headers});Future<Uint8List> readBytes(Uri url, {Map<String, String>? headers});Future<StreamedResponse> send(BaseRequest request);ImagePlaceholderBuilder
A builder for an image placeholder widget.
typedef ImagePlaceholderBuilder = Widget Function(BuildContext context,ImageReference
A reference to an image asset in the content management system.
class ImageReferenceDirectly declared public members:
final String type;final ObjectReference? asset;final String? sanityAsset;ImageReference({required this.type, required this.asset, this.sanityAsset});factory ImageReference.fromJson(final Map<String, dynamic> json);InitOncePlugin
Initializes a plugin once per active lifecycle, sharing concurrent calls.
mixin InitOncePlugin on PluginDirectly declared public members:
bool get initialized;Future<void> init();Future<void> dispose();Future<void> initOnce();Future<void> disposeOnce();InitState
The possible states of the system initialization.
enum InitStateLayoutConfiguration
Base class for configuring the visual layout of a content item.
abstract class LayoutConfiguration<T extends ContentItem> implements SchemaItemDirectly declared public members:
final String schemaType;final Type contentType;LayoutConfiguration({required this.schemaType});Creates an instance of LayoutConfiguration.
factory LayoutConfiguration.fromJson(Map<String, dynamic> json);Converts the JSON representation of the layout configuration to an instance of LayoutConfiguration.
Widget build(BuildContext context, T content);Builds the layout widget tree for the given content item.
LayoutFailure
Failure when a layout for a registered content type is missing.
final class LayoutFailure extends ContentFailureDirectly declared public members:
final String contentSchemaType;The content type that needs a layout
final String? requestedLayoutType;The specific layout type that was requested (if any)
const LayoutFailure({required super.schemaType, required this.contentSchemaType, this.requestedLayoutType, super.jsonPayload, super.description, super.suggestions});LazyFeatureDescriptor
Describes a feature that should be loaded lazily — only when one of its route prefixes is first navigated to.
final class LazyFeatureDescriptorDirectly declared public members:
final String name;Unique name for this feature. Must match the inner FeatureDescriptor.name returned by loader.
final String title;Human-readable title shown in the loading UI while the feature is being downloaded and initialized.
final String? description;Optional description of what this feature does.
final IconData? icon;Optional icon for the loading indicator.
final List<String> routePrefixes;Route path prefixes that belong to this feature. When any URL matching these prefixes is navigated to, the feature is loaded.
final DeferredFeatureLoader loader;The function that loads the actual FeatureDescriptor. This is where deferred as loading happens.
final List<String> dependencies;Optional list of feature names this feature depends on. If a dependency is also lazy, it will be loaded first. If a dependency is already loaded (eager or previously loaded lazy), it is skipped.
final String? featureFlag;Optional feature flag name. If provided and a FeatureFlagPlugin is registered, the feature is only loaded when the flag evaluates to true.
LazyFeatureDescriptor({required this.name, required this.title, required this.routePrefixes, required this.loader, this.description, this.icon, this.dependencies = const [], this.featureFlag});LazyFeaturesBuilder
A builder that returns lazy feature descriptors.
typedef LazyFeaturesBuilder = List<LazyFeatureDescriptor> Function();LiveContentProvider
An interface for plugins that provide live content.
abstract class LiveContentProviderDirectly declared public members:
final String title;The title of the live content provider.
const LiveContentProvider({required this.title});Future<void> init();Future<void> dispose();Stream<T?> fetchById<T>(String id, {required FromJsonConverter<T> fromJson, bool includeDrafts = false});Fetches content by ID.
Stream<T?> fetchSingle<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool includeDrafts = false});Fetches content by query, returning a single item.
Stream<List<T>?> fetchMultiple<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool includeDrafts = false});Fetches content by query, returning a list of items.
Stream<RouteBase?> fetchRoute({String? path, String? routeId, bool includeDrafts = false});Fetches content by route.
Loader
A builder for a widget that is shown when the app is loading.
typedef Loader = Widget Function(BuildContext context);LocalContentProvider
Public declaration in this package.
final class LocalContentProvider extends ContentProviderDirectly declared public members:
LocalContentProvider();String schemaType(Map<String, dynamic> json);String fieldValue(String key, Map<String, dynamic> json);Future<T?> fetchById<T>(String id, {required FromJsonConverter<T> fromJson, bool useCache = true});Future<List<T>?> fetchMultiple<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});Future<RouteBase?> fetchRoute({String? path, String? routeId, bool useCache = true});Future<T?> fetchSingle<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});Uri? fileUrl(FileReference fileRef);ImageProvider<Object>? image(ImageReference imageRef, {int? width, int? height, int? devicePixelRatio, int? quality, String? format});Future<void> init();Future<void> dispose();LocaleConfiguration
Configuration for a single locale including its code, native name, and icon
class LocaleConfigurationDirectly declared public members:
final Locale locale;The Flutter locale
final String nativeName;Native name of the language (e.g., "हिन्दी" for Hindi)
final String icon;Icon/emoji representing the locale (e.g., "🇮🇳" for Hindi)
const LocaleConfiguration({required this.locale, required this.nativeName, required this.icon});String get languageCode;Get the language code from the locale
factory LocaleConfiguration.fromCode(String code, {required String nativeName, required String icon});Create from language code with explicit name and icon
LocalePlugin
Plugin for managing internationalization across features
class LocalePlugin extends PluginDirectly declared public members:
final List<LocaleConfiguration> locales;List of supported locale configurations
final Observable<Locale> currentLocale;Raw observable for the current locale (no codegen)
final Observable<bool> isLoadingLocale;Raw observable to track locale loading state (no codegen)
LocaleConfiguration get defaultLocale;Get the default locale configuration
List<Locale> get supportedLocales;Available locales in the application
LocalePlugin({required this.locales, this._defaultLocale});void registerTranslations(TranslationRegistration registration);Register a feature's translation configuration
Future<bool> setLocale(Locale locale);Set the application locale
Future<void> useDeviceLocale();Use the device's locale if supported, otherwise default to configured default
bool isLocaleActive(Locale locale);Check if a specific locale is currently active
String getLocaleName(String localeCode);Get the native name for a locale code
String getLocaleIcon(String localeCode);Get the icon/emoji for a locale code
String get currentLocaleCode;Get the current locale code
int get registrationCount;Number of registered translations
Future<void> init();Future<void> dispose();LogLevel
Public declaration in this package.
enum LogLevelLogger
Public declaration in this package.
abstract interface class LoggerDirectly declared public members:
void trace(dynamic message);void debug(dynamic message);void info(dynamic message);void warn(dynamic message);void error(dynamic message, {Object? error});void fatal(dynamic message, {Object? error, StackTrace? stackTrace});LoggerInterface
A convenience wrapper to provide a Logger interface to the Telemetry reportMessage() calls.
extension LoggerInterface on VyuhBindingDirectly declared public members:
Logger get log;LoginMethod
Represents the method used to login.
enum LoginMethodDirectly declared public members:
IconData icon();Returns the icon for this login method. This is useful only in the developer tools or UI.
String label();Returns the label for this login method. This is useful only in the developer tools or UI.
LoginMethodCanceled
Exception thrown when a login method is canceled.
final class LoginMethodCanceled extends AuthExceptionDirectly declared public members:
final LoginMethod method;The login method that was canceled.
const LoginMethodCanceled(this.method, super.error);Create a new LoginMethodCanceled with the given method and error.
LoginMethodFailure
Exception thrown when a login method fails.
final class LoginMethodFailure extends AuthExceptionDirectly declared public members:
final LoginMethod method;The login method that failed.
const LoginMethodFailure(this.method, super.error);Create a new LoginMethodFailure with the given method and error.
LogoutFailure
Exception thrown when the logout fails.
final class LogoutFailure extends AuthExceptionDirectly declared public members:
const LogoutFailure(super.error);Create a new LogoutFailure with the given error.
ModifierFailure
Failure when a content modifier registration is missing.
final class ModifierFailure extends ContentFailureDirectly declared public members:
final List<String> modifierChain;The complete chain of modifiers being applied
final int failedIndex;The index in the modifier chain where the failure occurred
const ModifierFailure({required super.schemaType, required this.modifierChain, required this.failedIndex, super.jsonPayload, super.description, super.suggestions});NamedBindings
Public declaration in this package.
extension NamedBindings on VyuhBindingDirectly declared public members:
ContentPlugin get content;The content plugin, responsible for managing content-related operations.
DIPlugin get di;The dependency injection plugin, providing dependency injection services.
AnalyticsPlugin get analytics;The analytics plugin, for tracking and reporting analytics data.
TelemetryPlugin get telemetry;The telemetry plugin, used for monitoring and logging telemetry information.
NetworkPlugin get network;The network plugin, for handling network requests and communication.
FeatureFlagPlugin? get featureFlag;The feature flag plugin, used for managing and toggling feature flags. Can be null if the plugin is not registered.
EnvPlugin get env;The environment plugin, providing access to platform-specific environment settings.
EventPlugin get event;The event plugin, for managing and emitting events within the platform.
NamedPlugins
Provides convenient accessors for named plugins within the Vyuh platform.
extension NamedPlugins on VyuhPlatformDirectly declared public members:
ContentPlugin get content;The content plugin, responsible for managing content-related operations.
DIPlugin get di;The dependency injection plugin, providing dependency injection services.
AnalyticsPlugin get analytics;The analytics plugin, for tracking and reporting analytics data.
TelemetryPlugin get telemetry;The telemetry plugin, used for monitoring and logging telemetry information.
NetworkPlugin get network;The network plugin, for handling network requests and communication.
AuthPlugin get auth;The authentication plugin, responsible for user authentication and authorization.
NavigationPlugin get router;The navigation/router plugin, managing navigation within the application.
FeatureFlagPlugin? get featureFlag;The feature flag plugin, used for managing and toggling feature flags. Can be null if the plugin is not registered.
EnvPlugin get env;The environment plugin, providing access to platform-specific environment settings.
EventPlugin get event;The event plugin, for managing and emitting events within the platform.
LocalePlugin? get locale;The locale plugin, providing access to locale settings. Can be null if the plugin is not registered.
NavigationPlugin
Public declaration in this package.
abstract class NavigationPlugin extends PluginDirectly declared public members:
GoRouter get instance;static final dynamic fallbackRoute;NavigationPlugin({required super.name, required super.title});void initRouter({String? initialLocation, required List<g.RouteBase> routes, required GlobalKey<NavigatorState> rootNavigatorKey});void replaceRoutes(List<g.RouteBase> routes);void appendRoutes(List<g.RouteBase> routes);void appendInitialRoutes(List<g.RouteBase> routes);void pop<T extends Object?>([T? result]);void go(String location, {Object? extra});void goNamed(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});Future<T?> push<T extends Object?>(String location, {Object? extra});Future<T?> pushNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});Future<T?> pushReplacement<T extends Object?>(String location, {Object? extra});Future<T?> pushReplacementNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});Future<T?> replace<T extends Object?>(String location, {Object? extra});Future<T?> replaceNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});NetworkPlugin
Base class for implementing network communication in Vyuh applications.
abstract class NetworkPlugin extends Plugin with PreloadedPlugin implements ClientDirectly declared public members:
NetworkPlugin({required super.name, required super.title});Future<Response> get(Uri url, {Map<String, String>? headers});Sends an HTTP GET request to the given URL.
Future<Response> head(Uri url, {Map<String, String>? headers});Sends an HTTP HEAD request to the given URL.
Future<Response> post(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});Sends an HTTP POST request to the given URL.
Future<Response> put(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});Sends an HTTP PUT request to the given URL.
Future<Response> delete(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});Sends an HTTP DELETE request to the given URL.
Future<Response> patch(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});Sends an HTTP PATCH request to the given URL.
NoOpAnalyticsProvider
A no-op implementation of AnalyticsProvider.
final class NoOpAnalyticsProvider implements AnalyticsProviderDirectly declared public members:
String get name;String get title;String get description;Future<void> dispose();Future<void> init();Future<void> reportEvent(String name, {Map<String, dynamic>? params});Future<void> identifyUser(String userId, {Map<String, dynamic>? traits});Future<void> resetUser();List<NavigatorObserver> get observers;NoOpContentPlugin
Public declaration in this package.
final class NoOpContentPlugin extends ContentPluginDirectly declared public members:
NoOpContentPlugin();Widget buildContent<T extends ContentItem>(BuildContext context, T content, {LayoutConfiguration<T>? layout});Widget buildRoute(BuildContext context, {Uri? url, String? routeId});Future<void> dispose();Future<void> init();bool isRegistered<T>(String schemaType);dynamic register<T>(TypeDescriptor<T> descriptor);void attach(ExtensionBuilder extBuilder);T? fromJson<T>(Map<String, dynamic> json);Map<Type, Map<String, TypeDescriptor>> get typeRegistry;NoOpContentProvider
Public declaration in this package.
final class NoOpContentProvider extends ContentProviderDirectly declared public members:
NoOpContentProvider();Future<void> dispose();Future<List<T>?> fetchMultiple<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});Future<RouteBase?> fetchRoute({String? path, String? routeId, bool useCache = true});Future<T?> fetchSingle<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});String fieldValue(String key, Map<String, dynamic> json);ImageProvider? image(ImageReference imageRef, {int? width, int? height, int? devicePixelRatio, int? quality, String? format});Future<void> init();String schemaType(Map<String, dynamic> json);Future<T?> fetchById<T>(String id, {required FromJsonConverter<T> fromJson, bool useCache = true});Uri? fileUrl(FileReference fileRef);NoOpLiveContentProvider
A no-op implementation of LiveContentProvider. Is used internally to ensure the Developer is using it correctly by giving proper errors and hints
final class NoOpLiveContentProvider extends LiveContentProviderDirectly declared public members:
const NoOpLiveContentProvider();Stream<T?> fetchById<T>(String id, {required FromJsonConverter<T> fromJson, bool includeDrafts = false});Stream<T?> fetchSingle<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool includeDrafts = false});Stream<List<T>?> fetchMultiple<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool includeDrafts = false});Stream<RouteBase?> fetchRoute({String? path, String? routeId, bool includeDrafts = false});Future<void> dispose();Future<void> init();NoOpTelemetryProvider
A no-op implementation of TelemetryProvider that can be used for development or testing purposes.
final class NoOpTelemetryProvider implements TelemetryProviderDirectly declared public members:
Future<Trace> startTrace(String name, String operation, {LogLevel? level = LogLevel.info});String get name;String get title;String get description;Future<void> dispose();Future<void> init();Future<void> reportError(exception, {StackTrace? stackTrace, Map<String, dynamic>? params, bool fatal = false});Future<void> reportFlutterError(FlutterErrorDetails details, {bool fatal = false});Future<void> reportMessage(String message, {Map<String, dynamic>? params, LogLevel? level = LogLevel.info});NoOpTrace
A no-op implementation of Trace that can be used for development or testing.
final class NoOpTrace extends TraceDirectly declared public members:
Map<String, String> getAttributes();int getMetric(String name);void setAttributes(Map<String, String> attributes);void setMetric(String name, int value);Future<void> stop();Future<Trace> startChild(String name, String operation, {LogLevel? level = LogLevel.info});OAuthType
Public declaration in this package.
enum OAuthTypeDirectly declared public members:
LoginMethod get loginMethod;ObjectReference
A reference to any content object in the content management system.
class ObjectReferenceDirectly declared public members:
final String type;final String ref;ObjectReference({required this.type, required this.ref});factory ObjectReference.fromJson(Map<String, dynamic> json);PlatformLoggerInterface
Public declaration in this package.
extension PlatformLoggerInterface on VyuhPlatformDirectly declared public members:
Logger get log;PlatformWidgetBuilder
A builder for platform-specific widgets used throughout the Vyuh application.
class PlatformWidgetBuilderDirectly declared public members:
final AppBuilder appBuilder;A builder for the app widget. This becomes the root of the widget tree. Typically this would return a MaterialApp or CupertinoApp.
final Loader appLoader;A loader widget that is shown when the app is loading.
final Loader contentLoader;A loader widget that is shown when the content is loading.
final RouteLoader routeLoader;A loader widget that is shown when a route is loading.
final ImagePlaceholderBuilder imagePlaceholder;A builder for the image placeholder widget.
final RouteErrorViewBuilder routeErrorView;A builder for the route error view widget.
final ErrorViewBuilder errorView;A builder for the error view widget.
final UnknownContentBuilder unknown;A builder for unknown content failures.
PlatformWidgetBuilder({required this.appBuilder, required this.appLoader, required this.contentLoader, required this.routeLoader, required this.errorView, required this.routeErrorView, required this.imagePlaceholder, required this.unknown});Creates a new PlatformWidgetBuilder instance.
PlatformWidgetBuilder copyWith({AppBuilder? appBuilder, Loader? appLoader, Loader? contentLoader, RouteLoader? routeLoader, ImagePlaceholderBuilder? imagePlaceholder, RouteErrorViewBuilder? routeErrorView, ErrorViewBuilder? errorView, UnknownContentBuilder? unknown});Creates a copy of this PlatformWidgetBuilder but with the given fields
static final dynamic system;Plugin
Public declaration in this package.
abstract class PluginDirectly declared public members:
final String name;final String title;Plugin({required this.name, required this.title});Future<void> init();Future<void> dispose();PluginDescriptor
A descriptor for configuring the plugin system in a Vyuh application.
final class PluginDescriptorDirectly declared public members:
List<Plugin> get plugins;PluginDescriptor({final DIPlugin? di, final ContentPlugin? content, final AnalyticsPlugin? analytics, final TelemetryPlugin? telemetry, final NetworkPlugin? network, final AuthPlugin? auth, final NavigationPlugin? navigation, final EnvPlugin? env, final EventPlugin? event, final StoragePlugin? storage, final SecureStoragePlugin? secureStorage, final List<Plugin>? others});static final dynamic systemPluginTypes;static final dynamic system;T? get<T extends Plugin>();PreloadedPlugin
A mixin to mark any plugin to be loaded before the Platform.
mixin PreloadedPlugin on PluginRestartable
Restart the platform, re-running the initialization process.
extension Restartable on VyuhPlatformDirectly declared public members:
Future<void> restart();RootItem
Represents a root item that is the root of a content tree.
abstract interface class RootItem implements ContainerItemRouteBase
Base class for all route content items in Vyuh.
abstract class RouteBase extends ContentItem implements RootItemDirectly declared public members:
final String title;The title of the route, displayed in navigation UI.
final String path;The URL path for this route. This is used to match URLs and generate links.
final Category? category;Optional category for organizing routes.
final RouteTypeConfiguration? routeType;Configuration for how this route should be presented. Defines transitions, animations, and other route-specific behavior.
final String id;Unique identifier for this route.
final DateTime updatedAt;When this route was last updated in the CMS.
final DateTime createdAt;When this route was created in the CMS.
RouteBase({required super.schemaType, this.routeType, required this.title, required this.path, this.category, required this.createdAt, required this.updatedAt, required this.id, required super.layout, required super.modifiers});factory RouteBase.fromJson(Map<String, dynamic> json);Future<RouteBase?> init(BuildContext context);Initialize the route when it becomes active.
Future<void> dispose();Clean up the route when it is no longer active.
Page<T> createPage<T>(BuildContext context, [LocalKey? pageKey]);Create a Flutter page for this route.
LayoutConfiguration? getLayout();List<ContentModifierConfiguration>? getModifiers();RouteBuilderFunction
A function that returns a list of routes.
typedef RouteBuilderFunction = FutureOr<List<g.RouteBase>?> Function();RouteErrorViewBuilder
A builder for a route error view widget.
typedef RouteErrorViewBuilder = Widget Function( BuildContext context,RouteLifecycleConfiguration
Configuration for managing route lifecycle events.
abstract class RouteLifecycleConfiguration implements SchemaItemDirectly declared public members:
final String schemaType;final String? title;RouteLifecycleConfiguration({this.title, required this.schemaType});Future<void> init(BuildContext context, RouteBase route);Future<void> dispose();RouteLoader
A builder for a widget that is shown when a route is loading.
typedef RouteLoader = Widget Function(BuildContext context, [Uri? url, String? routeId]);RouteObservers
Public declaration in this package.
mixin RouteObservers on PluginDirectly declared public members:
List<NavigatorObserver> get observers;RouteTypeConfiguration
Configuration for how a route should be presented.
abstract class RouteTypeConfiguration implements SchemaItemDirectly declared public members:
final String? title;final String schemaType;RouteTypeConfiguration({this.title, required this.schemaType});Page<T> create<T>(Widget child, RouteBase route, [LocalKey? pageKey]);RoutingConfigNotifier
Public declaration in this package.
final class RoutingConfigNotifier extends ValueNotifier<g.RoutingConfig>Directly declared public members:
final g.GoRouterRedirect? redirect;RoutingConfigNotifier(List<g.RouteBase> routes, {this.redirect});void setRoutes(List<g.RouteBase> routes);SchemaItem
The base interface for all schema-driven content items.
abstract interface class SchemaItemDirectly declared public members:
String get schemaType;The schema type of the content item.
SecureStoragePlugin
Base class for implementing secure storage in Vyuh applications.
abstract class SecureStoragePlugin extends PluginDirectly declared public members:
SecureStoragePlugin({required super.name, required super.title});Future<dynamic> read(String key);Reads a value from secure storage by its key.
Future<dynamic> write(String key, dynamic value);Writes a value to secure storage with the given key.
Future<bool> has(String key);Checks if a key exists in secure storage.
Future<bool> delete(String key);Deletes a value from secure storage by its key.
SendEmailLinkFailure
Exception thrown when sending an email-link for logging in.
final class SendEmailLinkFailure extends AuthExceptionDirectly declared public members:
const SendEmailLinkFailure(super.error);Create a new SendEmailLinkFailure with the given error.
SendPasswordResetEmailFailure
Exception thrown when sending a password reset email.
final class SendPasswordResetEmailFailure extends AuthExceptionDirectly declared public members:
const SendPasswordResetEmailFailure(super.error);Create a new SendPasswordResetEmailFailure with the given error.
StoragePlugin
Base class for implementing persistent storage in Vyuh applications.
abstract class StoragePlugin extends PluginDirectly declared public members:
StoragePlugin({required super.name, required super.title});Future<dynamic> read(String key);Reads a value from storage by its key.
Future<dynamic> write(String key, dynamic value);Writes a value to storage with the given key.
Future<bool> has(String key);Checks if a key exists in storage.
Future<bool> delete(String key);Deletes a value from storage by its key.
SystemInitTracker
A tracker for the system initialization process.
abstract interface class SystemInitTrackerDirectly declared public members:
VyuhPlatform get platform;The platform that is being initialized.
Observable<InitState> get currentState;The current state of the initialization process.
FutureStatus? get status;The status of the future that is being awaited.
dynamic get error;The error that occurred during initialization.
Future<void> init([InitState initialState]);Initializes the system.
SystemReadyEvent
An event indicating that the system is ready.
final class SystemReadyEvent extends VyuhEvent<void>Directly declared public members:
SystemReadyEvent();Creates a new SystemReadyEvent.
TelemetryPlugin
The default implementation for a Telemetry Plugin.
final class TelemetryPlugin extends Plugin with PreloadedPlugin, InitOncePlugin implements TelemetryProviderDirectly declared public members:
final List<TelemetryProvider> providers;The list of providers for the plugin.
String get description;TelemetryPlugin({required this.providers});Creates a new TelemetryPlugin.
Future<void> initOnce();Future<void> disposeOnce();Future<Trace> startTrace(String name, String operation, {LogLevel? level = LogLevel.info});Future<void> reportError(exception, {StackTrace? stackTrace, Map<String, dynamic>? params, bool fatal = false});Future<void> reportFlutterError(FlutterErrorDetails details, {bool fatal = false});Future<void> reportMessage(String message, {Map<String, dynamic>? params, LogLevel? level = LogLevel.info});Future<T?> trace<T>({required String name, required String operation, required FutureOr<T?> Function(Trace? parentTrace) fn, Trace? parentTrace, LogLevel? level = LogLevel.info});Runs a function with a trace. This is useful for wrapping functions that need to be traced. It can also be part of a nested trace, using the parentTrace parameter.
TelemetryProvider
The base interface for an Telemetry Provider. The provider is responsible for reporting telemetry events, errors, and messages.
abstract interface class TelemetryProviderDirectly declared public members:
String get name;The name of the provider.
String get title;The title of the provider.
String get description;The description of the provider.
Future<void> init();Initializes the provider.
Future<void> dispose();Disposes the provider.
Future<void> reportError(dynamic exception, {StackTrace? stackTrace, Map<String, dynamic>? params, bool fatal = false});Reports an error with an optional stack trace and parameters.
Future<void> reportFlutterError(FlutterErrorDetails details, {bool fatal = false});Reports a Flutter error with optional parameters.
Future<void> reportMessage(String message, {Map<String, dynamic>? params, LogLevel? level = LogLevel.info});Reports a message with optional parameters.
Future<Trace> startTrace(String name, String operation, {LogLevel? level = LogLevel.info});Starts a trace with a specific name and operation.
Trace
The base interface for a Telemetry Trace. The trace is responsible for tracking the duration of an operation, and reporting metrics and attributes.
abstract class TraceDirectly declared public members:
Future<void> stop();Stops or finalizes the trace.
void setMetric(String name, int value);Sets a metric with a specific name and value.
int getMetric(String name);Gets a metric with a specific name.
void setAttributes(Map<String, String> attributes);Sets an attribute with a specific name and value.
Map<String, String> getAttributes();Gets all attributes set so far in the trace.
Future<Trace> startChild(String name, String operation, {LogLevel? level = LogLevel.info});Starts a child trace with a specific name and operation.
TranslationRegistration
Registration for feature-specific translations
class TranslationRegistrationDirectly declared public members:
final String name;Name of the translation system (for debugging)
final Future<void> Function(Locale locale) onLocaleChange;Callback when locale changes (async to support deferred loading)
const TranslationRegistration({required this.name, required this.onLocaleChange});TypeDescriptor
Describes a schema type and its serialization behavior.
class TypeDescriptor<T>Directly declared public members:
final String title;Human-readable name for this type.
final String schemaType;Schema type identifier from the CMS.
final FromJsonConverter<T> fromJson;Function to convert JSON data to an instance of T.
final T Function()? preview;Optional function to create a preview instance.
final Type type;The runtime type of T.
String? get sourceFeature;void setSourceFeature(String? featureName);Updates the source feature for this type descriptor.
TypeDescriptor({required this.schemaType, required this.fromJson, required this.title, this.preview});Creates a new type descriptor.
bool ==(Object other);int get hashCode;UnknownContentBuilder
A builder for unknown content failures.
typedef UnknownContentBuilder = Widget Function(BuildContext context, ContentFailure failure);UnknownContentItem
Internal marker class for unknown content items.
final class UnknownContentItem extends ContentItemDirectly declared public members:
static const dynamic schemaName;final String missingSchemaType;final Map<String, dynamic> jsonPayload;UnknownContentItem({required this.missingSchemaType, required this.jsonPayload});UnknownPlaceholderFactory
Factory function for creating unknown placeholders for different types. This is set by the extension_content package to provide unknown placeholders for ActionConfiguration, ConditionConfiguration, etc.
typedef UnknownPlaceholderFactory = SchemaItem? Function( Type type, String missingSchemaType, Map<String, dynamic> jsonPayload, );User
Represents a user of the application.
class UserDirectly declared public members:
final String id;The unique identifier of the user.
final String? name;The name of the user. This could include the first name, last name or display name.
final String? email;The email of the user.
final String? phoneNumber;The phone number of the user.
final String? photoUrl;The URL of the user's photo.
final LoginMethod loginMethod;The method used to login.
final DateTime? lastSignInTime;The last sign-in time of the user.
final DateTime? creationTime;The creation time of the user.
const User({required this.loginMethod, required this.id, this.name, this.email, this.phoneNumber, this.photoUrl, this.lastSignInTime, this.creationTime});Create a new user with the given parameters.
bool get isUnknown;Returns true if this user is the unknown user.
static const dynamic unknown;A constant unknown user.
VoidFutureFunction
A function that returns a void Future.
typedef VoidFutureFunction = Future<void> Function();VyuhBinding
Public declaration in this package.
final class VyuhBindingDirectly declared public members:
static VyuhBinding get instance;List<Plugin> get plugins;final PlatformWidgetBuilder widgetBuilder;final Future<void> widgetReady;bool get initInvoked;bool get initialized;void widgetInit({PluginDescriptor? plugins, PlatformWidgetBuilder? widgetBuilder, required ExtensionBuilder extensionBuilder, required List<ExtensionDescriptor> extensionDescriptors, Future<void> Function(VyuhBinding)? onReady});Purely meant to be called with running Vyuh in widget-mode, using VyuhContentWidget. There is a convenience API inside vyuh_extension_content to make this easier. Use the VyuhContentBinding.init() instead.
Future<void> dispose();T? get<T extends Plugin>();VyuhEvent
Base class for all events in a Vyuh application.
class VyuhEvent<T>Directly declared public members:
final String name;The name of the event, used for identification and logging.
final DateTime timestamp;When the event was created.
final T? data;Optional data associated with the event.
VyuhEvent({required this.name, this.data});VyuhEventListener
A function that handles events of type T.
typedef VyuhEventListener<T extends VyuhEvent> = void Function(T event);VyuhPlatform
The base class for the Vyuh Platform. This class is responsible for initializing the platform and managing the lifecycle of the platform.
abstract class VyuhPlatformDirectly declared public members:
List<FeatureDescriptor> get features;A list of features currently registered and available on the platform.
List<Plugin> get plugins;A list of plugins available to the platform. Plugins provide extended functionalities and services to the platform.
PlatformWidgetBuilder get widgetBuilder;A builder function that creates platform-specific widgets. This allows for flexible UI customization based on the platform.
GlobalKey<NavigatorState> get rootNavigatorKey;The root navigator key. Used by the router plugin for navigation management within the application.
SystemInitTracker get tracker;Tracks the initialization status of the platform, including its features and plugins.
Future<void>? featureReady(String featureName);Verifies or waits for the specified feature to become ready.
Future<void> run();Initializes and runs the platform. This method is internally managed and should not be called directly.
Future<void> initPlugins(Trace parentTrace);Initializes the registered plugins for the platform. This method is internally managed and should not be called directly.
Future<void> initFeatures(Trace parentTrace);Initializes the features for the platform. This method is internally managed and should not be called directly.
T? getPlugin<T extends Plugin>();Retrieves a specific plugin instance based on the requested type T. Returns null if no plugin of the specified type is registered. There are named extensions already available for all the standard plugins. You use this method when writing a custom plugin which needs to be exposed with a named extension. Refer to the NamedPlugins extension for a practical example of exposing a named reference to a plugin.
ExtensionBuilder? extensionBuilder<T extends ExtensionDescriptor>();Gets the ExtensionBuilder given an extensionType
bool isFeatureLoaded(String featureName);Whether a feature (eager or lazy) has been loaded and is ready.
Future<void> loadFeature(String featureName);Programmatically load a lazy feature by name. If the feature is already loaded (eager or lazy), this is a no-op. Throws StateError if no feature with the given name is registered.
Future<void> dispose();debugAssertOneOfPathOrRouteId
Asserts only one of path or routeId is provided and not both. Asserts that only one of path or routeId is provided.
void debugAssertOneOfPathOrRouteId(String? path, String? routeId)defaultAppRunner
The default app runner that initializes Flutter bindings and runs the app using flutter.runApp.
void defaultAppRunner(Widget app)defaultRoutePageBuilder
The default page builder for CMS routes.
Page<dynamic> defaultRoutePageBuilder(BuildContext context, GoRouterState state, {Widget Function(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child)? transitionsBuilder, Duration? transitionDuration})fieldKeyMap
Public declaration in this package.
const fieldKeyMap =listFromJson
Converts a JSON list to a nullable-list of SchemaItem instances of type T.
List<T>? listFromJson<T extends SchemaItem>(dynamic json)messages
Public declaration in this package.
final messages =readValue
Reads a value from a JSON object using the provided key.
Object? readValue(dynamic json, String key)runApp
The main entry point to kick off the Vyuh Application. This function should be called from the main function of the application. It initializes the Vyuh Platform and runs the application with given features and plugins.
void runApp({required FeaturesBuilder features, LazyFeaturesBuilder? lazyFeatures, PluginDescriptor? plugins, PlatformWidgetBuilder? platformWidgetBuilder, String? initialLocation, AppRunner? appRunner})setUnknownPlaceholderFactory
Sets the factory for creating unknown placeholders.
void setUnknownPlaceholderFactory(UnknownPlaceholderFactory factory)typeFromFirstOfListJson
Converts a JSON object to a nullable-instance of SchemaItem of type T.
T? typeFromFirstOfListJson<T extends SchemaItem>(dynamic json)vyuh
The platform interface for Vyuh. This tracks the instance of the platform and can be used to access various aspects of the framework.
VyuhPlatform vyuh = _UninitializedPlatform();