Implemented TimeTable

This commit is contained in:
Elias Müller 2023-01-29 22:29:48 +01:00
parent 1baa8028fa
commit 83ad7d59d2
11 changed files with 285 additions and 93 deletions

View File

@ -19,14 +19,14 @@
<entry key="archive">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.3/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.6/lib" />
</list>
</value>
</entry>
<entry key="args">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.3.1/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.3.2/lib" />
</list>
</value>
</entry>
@ -145,14 +145,14 @@
<entry key="flutter_login">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_login-4.1.0/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_login-4.1.1/lib" />
</list>
</value>
</entry>
<entry key="flutter_native_splash">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-2.2.14/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-2.2.17/lib" />
</list>
</value>
</entry>
@ -173,7 +173,7 @@
<entry key="font_awesome_flutter">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/font_awesome_flutter-10.2.1/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/font_awesome_flutter-10.3.0/lib" />
</list>
</value>
</entry>
@ -201,7 +201,7 @@
<entry key="image">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/image-3.2.2/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/image-4.0.12/lib" />
</list>
</value>
</entry>
@ -327,49 +327,42 @@
<entry key="provider">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/provider-6.0.4/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/provider-6.0.5/lib" />
</list>
</value>
</entry>
<entry key="quiver">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-3.1.0/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-3.2.1/lib" />
</list>
</value>
</entry>
<entry key="shared_preferences">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.15/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.17/lib" />
</list>
</value>
</entry>
<entry key="shared_preferences_android">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.14/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.15/lib" />
</list>
</value>
</entry>
<entry key="shared_preferences_ios">
<entry key="shared_preferences_foundation">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_foundation-2.1.2/lib" />
</list>
</value>
</entry>
<entry key="shared_preferences_linux">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.1/lib" />
</list>
</value>
</entry>
<entry key="shared_preferences_macos">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.4/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.3/lib" />
</list>
</value>
</entry>
@ -390,7 +383,7 @@
<entry key="shared_preferences_windows">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.1/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.3/lib" />
</list>
</value>
</entry>
@ -450,6 +443,13 @@
</list>
</value>
</entry>
<entry key="timetable_view">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/timetable_view-0.3.0/lib" />
</list>
</value>
</entry>
<entry key="typed_data">
<value>
<list>
@ -467,35 +467,35 @@
<entry key="url_launcher">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.6/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.8/lib" />
</list>
</value>
</entry>
<entry key="url_launcher_android">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.21/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.23/lib" />
</list>
</value>
</entry>
<entry key="url_launcher_ios">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.17/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.18/lib" />
</list>
</value>
</entry>
<entry key="url_launcher_linux">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.1/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.2/lib" />
</list>
</value>
</entry>
<entry key="url_launcher_macos">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.1/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.2/lib" />
</list>
</value>
</entry>
@ -509,14 +509,14 @@
<entry key="url_launcher_web">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.13/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.14/lib" />
</list>
</value>
</entry>
<entry key="url_launcher_windows">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.1/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.3/lib" />
</list>
</value>
</entry>
@ -530,7 +530,7 @@
<entry key="web_socket_channel">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-2.2.0/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-2.3.0/lib" />
</list>
</value>
</entry>
@ -544,14 +544,14 @@
<entry key="win32">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/win32-3.1.1/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/win32-3.1.3/lib" />
</list>
</value>
</entry>
<entry key="xdg_directories">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.2.0+2/lib" />
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.2.0+3/lib" />
</list>
</value>
</entry>
@ -574,8 +574,8 @@
<CLASSES>
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/another_flushbar-1.12.29/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/another_transformer_page_view-2.0.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.3.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.3.6/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.3.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.9.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/bubble-1.2.1/lib" />
@ -591,13 +591,13 @@
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-2.0.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.1.4/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_lints-2.0.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_login-4.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-2.2.14/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/font_awesome_flutter-10.2.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_login-4.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-2.2.17/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/font_awesome_flutter-10.3.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/html-0.15.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.5/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-4.0.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/image-3.2.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/image-4.0.12/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.17.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/jiffy-5.0.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.4/lib" />
@ -615,16 +615,15 @@
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/plugin_platform_interface-2.1.3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/pointycastle-3.6.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.2.4/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/provider-6.0.4/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-3.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.15/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.14/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.4/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/provider-6.0.5/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/quiver-3.2.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.17/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.15/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_foundation-2.1.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_platform_interface-2.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.4/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/sign_in_button-3.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.9.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib" />
@ -632,21 +631,22 @@
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.4.12/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/timetable_view-0.3.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.6/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.21/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.17/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.8/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.23/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.18/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_platform_interface-2.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.13/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.14/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-2.2.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/web_socket_channel-2.3.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/webdav_client-1.1.8/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/win32-3.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.2.0+2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/win32-3.1.3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.2.0+3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/xml-6.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/yaml-3.1.1/lib" />
<root url="file:///opt/flutter/bin/cache/pkg/sky_engine/lib" />

