Implement Webuntis HTTP Api and Display

This commit is contained in:
2023-02-15 20:33:05 +01:00
parent 7432972b3c
commit 2b6dc8e3e6
42 changed files with 746 additions and 287 deletions

View File

@ -0,0 +1,29 @@
import '../incomingPacket.dart';
class FileEntry {
String name;
bool isFolder;
String path;
FileEntry(this.name, this.isFolder, this.path);
}
class FileListPacket extends IncomingPacket {
FileListPacket() : super("fileList");
List<FileEntry> _entries = List<FileEntry>.empty(growable: true);
List<FileEntry> get entries => _entries;
String _lastPath = "/";
String get lastPath => _lastPath;
@override
void handle(data) {
_entries = List<FileEntry>.empty(growable: true);
_lastPath = data['backLink'];
data['files'].forEach((value) => {
_entries.add(FileEntry(value['name'], value['is_folder'], value['path']))
});
}
}