///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`.
classInAppLocalhostServer{
HttpServer_server;
int_port=8080;
InAppLocalhostServer({intport=8080}){
this._port=port;
}
///Starts a server on http://localhost:[port]/.
///
///**NOTE for iOS**: For the iOS Platform, you need to add the `NSAllowsLocalNetworking` key with `true` in the `Info.plist` file (See [ATS Configuration Basics](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW35)):
///```xml
///<key>NSAppTransportSecurity</key>
///<dict>
/// <key>NSAllowsLocalNetworking</key>
/// <true/>
///</dict>
///```
///The `NSAllowsLocalNetworking` key is available since **iOS 10**.
Future<void>start()async{
if(this._server!=null){
throwException('Server already started on http://localhost:$_port');
}
varcompleter=newCompleter();
runZoned((){
HttpServer.bind('127.0.0.1',_port).then((server){
print('Server running on http://localhost:'+_port.toString());