reset method

Reset the root directory, database, and stores

Internally calls delete then re-initialises FMTC with the same root directory, FMTCSettings, and debug mode. Other setup is lost: need to further customise the FlutterMapTileCaching.initialise? Use delete, then re-initialise yourself.

This will remove all traces of this root from the user's device. Use with caution!

Returns the new FlutterMapTileCaching instance.

Implementation

Future<FlutterMapTileCaching> reset() async {
  final directory = FMTC.instance.rootDirectory.directory.absolute.path;
  final settings = FMTC.instance.settings;
  final debugMode = FMTC.instance.debugMode;

  await delete();
  return FMTC.initialise(
    rootDirectory: directory,
    settings: settings,
    debugMode: debugMode,
  );
}