View File

@ -1,23 +1,22 @@
<component name="libraryTable">
<library name="Flutter Plugins" type="FlutterPluginsLibraryType">
<CLASSES>
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-2.2.14" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.17" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.21" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.1" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.1" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.1" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.13" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.6" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.14" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-2.0.4" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.1" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-2.0.4" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.1" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.15" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.3" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_native_splash-2.2.17" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_android-2.0.15" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.3" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.14" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.3" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.17" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.18" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.2" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.2" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.23" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_foundation-2.1.2" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.8" />
</CLASSES>
<JAVADOC />
<SOURCES />

View File

@ -37,7 +37,9 @@ class _AppState extends State<App> {
)
],
),
body: PageView(
body: Stack(
children: [
PageView(
controller: pageController,
children: const [
Timetable(),
@ -51,6 +53,13 @@ class _AppState extends State<App> {
});
},
),
// LinearProgressIndicator(
// backgroundColor: Colors.transparent,
// valueColor: AlwaysStoppedAnimation(Theme.of(context).primaryColor),
// minHeight: 5,
// ),
],
),
bottomNavigationBar: BottomNavigationBar(
items: [
@ -91,7 +100,7 @@ class _AppState extends State<App> {
],
), label: "Talk"),
const BottomNavigationBarItem(icon: Icon(Icons.folder), label: "Dateien"),
const BottomNavigationBarItem(icon: Icon(Icons.list), label: "Mehr"),
const BottomNavigationBarItem(icon: Icon(Icons.more_horiz), label: "Mehr"),
],
selectedItemColor: Theme.of(context).primaryColor,
unselectedItemColor: Colors.grey,

View File

