PlatformWidgetBuilder class

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

This class provides a centralized way to customize the appearance and behavior of common UI components in a Vyuh application. It includes builders for:

Use copyWith to create a modified version of an existing builder:

final customBuilder = defaultPlatformWidgetBuilder.copyWith(
  appLoader: (context) => MyCustomLoader(),
  errorView: (context, {title, error}) => MyCustomErrorView(title: title),
);

Constructors

PlatformWidgetBuilder({required AppBuilder appBuilder, required Loader appLoader, required Loader contentLoader, required RouteLoader routeLoader, required ErrorViewBuilder errorView, required RouteErrorViewBuilder routeErrorView, required ImagePlaceholderBuilder imagePlaceholder, VyuhTheme? theme, VyuhStrings strings = const VyuhStrings()})
Creates a new PlatformWidgetBuilder instance.

Properties

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
appLoader → Loader
A loader widget that is shown when the app is loading.
final
contentLoader → Loader
An inline loader, shown while a part of a page (a section, a list, an image) loads. Unlike routeLoader it does not take over the page.
final
errorView → ErrorViewBuilder
A builder for the error view widget.
final
hashCode → int
The hash code for this object.
no setterinherited
imagePlaceholder → ImagePlaceholderBuilder
A builder for the image placeholder widget.
final
routeErrorView → RouteErrorViewBuilder
A builder for the route error view widget.
final
routeLoader → RouteLoader
A loader widget that is shown when a route is loading.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
strings → VyuhStrings
Every user-facing string the framework shows. See VyuhStrings.
final
theme → VyuhTheme
The app's themes. Used by the default appBuilder, and by the loading and failure screens shown before the app itself is built, so the very first frame already matches the app. See VyuhTheme.
final

Methods

copyWith({AppBuilder? appBuilder, Loader? appLoader, Loader? contentLoader, RouteLoader? routeLoader, ImagePlaceholderBuilder? imagePlaceholder, RouteErrorViewBuilder? routeErrorView, ErrorViewBuilder? errorView, VyuhTheme? theme, VyuhStrings? strings}) → PlatformWidgetBuilder
Creates a copy of this PlatformWidgetBuilder but with the given fields
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

system → PlatformWidgetBuilder
The framework defaults: a Material app root using theme, themed loaders, and error views that always offer a way back.
final