PlatformInAppLocalhostServer class abstract
This class allows you to create a simple server on http://localhost:[port]/
in order to be able to load your assets file on a local server.
The default port
value is 8080
.
Officially Supported Platforms/Implementations:
- Android native WebView
- iOS
- MacOS
- Inheritance
-
- Object
- PlatformInterface
- PlatformInAppLocalhostServer
Constructors
- PlatformInAppLocalhostServer(PlatformInAppLocalhostServerCreationParams params)
-
Creates a new PlatformInAppLocalhostServer
factory
- PlatformInAppLocalhostServer.implementation(PlatformInAppLocalhostServerCreationParams params)
- Used by the platform implementation to create a new PlatformInAppLocalhostServer.
Properties
- directoryIndex → String
-
represents the index file to use. The default value is
index.html
.no setter - documentRoot → String
-
Represents the document root path to serve. The default value is
./
.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- params → PlatformInAppLocalhostServerCreationParams
-
The parameters used to initialize the PlatformInAppLocalhostServer.
final
- port → int
-
Represents the port of the server. The default value is
8080
.no setter - 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.no setter
Methods
-
close(
) → Future< void> - Closes the server.
-
isRunning(
) → bool - Indicates if the server is running or not.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
start(
) → Future< void> -
Starts the server on
http://localhost:[port]/
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited