If you're developing an application that isn't licensed under GPL, this affects you and your application's legal right to distribution. For more information, please see (Proprietary) Licensing.
Looking to start using FMTC in your project? Check out the Quickstart guide!
Install
For the latest stable release, depend on the package as you normally would by adding it to your pubspec.yaml manually or using:
flutterpubaddflutter_map_tile_caching
To depend on potentially unstable commits from a branch (the commits on main usually represent stable releases), for development or testing, follow from pub.dev, then add the following lines to your pubspec.yaml file under the dependencies_override section:
pubspec.yaml
dependency_overrides:flutter_map_tile_caching:git:url:https://github.com/JaffaKetchup/flutter_map_tile_caching.git# ref: a commit hash, branch name, or tag (otherwise defaults to master)
Then, depending on the platforms you are developing for, you may need to follow ObjectBox's installation instructions for your platform (which can be found originally here, under the Flutter tab):
Try building the app - it might just work, especially if you are using other plugins in your app!
If it does not build successfully
If the error message seems to indicate that the "Android NDK" version needs to be higher, follow the instructions.
Usually this involves the following change to your app-level build.gradle(.kts) config:
android/app/build.gradle(.kts)
android { namespace = "*" compileSdk = flutter.compileSdkVersion- ndkVersion = flutter.ndkVersion+ ndkVersion = <the version specified at the end of the error log> ...}
macOS apps may need to target macOS 10.15. In your Podfile, change the platform and in the Runner.xcodeproj/project.pbxproj file, update MACOSX_DEPLOYMENT_TARGET.
To enable your app to run in sandboxed mode (which is a requirement for most applications), you'll need to specify an application group. Follow these instructions:
Check all macos/Runner/*.entitlements files contain a section with the group ID
If necessary, change the string value to the DEVELOPMENT_TEAM you can find in your Xcode settings, plus an application-specific suffix. Due to macOS restrictions the complete string must be 19 characters or shorter. For example:
When initialising FMTC, make sure to pass this string to the macosApplicationGroup argument
Although FMTC will compile on the web, the default FMTC backend does not support the web platform. FMTCObjectBoxBackend.initialise and .uninitialise will throw UnsupportedErrors if invoked on the web. Other methods will throw RootUnavailable as normal.
Import
After installing the package, import it into the necessary files in your project: