Response class
Constructors
-
Response.new({dynamic data, ResponseType responseType = ResponseType.none, int httpStatusCode = HttpStatus.ok, Map<
String, String> headers = const {}})
Properties
- data → dynamic
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> -
final
- httpStatusCode → int
-
final
- responseType → ResponseType
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
makeResponse(
HttpResponse res) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sseHandler(
HttpResponse res) → Future< void> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
back(
[String? key, String? message]) → Response -
backWithInput(
[String? input, String? message]) → Response -
download(
String fileName, Uint8List bytes, {Map< String, String> headers = const {}}) → Response -
file(
String fileName, Uint8List bytes, {Map< String, String> headers = const {}}) → Response -
html(
dynamic htmlData, {Map< String, String> headers = const {}}) → Response -
json(
dynamic jsonData, [int statusCode = HttpStatus.ok]) → Response -
jsonWithHeader(
dynamic jsonData, {int statusCode = HttpStatus.ok, Map< String, String> headers = const {}}) → Response -
redirect(
String location) → Response -
sse(
Stream eventStream, {int statusCode = HttpStatus.ok, Map< String, String> headers = const {}}) → Response