Installation

You're viewing documentation for an older version of FMTC (v6).

Depend On

From pub.dev

This is the recommended method of installing this package as it ensures you only receive stable versions, and you can be sure pub.dev is reliable. It also keeps the size of your pubspec.yaml small.

Just import the package as you would normally, from the command line:

flutter pub add flutter_map_tile_caching

This should automatically import the latest version of the package and create an entry for it in your pubspec.yaml. Otherwise follow the old method and add the latest version of the 'flutter_map_tile_caching' dependency to the pubspec.yaml manually.

If you urgently need the latest version, a specific branch, or a specific fork, you can use this method.

Commits available from Git (GitHub) may not be stable. Only use this method if you have no other choice.

Add the following lines to your pubspec.yaml file under the 'dependencies_override' section:

pubspec.yaml
dependency_overrides:
    flutter_map:
        git:
            url: https://github.com/jaffaketchup/flutter_map_tile_caching.git
            # ref: main 

Import

After installing the package, import it into the necessary files in your project:

import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart'; // Suitable for most situations
import 'package:flutter_map_tile_caching/fmtc_advanced.dart'; // Only import if required functionality is not exposed by 'flutter_map_tile_caching.dart'

Additional Setup

After installing and importing wherever you need it, be sure to follow the Additional Setup instructions to ensure your application builds and runs correctly.

Before continuing with usage, make ensure you comply with the appropriate rules and terms of service set by your tile server.

This library and/or the creator(s) are not responsible for any violations you make using this package. Remember that this library automatically adds a clear 'with flutter_map_tile_caching' to the User-Agent header.

Last updated

© Luka Stillingfleet (JaffaKetchup)