-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
78 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:path/path.dart'; | ||
|
||
class Files { | ||
const Files._(); | ||
|
||
static late final Directory temp; | ||
static late final Directory cache; | ||
static late final Directory internal; | ||
static late final Directory user; | ||
|
||
static Directory get screenshot => temp.subDir("screenshot"); | ||
|
||
static const timetable = TimetableFiles(); | ||
|
||
static Future<void> init() async { | ||
await screenshot.create(recursive: true); | ||
await timetable.init(); | ||
} | ||
} | ||
|
||
extension DirectoryX on Directory { | ||
File subFile(String p1, [String? p2, String? p3, String? p4]) => File(join(path, p1, p2, p3, p4)); | ||
|
||
Directory subDir(String p1, [String? p2, String? p3, String? p4]) => Directory(join(path, p1, p2, p3, p4)); | ||
} | ||
|
||
class TimetableFiles { | ||
const TimetableFiles(); | ||
|
||
File get screenshotFile => Files.screenshot.subFile("timetable.png"); | ||
File get backgroundFile => Files.user.subFile("timetable", "background.png"); | ||
|
||
Directory get calendarDir => Files.user.subDir("timetable", "calendar"); | ||
|
||
Future<void> init() async { | ||
await calendarDir.create(recursive: true); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters