Skip to content

Commit 55dbf11

Browse files
committed
ignore .dart_tool folder
1 parent 930ace2 commit 55dbf11

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ proguard/
2929

3030
# Android Studio Navigation editor temp files
3131
.navigation/
32-
32+
.dart_tool/
3333
# Android Studio captures folder
3434
captures/
3535

lib/cc_project_structure.dart

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
import 'dart:convert';
3+
import 'dart:io';
4+
import 'dart:ui';
5+
6+
import 'package:flutter/material.dart';
7+
8+
import 'editor.dart';
9+
import 'modules_manager.dart';
10+
11+
/* Class for storing project information */
12+
class CCSolution {
13+
final String name, desc, author, identifier, slnPath, slnFolderPath;
14+
late Image image;
15+
Map<String, String> folders = {};
16+
List<CCProject> projects = [];
17+
18+
static const decoder = JsonDecoder();
19+
20+
CCSolution(this.name, this.desc, this.author, this.identifier, this.slnPath,
21+
this.slnFolderPath);
22+
23+
static Future<CCSolution?> loadFromFile(String filepath) async{
24+
var file = File(filepath);
25+
if (await file.exists()) {
26+
String input = await file.readAsString();
27+
var obj = decoder.convert(input);
28+
try {
29+
var result = CCSolution(obj["name"], obj["description"] ?? "",
30+
obj["author"], obj["identifier"], filepath, file.parent.path);
31+
32+
/// Add the solution project folders
33+
var folders = (obj["folders"] as Map);
34+
for (var key in folders.keys) {
35+
result.folders[key] = folders[key];
36+
}
37+
return result;
38+
} on Exception catch (e) {
39+
debugPrint("Error: error parsing solution: $filepath #${e.toString()}");
40+
return null;
41+
}
42+
} else {
43+
debugPrint("Error: project can't be found: $filepath");
44+
return null;
45+
}
46+
}
47+
}
48+
49+
class CCProject {
50+
final String name, desc, author, identifier, slnPath, slnFolderPath, projPath;
51+
CCProject(this.name, this.desc, this.author, this.identifier, this.slnPath,
52+
this.slnFolderPath, this.projPath);
53+
}

0 commit comments

Comments
 (0)