isValidFilename function
Checks if the filename is valid for a given system.
os is used to determine the system. Its values can be any of "android" "fuchsia" "ios" "linux" "macos" "windows".
If the system is unspecified or recognized, isValidUniversalFilename will be used.
Implementation
bool isValidFilename(String filename, {String? os}) {
switch (os) {
case 'windows':
return isValidWindowsFilename(filename);
case 'ios':
case 'macos':
return isValidHFSFilename(filename);
case 'android':
return isValidFATFilename(filename);
case 'linux':
return isValidPosixFilename(filename);
case 'fuchsia':
default:
return isValidUniversalFilename(filename);
}
}