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

View File

@@ -0,0 +1,68 @@
import 'package:flutter/foundation.dart';
import 'package:prod/models/editor.dart';
import 'package:prod/models/project.dart';
class GlobalModel extends ChangeNotifier {
late List<Project> projects;
late List<bool> hoverShow;
late List<Editor> editors;
GlobalModel() {
projects = [];
editors = [];
hoverShow = List.filled(projects.length, false, growable: true);
}
void addPrj(Project prj) {
projects.add(prj);
hoverShow.add(false);
notifyListeners();
}
void delPrj(int index) {
projects.removeAt(index);
hoverShow.removeAt(index);
notifyListeners();
}
List<Project> get lsPrj {
return projects;
}
int get lenPrj {
return projects.length;
}
Project nthPrj(int index) {
return projects[index];
}
void setHoverShow(int index, bool state) {
hoverShow[index] = state;
notifyListeners();
}
bool getHoverShow(int index) {
return hoverShow[index];
}
// Editor List Management.
void addEdt(Editor edt) {
editors.add(edt);
notifyListeners();
}
void delEdt(int index) {
editors.removeAt(index);
notifyListeners();
}
int get lenEdt {
return editors.length;
}
Editor nthEdt(int index) {
return editors[index];
}
}