

#FLUTTER PROVIDER DISPOSE CODE#
Internally, the HERE SDK will offload most of its work to a background thread, but callbacks to your code will always occur on the main thread. The HERE SDK is not guaranteed to be thread safe and it is recommended to make calls to the SDK from the main thread. This means that the HERE SDK plugin must be copied locally to an application project as described in the Get Started section. When running an iOS simulator, you can obtain logs without running Xcode by executing the following command from the terminal: xcrun simctl spawn booted log stream -level debugĬurrently, dependency management, for example, via, is not yet supported. This way you can log HERE SDK messages for various predefined log levels even for release builds of your app. You can use the LogAppender interface to insert your own log class into the SDKNativeEngine. If only one listener can be set at a time, the set_x() pattern is used that can be set to null to stop listening. When multiple listeners can be set, then the method pattern add_x() and remove_x() is used as naming convention. For reoccurring event notifications such as for gesture events, listeners are used.The HERE SDK exposes callbacks for single event notification such as for search results.After calling dispose() any related HERE SDK feature should no longer be used. Calling dispose() will stop pending requests and close open files and databases that are still running on the main thread.
#FLUTTER PROVIDER DISPOSE FREE#
Dispose ObjectsĪll HERE SDK classes will be garbage collected by Flutter if the instance is no longer referenced or set to null.įor the SDKNativeEngine, which can be initialized automatically or programmatically, you can free resources by calling SDKNativeEngine.sharedInstance?.dispose(), for example, when the hosting widget's lifetime has ended. Most often this class gets a reference to a MapView to start its work.ĭespite the popular phrase that "everything is a widget", the example code is kept free of most Flutter dependencies - instead it's mostly pure Dart code that shows how the HERE SDK can be used. Since each app is focusing on a different aspect of the HERE SDK, that code can be found in a single class postfixed with ".Example.dart" in its class name. Each example app follows the same entry point from which the HERE SDK is initialized. We hope this makes it easier to see the relevant parts of the shown APIs. As much as possible the HERE SDK example code is decoupled from the surrounding platform code. The accompanying example apps follow the same structure. In some cases, the obvious code is left out, but it can be found in the accompanying example apps that can be built and deployed instantly on any supported device with a set of valid HERE credentials. However, for the sake of simplicity and to not shadow the educational approach of this guide, not all edge scenarios may be handled, especially when it comes to error handling or robust threading. The shown code snippets cover best practice example code ready to be used for your own applications. See an overview of the available use cases covered in this Developer's Guide.If you are interested in building your first app showing a HERE map, take a look at the Get Started section to guide you through the first simple steps.In the example section, you can find the example apps accompanying this user guide.All sections are independent from each other, making it easy to skip any section and to dive straight into the topics which you are most interested in. In the following use case sections, we will guide you through the most common usage scenarios and reveal tips and easy-to-understand guidelines to help you get the most out of the HERE SDK for Flutter.
