Skip to content

expofp/expofp-flutter-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an example of how you can integrate ExpoFP maps into an android(Flutter) application.

Configuring WebView

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
            });
    },
)

JavaScript code invocation

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)");

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages