ResponseRenderer class
Handles view rendering and template responses.
This class provides methods for rendering views and sending HTML content with proper content type handling and context management.
It ensures all necessary context data is available to the view, including:
- Request object
- Session data
- CSRF token
- Flash messages
- Validation errors
- Old input
- Authentication status
Constructors
- ResponseRenderer(ResponseBody _body, ResponseHeaders _headers)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
renderJsonView(
String viewName, {Map< String, dynamic> data = const {}}) → Future<void> - Renders JSON data using a view template.
-
renderPartial(
String partialName, {Map< String, dynamic> data = const {}}) → Future<void> - Sends a partial view (component) as HTML.
-
renderToString(
String viewName, {Map< String, dynamic> data = const {}}) → Future<String> - Renders a view template as a string without sending response.
-
renderView(
String viewName, {Map< String, dynamic> data = const {}, int? statusCode}) → Future<void> - Renders a view template and sends it as HTML response.
-
renderWithLayout(
String viewName, String layoutName, {Map< String, dynamic> data = const {}, Map<String, dynamic> layoutData = const {}}) → Future<void> - Sends a template with layout.
-
sendHtml(
String html, {int? statusCode}) → void - Sends raw HTML content.
-
setRequest(
Request request) → void - Sets the request object for the renderer
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited