readProjectPath function

String readProjectPath()

Returns the session's Flutter project path: the path stored at launch, or the session directory's parent for sessions created by older fdb versions.

Implementation

String readProjectPath() {
  final file = File(projectPathFile);
  if (file.existsSync()) {
    final content = file.readAsStringSync().trim();
    if (content.isNotEmpty) return content;
  }
  return Directory(sessionDirPath).parent.path;
}