static bool isValidPath(String? path, [RegExp? pattern]) { return path != null && path.isNotEmpty && (pattern ?? Patterns.path).hasMatch(path); }