downloadModel method

Future<String> downloadModel(
  1. String modelTag, {
  2. bool isWifiRequired = true,
})

Downloads a model. Returns success if model downloads succesfully or model is already downloaded. On failing to dowload it throws an error.

Implementation

Future<String> downloadModel(String modelTag,
    {bool isWifiRequired = true}) async {
  final result = await NaturalLanguage.channel.invokeMethod(
      "nlp#startLanguageModelManager", <String, dynamic>{
    "task": "download",
    "model": modelTag,
    "wifi": isWifiRequired
  });
  return result.toString();
}