initial commit

This commit is contained in:
2026-02-08 11:04:35 +05:30
parent a1287b696a
commit e1be0429bd
24 changed files with 1041 additions and 2 deletions

44
lib/models/project.dart Normal file
View File

@@ -0,0 +1,44 @@
import 'package:prod/models/editor.dart';
import "dart:io";
import "package:path/path.dart" as p;
class Project {
final String name;
final String language;
final File path;
final List<Editor> editors;
final bool isGit;
final bool enableTerminal;
Project(
this.name,
this.language,
this.path,
this.editors,
this.isGit,
this.enableTerminal,
);
factory Project.validated(
String name,
String lang,
String path,
List<Editor> editors,
bool enableTerminal,
) {
final File fpath = File(path);
if (fpath.existsSync()) {
print("Project not found!!!");
} else {
print("Project Exists on disk");
}
String gitPath = p.join(path, ".git", "HEAD");
final bool isGit = File(gitPath).existsSync();
return Project(name, lang, fpath, editors, isGit, enableTerminal);
}
// bool validatePath(){
// return File
// }
}