downloadModel method

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

Downloads a model. Returns true if model downloads successfully or model is already downloaded. On failing to download it throws an error.

Implementation

Future<bool> downloadModel(String model, {bool isWifiRequired = true}) async {
  final result = await channel.invokeMethod(method, <String, dynamic>{
    'task': 'download',
    'model': model,
    'wifi': isWifiRequired
  });
  return result.toString() == 'success';
}