WebF class

The entry-point widget class responsible for rendering all content created by HTML, CSS, and JavaScript in WebF.

WebF can be used in two ways:

  1. Directly with a WebFController instance using the default constructor
  2. By referencing a controller name managed by WebFControllerManager using WebF.fromControllerName

The second approach supports automatic initialization of controllers that don't exist yet, if proper bundle and initialization parameters are provided.

Inheritance

Properties

controller WebFController
The WebF controller to use for rendering content
final
errorBuilder Widget Function(BuildContext context, Object? error)?
Custom error builder when using controllerName
final
hashCode int
The hash code for this object.
no setterinherited
initialRoute String?
The default route path for the hybrid router in WebF.
final
initialState Map<String, dynamic>?
The default route state for the hybrid router in WebF.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingWidget Widget?
Widget to display while loading the controller when using controllerName
final
onBuildSuccess VoidCallback?
Callback that's called after the build success in webf.dart when widget.controller.view.document.documentElement!.toWidget() finishes executing.
final
onControllerCreated OnControllerCreated?
Callbacks when WebFController was created by this WebF widget.
final
onDispose VoidCallback?
Callbacks for this controller of WebF had been disposed
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
override
createState() State<WebF>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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

Static Methods

clearAllCaches() Future<void>
defineCustomElement(String tagName, ElementCreator creator) → void
defineModule(ModuleCreator creator) → void
fromControllerName({Key? key, required String controllerName, String? initialRoute = '/', Map<String, dynamic>? initialState, Widget? loadingWidget, Widget errorBuilder(BuildContext context, Object? error)?, bool forceLoad = false, WebFBundle? bundle, ControllerFactory? createController, Map<String, SubViewBuilder>? routes, VoidCallback? onDispose, OnControllerCreated? onControllerCreated, VoidCallback? onBuildSuccess, ControllerSetup? setup}) AutoManagedWebF
Create a WebF widget using a controller name from WebFControllerManager.
overrideCustomElement(String tagName, ElementCreator creator) → void
setHttpCacheMode(HttpCacheMode mode) → void