start method
Starts the 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):
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
The NSAllowsLocalNetworking key is available since iOS 10.
Officially Supported Platforms/Implementations:
- Android WebView
- iOS WKWebView
- macOS WKWebView
- Windows WebView2
- Linux WPE WebKit
Use the PlatformInAppLocalhostServer.isMethodSupported method to check if this method is supported at runtime.
Implementation
Future<void> start() => platform.start();