getFile method

Future<File?> getFile(
  1. String id
)

Implementation

Future<File?> getFile(String id) async {
  if(!await ready()) return null;
  try{
    return (await api!.files.get(id)) as File;
  }catch(e, stack){
    if(e is PlatformException && e.code == "network_error"){
      return null;
    }
    if(kDebugMode){
      print("getFile:");
      print("${e.toString()}\n${stack.toString()}");
    }else if (onError != null){
      onError!(e, stack);
    }
    return null;
  }
}