Skip to content

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

Package source · Released API

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 ​

Source

Failure when an action configuration registration is missing.

dart
final class ActionFailure extends ContentFailure

Directly declared public members:

dart
final Map<String, dynamic>? actionConfig;

The action configuration that failed to resolve

dart
const ActionFailure({required super.schemaType, this.actionConfig, super.jsonPayload, super.description, super.suggestions});

AnalyticsPlugin ​

Source

The default implementation of analytics tracking in Vyuh applications.

dart
final class AnalyticsPlugin extends Plugin with PreloadedPlugin, InitOncePlugin, RouteObservers implements AnalyticsProvider

Directly declared public members:

dart
final List<AnalyticsProvider> providers;

The list of analytics providers managed by this plugin.

dart
String get description;
dart
List<NavigatorObserver> get observers;

Navigation observers for automatic route tracking.

dart
AnalyticsPlugin({required this.providers});

Creates a new AnalyticsPlugin with the given providers.

dart
Future<void> initOnce();

Initializes all analytics providers.

dart
Future<void> disposeOnce();

Disposes all analytics providers.

dart
Future<void> reportEvent(String name, {Map<String, dynamic>? params});

Reports an analytics event to all providers.

dart
Future<void> identifyUser(String userId, {Map<String, dynamic>? traits});

Identifies a user across all analytics providers.

dart
Future<void> resetUser();

Resets the user identity across all analytics providers.

AnalyticsProvider ​

Source

The base interface for an Analytics Provider. The provider is responsible for reporting analytics events, errors, and messages.

dart
abstract interface class AnalyticsProvider

Directly declared public members:

dart
List<NavigatorObserver> get observers;

The list of observers for the provider. These are added to the navigator, as part of the router setup.

dart
String get name;

The name of the provider.

dart
String get title;

The title of the provider.

dart
String get description;

The description of the provider.

dart
Future<void> init();

Initializes the provider.

dart
Future<void> dispose();

Disposes the provider.

dart
Future<void> reportEvent(String name, {Map<String, dynamic>? params});

Reports an event with a specific name and optional parameters.

dart
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.

dart
Future<void> resetUser();

Clears the current user identification and associated traits. This should be called when the user logs out.

AppBuilder ​

Source

A builder for root Widget of the application. Typically this would be a MaterialApp or CupertinoApp.

dart
typedef AppBuilder = Widget Function(BuildContext context, VyuhPlatform platform);

AppRunner ​

Source

A function that takes a Widget and runs the application.

dart
typedef AppRunner = void Function(Widget app);

AsyncLazyDI ​

Source

An extension on the DIPlugin class to provide asynchronous lazy dependency injection.

dart
extension AsyncLazyDI on DIPlugin

Directly declared public members:

dart
void registerAsync<T extends Object>(Future<T> Function() fn, {String? name});

Registers a lazily initialized asynchronous dependency in the dependency injection container.

dart
Future<T> getAsync<T extends Object>({String? name});

Retrieves an asynchronously initialized dependency from the dependency injection container.

AuthException ​

Source

Base type for all Authentication related exceptions.

dart
abstract class AuthException implements Exception

Directly declared public members:

dart
const AuthException(this.error);

Create an exception with the given error.

dart
final Object error;

The error that caused this exception.

dart
String toString();

AuthPlugin ​

Source

An authentication plugin that supports various authentication methods.

dart
abstract class AuthPlugin extends Plugin

Directly declared public members:

dart
var dynamic controller;

The controller for the user changes stream.

dart
String get token;
dart
String get refreshToken;
dart
AuthPlugin({required super.name, required super.title});

Creates an instance of AuthPlugin.

dart
User get currentUser;

The current user that is signed in.

dart
Stream<User> get userChanges;

A stream of user changes.

dart
void setCurrentUser(User user);
dart
Future<void> dispose();
dart
Future<void> init();
dart
Future<void> loginAnonymously();
dart
Future<void> sendOtp({required String phoneNumber});
dart
Future<void> loginWithPhoneOtp({required String phoneNumber, required String otp});
dart
Future<void> loginWithEmailPassword({required String email, required String password});
dart
Future<void> registerWithEmailPassword({required String email, required String password});
dart
Future<void> sendEmailLink({required String email, required String clientId});
dart
Future<void> sendPasswordResetEmail({required String email});
dart
Future<void> loginWithEmailLink({required String email, required String link});
dart
Future<void> loginWithOAuth(OAuthType type);
dart
Future<void> logout();

Logs out the current user.

dart
Future<bool> refreshSession();

Attempts to refresh the current session token.

dart
Future<void> deleteAccount();

Deletes the current user account.

CMSPathResolver ​

Source

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)

dart
typedef CMSPathResolver = String Function(String path);

CMSRoute ​

Source

A route purely meant to identify CMS pages. Use it to distinguish between the way local routes and CMS routes are handled.

dart
final class CMSRoute extends GoRoute

Directly declared public members:

dart
final CMSPathResolver cmsPathResolver;

A function that resolves a CMS path from a local path.

dart
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 ​

Source

A category for organizing routes.

dart
class Category implements SchemaItem

Directly declared public members:

dart
String get schemaType;
dart
final String identifier;
dart
final String title;
dart
final LayoutConfiguration? layout;
dart
final List<ContentModifierConfiguration>? modifiers;
dart
static List<ContentModifierConfiguration>? modifierList(dynamic json);
dart
Category({required this.identifier, required this.title, this.layout, this.modifiers});
dart
factory Category.fromJson(Map<String, dynamic> json);

ConditionFailure ​

Source

Failure when a condition configuration registration is missing.

dart
final class ConditionFailure extends ContentFailure

Directly declared public members:

dart
final Map<String, dynamic>? conditionConfig;

The condition configuration that failed to resolve

dart
const ConditionFailure({required super.schemaType, this.conditionConfig, super.jsonPayload, super.description, super.suggestions});

ContainerItem ​

Source

Represents a container item that can contain other content items.

dart
abstract interface class ContainerItem implements ContentItem

ContentFailure ​

Source

Base class for content-related failures in the Vyuh framework.

dart
abstract class ContentFailure

Directly declared public members:

dart
final String schemaType;

The schema type that failed to resolve

dart
final Map<String, dynamic>? jsonPayload;

The original JSON payload that caused the failure (if available)

dart
final String? description;

Human-readable description of the failure

dart
final List<String>? suggestions;

Optional suggestions for resolving the failure

dart
const ContentFailure({required this.schemaType, this.jsonPayload, this.description, this.suggestions});

ContentItem ​

Source

The base class for all content items in Vyuh.

dart
abstract class ContentItem implements SchemaItem

Directly declared public members:

dart
final String schemaType;
dart
final LayoutConfiguration? layout;

The layout configuration for the content item.

dart
final List<ContentModifierConfiguration>? modifiers;
dart
static List<ContentModifierConfiguration>? modifierList(dynamic json);
dart
ContentItem? parent;

The parent content item of this content item. This is used internally by the content system.

dart
ContentItem({required this.schemaType, required this.layout, required this.modifiers});

Creates an instance of ContentItem.