@ -8,19 +8,20 @@ import 'package:marianum_mobile/data/socketConnection.dart';
class IncomingPacket extends ChangeNotifier {
String packetId;
bool useJsonDecode;
bool _isReceived = false;
bool get isReceived => _isReceived;
IncomingPacket(this.packetId) {
log("PACKETLISTENER ERSTELLT!");
IncomingPacket(this.packetId, {this.useJsonDecode = true}) {
SocketConnection.read.listen((event) {
if(event.startsWith("$packetId:")) {
_isReceived = true;
// THIS listener handles the incomming request
log("$packetId is handled!");
handle(jsonDecode(event.split("$packetId:")[1]));
String content = event.split("$packetId:")[1];
handle(useJsonDecode ? jsonDecode(content) : content);
}
notifyListeners();
});

View File

@ -0,0 +1,21 @@
import 'package:marianum_mobile/data/incomingPacket.dart';
class ErrorPacket extends IncomingPacket {
ErrorPacket() : super("error", useJsonDecode: false);
bool _errorDismissed = true;
bool get errorDismissed => _errorDismissed;
set errorDismissed(bool value) {
_errorDismissed = value;
notifyListeners();
}
String _errorText = "";
String get errorText => _errorText;
@override
void handle(data) {
_errorDismissed = false;
_errorText = data;
}
}

View File

@ -0,0 +1,71 @@
import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:marianum_mobile/data/socketConnection.dart';
import '../incomingPacket.dart';
class TimetablePacket extends IncomingPacket {
TimetablePacket() : super('timetable');
TimeTableData _timeTable = TimeTableData();
TimeTableData get timeTable => _timeTable;
@override
void handle(data) {
_timeTable = TimeTableData();
data.forEach((day) {
TimeTableDay dayData = TimeTableDay(List<TimeTableEntry>.empty(growable: true), day['title']);
day['tiles'].forEach((tile) {
dayData._entries.add(TimeTableEntry(
tile['title'], tile['title'], tile['room'], tile['title'],
TimeTableEntryTime(tile['begin']['hour'], tile['begin']['minute']),
TimeTableEntryTime(tile['end']['hour'], tile['end']['minute'])
));
});
_timeTable._days.add(dayData);
});
}
}
class TimeTableData {
List<TimeTableDay> _days = [];
List<TimeTableDay> get days => _days;
set days(List<TimeTableDay> value) {
_days = value;
}
}
class TimeTableDay {
List<TimeTableEntry> _entries;
String _name;
TimeTableDay(this._entries, this._name);
List<TimeTableEntry> get entries => _entries;
String get name => _name;
}
class TimeTableEntry {
late String subject;
late String teacher;
late String room;
late String classes;
late TimeTableEntryTime start;
late TimeTableEntryTime end;
TimeTableEntry(this.subject, this.teacher, this.room, this.classes,
this.start, this.end);
}
class TimeTableEntryTime {
int hour;
int minute;
TimeTableEntryTime(this.hour, this.minute);
}

View File

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:marianum_mobile/data/accountModel.dart';
import 'package:marianum_mobile/data/incommingPackets/authenticatePacket.dart';
import 'package:marianum_mobile/data/incommingPackets/errorPacket.dart';
import 'package:marianum_mobile/data/incommingPackets/fileListPacket.dart';
import 'package:marianum_mobile/data/incommingPackets/talkChatPacket.dart';
import 'package:marianum_mobile/data/incommingPackets/talkNotificationsPacket.dart';
@ -17,6 +18,7 @@ import 'package:web_socket_channel/web_socket_channel.dart';
import 'app.dart';
import 'data/incommingPackets/serverInfoPacket.dart';
import 'data/incommingPackets/talkContactsPacket.dart';
import 'data/incommingPackets/timetablePacket.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
@ -30,11 +32,13 @@ Future<void> main() async {
MultiProvider(
providers: [
ChangeNotifierProvider(create: (context) => AccountModel()),
ChangeNotifierProvider(create: (context) => ErrorPacket()),
ChangeNotifierProvider(create: (context) => ServerInfoPacket()),
ChangeNotifierProvider(create: (context) => TalkContactsPaket()),
ChangeNotifierProvider(create: (context) => TalkNotificationsPacket()),
ChangeNotifierProvider(create: (context) => FileListPacket()),
ChangeNotifierProvider(create: (context) => TalkChatPacket()),
ChangeNotifierProvider(create: (context) => TimetablePacket()),
],
child: const Main(),
)
@ -89,9 +93,17 @@ class _MainState extends State<Main> {
if(snapshot.hasData) {
return Consumer<AccountModel>(
builder: (context, value, child) {
return value.isLoggedIn ? const App() : const Login();
return Consumer2<AccountModel, ErrorPacket>(
builder: (context, accountModel, errorPacket, child) {
if(errorPacket.errorDismissed) {
return accountModel.isLoggedIn ? const App() : const Login();
} else {
return AlertDialog(title: const Text("Serverseitige Fehlermeldung"), content: Text(errorPacket.errorText), actions: [
TextButton(onPressed: () {
Provider.of<ErrorPacket>(context, listen: false).errorDismissed = true;
}, child: const Text("Weiter"))
]);
}
},
);

View File

@ -1,6 +1,12 @@
import 'dart:developer';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:marianum_mobile/data/incommingPackets/timetablePacket.dart';
import 'package:marianum_mobile/widget/loadingPacket.dart';
import 'package:provider/provider.dart';
import 'package:timetable_view/timetable_view.dart';
class Timetable extends StatefulWidget {
const Timetable({Key? key}) : super(key: key);
@ -13,15 +19,87 @@ class _TimetableState extends State<Timetable> {
@override
void initState() {
Provider.of<TimetablePacket>(context, listen: false).invoke();
super.initState();
}
@override
Widget build(BuildContext context) {
List<ListTile> chats = List<ListTile>.empty(growable: true);
return Consumer<TimetablePacket>(
builder: (context, data, child) {
return const Center(
child: Text("Not supported"),
return LoadingPacket(packet: data, child: TimetableView(
laneEventsList: _buildLaneEvents(context, data),
onEventTap: (TableEvent event) {},
timetableStyle: CustomTableStyle(context),
onEmptySlotTap: (int laneIndex, TableEventTime start, TableEventTime end) => {},
));
},
);
}
List<LaneEvents> _buildLaneEvents(context, TimetablePacket data) {
List<LaneEvents> laneEvents = List<LaneEvents>.empty(growable: true);
data.timeTable.days.forEach((day) {
List<TableEvent> tableEvents = List<TableEvent>.empty(growable: true);
day.entries.forEach((element) {
tableEvents.add(
TableEvent(
backgroundColor: Theme.of(context).primaryColor,
padding: const EdgeInsets.all(5),
title: element.subject,
location: "\n${element.room}",
eventId: tableEvents.length,
laneIndex: tableEvents.length,
startTime: TableEventTime(hour: element.start.hour, minute: element.start.minute),
endTime: TableEventTime(hour: element.end.hour, minute: element.end.minute)
)
);
});
laneEvents.add(
LaneEvents(
lane: Lane(laneIndex: laneEvents.length, name: day.name, textStyle: TextStyle(color: Theme.of(context).primaryColor, fontWeight: FontWeight.bold)),
events: tableEvents
)
);
});
return laneEvents;
}
void onEventTapCallBack(TableEvent event) {
print(
"Event Clicked!! LaneIndex ${event.laneIndex} Title: ${event.title} StartHour: ${event.startTime.hour} EndHour: ${event.endTime.hour}");
}
void onTimeSlotTappedCallBack(
int laneIndex, TableEventTime start, TableEventTime end) {
print(
"Empty Slot Clicked !! LaneIndex: $laneIndex StartHour: ${start.hour} EndHour: ${end.hour}");
}
}
class CustomTableStyle extends TimetableStyle {
dynamic context;
CustomTableStyle(context) {
this.context = context;
}
@override
int get startHour => 07;
@override
int get endHour => 17;
@override
double get laneWidth => 200;
@override
Color get cornerColor => Theme.of(this.context).primaryColor;
@override
Color get timeItemTextColor => Theme.of(this.context).primaryColor;
@override
// TODO: implement timeItemHeight
double get timeItemHeight => 60;
}

View File

@ -19,7 +19,7 @@ class _SettingsState extends State<Settings> {
@override
void initState() {
super.initState();
ServerInfoPacket().invoke();
Provider.of<ServerInfoPacket>(context, listen: false).invoke();
}
@override

View File

@ -5,7 +5,7 @@
import FlutterMacOS
import Foundation
import shared_preferences_macos
import shared_preferences_foundation
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {

View File

@ -45,6 +45,7 @@ dependencies:
provider: ^6.0.4
web_socket_channel: ^2.2.0
jiffy: ^5.0.0
timetable_view: ^0.3.0
dev_dependencies:
flutter_test: