getPathWithName static method

String? getPathWithName(
  1. String? firstPath,
  2. String secondPath, {
  3. bool createWithWrappedFolder = false,
  4. required String? folderName,
})

Implementation

static String? getPathWithName(String? firstPath, String secondPath,
    {bool createWithWrappedFolder = false, required String? folderName}) {
  late String betweenPaths;
  if (Platform.isWindows) {
    betweenPaths = '\\\\';
  } else if (Platform.isMacOS || Platform.isLinux) {
    betweenPaths = '/';
  }
  if (betweenPaths.isNotEmpty) {
    if (createWithWrappedFolder) {
      return firstPath! +
          betweenPaths +
          folderName! +
          betweenPaths +
          secondPath;
    } else {
      return firstPath! + betweenPaths + secondPath;
    }
  }
  return null;
}