first working prototype
Some checks failed
Build CI / Build (push) Has been cancelled

This commit is contained in:
2026-02-11 22:59:25 +05:30
parent 6a10685033
commit 73827ea62c
13 changed files with 281 additions and 32 deletions

View File

@@ -6,7 +6,7 @@ class Project {
final String name;
final String language;
final File path;
final List<Editor> editors;
final List<String> editors;
final bool isGit;
final bool enableTerminal;
@@ -19,14 +19,15 @@ class Project {
this.enableTerminal,
);
factory Project.validated(
factory Project.newValidated(
String name,
String lang,
String path,
List<Editor> editors,
List<String> editors,
bool enableTerminal,
) {
final File fpath = File(path);
print(fpath.absolute.path);
if (fpath.existsSync()) {
print("Project not found!!!");
} else {
@@ -38,6 +39,28 @@ class Project {
return Project(name, lang, fpath, editors, isGit, enableTerminal);
}
Map<String, dynamic> toJson() {
return {
"name": name,
"language": language,
"path": path.path,
"editors": editors,
"isGit": isGit,
"enableTerminal": enableTerminal,
};
}
factory Project.fromJson(Map<String, dynamic> data) {
return Project(
data["name"] as String,
data["language"] as String,
File(data["path"] as String),
(data["editors"] as List<dynamic>).map((a) => a.toString()).toList(),
data["isGit"] as bool,
data["enableTerminal"] as bool,
);
}
// bool validatePath(){
// return File
// }