FinchView class

A base class for views in the web application. The FinchView class provides the core structure for rendering views and handling data within the application. It includes logic for rendering widgets and allows derived classes to customize how data is processed. Example usage:

class MyCustomView extends FinchView {
  MyCustomView({
    required String widget,
    Map<String, Object?> params = const {},
  }) : super(widget: widget, params: params);
  @override
  Future<Map<String, Object?>> renderData() async {
    // Custom data processing logic here.
  }
}
Implementers

Constructors

FinchView({required String widget, Map<String, Object?> params = const {}})
Creates an instance of FinchView. The constructor requires a widget path, with an optional params map that can be used to pass additional data to the view during rendering.

Properties

hashCode int
The hash code for this object.
no setterinherited
params Map<String, Object?>
A map containing parameters that can be passed to the view for rendering.
getter/setter pair
rq Request
Gets the current WebRequest from the request context
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
widget String
The path to the widget or view template.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render({bool toData = false}) Future<Object>
Renders the view. The toData parameter determines whether to render as raw data or as a fully rendered view using the specified widget template. If toData is true, the method returns the data processed by renderData. Otherwise, it returns the rendered view content. If the widget path is empty, an error message is returned.
renderData() Future<Map<String, Object?>>
Processes and returns the data for the view. This method returns the params map by default, but can be overridden in derived classes to implement custom data processing logic. Example:
toString() String
A string representation of this object.
inherited

Operators

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