dart
factory ContentItem.fromJson(Map<String, dynamic> json);

Converts the JSON representation of the content item to an instance of ContentItem.

dart
void setParent(Iterable<ContentItem?> children);

Sets the parent content item for the given list of children.

dart
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.

dart
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 ​

Source

Failure when a ContentItem type registration is missing.

dart
final class ContentItemFailure extends ContentFailure

Directly declared public members:

dart
const ContentItemFailure({required super.schemaType, super.jsonPayload, super.description, super.suggestions});

ContentModifierConfiguration ​

Source

Configuration for modifying content presentation.

dart
abstract class ContentModifierConfiguration implements SchemaItem

Directly declared public members:

dart
final String schemaType;
dart
ContentModifierConfiguration({required this.schemaType});
dart
factory ContentModifierConfiguration.fromJson(Map<String, dynamic> json);
dart
Widget build(BuildContext context, Widget child, ContentItem content);

Builds the modifier widget tree for the given content item.

ContentPlugin ​

Source

The base class for a Content Plugin

dart
abstract class ContentPlugin extends Plugin

Directly declared public members:

dart
final ContentProvider provider;

The ContentProvider for this plugin

dart
ContentPlugin({required this.provider, required super.name, required super.title});

Creates a new ContentPlugin with the given provider, name, and title

dart
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.

dart
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

dart
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.

dart
void attach(ExtensionBuilder extBuilder);

Sets up the plugin with the ContentExtensionBuilder. The plugin relies on the ContentExtensionBuilder to do its work.

dart
T? fromJson<T>(Map<String, dynamic> json);

Converts the given json to an item of type T

dart
void register<T>(TypeDescriptor<T> descriptor);

Registers the given type descriptor

dart
bool isRegistered<T>(String schemaType);

Checks if the given schema type is registered for type T

ContentProvider ​

Source

Public declaration in this package.

dart
abstract class ContentProvider

Directly declared public members:

dart
final String name;
dart
final String title;
dart
final LiveContentProvider live;
dart
ContentProvider({required this.name, required this.title, this.live = const NoOpLiveContentProvider()});
dart
bool get supportsLive;
dart
String fieldValue(String key, Map<String, dynamic> json);
dart
String schemaType(Map<String, dynamic> json);
dart
Future<void> init();
dart
Future<void> dispose();
dart
ImageProvider? image(final ImageReference imageRef, {final int? width, final int? height, final int? devicePixelRatio, final int? quality, final String? format});
dart
Uri? fileUrl(final FileReference fileRef);
dart
Future<T?> fetchById<T>(String id, {required FromJsonConverter<T> fromJson, bool useCache = true});
dart
Future<T?> fetchSingle<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});
dart
Future<List<T>?> fetchMultiple<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});
dart
Future<RouteBase?> fetchRoute({String? path, String? routeId, bool useCache = true});

CreateUserFailure ​

Source

Exception thrown when creating a user fails.

dart
final class CreateUserFailure extends AuthException

Directly declared public members:

dart
const CreateUserFailure(super.error);

DIPlugin ​

Source

DIPlugin is an abstract class that extends the Plugin class.

dart
abstract class DIPlugin extends Plugin

Directly declared public members:

dart
DIPlugin({required super.name, required super.title});

Constructs a DIPlugin instance with the given name and title.

dart
void register<T extends Object>(T instance, {String? name});

Registers an instance of any Object type with the DI container.

dart
void registerLazy<T extends Object>(T Function() fn, {String? name});

Registers a function that produces an instance of any Object type.

dart
void registerFactory<T extends Object>(T Function() fn, {String? name});

Registers a factory function that produces a new instance each time it is called.

dart
void unregister<T extends Object>({String? name});

Removes the instance of the specified type from the DI container.

dart
T get<T extends Object>({String? name});

Retrieves the registered instance of type T from the DI container.

dart
bool has<T extends Object>({String? name});

Checks if an instance of the specified type is registered in the DI container.

dart
Future<void> reset();

Clears all instances registered in the DI container.

DefaultEnvPlugin ​

Source

Public declaration in this package.

dart
final class DefaultEnvPlugin extends EnvPlugin

Directly declared public members:

dart
final String fileName;
dart
final Map<String, String> defaults;
dart
DefaultEnvPlugin({this.fileName = '.env', this.defaults = const {}});
dart
Future<void> init();
dart
Map<String, String> all();
dart
dynamic clear();
dart
Future<void> dispose();
dart
String get(String key, {String? fallback});
dart
String? maybeGet(String key, {String? fallback});

DefaultEventPlugin ​

Source

Default implementation of EventPlugin using the event_bus package.

dart
final class DefaultEventPlugin extends EventPlugin

Directly declared public members:

dart
DefaultEventPlugin();
dart
void emit<T extends VyuhEvent>(T event);
dart
DisposeFunction on<T extends VyuhEvent>(VyuhEventListener<T> listener);
dart
void once<T extends VyuhEvent>(VyuhEventListener<T> listener);
dart
Future<void> dispose();
dart
Future<void> init();

DefaultNavigationPlugin ​

Source

Public declaration in this package.

dart
final class DefaultNavigationPlugin extends NavigationPlugin

Directly declared public members:

dart
final bool includeFallbackRoute;
dart
DefaultNavigationPlugin({this.includeFallbackRoute = true, final bool urlReflectsImperativeAPIs = false, g.GoRouterRedirect? redirect});
dart
GoRouter get instance;
dart
static void enableURLReflectsImperativeAPIs();
dart
static void usePathStrategy();
dart
static void useHashStrategy();
dart
static void setRouterRedirect(g.GoRouterRedirect redirect);
dart
void initRouter({String? initialLocation, required List<g.RouteBase> routes, required GlobalKey<NavigatorState> rootNavigatorKey});
dart
dynamic replaceRoutes(List<g.RouteBase> routes);
dart
void appendInitialRoutes(List<g.RouteBase> routes);
dart
dynamic appendRoutes(List<g.RouteBase> routes);
dart
Future<void> init();
dart
Future<void> dispose();
dart
void go(String location, {Object? extra});
dart
void goNamed(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});
dart
void pop<T extends Object?>([T? result]);
dart
Future<T?> push<T extends Object?>(String location, {Object? extra});
dart
Future<T?> pushNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});
dart
Future<T?> pushReplacement<T extends Object?>(String location, {Object? extra});
dart
Future<T?> pushReplacementNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});
dart
Future<T?> replace<T extends Object?>(String location, {Object? extra});
dart
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 ​

Source

A callback that loads a FeatureDescriptor, potentially using Dart's deferred import mechanism for web code splitting.

dart
typedef DeferredFeatureLoader = Future<FeatureDescriptor> Function();

DeleteAccountFailure ​

Source

Exception thrown when the account deletion fails.

dart
final class DeleteAccountFailure extends AuthException

Directly declared public members:

dart
const DeleteAccountFailure(super.error);

Create a new DeleteAccountFailure with the given error.

DisposeFunction ​

Source

A function that can be called to dispose of (cancel) an event subscription.

dart
typedef DisposeFunction = void Function();

DocumentItem ​

Source

The base interface for all schema-driven document items.

