locateFbClient method
Deduces the location of the fbclient library.
First it tries to find the library in the current directory, with the library file name specific to the platform (libfbclient.so on Linux, fbclient.dll on Windows, libfbclient.dylib on Mac). If it is found, returns the path starting with the current directory ("./"). If the file is not found, it tries to locate the "fb" subdirectory and find the library file there. If found, the "./fb/libraryfile" will be returned. If both of the above fail, it returns just the library file name, to be located by the OS default resolver.
Implementation
String locateFbClient([String version = ""]) {
final libName = _libName(version);
var res = libName;
if (FileSystemEntity.isFileSync(".$dirSep$libName")) {
res = ".$dirSep$libName";
} else if (FileSystemEntity.isDirectorySync(".${dirSep}fb")) {
if (FileSystemEntity.isFileSync(".${dirSep}fb$dirSep$libName")) {
res = ".${dirSep}fb$dirSep$libName";
}
}
return res;
}