This is an example of how you can integrate ExpoFP maps into an android(Flutter) application.
InAppWebView(
initialUrlRequest: URLRequest(url: Uri.parse('https://developer.expofp.com/examples/autumnfair.html')),
initialOptions: InAppWebViewGroupOptions(
android: AndroidInAppWebViewOptions(
allowFileAccess: true,
domStorageEnabled: true,
allowContentAccess: true),
crossPlatform: InAppWebViewOptions(
allowUniversalAccessFromFileURLs: true,
javaScriptEnabled: true,
allowFileAccessFromFileURLs: true)),
onConsoleMessage: (InAppWebViewController controller,
ConsoleMessage consoleMessage) {},
onWebViewCreated: (InAppWebViewController controller) {
controller.addJavaScriptHandler(
handlerName: 'onBoothClick',
callback: (args) {
//Some code
});
controller.addJavaScriptHandler(
handlerName: 'onFpConfigured', callback: (args) {
//Some code
});
controller.addJavaScriptHandler(
handlerName: 'onDirection',
callback: (args) {
//Some code
});
},
)
Calling the booth selection function:
webViewController?.evaluateJavascript(source: "selectBooth($boothName)");
Calling the set blue-dot function:
webViewController?.evaluateJavascript(source: "setCurrentPosition($x, $y, $focus)");
Calling the route building function:
webViewController?.evaluateJavascript(source: "selectRoute($boothFrom, $boothTo, $exceptUnAccessible)");