dart
abstract interface class DocumentItem implements SchemaItem

EnvPlugin ​

Source

An abstract class representing an environment plugin. It provides methods to interact with environment variables.

dart
abstract class EnvPlugin extends Plugin

Directly declared public members:

dart
EnvPlugin({required super.name, required super.title});

Constructs an EnvPlugin with the given name and title.

dart
Map<String, String?> all();

Returns a map of all environment variables.

dart
String get(String key, {String? fallback});

Returns the value of the environment variable specified by key, or the fallback value if not found.

dart
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.

dart
void clear();

Clears all the environment variables.

ErrorViewBuilder ​

Source

A builder for an error view widget.

dart
typedef ErrorViewBuilder = Widget Function( BuildContext context,

EventPlugin ​

Source

Base class for implementing event handling in Vyuh applications.

dart
abstract class EventPlugin extends Plugin with PreloadedPlugin

Directly declared public members:

dart
EventPlugin({required super.name, required super.title});
dart
DisposeFunction on<T extends VyuhEvent>(VyuhEventListener<T> listener);

Subscribe to events of type T.

dart
void once<T extends VyuhEvent>(VyuhEventListener<T> listener);

Subscribe to a single occurrence of an event of type T.

dart
void emit<T extends VyuhEvent>(T event);

Emit an event to all subscribers.

ExtensionBuilder ​

Source

The base type for all extension builders. An extension builder is responsible for building an extension, by assembling all of the extension descriptors.

dart
abstract class ExtensionBuilder<T extends ExtensionDescriptor>

Directly declared public members:

dart
final String title;

The title of the extension.

dart
final Type extensionType;

The runtime Type of the extension.

dart
String? get sourceFeature;

The name of the feature which this extension belongs to. This is set by the bootstrapping process of Vyuh.

dart
void setSourceFeature(String featureName);

Sets the source feature for this extension builder. This is called by the Vyuh bootstrapping process.

dart
ExtensionBuilder({required this.extensionType, required this.title});

Creates a new ExtensionBuilder.

dart
bool get isInitialized;

Whether the extension is currently initialized.

dart
bool get isDisposed;

Whether the extension has been disposed.

dart
Future<void> onInit(List<T> extensions);

Protected method for subclasses to implement initialization logic.

dart
Future<void> onDispose();

Protected method for subclasses to implement disposal logic.

dart
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.

dart
Future<void> init(List<ExtensionDescriptor> extensions);

Initializes the extension.

dart
Future<void> dispose();

Disposes the extension.

ExtensionDescriptor ​

Source

The base type for all extension descriptors. An ExtensionDescriptor provides configurability for an extension.

dart
abstract class ExtensionDescriptor

Directly declared public members:

dart
final String title;

The title of the extension.

dart
String? get sourceFeature;

The name of the feature which this extension belongs to. This is set by the Vyuh bootstrapping process

dart
void setSourceFeature(String featureName);

Sets the source feature for this extension. This is called by the Vyuh bootstrapping process.

dart
ExtensionDescriptor({required this.title});

Creates a new ExtensionDescriptor.

dart
void onSourceFeatureUpdated();

FeatureDescriptor ​

Source

The essential descriptor for a feature. A feature descriptor provides the necessary information to register a feature within the framework.

dart
final class FeatureDescriptor

Directly declared public members:

dart
final String name;

The name of the feature.

dart
final String title;

The title of the feature.

dart
final String? description;

The description of the feature.

dart
final IconData? icon;

The icon of the feature.

dart
final VoidFutureFunction? init;

The function to initialize the feature.

dart
final VoidFutureFunction? dispose;

The function to dispose the feature.

dart
final List<ExtensionDescriptor>? extensions;

The list of extensions for the feature.

dart
final List<ExtensionBuilder>? extensionBuilders;

The list of extension builders exposed by this feature.

dart
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.

dart
RouteBuilderFunction? get routes;

The routes for the feature.

dart
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 ​

Source

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.

dart
abstract class FeatureFlagPlugin<TSettings, TContext> extends Plugin

Directly declared public members:

dart
final TSettings settings;

The settings for the feature flag plugin.

dart
FeatureFlagPlugin({required this.settings, required super.name, required super.title});
dart
Future<bool> getBool(String featureName, {bool defaultValue = false});

Returns the value of the feature flag as a boolean.

dart
Future<String> getString(String featureName, {String defaultValue = ''});

Returns the value of the feature flag as a string.

dart
Future<int> getInt(String featureName, {int defaultValue = 0});

Returns the value of the feature flag as an integer.

dart
Future<double> getDouble(String featureName, {double defaultValue = 0.0});

Returns the value of the feature flag as a double.

dart
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.

dart
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.

dart
Future<void> updateContext(TContext context);

Updates the context of the feature flag plugin. This could include setting the user id, user attributes, locale, etc.

dart
Future<void> refresh();

Refreshes the feature flags. This is useful to force an update on the feature flag values.

FeaturesBuilder ​

Source

The builder function that creates a set of features.

dart
typedef FeaturesBuilder = FutureOr<List<FeatureDescriptor>> Function();

FieldName ​

Source

Public declaration in this package.

dart
enum FieldName

FileReference ​

Source

A reference to a file asset in the content management system.

dart
class FileReference

Directly declared public members:

dart
final String type;
dart
final ObjectReference? asset;
dart
FileReference({required this.type, required this.asset});
dart
factory FileReference.fromJson(final Map<String, dynamic> json);

FromJsonConverter ​

Source

Function type for converting JSON data to a typed object.

dart
typedef FromJsonConverter<T> = T? Function(Map<String, dynamic> json);

GetItDIPlugin ​

Source

GetItDIPlugin is a class that is final and it extends the DIPlugin. It uses the 'GetIt' package to manage dependency injection in the project.

dart
final class GetItDIPlugin extends DIPlugin

Directly declared public members:

dart
final String? debugLabel;
dart
GetItDIPlugin({this.debugLabel});
dart
Future<void> init();
dart
Future<void> dispose();
dart
T get<T extends Object>({String? name});
dart
bool has<T extends Object>({String? name});
dart
void register<T extends Object>(T instance, {String? name});
dart
void registerFactory<T extends Object>(T Function() fn, {String? name});
dart
void registerLazy<T extends Object>(T Function() fn, {String? name});
dart
Future<void> reset();
dart
void unregister<T extends Object>({String? name});

HttpNetworkConfig ​

Source

Public declaration in this package.

dart
final class HttpNetworkConfig

Directly declared public members:

dart
final Duration timeout;
dart
final int maxRetryAttempts;
dart
final Duration maxRetryDelay;
dart
const HttpNetworkConfig({required this.timeout, required this.maxRetryAttempts, required this.maxRetryDelay});
dart
static const dynamic standard;

HttpNetworkPlugin ​

Source

Public declaration in this package.

dart
final class HttpNetworkPlugin extends NetworkPlugin

Directly declared public members:

dart
HttpNetworkPlugin({Client? client, RetryOptions? retryOptions, Duration? timeout, this._webIncludeCredentials = true});

Creates an HTTP network plugin.

dart
Future<void> init();
dart
Future<void> dispose();
dart
Future<Response> get(Uri url, {Map<String, String>? headers});
dart
Future<Response> head(Uri url, {Map<String, String>? headers});
dart
Future<Response> post(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});
dart
Future<Response> put(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});
dart
Future<Response> delete(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});
dart
Future<Response> patch(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});
dart
void close();
dart
Future<String> read(Uri url, {Map<String, String>? headers});
dart
Future<Uint8List> readBytes(Uri url, {Map<String, String>? headers});
dart
Future<StreamedResponse> send(BaseRequest request);

ImagePlaceholderBuilder ​

Source

A builder for an image placeholder widget.

dart
typedef ImagePlaceholderBuilder = Widget Function(BuildContext context,

ImageReference ​

Source

A reference to an image asset in the content management system.

dart
class ImageReference

Directly declared public members:

dart
final String type;
dart
final ObjectReference? asset;
dart
final String? sanityAsset;
dart
ImageReference({required this.type, required this.asset, this.sanityAsset});
dart
factory ImageReference.fromJson(final Map<String, dynamic> json);

InitOncePlugin ​

Source

Initializes a plugin once per active lifecycle, sharing concurrent calls.

dart
mixin InitOncePlugin on Plugin

Directly declared public members:

dart
bool get initialized;
dart
Future<void> init();
dart
Future<void> dispose();
dart
Future<void> initOnce();
dart
Future<void> disposeOnce();

InitState ​

Source

The possible states of the system initialization.

dart
enum InitState

LayoutConfiguration ​

Source

Base class for configuring the visual layout of a content item.

dart
abstract class LayoutConfiguration<T extends ContentItem> implements SchemaItem

Directly declared public members:

dart
final String schemaType;
dart
final Type contentType;
dart
LayoutConfiguration({required this.schemaType});

Creates an instance of LayoutConfiguration.

dart
factory LayoutConfiguration.fromJson(Map<String, dynamic> json);

Converts the JSON representation of the layout configuration to an instance of LayoutConfiguration.

dart
Widget build(BuildContext context, T content);

Builds the layout widget tree for the given content item.

LayoutFailure ​

Source

Failure when a layout for a registered content type is missing.

dart
final class LayoutFailure extends ContentFailure

Directly declared public members:

dart
final String contentSchemaType;

The content type that needs a layout

dart
final String? requestedLayoutType;

The specific layout type that was requested (if any)

dart
const LayoutFailure({required super.schemaType, required this.contentSchemaType, this.requestedLayoutType, super.jsonPayload, super.description, super.suggestions});

LazyFeatureDescriptor ​

Source

Describes a feature that should be loaded lazily — only when one of its route prefixes is first navigated to.

dart
final class LazyFeatureDescriptor

Directly declared public members:

dart
final String name;

Unique name for this feature. Must match the inner FeatureDescriptor.name returned by loader.

dart
final String title;

Human-readable title shown in the loading UI while the feature is being downloaded and initialized.

dart
final String? description;

Optional description of what this feature does.

dart
final IconData? icon;

Optional icon for the loading indicator.

dart
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.

dart
final DeferredFeatureLoader loader;

The function that loads the actual FeatureDescriptor. This is where deferred as loading happens.

dart
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.

dart
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.

dart
LazyFeatureDescriptor({required this.name, required this.title, required this.routePrefixes, required this.loader, this.description, this.icon, this.dependencies = const [], this.featureFlag});

LazyFeaturesBuilder ​

Source

A builder that returns lazy feature descriptors.

dart
typedef LazyFeaturesBuilder = List<LazyFeatureDescriptor> Function();

LiveContentProvider ​

Source

An interface for plugins that provide live content.

dart
abstract class LiveContentProvider

Directly declared public members:

dart
final String title;

The title of the live content provider.

dart
const LiveContentProvider({required this.title});
dart
Future<void> init();
dart
Future<void> dispose();
dart
Stream<T?> fetchById<T>(String id, {required FromJsonConverter<T> fromJson, bool includeDrafts = false});

Fetches content by ID.

dart
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.

dart
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.

dart
Stream<RouteBase?> fetchRoute({String? path, String? routeId, bool includeDrafts = false});

Fetches content by route.

Loader ​

Source

A builder for a widget that is shown when the app is loading.

dart
typedef Loader = Widget Function(BuildContext context);

LocalContentProvider ​

Source

Public declaration in this package.

dart
final class LocalContentProvider extends ContentProvider

Directly declared public members:

dart
LocalContentProvider();
dart
String schemaType(Map<String, dynamic> json);
dart
String fieldValue(String key, Map<String, dynamic> json);
dart
Future<T?> fetchById<T>(String id, {required FromJsonConverter<T> fromJson, bool useCache = true});
dart
Future<List<T>?> fetchMultiple<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});
dart
Future<RouteBase?> fetchRoute({String? path, String? routeId, bool useCache = true});
dart
Future<T?> fetchSingle<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});
dart
Uri? fileUrl(FileReference fileRef);
dart
ImageProvider<Object>? image(ImageReference imageRef, {int? width, int? height, int? devicePixelRatio, int? quality, String? format});
dart
Future<void> init();
dart
Future<void> dispose();

LocaleConfiguration ​

Source

Configuration for a single locale including its code, native name, and icon

dart
class LocaleConfiguration

Directly declared public members:

dart
final Locale locale;

The Flutter locale

dart
final String nativeName;

Native name of the language (e.g., "हिन्दी" for Hindi)

dart
final String icon;

Icon/emoji representing the locale (e.g., "🇮🇳" for Hindi)

dart
const LocaleConfiguration({required this.locale, required this.nativeName, required this.icon});
dart
String get languageCode;

Get the language code from the locale

dart
factory LocaleConfiguration.fromCode(String code, {required String nativeName, required String icon});

Create from language code with explicit name and icon

LocalePlugin ​

Source

Plugin for managing internationalization across features

dart
class LocalePlugin extends Plugin

Directly declared public members:

dart
final List<LocaleConfiguration> locales;

List of supported locale configurations

dart
final Observable<Locale> currentLocale;

Raw observable for the current locale (no codegen)

dart
final Observable<bool> isLoadingLocale;

Raw observable to track locale loading state (no codegen)

dart
LocaleConfiguration get defaultLocale;

Get the default locale configuration

dart
List<Locale> get supportedLocales;

Available locales in the application

dart
LocalePlugin({required this.locales, this._defaultLocale});
dart
void registerTranslations(TranslationRegistration registration);

Register a feature's translation configuration

dart
Future<bool> setLocale(Locale locale);

Set the application locale

dart
Future<void> useDeviceLocale();

Use the device's locale if supported, otherwise default to configured default

dart
bool isLocaleActive(Locale locale);

Check if a specific locale is currently active

dart
String getLocaleName(String localeCode);

Get the native name for a locale code

dart
String getLocaleIcon(String localeCode);

Get the icon/emoji for a locale code

dart
String get currentLocaleCode;

Get the current locale code

dart
int get registrationCount;

Number of registered translations

dart
Future<void> init();
dart
Future<void> dispose();

LogLevel ​

Source

Public declaration in this package.

dart
enum LogLevel

Logger ​

Source

Public declaration in this package.

dart
abstract interface class Logger

Directly declared public members:

dart
void trace(dynamic message);
dart
void debug(dynamic message);
dart
void info(dynamic message);
dart
void warn(dynamic message);
dart
void error(dynamic message, {Object? error});
dart
void fatal(dynamic message, {Object? error, StackTrace? stackTrace});

LoggerInterface ​

Source

A convenience wrapper to provide a Logger interface to the Telemetry reportMessage() calls.

dart
extension LoggerInterface on VyuhBinding

Directly declared public members:

dart
Logger get log;

LoginMethod ​

Source

Represents the method used to login.

dart
enum LoginMethod

Directly declared public members:

dart
IconData icon();

Returns the icon for this login method. This is useful only in the developer tools or UI.

dart
String label();

Returns the label for this login method. This is useful only in the developer tools or UI.

LoginMethodCanceled ​

Source

Exception thrown when a login method is canceled.

dart
final class LoginMethodCanceled extends AuthException

Directly declared public members:

dart
final LoginMethod method;

The login method that was canceled.

dart
const LoginMethodCanceled(this.method, super.error);

Create a new LoginMethodCanceled with the given method and error.

LoginMethodFailure ​

Source

Exception thrown when a login method fails.

dart
final class LoginMethodFailure extends AuthException

Directly declared public members:

dart
final LoginMethod method;

The login method that failed.

dart
const LoginMethodFailure(this.method, super.error);

Create a new LoginMethodFailure with the given method and error.

LogoutFailure ​

Source

Exception thrown when the logout fails.

dart
final class LogoutFailure extends AuthException

Directly declared public members:

dart
const LogoutFailure(super.error);

Create a new LogoutFailure with the given error.

ModifierFailure ​

Source

Failure when a content modifier registration is missing.

dart
final class ModifierFailure extends ContentFailure

Directly declared public members:

dart
final List<String> modifierChain;

The complete chain of modifiers being applied

dart
final int failedIndex;

The index in the modifier chain where the failure occurred

dart
const ModifierFailure({required super.schemaType, required this.modifierChain, required this.failedIndex, super.jsonPayload, super.description, super.suggestions});

NamedBindings ​

Source

Public declaration in this package.

dart
extension NamedBindings on VyuhBinding

Directly declared public members:

dart
ContentPlugin get content;

The content plugin, responsible for managing content-related operations.

dart
DIPlugin get di;

The dependency injection plugin, providing dependency injection services.

dart
AnalyticsPlugin get analytics;

The analytics plugin, for tracking and reporting analytics data.

dart
TelemetryPlugin get telemetry;

The telemetry plugin, used for monitoring and logging telemetry information.

dart
NetworkPlugin get network;

The network plugin, for handling network requests and communication.

dart
FeatureFlagPlugin? get featureFlag;

The feature flag plugin, used for managing and toggling feature flags. Can be null if the plugin is not registered.

dart
EnvPlugin get env;

The environment plugin, providing access to platform-specific environment settings.

dart
EventPlugin get event;

The event plugin, for managing and emitting events within the platform.

NamedPlugins ​

Source

Provides convenient accessors for named plugins within the Vyuh platform.

dart
extension NamedPlugins on VyuhPlatform

Directly declared public members:

dart
ContentPlugin get content;

The content plugin, responsible for managing content-related operations.

dart
DIPlugin get di;

The dependency injection plugin, providing dependency injection services.

dart
AnalyticsPlugin get analytics;

The analytics plugin, for tracking and reporting analytics data.

dart
TelemetryPlugin get telemetry;

The telemetry plugin, used for monitoring and logging telemetry information.

dart
NetworkPlugin get network;

The network plugin, for handling network requests and communication.

dart
AuthPlugin get auth;

The authentication plugin, responsible for user authentication and authorization.

dart
NavigationPlugin get router;

The navigation/router plugin, managing navigation within the application.

dart
FeatureFlagPlugin? get featureFlag;

The feature flag plugin, used for managing and toggling feature flags. Can be null if the plugin is not registered.

dart
EnvPlugin get env;

The environment plugin, providing access to platform-specific environment settings.

dart
EventPlugin get event;

The event plugin, for managing and emitting events within the platform.

dart
LocalePlugin? get locale;

The locale plugin, providing access to locale settings. Can be null if the plugin is not registered.

Source

Public declaration in this package.

dart
abstract class NavigationPlugin extends Plugin

Directly declared public members:

dart
GoRouter get instance;
dart
static final dynamic fallbackRoute;
dart
NavigationPlugin({required super.name, required super.title});
dart
void initRouter({String? initialLocation, required List<g.RouteBase> routes, required GlobalKey<NavigatorState> rootNavigatorKey});
dart
void replaceRoutes(List<g.RouteBase> routes);
dart
void appendRoutes(List<g.RouteBase> routes);
dart
void appendInitialRoutes(List<g.RouteBase> routes);
dart
void pop<T extends Object?>([T? result]);
dart
void go(String location, {Object? extra});
dart
void goNamed(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});
dart
Future<T?> push<T extends Object?>(String location, {Object? extra});
dart
Future<T?> pushNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});
dart
Future<T?> pushReplacement<T extends Object?>(String location, {Object? extra});
dart
Future<T?> pushReplacementNamed<T extends Object?>(String name, {Map<String, String> pathParameters = const <String, String>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, Object? extra});
dart
Future<T?> replace<T extends Object?>(String location, {Object? extra});
dart
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 ​

Source

Base class for implementing network communication in Vyuh applications.

dart
abstract class NetworkPlugin extends Plugin with PreloadedPlugin implements Client

Directly declared public members:

dart
NetworkPlugin({required super.name, required super.title});
dart
Future<Response> get(Uri url, {Map<String, String>? headers});

Sends an HTTP GET request to the given URL.

dart
Future<Response> head(Uri url, {Map<String, String>? headers});

Sends an HTTP HEAD request to the given URL.

dart
Future<Response> post(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});

Sends an HTTP POST request to the given URL.

dart
Future<Response> put(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});

Sends an HTTP PUT request to the given URL.

dart
Future<Response> delete(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});

Sends an HTTP DELETE request to the given URL.

dart
Future<Response> patch(Uri url, {Map<String, String>? headers, Object? body, Encoding? encoding});

Sends an HTTP PATCH request to the given URL.

NoOpAnalyticsProvider ​

Source

A no-op implementation of AnalyticsProvider.

dart
final class NoOpAnalyticsProvider implements AnalyticsProvider

Directly declared public members:

dart
String get name;
dart
String get title;
dart
String get description;
dart
Future<void> dispose();
dart
Future<void> init();
dart
Future<void> reportEvent(String name, {Map<String, dynamic>? params});
dart
Future<void> identifyUser(String userId, {Map<String, dynamic>? traits});
dart
Future<void> resetUser();
dart
List<NavigatorObserver> get observers;

NoOpContentPlugin ​

Source

Public declaration in this package.

dart
final class NoOpContentPlugin extends ContentPlugin

Directly declared public members:

