InAppLocalhostServer class
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 server.
The default port value is 8080.
Constructors
- InAppLocalhostServer({int port = 8080, String directoryIndex = 'index.html', String documentRoot = './', })
-
portrepresents the port of the server. The default value is8080.directoryIndexrepresents the index file to use. The default value isindex.html.documentRootrepresents the document root path to serve. The default value is./.The optional argument
sharedspecifies whether additionalHttpServerobjects can bind to the same combination ofaddress,portandv6Only. Ifsharedistrueand moreHttpServers from this isolate or other isolates are bound to the port, then the incoming connections will be distributed among all the boundHttpServers. Connections can be distributed over multiple isolates this way.
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
-
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