Flutter

Flutter

NAOSDK Flutter Plugin

In the context of helping our customers and partners who want to develop their application with Flutter and use NAOSDK indoor location-based use cases, we have developed a version of a flutter plugin that makes it easy to embed our library for Android and iOS.
The link below contains the dart models for iOS and Android. https://bitbucket.org/polestarusa/naosdk_flutter_plugin/
You’ll also find a sample application for starting and stopping the NAO location service.

 

To keep in mind

  • This is a subset of packages designed to interface with native NAOSDK services.
  • It enables Flutter applications to communicate easily with NAOSDK’s native functionality.
  • The plugin is made up of Dart code and native code (for iOS and Android) to provide a unified Flutter API for accessing NAO services.

Version 2.0.0

  • Example of integration diagram

How to integrate

 

Create a service provider with your APiKey

final LocationProvider _location_provider = LocationProvider(YOUR_API_KEY);

Call the synchronize method

_location_provider.synchronizeData();

Call the start method

_location_provider.start();

Set the handler for the callback you want to receive

Example to receive the synchronization success callback

_location_provider.setDidSynchronizationSuccessCallbackHandler(LocationMonitor.didSynchronizationSuccess);

 

Example to receive the location changed callback

_location_provider.setDidLocationChangeCallbackHandler(LocationMonitor.locationCallback);

 

Example of callback usage 

static void locationCallback(Location? location) {
  // We use isolate ports to communicate between the main isolate and spawned
  // isolates since they do not share memory. The port lookup will return
  // null if the UI isolate has explicitly removed the mapping on shutdown.
  final SendPort? uiSendPort =
      IsolateNameServer.lookupPortByName(kLocationPluginPortName);
  uiSendPort?.send(location?.toJson());
}

static void didSynchronizationSuccess() {
  print('Synchronization successful!');
}
 
    • Related Articles

    • Release 24.09 (NAOSDK 4.11.17)

      Versions Component Version NAO® Cloud 24.09 NAO® Viewer 24.09 NAO® SDK iOS 4.11.17 NAO® SDK Android 4.11.17 NAO® Logger iOS 4.11.17 NAO® Logger Android 4.11.17 New Features NAO® Cloud Location history: added new controls on the NAO Cloud history ...