dart
NoOpContentPlugin();
dart
Widget buildContent<T extends ContentItem>(BuildContext context, T content, {LayoutConfiguration<T>? layout});
dart
Widget buildRoute(BuildContext context, {Uri? url, String? routeId});
dart
Future<void> dispose();
dart
Future<void> init();
dart
bool isRegistered<T>(String schemaType);
dart
dynamic register<T>(TypeDescriptor<T> descriptor);
dart
void attach(ExtensionBuilder extBuilder);
dart
T? fromJson<T>(Map<String, dynamic> json);
dart
Map<Type, Map<String, TypeDescriptor>> get typeRegistry;

NoOpContentProvider ​

Source

Public declaration in this package.

dart
final class NoOpContentProvider extends ContentProvider

Directly declared public members:

dart
NoOpContentProvider();
dart
Future<void> dispose();
dart
Future<List<T>?> fetchMultiple<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});
dart
Future<RouteBase?> fetchRoute({String? path, String? routeId, bool useCache = true});
dart
Future<T?> fetchSingle<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool useCache = true});
dart
String fieldValue(String key, Map<String, dynamic> json);
dart
ImageProvider? image(ImageReference imageRef, {int? width, int? height, int? devicePixelRatio, int? quality, String? format});
dart
Future<void> init();
dart
String schemaType(Map<String, dynamic> json);
dart
Future<T?> fetchById<T>(String id, {required FromJsonConverter<T> fromJson, bool useCache = true});
dart
Uri? fileUrl(FileReference fileRef);

NoOpLiveContentProvider ​

Source

A no-op implementation of LiveContentProvider. Is used internally to ensure the Developer is using it correctly by giving proper errors and hints

dart
final class NoOpLiveContentProvider extends LiveContentProvider

Directly declared public members:

dart
const NoOpLiveContentProvider();
dart
Stream<T?> fetchById<T>(String id, {required FromJsonConverter<T> fromJson, bool includeDrafts = false});
dart
Stream<T?> fetchSingle<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool includeDrafts = false});
dart
Stream<List<T>?> fetchMultiple<T>(String query, {required FromJsonConverter<T> fromJson, Map<String, String>? queryParams, bool includeDrafts = false});
dart
Stream<RouteBase?> fetchRoute({String? path, String? routeId, bool includeDrafts = false});
dart
Future<void> dispose();
dart
Future<void> init();

NoOpTelemetryProvider ​

Source

A no-op implementation of TelemetryProvider that can be used for development or testing purposes.

dart
final class NoOpTelemetryProvider implements TelemetryProvider

Directly declared public members:

dart
Future<Trace> startTrace(String name, String operation, {LogLevel? level = LogLevel.info});
dart
String get name;
dart
String get title;
dart
String get description;
dart
Future<void> dispose();
dart
Future<void> init();
dart
Future<void> reportError(exception, {StackTrace? stackTrace, Map<String, dynamic>? params, bool fatal = false});
dart
Future<void> reportFlutterError(FlutterErrorDetails details, {bool fatal = false});
dart
Future<void> reportMessage(String message, {Map<String, dynamic>? params, LogLevel? level = LogLevel.info});

NoOpTrace ​

Source

A no-op implementation of Trace that can be used for development or testing.

dart
final class NoOpTrace extends Trace

Directly declared public members:

dart
Map<String, String> getAttributes();
dart
int getMetric(String name);
dart
void setAttributes(Map<String, String> attributes);
dart
void setMetric(String name, int value);
dart
Future<void> stop();
dart
Future<Trace> startChild(String name, String operation, {LogLevel? level = LogLevel.info});

OAuthType ​

Source

Public declaration in this package.

dart
enum OAuthType

Directly declared public members:

dart
LoginMethod get loginMethod;

ObjectReference ​

Source

A reference to any content object in the content management system.

dart
class ObjectReference

Directly declared public members:

dart
final String type;
dart
final String ref;
dart
ObjectReference({required this.type, required this.ref});
dart
factory ObjectReference.fromJson(Map<String, dynamic> json);

PlatformLoggerInterface ​

Source

Public declaration in this package.

dart
extension PlatformLoggerInterface on VyuhPlatform

Directly declared public members:

dart
Logger get log;

PlatformWidgetBuilder ​

Source

A builder for platform-specific widgets used throughout the Vyuh application.

dart
class PlatformWidgetBuilder

Directly declared public members:

dart
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.

dart
final Loader appLoader;

A loader widget that is shown when the app is loading.

dart
final Loader contentLoader;

A loader widget that is shown when the content is loading.

dart
final RouteLoader routeLoader;

A loader widget that is shown when a route is loading.

dart
final ImagePlaceholderBuilder imagePlaceholder;

A builder for the image placeholder widget.

dart
final RouteErrorViewBuilder routeErrorView;

A builder for the route error view widget.

dart
final ErrorViewBuilder errorView;

A builder for the error view widget.

dart
final UnknownContentBuilder unknown;

A builder for unknown content failures.

dart
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.

dart
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

dart
static final dynamic system;

Plugin ​

Source

Public declaration in this package.

dart
abstract class Plugin

Directly declared public members:

dart
final String name;
dart
final String title;
dart
Plugin({required this.name, required this.title});
dart
Future<void> init();
dart
Future<void> dispose();

PluginDescriptor ​

Source

A descriptor for configuring the plugin system in a Vyuh application.

dart
final class PluginDescriptor

Directly declared public members:

dart
List<Plugin> get plugins;
dart
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});
dart
static final dynamic systemPluginTypes;
dart
static final dynamic system;
dart
T? get<T extends Plugin>();

PreloadedPlugin ​

Source

A mixin to mark any plugin to be loaded before the Platform.

dart
mixin PreloadedPlugin on Plugin

Restartable ​

Source

Restart the platform, re-running the initialization process.

dart
extension Restartable on VyuhPlatform

Directly declared public members:

dart
Future<void> restart();

RootItem ​

Source

Represents a root item that is the root of a content tree.

dart
abstract interface class RootItem implements ContainerItem

RouteBase ​

Source

Base class for all route content items in Vyuh.

dart
abstract class RouteBase extends ContentItem implements RootItem

Directly declared public members:

dart
final String title;

The title of the route, displayed in navigation UI.

dart
final String path;

The URL path for this route. This is used to match URLs and generate links.

dart
final Category? category;

Optional category for organizing routes.

dart
final RouteTypeConfiguration? routeType;

Configuration for how this route should be presented. Defines transitions, animations, and other route-specific behavior.

dart
final String id;

Unique identifier for this route.

dart
final DateTime updatedAt;

When this route was last updated in the CMS.

dart
final DateTime createdAt;

When this route was created in the CMS.

dart
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});
dart
factory RouteBase.fromJson(Map<String, dynamic> json);
dart
Future<RouteBase?> init(BuildContext context);

Initialize the route when it becomes active.

dart
Future<void> dispose();

Clean up the route when it is no longer active.

dart
Page<T> createPage<T>(BuildContext context, [LocalKey? pageKey]);

Create a Flutter page for this route.

dart
LayoutConfiguration? getLayout();
dart
List<ContentModifierConfiguration>? getModifiers();

