PlatformInAppLocalhostServerCreationParams class
Object specifying creation parameters for creating a PlatformInAppLocalhostServer.
Platform specific implementations can add additional fields by extending this class.
- Annotations
Constructors
-
PlatformInAppLocalhostServerCreationParams.new({int port = 8080, String directoryIndex = 'index.html', String documentRoot = './', Future<
bool> onData(HttpRequest request)? = null}) -
Used by the platform implementation to create a new PlatformInAppLocalhostServer.
const
Properties
- directoryIndex → String
-
represents the index file to use. The default value is
index.html
.final - documentRoot → String
-
Represents the document root path to serve. The default value is
./
.final - hashCode → int
-
The hash code for this object.
no setterinherited
-
onData
→ Future<
bool> Function(HttpRequest request)? -
A custom callback that is called when a new request is received by the server
that can be used to send or modify the response, for example adding custom headers.
If this callback returns
true
, it means that the request has been handled by this callback. Otherwise, if this callback returnsfalse
, the server will continue to process the request using the default implementation.final - port → int
-
Represents the port of the server. The default value is
8080
.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Specifies whether additional
HttpServer
objects can bind to the same combination ofaddress
,port
andv6Only
. Ifshared
istrue
and moreHttpServer
s from this isolate or other isolates are bound to the port, then the incoming connections will be distributed among all the boundHttpServer
s. Connections can be distributed over multiple isolates this way.final
Methods
-
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