Skip to content

Latest commit

 

History

History
136 lines (88 loc) · 5.47 KB

README.md

File metadata and controls

136 lines (88 loc) · 5.47 KB

Situm Flutter Example

A sample Flutter application to start learning the power of Situm Flutter Plugin.

License: MIT Pub Version Flutter

What's in here

This folder contains the necessary source code for an example application using the Situm Flutter plugin.

home_preview wyf_preview

How to run the app

Step 1: Install the dependencies

The first step is to download this repo:

git clone https://github.com/situmtech/flutter.git situm_flutter

And then install the plugin dependencies alongside the example app as follows:

cd situm_flutter/example
flutter pub get

iOS only

The bundled example app uses Swift Package Manager for iOS dependencies.

Note

This limitation only affects local development of this repository and the bundled example app when using Swift Package Manager. Apps that consume situm_flutter from pub.dev are not affected.

When running this example app on iOS with Swift Package Manager, make sure the repository directory is named situm_flutter. Some Flutter versions generate local Swift package overrides using the plugin directory name, and a different checkout folder name can cause Swift package resolution failures.

Also check out the project code signing before you run the example.

Step 2: Set up your Situm credentials

This example provides you with a template on lib/config.dart.example:

Warning Rename config.dart.example to config.dart.

Now populate it with your credentials:

const situmApiKey = "YOUR-SITUM-API-KEY";
const buildingIdentifier = "YOUR-SITUM-BUILDING-IDENTIFIER";

Step 3: Run the app

From the example folder, execute the following command which works on both Android and iOS devices:

flutter run

Important

In case you are not able to compile our example app, you could try to set your flutter and java versions to the specified at mise.toml. If you install mise, this versioning tool will switch automatically to the correct versions you need.

Tip

If a release build (flutter build apk) fails in a Gradle lint task with a Java error such as NoSuchMethodError, the JDK used by Flutter is probably too old. Debug runs (flutter run) do not run that lint, so the problem only shows up in release builds.

Flutter does not always use the java from your PATH or JAVA_HOME (for example, it may pick the JDK bundled with Android Studio). To check and change it:

flutter doctor -v | grep -i java        # JDK that Flutter is using
flutter config --jdk-dir <path-to-jdk>  # use a recent JDK (21 or later)

You can also run the app from your IDE:

  • On Android: open example/android/ with Android Studio.
  • On iOS: open example/ios/Runner.xcworkspace with XCode.

Documentation

More information on how to use the official Flutter plugin and the set of APIs, the functions, parameters and results each function accepts and provides can be found in our SDK API Reference and Wayfinding API Reference.

Examples

In case you want to learn how to use our plugin, you may want to take a look at our code samples of the basics functionalities:

  1. Basic SDK and Wayfinding functionality: showcases how to initialize the Situm SDK (refer to the flutter sdk quickstart guide for more information) and how to use some basic features like positioning and obtaining the information of a given building. It also shows how to use the Situm Wayfinding module (refer to the flutter wayfinding quickstart guide for more information).

Versioning

We use SemVer for versioning.

Please refer to CHANGELOG.md for a list of notables changes for each version of the library.

You can also see the tags on this repository.

Submitting Contributions

You will need to sign a Contributor License Agreement (CLA) before making a submission. Learn more here.

License

This project is licensed under the MIT - see the LICENSE file for details.

More information

More info is available at our Developers Page.

Support information

For any question or bug report, please send an email to support@situm.es