RouteBuilderFunction ​

Source

A function that returns a list of routes.

dart
typedef RouteBuilderFunction = FutureOr<List<g.RouteBase>?> Function();

RouteErrorViewBuilder ​

Source

A builder for a route error view widget.

dart
typedef RouteErrorViewBuilder = Widget Function( BuildContext context,

RouteLifecycleConfiguration ​

Source

Configuration for managing route lifecycle events.

dart
abstract class RouteLifecycleConfiguration implements SchemaItem

Directly declared public members:

dart
final String schemaType;
dart
final String? title;
dart
RouteLifecycleConfiguration({this.title, required this.schemaType});
dart
Future<void> init(BuildContext context, RouteBase route);
dart
Future<void> dispose();

RouteLoader ​

Source

A builder for a widget that is shown when a route is loading.

dart
typedef RouteLoader = Widget Function(BuildContext context, [Uri? url, String? routeId]);

RouteObservers ​

Source

Public declaration in this package.

dart
mixin RouteObservers on Plugin

Directly declared public members:

dart
List<NavigatorObserver> get observers;

RouteTypeConfiguration ​

Source

Configuration for how a route should be presented.

dart
abstract class RouteTypeConfiguration implements SchemaItem

Directly declared public members:

dart
final String? title;
dart
final String schemaType;
dart
RouteTypeConfiguration({this.title, required this.schemaType});
dart
Page<T> create<T>(Widget child, RouteBase route, [LocalKey? pageKey]);

RoutingConfigNotifier ​

Source

Public declaration in this package.

dart
final class RoutingConfigNotifier extends ValueNotifier<g.RoutingConfig>

Directly declared public members:

dart
final g.GoRouterRedirect? redirect;
dart
RoutingConfigNotifier(List<g.RouteBase> routes, {this.redirect});
dart
void setRoutes(List<g.RouteBase> routes);

SchemaItem ​

Source

The base interface for all schema-driven content items.

dart
abstract interface class SchemaItem

Directly declared public members:

dart
String get schemaType;

The schema type of the content item.

SecureStoragePlugin ​

Source

Base class for implementing secure storage in Vyuh applications.

dart
abstract class SecureStoragePlugin extends Plugin

Directly declared public members:

dart
SecureStoragePlugin({required super.name, required super.title});
dart
Future<dynamic> read(String key);

Reads a value from secure storage by its key.

dart
Future<dynamic> write(String key, dynamic value);

Writes a value to secure storage with the given key.

dart
Future<bool> has(String key);

Checks if a key exists in secure storage.

dart
Future<bool> delete(String key);

Deletes a value from secure storage by its key.

SendEmailLinkFailure ​

Source

Exception thrown when sending an email-link for logging in.

dart
final class SendEmailLinkFailure extends AuthException

Directly declared public members:

dart
const SendEmailLinkFailure(super.error);

Create a new SendEmailLinkFailure with the given error.

SendPasswordResetEmailFailure ​

Source

Exception thrown when sending a password reset email.

dart
final class SendPasswordResetEmailFailure extends AuthException

Directly declared public members:

dart
const SendPasswordResetEmailFailure(super.error);

Create a new SendPasswordResetEmailFailure with the given error.

StoragePlugin ​

Source

Base class for implementing persistent storage in Vyuh applications.

dart
abstract class StoragePlugin extends Plugin

Directly declared public members:

dart
StoragePlugin({required super.name, required super.title});
dart
Future<dynamic> read(String key);

Reads a value from storage by its key.

dart
Future<dynamic> write(String key, dynamic value);

Writes a value to storage with the given key.

dart
Future<bool> has(String key);

Checks if a key exists in storage.

dart
Future<bool> delete(String key);

Deletes a value from storage by its key.

SystemInitTracker ​

Source

A tracker for the system initialization process.

dart
abstract interface class SystemInitTracker

Directly declared public members:

dart
VyuhPlatform get platform;

The platform that is being initialized.

dart
Observable<InitState> get currentState;

The current state of the initialization process.

dart
FutureStatus? get status;

The status of the future that is being awaited.

dart
dynamic get error;

The error that occurred during initialization.

dart
Future<void> init([InitState initialState]);

Initializes the system.

SystemReadyEvent ​

Source

An event indicating that the system is ready.

dart
final class SystemReadyEvent extends VyuhEvent<void>

Directly declared public members:

dart
SystemReadyEvent();

Creates a new SystemReadyEvent.

TelemetryPlugin ​

Source

The default implementation for a Telemetry Plugin.

dart
final class TelemetryPlugin extends Plugin with PreloadedPlugin, InitOncePlugin implements TelemetryProvider

Directly declared public members:

dart
final List<TelemetryProvider> providers;

The list of providers for the plugin.

dart
String get description;
dart
TelemetryPlugin({required this.providers});

Creates a new TelemetryPlugin.

dart
Future<void> initOnce();
dart
Future<void> disposeOnce();
dart
Future<Trace> startTrace(String name, String operation, {LogLevel? level = LogLevel.info});
dart
Future<void> reportError(exception, {StackTrace? stackTrace, Map<String, dynamic>? params, bool fatal = false});
dart
Future<void> reportFlutterError(FlutterErrorDetails details, {bool fatal = false});
dart
Future<void> reportMessage(String message, {Map<String, dynamic>? params, LogLevel? level = LogLevel.info});
dart
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 ​

Source

The base interface for an Telemetry Provider. The provider is responsible for reporting telemetry events, errors, and messages.

dart
abstract interface class TelemetryProvider

Directly declared public members:

dart
String get name;

The name of the provider.

dart
String get title;

The title of the provider.

dart
String get description;

The description of the provider.

dart
Future<void> init();

Initializes the provider.

dart
Future<void> dispose();

Disposes the provider.

dart
Future<void> reportError(dynamic exception, {StackTrace? stackTrace, Map<String, dynamic>? params, bool fatal = false});

Reports an error with an optional stack trace and parameters.

dart
Future<void> reportFlutterError(FlutterErrorDetails details, {bool fatal = false});

Reports a Flutter error with optional parameters.

dart
Future<void> reportMessage(String message, {Map<String, dynamic>? params, LogLevel? level = LogLevel.info});

Reports a message with optional parameters.

dart
Future<Trace> startTrace(String name, String operation, {LogLevel? level = LogLevel.info});

Starts a trace with a specific name and operation.

Trace ​

Source

The base interface for a Telemetry Trace. The trace is responsible for tracking the duration of an operation, and reporting metrics and attributes.

dart
abstract class Trace

Directly declared public members:

dart
Future<void> stop();

Stops or finalizes the trace.

dart
void setMetric(String name, int value);

Sets a metric with a specific name and value.

dart
int getMetric(String name);

Gets a metric with a specific name.

dart
void setAttributes(Map<String, String> attributes);

Sets an attribute with a specific name and value.

dart
Map<String, String> getAttributes();

Gets all attributes set so far in the trace.

dart
Future<Trace> startChild(String name, String operation, {LogLevel? level = LogLevel.info});

Starts a child trace with a specific name and operation.

TranslationRegistration ​

Source

Registration for feature-specific translations

dart
class TranslationRegistration

Directly declared public members:

dart
final String name;

Name of the translation system (for debugging)

dart
final Future<void> Function(Locale locale) onLocaleChange;

Callback when locale changes (async to support deferred loading)

dart
const TranslationRegistration({required this.name, required this.onLocaleChange});

TypeDescriptor ​

Source

Describes a schema type and its serialization behavior.

dart
class TypeDescriptor<T>

Directly declared public members:

dart
final String title;

Human-readable name for this type.

dart
final String schemaType;

Schema type identifier from the CMS.

dart
final FromJsonConverter<T> fromJson;

Function to convert JSON data to an instance of T.

dart
final T Function()? preview;

Optional function to create a preview instance.

dart
final Type type;

The runtime type of T.

dart
String? get sourceFeature;
dart
void setSourceFeature(String? featureName);

Updates the source feature for this type descriptor.

dart
TypeDescriptor({required this.schemaType, required this.fromJson, required this.title, this.preview});

Creates a new type descriptor.

dart
bool ==(Object other);
dart
int get hashCode;

UnknownContentBuilder ​

Source

A builder for unknown content failures.

dart
typedef UnknownContentBuilder = Widget Function(BuildContext context, ContentFailure failure);

UnknownContentItem ​

Source

Internal marker class for unknown content items.

dart
final class UnknownContentItem extends ContentItem

Directly declared public members:

dart
static const dynamic schemaName;
dart
final String missingSchemaType;
dart
final Map<String, dynamic> jsonPayload;
dart
UnknownContentItem({required this.missingSchemaType, required this.jsonPayload});

UnknownPlaceholderFactory ​

Source

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.

dart
typedef UnknownPlaceholderFactory = SchemaItem? Function( Type type, String missingSchemaType, Map<String, dynamic> jsonPayload, );

User ​

Source

Represents a user of the application.

dart
class User

Directly declared public members:

dart
final String id;

The unique identifier of the user.

dart
final String? name;

The name of the user. This could include the first name, last name or display name.

dart
final String? email;

The email of the user.

dart
final String? phoneNumber;

The phone number of the user.

dart
final String? photoUrl;

The URL of the user's photo.

dart
final LoginMethod loginMethod;

The method used to login.

dart
final DateTime? lastSignInTime;

The last sign-in time of the user.

dart
final DateTime? creationTime;

The creation time of the user.

dart
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.

dart
bool get isUnknown;

Returns true if this user is the unknown user.

dart
static const dynamic unknown;

A constant unknown user.

VoidFutureFunction ​

Source

A function that returns a void Future.

dart
typedef VoidFutureFunction = Future<void> Function();

VyuhBinding ​

Source

Public declaration in this package.

dart
final class VyuhBinding

Directly declared public members:

dart
static VyuhBinding get instance;
dart
List<Plugin> get plugins;
dart
final PlatformWidgetBuilder widgetBuilder;
dart
final Future<void> widgetReady;
dart
bool get initInvoked;
dart
bool get initialized;
dart
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.

dart
Future<void> dispose();
dart
T? get<T extends Plugin>();

VyuhEvent ​

Source

Base class for all events in a Vyuh application.

dart
class VyuhEvent<T>

Directly declared public members:

dart
final String name;

The name of the event, used for identification and logging.

dart
final DateTime timestamp;

When the event was created.

dart
final T? data;

Optional data associated with the event.

dart
VyuhEvent({required this.name, this.data});

VyuhEventListener ​

Source

A function that handles events of type T.

dart
typedef VyuhEventListener<T extends VyuhEvent> = void Function(T event);

VyuhPlatform ​

Source

The base class for the Vyuh Platform. This class is responsible for initializing the platform and managing the lifecycle of the platform.

dart
abstract class VyuhPlatform

Directly declared public members:

dart
List<FeatureDescriptor> get features;

A list of features currently registered and available on the platform.

dart
List<Plugin> get plugins;

A list of plugins available to the platform. Plugins provide extended functionalities and services to the platform.

dart
PlatformWidgetBuilder get widgetBuilder;

A builder function that creates platform-specific widgets. This allows for flexible UI customization based on the platform.

dart
GlobalKey<NavigatorState> get rootNavigatorKey;

The root navigator key. Used by the router plugin for navigation management within the application.

dart
SystemInitTracker get tracker;

Tracks the initialization status of the platform, including its features and plugins.

dart
Future<void>? featureReady(String featureName);

Verifies or waits for the specified feature to become ready.

dart
Future<void> run();

Initializes and runs the platform. This method is internally managed and should not be called directly.

dart
Future<void> initPlugins(Trace parentTrace);

Initializes the registered plugins for the platform. This method is internally managed and should not be called directly.

dart
Future<void> initFeatures(Trace parentTrace);

Initializes the features for the platform. This method is internally managed and should not be called directly.

dart
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.

dart
ExtensionBuilder? extensionBuilder<T extends ExtensionDescriptor>();

Gets the ExtensionBuilder given an extensionType

dart
bool isFeatureLoaded(String featureName);

Whether a feature (eager or lazy) has been loaded and is ready.

dart
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.

dart
Future<void> dispose();

debugAssertOneOfPathOrRouteId ​

Source

Asserts only one of path or routeId is provided and not both. Asserts that only one of path or routeId is provided.

dart
void debugAssertOneOfPathOrRouteId(String? path, String? routeId)

defaultAppRunner ​

Source

The default app runner that initializes Flutter bindings and runs the app using flutter.runApp.

dart
void defaultAppRunner(Widget app)

defaultRoutePageBuilder ​

Source

The default page builder for CMS routes.

dart
Page<dynamic> defaultRoutePageBuilder(BuildContext context, GoRouterState state, {Widget Function(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child)? transitionsBuilder, Duration? transitionDuration})

fieldKeyMap ​

Source

Public declaration in this package.

dart
const fieldKeyMap =

listFromJson ​

Source

Converts a JSON list to a nullable-list of SchemaItem instances of type T.

dart
List<T>? listFromJson<T extends SchemaItem>(dynamic json)

messages ​

Source

Public declaration in this package.

dart
final messages =

readValue ​

Source

Reads a value from a JSON object using the provided key.

dart
Object? readValue(dynamic json, String key)

runApp ​

Source

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.

dart
void runApp({required FeaturesBuilder features, LazyFeaturesBuilder? lazyFeatures, PluginDescriptor? plugins, PlatformWidgetBuilder? platformWidgetBuilder, String? initialLocation, AppRunner? appRunner})

setUnknownPlaceholderFactory ​

Source

Sets the factory for creating unknown placeholders.

dart
void setUnknownPlaceholderFactory(UnknownPlaceholderFactory factory)

typeFromFirstOfListJson ​

Source

Converts a JSON object to a nullable-instance of SchemaItem of type T.

dart
T? typeFromFirstOfListJson<T extends SchemaItem>(dynamic json)

vyuh ​

Source

The platform interface for Vyuh. This tracks the instance of the platform and can be used to access various aspects of the framework.

dart
VyuhPlatform vyuh = _UninitializedPlatform();