Implement local HTTP Api usage

This commit is contained in:
Elias Müller 2023-02-14 18:06:18 +01:00
parent 83ad7d59d2
commit 7432972b3c
27 changed files with 1300 additions and 59 deletions

View File

@ -2,6 +2,20 @@
<library name="Dart Packages" type="DartPackagesLibraryType"> <library name="Dart Packages" type="DartPackagesLibraryType">
<properties> <properties>
<option name="packageNameToDirsMap"> <option name="packageNameToDirsMap">
<entry key="_fe_analyzer_shared">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-50.0.0/lib" />
</list>
</value>
</entry>
<entry key="analyzer">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-5.2.0/lib" />
</list>
</value>
</entry>
<entry key="another_flushbar"> <entry key="another_flushbar">
<value> <value>
<list> <list>
@ -26,7 +40,7 @@
<entry key="args"> <entry key="args">
<value> <value>
<list> <list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.3.2/lib" /> <option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.4.0/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -51,6 +65,62 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="build">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/build-2.3.1/lib" />
</list>
</value>
</entry>
<entry key="build_config">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/build_config-1.1.1/lib" />
</list>
</value>
</entry>
<entry key="build_daemon">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/build_daemon-3.1.0/lib" />
</list>
</value>
</entry>
<entry key="build_resolvers">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/build_resolvers-2.1.0/lib" />
</list>
</value>
</entry>
<entry key="build_runner">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/build_runner-2.3.3/lib" />
</list>
</value>
</entry>
<entry key="build_runner_core">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/build_runner_core-7.2.7/lib" />
</list>
</value>
</entry>
<entry key="built_collection">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/built_collection-5.1.1/lib" />
</list>
</value>
</entry>
<entry key="built_value">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/built_value-8.4.3/lib" />
</list>
</value>
</entry>
<entry key="characters"> <entry key="characters">
<value> <value>
<list> <list>
@ -58,6 +128,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="checked_yaml">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/checked_yaml-2.0.2/lib" />
</list>
</value>
</entry>
<entry key="clock"> <entry key="clock">
<value> <value>
<list> <list>
@ -65,6 +142,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="code_builder">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/code_builder-4.4.0/lib" />
</list>
</value>
</entry>
<entry key="collection"> <entry key="collection">
<value> <value>
<list> <list>
@ -100,6 +184,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="dart_style">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-2.2.4/lib" />
</list>
</value>
</entry>
<entry key="dio"> <entry key="dio">
<value> <value>
<list> <list>
@ -128,6 +219,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="fixnum">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/fixnum-1.0.1/lib" />
</list>
</value>
</entry>
<entry key="flutter"> <entry key="flutter">
<value> <value>
<list> <list>
@ -173,7 +271,28 @@
<entry key="font_awesome_flutter"> <entry key="font_awesome_flutter">
<value> <value>
<list> <list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/font_awesome_flutter-10.3.0/lib" /> <option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/font_awesome_flutter-10.4.0/lib" />
</list>
</value>
</entry>
<entry key="frontend_server_client">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/frontend_server_client-3.2.0/lib" />
</list>
</value>
</entry>
<entry key="glob">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/glob-2.1.1/lib" />
</list>
</value>
</entry>
<entry key="graphs">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/graphs-2.2.0/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -191,6 +310,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="http_multi_server">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-3.2.1/lib" />
</list>
</value>
</entry>
<entry key="http_parser"> <entry key="http_parser">
<value> <value>
<list> <list>
@ -201,7 +327,7 @@
<entry key="image"> <entry key="image">
<value> <value>
<list> <list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/image-4.0.12/lib" /> <option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/image-4.0.15/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -212,6 +338,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="io">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/io-1.0.4/lib" />
</list>
</value>
</entry>
<entry key="jiffy"> <entry key="jiffy">
<value> <value>
<list> <list>
@ -226,6 +359,20 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="json_annotation">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/json_annotation-4.8.0/lib" />
</list>
</value>
</entry>
<entry key="json_serializable">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/json_serializable-6.6.1/lib" />
</list>
</value>
</entry>
<entry key="lints"> <entry key="lints">
<value> <value>
<list> <list>
@ -233,6 +380,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="logging">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/logging-1.1.1/lib" />
</list>
</value>
</entry>
<entry key="matcher"> <entry key="matcher">
<value> <value>
<list> <list>
@ -254,6 +408,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="mime">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/mime-1.0.4/lib" />
</list>
</value>
</entry>
<entry key="nested"> <entry key="nested">
<value> <value>
<list> <list>
@ -261,6 +422,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="package_config">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/package_config-2.1.0/lib" />
</list>
</value>
</entry>
<entry key="path"> <entry key="path">
<value> <value>
<list> <list>
@ -271,7 +439,7 @@
<entry key="path_provider_linux"> <entry key="path_provider_linux">
<value> <value>
<list> <list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/lib" /> <option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.8/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -317,6 +485,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="pool">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/pool-1.5.1/lib" />
</list>
</value>
</entry>
<entry key="process"> <entry key="process">
<value> <value>
<list> <list>
@ -331,6 +506,20 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="pub_semver">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/pub_semver-2.1.3/lib" />
</list>
</value>
</entry>
<entry key="pubspec_parse">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/pubspec_parse-1.2.1/lib" />
</list>
</value>
</entry>
<entry key="quiver"> <entry key="quiver">
<value> <value>
<list> <list>
@ -355,7 +544,7 @@
<entry key="shared_preferences_foundation"> <entry key="shared_preferences_foundation">
<value> <value>
<list> <list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_foundation-2.1.2/lib" /> <option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_foundation-2.1.3/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -387,6 +576,20 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="shelf">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-1.4.0/lib" />
</list>
</value>
</entry>
<entry key="shelf_web_socket">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_web_socket-1.0.3/lib" />
</list>
</value>
</entry>
<entry key="sign_in_button"> <entry key="sign_in_button">
<value> <value>
<list> <list>
@ -401,6 +604,20 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="source_gen">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/source_gen-1.2.7/lib" />
</list>
</value>
</entry>
<entry key="source_helper">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/source_helper-1.3.3/lib" />
</list>
</value>
</entry>
<entry key="source_span"> <entry key="source_span">
<value> <value>
<list> <list>
@ -422,6 +639,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="stream_transform">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/stream_transform-2.1.0/lib" />
</list>
</value>
</entry>
<entry key="string_scanner"> <entry key="string_scanner">
<value> <value>
<list> <list>
@ -450,6 +674,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="timing">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/timing-1.0.1/lib" />
</list>
</value>
</entry>
<entry key="typed_data"> <entry key="typed_data">
<value> <value>
<list> <list>
@ -467,7 +698,7 @@
<entry key="url_launcher"> <entry key="url_launcher">
<value> <value>
<list> <list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.8/lib" /> <option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.9/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -481,7 +712,7 @@
<entry key="url_launcher_ios"> <entry key="url_launcher_ios">
<value> <value>
<list> <list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.18/lib" /> <option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.1.0/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -527,6 +758,13 @@
</list> </list>
</value> </value>
</entry> </entry>
<entry key="watcher">
<value>
<list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/watcher-1.0.2/lib" />
</list>
</value>
</entry>
<entry key="web_socket_channel"> <entry key="web_socket_channel">
<value> <value>
<list> <list>
@ -551,7 +789,7 @@
<entry key="xdg_directories"> <entry key="xdg_directories">
<value> <value>
<list> <list>
<option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.2.0+3/lib" /> <option value="/opt/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-1.0.0/lib" />
</list> </list>
</value> </value>
</entry> </entry>
@ -572,81 +810,115 @@
</option> </option>
</properties> </properties>
<CLASSES> <CLASSES>
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-50.0.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-5.2.0/lib" />
<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_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/another_transformer_page_view-2.0.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/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/args-2.4.0/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/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/boolean_selector-2.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/bubble-1.2.1/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/bubble-1.2.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/build-2.3.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/build_config-1.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/build_daemon-3.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/build_resolvers-2.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/build_runner-2.3.3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/build_runner_core-7.2.7/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/built_collection-5.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/built_value-8.4.3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.1/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.2.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/checked_yaml-2.0.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.1/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/code_builder-4.4.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.16.0/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.16.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/convert-3.1.1/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/convert-3.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-3.0.2/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-3.0.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/csslib-0.17.2/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/csslib-0.17.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.5/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.5/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/dart_style-2.2.4/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/dio-4.0.6/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/dio-4.0.6/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.3.1/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.3.1/lib" />
<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/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/file-6.1.4/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/fixnum-1.0.1/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_lints-2.0.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_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/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/font_awesome_flutter-10.4.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/frontend_server_client-3.2.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/glob-2.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/graphs-2.2.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/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-0.13.5/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/http_multi_server-3.2.1/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/http_parser-4.0.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/image-4.0.15/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/intl-0.17.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/io-1.0.4/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/jiffy-5.0.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.4/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.4/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/json_annotation-4.8.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/json_serializable-6.6.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/lints-2.0.1/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/lints-2.0.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/logging-1.1.1/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.12/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.12/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/material_color_utilities-0.1.5/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.8.0/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.8.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/mime-1.0.4/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/nested-1.0.0/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/nested-1.0.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/package_config-2.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.2/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.8/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_platform_interface-2.0.5/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_platform_interface-2.0.5/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/petitparser-5.1.0/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/petitparser-5.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.1.0/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.1.0/lib" />
<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/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/pointycastle-3.6.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/pool-1.5.1/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/process-4.2.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/provider-6.0.5/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/pub_semver-2.1.3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/pubspec_parse-1.2.1/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/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-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_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_foundation-2.1.3/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_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_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_web-2.0.4/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/shared_preferences_windows-2.1.3/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shelf-1.4.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shelf_web_socket-1.0.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/sign_in_button-3.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/source_gen-1.2.7/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/source_helper-1.3.3/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/source_span-1.9.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/stream_transform-2.1.0/lib" />
<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/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/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/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/timetable_view-0.3.0/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/timing-1.0.1/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/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/universal_io-2.0.4/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-6.1.9/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_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_ios-6.1.0/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_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_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_platform_interface-2.1.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_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/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/vector_math-2.1.2/lib" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/watcher-1.0.2/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/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/webdav_client-1.1.8/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/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/xdg_directories-1.0.0/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/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/.pub-cache/hosted/pub.dartlang.org/yaml-3.1.1/lib" />
<root url="file:///opt/flutter/bin/cache/pkg/sky_engine/lib" /> <root url="file:///opt/flutter/bin/cache/pkg/sky_engine/lib" />

View File

@ -1,7 +1,6 @@
<component name="libraryTable"> <component name="libraryTable">
<library name="Flutter Plugins" type="FlutterPluginsLibraryType"> <library name="Flutter Plugins" type="FlutterPluginsLibraryType">
<CLASSES> <CLASSES>
<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_web-2.0.4" /> <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/path_provider_windows-2.1.3" /> <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_windows-2.1.3" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_windows-2.1.3" />
@ -11,12 +10,13 @@
<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_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/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/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_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_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/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/shared_preferences_foundation-2.1.3" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.8" /> <root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.8" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-6.1.9" />
<root url="file:///opt/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.1.0" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES /> <SOURCES />

5
lib/api/apiError.dart Normal file
View File

@ -0,0 +1,5 @@
class ApiError {
String message;
ApiError(this.message);
}

39
lib/api/apiRequest.dart Normal file
View File

@ -0,0 +1,39 @@
import 'dart:developer';
import 'package:http/http.dart' as http;
import 'package:marianum_mobile/api/apiError.dart';
class ApiRequest {
Uri endpoint;
ApiRequest(this.endpoint);
Future<http.Response> get(Map<String, String>? headers) async {
return await http.get(endpoint, headers: headers);
}
Future<http.Response> post(String data, Map<String, String>? headers) async {
log("Fetching: ${data}");
try {
http.Response response = await http
.post(endpoint, body: data, headers: headers)
.timeout(
const Duration(seconds: 10),
onTimeout: () {
log("timeout!");
throw ApiError("Network timeout");
}
);
if(response.statusCode != 200) {
log("Got ${response.statusCode}");
throw ApiError("Service response invalid, got status ${response.statusCode}");
}
return response;
} on Exception catch(e) {
throw ApiError("Http: ${e.toString()}");
}
}
}

View File

@ -0,0 +1,6 @@
import 'package:marianum_mobile/api/apiRequest.dart';
class RequestLoginTest extends ApiRequest {
RequestLoginTest(super.endpoint);
}

View File

@ -0,0 +1,3 @@
class ApiParams {
}

View File

@ -0,0 +1,6 @@
import 'package:http/http.dart' as http;
import 'package:json_annotation/json_annotation.dart';
abstract class ApiResponse {
@JsonKey(includeFromJson: false, includeToJson: false)
late http.Response rawResponse;
}

View File

@ -0,0 +1,55 @@
import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'package:marianum_mobile/api/webuntis/webuntisApi.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'authenticateParams.dart';
import 'authenticateResponse.dart';
class Authenticate extends WebuntisApi {
AuthenticateParams param;
Authenticate(this.param) : super("authenticate", param, authenticatedResponse: false);
@override
Future<AuthenticateResponse> run() async {
awaitingResponse = true;
String rawAnswer = await query(this);
AuthenticateResponse response = finalize(AuthenticateResponse.fromJson(jsonDecode(rawAnswer)['result']));
_lastResponse = response;
awaitedResponse.complete();
return response;
}
static bool awaitingResponse = false;
static Completer awaitedResponse = Completer();
static AuthenticateResponse? _lastResponse;
static Future<void> createSession() async {
SharedPreferences preferences = await SharedPreferences.getInstance();
_lastResponse = await Authenticate(
AuthenticateParams(
user: preferences.getString("username")!,
password: preferences.getString("password")!,
)
).run();
}
static Future<AuthenticateResponse> getSession() async {
if(awaitingResponse) {
log("Other query in progress... waiting");
await awaitedResponse.future;
}
if(_lastResponse == null) {
log("Not authenticated... requesting");
awaitingResponse = true;
await createSession();
}
return _lastResponse!;
}
}

View File

@ -0,0 +1,16 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:marianum_mobile/api/webuntis/apiParams.dart';
part 'authenticateParams.g.dart';
@JsonSerializable()
class AuthenticateParams extends ApiParams {
String user;
String password;
AuthenticateParams({required this.user, required this.password});
factory AuthenticateParams.fromJson(Map<String, dynamic> json) => _$AuthenticateParamsFromJson(json);
Map<String, dynamic> toJson() => _$AuthenticateParamsToJson(this);
}

View File

@ -0,0 +1,19 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'authenticateParams.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
AuthenticateParams _$AuthenticateParamsFromJson(Map<String, dynamic> json) =>
AuthenticateParams(
user: json['user'] as String,
password: json['password'] as String,
);
Map<String, dynamic> _$AuthenticateParamsToJson(AuthenticateParams instance) =>
<String, dynamic>{
'user': instance.user,
'password': instance.password,
};

View File

@ -0,0 +1,18 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:marianum_mobile/api/webuntis/apiResponse.dart';
part 'authenticateResponse.g.dart';
@JsonSerializable()
class AuthenticateResponse extends ApiResponse {
String sessionId;
int personType;
int personId;
int klasseId;
AuthenticateResponse(this.sessionId, this.personType, this.personId, this.klasseId);
factory AuthenticateResponse.fromJson(Map<String, dynamic> json) => _$AuthenticateResponseFromJson(json);
Map<String, dynamic> toJson() => _$AuthenticateResponseToJson(this);
}

View File

@ -0,0 +1,25 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'authenticateResponse.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
AuthenticateResponse _$AuthenticateResponseFromJson(
Map<String, dynamic> json) =>
AuthenticateResponse(
json['sessionId'] as String,
json['personType'] as int,
json['personId'] as int,
json['klasseId'] as int,
);
Map<String, dynamic> _$AuthenticateResponseToJson(
AuthenticateResponse instance) =>
<String, dynamic>{
'sessionId': instance.sessionId,
'personType': instance.personType,
'personId': instance.personId,
'klasseId': instance.klasseId,
};

View File

@ -0,0 +1,17 @@
import 'dart:convert';
import 'package:marianum_mobile/api/webuntis/apiResponse.dart';
import 'package:marianum_mobile/api/webuntis/webuntisApi.dart';
import 'getRoomsResponse.dart';
class GetRooms extends WebuntisApi {
GetRooms() : super("getRooms", null);
@override
Future<GetRoomsResponse> run() async {
String rawAnswer = await query(this);
return finalize(GetRoomsResponse.fromJson(jsonDecode(rawAnswer)));
}
}

View File

@ -0,0 +1,29 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:marianum_mobile/api/webuntis/apiResponse.dart';
part 'getRoomsResponse.g.dart';
@JsonSerializable()
class GetRoomsResponse extends ApiResponse {
Set<GetRoomsResponseObject> result;
GetRoomsResponse(this.result);
factory GetRoomsResponse.fromJson(Map<String, dynamic> json) => _$GetRoomsResponseFromJson(json);
Map<String, dynamic> toJson() => _$GetRoomsResponseToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetRoomsResponseObject {
int id;
String name;
String longName;
bool active;
String building;
GetRoomsResponseObject(this.id, this.name, this.longName, this.active, this.building);
factory GetRoomsResponseObject.fromJson(Map<String, dynamic> json) => _$GetRoomsResponseObjectFromJson(json);
Map<String, dynamic> toJson() => _$GetRoomsResponseObjectToJson(this);
}

View File

@ -0,0 +1,40 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'getRoomsResponse.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
GetRoomsResponse _$GetRoomsResponseFromJson(Map<String, dynamic> json) =>
GetRoomsResponse(
(json['result'] as List<dynamic>)
.map(
(e) => GetRoomsResponseObject.fromJson(e as Map<String, dynamic>))
.toSet(),
);
Map<String, dynamic> _$GetRoomsResponseToJson(GetRoomsResponse instance) =>
<String, dynamic>{
'result': instance.result.toList(),
};
GetRoomsResponseObject _$GetRoomsResponseObjectFromJson(
Map<String, dynamic> json) =>
GetRoomsResponseObject(
json['id'] as int,
json['name'] as String,
json['longName'] as String,
json['active'] as bool,
json['building'] as String,
);
Map<String, dynamic> _$GetRoomsResponseObjectToJson(
GetRoomsResponseObject instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'longName': instance.longName,
'active': instance.active,
'building': instance.building,
};

View File

@ -0,0 +1,22 @@
import 'dart:convert';
import 'dart:developer';
import 'package:marianum_mobile/api/webuntis/apiResponse.dart';
import 'package:marianum_mobile/api/webuntis/webuntisApi.dart';
import 'getTimetableParams.dart';
import 'getTimetableResponse.dart';
class GetTimetable extends WebuntisApi {
GetTimetableParams params;
GetTimetable(this.params) : super("getTimetable", params);
@override
Future<GetTimetableResponse> run() async {
String rawAnswer = await query(this);
log(rawAnswer);
return finalize(GetTimetableResponse.fromJson(jsonDecode(rawAnswer)));
}
}

View File

@ -0,0 +1,91 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:marianum_mobile/api/webuntis/apiParams.dart';
part 'getTimetableParams.g.dart';
@JsonSerializable(explicitToJson: true)
class GetTimetableParams extends ApiParams {
GetTimetableParamsOptions options;
GetTimetableParams({required this.options});
factory GetTimetableParams.fromJson(Map<String, dynamic> json) => _$GetTimetableParamsFromJson(json);
Map<String, dynamic> toJson() => _$GetTimetableParamsToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetTimetableParamsOptions {
GetTimetableParamsOptionsElement element;
@JsonKey(includeIfNull: false)
int? startDate;
@JsonKey(includeIfNull: false)
int? endDate;
@JsonKey(includeIfNull: false)
bool? onlyBaseTimetable;
@JsonKey(includeIfNull: false)
bool? showBooking;
@JsonKey(includeIfNull: false)
bool? showInfo;
@JsonKey(includeIfNull: false)
bool? showSubstText;
@JsonKey(includeIfNull: false)
bool? showLsText;
@JsonKey(includeIfNull: false)
bool? showLsNumber;
@JsonKey(includeIfNull: false)
bool? showStudentgroup;
@JsonKey(includeIfNull: false)
GetTimetableParamsOptionsFields? klasseFields;
@JsonKey(includeIfNull: false)
GetTimetableParamsOptionsFields? roomFields;
@JsonKey(includeIfNull: false)
GetTimetableParamsOptionsFields? subjectFields;
@JsonKey(includeIfNull: false)
GetTimetableParamsOptionsFields? teacherFields;
GetTimetableParamsOptions({
required this.element,
this.startDate,
this.endDate,
this.onlyBaseTimetable,
this.showBooking,
this.showInfo,
this.showSubstText,
this.showLsText,
this.showLsNumber,
this.showStudentgroup,
this.klasseFields,
this.roomFields,
this.subjectFields,
this.teacherFields
});
factory GetTimetableParamsOptions.fromJson(Map<String, dynamic> json) => _$GetTimetableParamsOptionsFromJson(json);
Map<String, dynamic> toJson() => _$GetTimetableParamsOptionsToJson(this);
}
enum GetTimetableParamsOptionsFields {
@JsonValue("id") id,
@JsonValue("name") name,
@JsonValue("longname") longname,
@JsonValue("externalkey") externalkey,
}
@JsonSerializable()
class GetTimetableParamsOptionsElement {
int id;
int type;
@JsonKey(includeIfNull: false)
GetTimetableParamsOptionsElementKeyType? keyType;
GetTimetableParamsOptionsElement({required this.id, required this.type, this.keyType});
factory GetTimetableParamsOptionsElement.fromJson(Map<String, dynamic> json) => _$GetTimetableParamsOptionsElementFromJson(json);
Map<String, dynamic> toJson() => _$GetTimetableParamsOptionsElementToJson(this);
}
enum GetTimetableParamsOptionsElementKeyType {
@JsonValue("id") id,
@JsonValue("name") name,
@JsonValue("externalkey") externalkey
}

View File

@ -0,0 +1,114 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'getTimetableParams.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
GetTimetableParams _$GetTimetableParamsFromJson(Map<String, dynamic> json) =>
GetTimetableParams(
options: GetTimetableParamsOptions.fromJson(
json['options'] as Map<String, dynamic>),
);
Map<String, dynamic> _$GetTimetableParamsToJson(GetTimetableParams instance) =>
<String, dynamic>{
'options': instance.options.toJson(),
};
GetTimetableParamsOptions _$GetTimetableParamsOptionsFromJson(
Map<String, dynamic> json) =>
GetTimetableParamsOptions(
element: GetTimetableParamsOptionsElement.fromJson(
json['element'] as Map<String, dynamic>),
startDate: json['startDate'] as int?,
endDate: json['endDate'] as int?,
onlyBaseTimetable: json['onlyBaseTimetable'] as bool?,
showBooking: json['showBooking'] as bool?,
showInfo: json['showInfo'] as bool?,
showSubstText: json['showSubstText'] as bool?,
showLsText: json['showLsText'] as bool?,
showLsNumber: json['showLsNumber'] as bool?,
showStudentgroup: json['showStudentgroup'] as bool?,
klasseFields: $enumDecodeNullable(
_$GetTimetableParamsOptionsFieldsEnumMap, json['klasseFields']),
roomFields: $enumDecodeNullable(
_$GetTimetableParamsOptionsFieldsEnumMap, json['roomFields']),
subjectFields: $enumDecodeNullable(
_$GetTimetableParamsOptionsFieldsEnumMap, json['subjectFields']),
teacherFields: $enumDecodeNullable(
_$GetTimetableParamsOptionsFieldsEnumMap, json['teacherFields']),
);
Map<String, dynamic> _$GetTimetableParamsOptionsToJson(
GetTimetableParamsOptions instance) {
final val = <String, dynamic>{
'element': instance.element.toJson(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('startDate', instance.startDate);
writeNotNull('endDate', instance.endDate);
writeNotNull('onlyBaseTimetable', instance.onlyBaseTimetable);
writeNotNull('showBooking', instance.showBooking);
writeNotNull('showInfo', instance.showInfo);
writeNotNull('showSubstText', instance.showSubstText);
writeNotNull('showLsText', instance.showLsText);
writeNotNull('showLsNumber', instance.showLsNumber);
writeNotNull('showStudentgroup', instance.showStudentgroup);
writeNotNull('klasseFields',
_$GetTimetableParamsOptionsFieldsEnumMap[instance.klasseFields]);
writeNotNull('roomFields',
_$GetTimetableParamsOptionsFieldsEnumMap[instance.roomFields]);
writeNotNull('subjectFields',
_$GetTimetableParamsOptionsFieldsEnumMap[instance.subjectFields]);
writeNotNull('teacherFields',
_$GetTimetableParamsOptionsFieldsEnumMap[instance.teacherFields]);
return val;
}
const _$GetTimetableParamsOptionsFieldsEnumMap = {
GetTimetableParamsOptionsFields.id: 'id',
GetTimetableParamsOptionsFields.name: 'name',
GetTimetableParamsOptionsFields.longname: 'longname',
GetTimetableParamsOptionsFields.externalkey: 'externalkey',
};
GetTimetableParamsOptionsElement _$GetTimetableParamsOptionsElementFromJson(
Map<String, dynamic> json) =>
GetTimetableParamsOptionsElement(
id: json['id'] as int,
type: json['type'] as int,
keyType: $enumDecodeNullable(
_$GetTimetableParamsOptionsElementKeyTypeEnumMap, json['keyType']),
);
Map<String, dynamic> _$GetTimetableParamsOptionsElementToJson(
GetTimetableParamsOptionsElement instance) {
final val = <String, dynamic>{
'id': instance.id,
'type': instance.type,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('keyType',
_$GetTimetableParamsOptionsElementKeyTypeEnumMap[instance.keyType]);
return val;
}
const _$GetTimetableParamsOptionsElementKeyTypeEnumMap = {
GetTimetableParamsOptionsElementKeyType.id: 'id',
GetTimetableParamsOptionsElementKeyType.name: 'name',
GetTimetableParamsOptionsElementKeyType.externalkey: 'externalkey',
};

View File

@ -0,0 +1,85 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:marianum_mobile/api/webuntis/apiResponse.dart';
part 'getTimetableResponse.g.dart';
@JsonSerializable(explicitToJson: true)
class GetTimetableResponse extends ApiResponse {
Set<GetTimetableResponseObject> result;
GetTimetableResponse(this.result);
factory GetTimetableResponse.fromJson(Map<String, dynamic> json) => _$GetTimetableResponseFromJson(json);
Map<String, dynamic> toJson() => _$GetTimetableResponseToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetTimetableResponseObject {
int id;
int date;
int startTime;
int endTime;
String? lstype;
String? code;
String? info;
String? substText;
String? lstext;
int? lsnumber;
String? statflags;
String? activityType;
String? sg;
String? bkRemark;
String? bkText;
List<dynamic> kl;
List<dynamic> te;
List<dynamic> su;
List<dynamic> ro;
GetTimetableResponseObject({
required this.id,
required this.date,
required this.startTime,
required this.endTime,
this.lstype,
this.code,
this.info,
this.substText,
this.lstext,
this.lsnumber,
this.statflags,
this.activityType,
this.sg,
this.bkRemark,
required this.kl,
required this.te,
required this.su,
required this.ro
});
factory GetTimetableResponseObject.fromJson(Map<String, dynamic> json) => _$GetTimetableResponseObjectFromJson(json);
Map<String, dynamic> toJson() => _$GetTimetableResponseObjectToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetTimetableResponseObjectFields {
List<GetTimetableResponseObjectFieldsObject>? te;
GetTimetableResponseObjectFields(this.te);
factory GetTimetableResponseObjectFields.fromJson(Map<String, dynamic> json) => _$GetTimetableResponseObjectFieldsFromJson(json);
Map<String, dynamic> toJson() => _$GetTimetableResponseObjectFieldsToJson(this);
}
@JsonSerializable()
class GetTimetableResponseObjectFieldsObject {
int? id;
String? name;
String? longname;
String? externalkey;
GetTimetableResponseObjectFieldsObject({this.id, this.name, this.longname, this.externalkey});
factory GetTimetableResponseObjectFieldsObject.fromJson(Map<String, dynamic> json) => _$GetTimetableResponseObjectFieldsObjectFromJson(json);
Map<String, dynamic> toJson() => _$GetTimetableResponseObjectFieldsObjectToJson(this);
}

View File

@ -0,0 +1,103 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'getTimetableResponse.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
GetTimetableResponse _$GetTimetableResponseFromJson(
Map<String, dynamic> json) =>
GetTimetableResponse(
(json['result'] as List<dynamic>)
.map((e) =>
GetTimetableResponseObject.fromJson(e as Map<String, dynamic>))
.toSet(),
);
Map<String, dynamic> _$GetTimetableResponseToJson(
GetTimetableResponse instance) =>
<String, dynamic>{
'result': instance.result.map((e) => e.toJson()).toList(),
};
GetTimetableResponseObject _$GetTimetableResponseObjectFromJson(
Map<String, dynamic> json) =>
GetTimetableResponseObject(
id: json['id'] as int,
date: json['date'] as int,
startTime: json['startTime'] as int,
endTime: json['endTime'] as int,
lstype: json['lstype'] as String?,
code: json['code'] as String?,
info: json['info'] as String?,
substText: json['substText'] as String?,
lstext: json['lstext'] as String?,
lsnumber: json['lsnumber'] as int?,
statflags: json['statflags'] as String?,
activityType: json['activityType'] as String?,
sg: json['sg'] as String?,
bkRemark: json['bkRemark'] as String?,
kl: json['kl'] as List<dynamic>,
te: json['te'] as List<dynamic>,
su: json['su'] as List<dynamic>,
ro: json['ro'] as List<dynamic>,
)..bkText = json['bkText'] as String?;
Map<String, dynamic> _$GetTimetableResponseObjectToJson(
GetTimetableResponseObject instance) =>
<String, dynamic>{
'id': instance.id,
'date': instance.date,
'startTime': instance.startTime,
'endTime': instance.endTime,
'lstype': instance.lstype,
'code': instance.code,
'info': instance.info,
'substText': instance.substText,
'lstext': instance.lstext,
'lsnumber': instance.lsnumber,
'statflags': instance.statflags,
'activityType': instance.activityType,
'sg': instance.sg,
'bkRemark': instance.bkRemark,
'bkText': instance.bkText,
'kl': instance.kl,
'te': instance.te,
'su': instance.su,
'ro': instance.ro,
};
GetTimetableResponseObjectFields _$GetTimetableResponseObjectFieldsFromJson(
Map<String, dynamic> json) =>
GetTimetableResponseObjectFields(
(json['te'] as List<dynamic>?)
?.map((e) => GetTimetableResponseObjectFieldsObject.fromJson(
e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$GetTimetableResponseObjectFieldsToJson(
GetTimetableResponseObjectFields instance) =>
<String, dynamic>{
'te': instance.te?.map((e) => e.toJson()).toList(),
};
GetTimetableResponseObjectFieldsObject
_$GetTimetableResponseObjectFieldsObjectFromJson(
Map<String, dynamic> json) =>
GetTimetableResponseObjectFieldsObject(
id: json['id'] as int?,
name: json['name'] as String?,
longname: json['longname'] as String?,
externalkey: json['externalkey'] as String?,
);
Map<String, dynamic> _$GetTimetableResponseObjectFieldsObjectToJson(
GetTimetableResponseObjectFieldsObject instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'longname': instance.longname,
'externalkey': instance.externalkey,
};

View File

@ -0,0 +1,54 @@
import 'dart:convert';
import 'dart:developer';
import 'package:marianum_mobile/api/apiRequest.dart';
import 'package:http/http.dart' as http;
import 'package:marianum_mobile/api/webuntis/webuntisError.dart';
import 'package:marianum_mobile/api/webuntis/apiResponse.dart';
import 'apiParams.dart';
import 'queries/authenticate/authenticate.dart';
abstract class WebuntisApi extends ApiRequest {
String method;
ApiParams? genericParam;
http.Response? response;
bool authenticatedResponse;
WebuntisApi(this.method, this.genericParam, {this.authenticatedResponse = true}) : super(Uri.parse("https://peleus.webuntis.com/WebUntis/jsonrpc.do?school=marianum-fulda"));
Future<String> query(WebuntisApi untis) async {
String query = '{"id":"ID","method":"$method","params":${untis._body()},"jsonrpc":"2.0"}';
log(query);
String sessionId = "0";
if(authenticatedResponse) {
sessionId = (await Authenticate.getSession()).sessionId;
}
http.Response data = await post(query, {"Cookie": "JSESSIONID=$sessionId"});
response = data;
dynamic jsonData = jsonDecode(data.body);
if(jsonData['error'] != null) {
if(jsonData['error']['code'] == -8520) {
await Authenticate.createSession();
this.query(untis);
} else {
throw WebuntisError(jsonData['error']['message'], jsonData['error']['code']);
}
}
return data.body;
}
dynamic finalize(dynamic response) {
response.rawResponse = this.response!;
return response;
}
Future<ApiResponse> run();
String _body() {
return genericParam == null ? "{}" : jsonEncode(genericParam);
}
}

View File

@ -0,0 +1,10 @@
class WebuntisError {
String message;
int code;
WebuntisError(this.message, this.code);
String toString() {
return "WebUntis ($code): $message";
}
}

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:marianum_mobile/data/incommingPackets/talkNotificationsPacket.dart'; import 'package:marianum_mobile/data/incommingPackets/talkNotificationsPacket.dart';
import 'package:marianum_mobile/screen/pages/timetable/testTimetable.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -42,7 +43,7 @@ class _AppState extends State<App> {
PageView( PageView(
controller: pageController, controller: pageController,
children: const [ children: const [
Timetable(), TestTimeTable(),
Talk(), Talk(),
Files(), Files(),
Overhang(), Overhang(),

View File

@ -1,12 +1,19 @@
import 'dart:io'; import 'dart:io';
import 'dart:developer';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_login/flutter_login.dart'; import 'package:flutter_login/flutter_login.dart';
import 'package:marianum_mobile/api/apiError.dart';
import 'package:marianum_mobile/api/webuntis/webuntisError.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../../api/webuntis/queries/authenticate/authenticateParams.dart';
import '../../api/webuntis/queries/authenticate/authenticate.dart';
import '../../data/accountModel.dart'; import '../../data/accountModel.dart';
class Login extends StatefulWidget { class Login extends StatefulWidget {
const Login({Key? key}) : super(key: key); const Login({Key? key}) : super(key: key);
@ -15,32 +22,75 @@ class Login extends StatefulWidget {
} }
class _LoginState extends State<Login> { class _LoginState extends State<Login> {
Duration get loginTime => const Duration(milliseconds: 2250); bool displayDisclaimerText = true;
final Future<SharedPreferences> _storage = SharedPreferences.getInstance(); String? _checkInput(value){
return (value ?? "").length == 0 ? "Eingabe erforderlich" : null;
String? checkInput(value){
return (value ?? "").length < 5 ? "Eingabe zu kurz" : null;
} }
Future<String?> _login(LoginData data) async {
SharedPreferences preferences = await SharedPreferences.getInstance();
preferences.setBool("loggedIn", false);
try {
await Authenticate(
AuthenticateParams(
user: data.name,
password: data.password,
)
).run().then((value) => {
log(value.sessionId)
});
} on WebuntisError catch(e) {
return e.toString();
} on ApiError catch(e) {
return e.toString();
}
setState(() {
displayDisclaimerText = false;
});
preferences.setBool("loggedIn", true);
preferences.setString("username", data.name);
preferences.setString("password", data.password);
return null;
}
Future<String> _resetPassword(String name) {
return Future.delayed(Duration.zero).then((_) {
return "Diese Funktion steht nicht zur Verfügung!";
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return FlutterLogin( return FlutterLogin(
logo: Image.file(File("assets/logo/icon.png")).image, logo: Image.file(File("assets/logo/icon.png")).image,
userValidator: checkInput, userValidator: _checkInput,
passwordValidator: checkInput, passwordValidator: _checkInput,
onSubmitAnimationCompleted: () => Provider.of<AccountModel>(context, listen: false).login(),
onLogin: _authUser, savedEmail: "test",
onLogin: _login,
onSignup: null, onSignup: null,
onRecoverPassword: _recoverPassword,
onRecoverPassword: _resetPassword,
hideForgotPasswordButton: true,
theme: LoginTheme( theme: LoginTheme(
primaryColor: Theme.of(context).primaryColor, primaryColor: Theme.of(context).primaryColor,
accentColor: Colors.white,
errorColor: Theme.of(context).primaryColor,
footerBottomPadding: 10,
textFieldStyle: const TextStyle(
fontWeight: FontWeight.w500
),
cardTheme: const CardTheme( cardTheme: const CardTheme(
elevation: 10, elevation: 10,
shape: InputBorder.none,
), ),
), ),
@ -52,42 +102,23 @@ class _LoginState extends State<Login> {
disableCustomPageTransformer: true, disableCustomPageTransformer: true,
headerWidget: const Padding( headerWidget: Padding(
padding: EdgeInsets.only(bottom: 10), padding: const EdgeInsets.only(bottom: 30),
child: Center( child: Center(
child: Text( child: Visibility(
"Dies ist ein Inoffizieller Nextclient & Webuntis Client und wird nicht vom Marianum selbst betrieben.\nBitte bedenke, dass deine persönlichen Anmelde & Infodaten durch dritte, nicht vom Marianum betriebene, Systeme geleitet werden!", visible: displayDisclaimerText,
child: const Text(
"Dies ist ein Inoffizieller Nextclient & Webuntis Client und wird nicht vom Marianum selbst betrieben.\nKeinerlei Gewähr für Vollständigkeit, Richtigkeit und Aktualität!",
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
), ),
),
footer: "Marianum Fulda - Die persönliche Schule!", footer: "Marianum Fulda - Die persönliche Schule",
title: "Marianum", title: "Marianum Fulda",
hideForgotPasswordButton: true,
userType: LoginUserType.name, userType: LoginUserType.name,
); );
} }
Future<String?> _authUser(LoginData data) async {
final SharedPreferences preferences = await _storage;
preferences.setBool("loggedIn", true);
preferences.setString("username", data.name);
preferences.setString("password", data.password);
debugPrint('Name: ${data.name}, Password: ${data.password}');
return Future.delayed(loginTime).then((_) {
Provider.of<AccountModel>(context, listen: false).login();
return null;
});
}
Future<String> _recoverPassword(String name) {
return Future.delayed(loginTime).then((_) {
return "Diese Funktion steht nicht zur Verfügung!";
});
}
} }

View File

@ -0,0 +1,145 @@
import 'dart:developer';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:jiffy/jiffy.dart';
import 'package:marianum_mobile/api/webuntis/queries/getRooms/getRooms.dart';
import 'package:marianum_mobile/data/incommingPackets/timetablePacket.dart';
import 'package:marianum_mobile/widget/loadingSpinner.dart';
import 'package:marianum_mobile/widget/offlineError.dart';
import 'package:timetable_view/timetable_view.dart';
import '../../../api/webuntis/queries/getTimetable/getTimetableParams.dart';
import '../../../api/webuntis/queries/getTimetable/getTimetableResponse.dart';
import '../../../api/webuntis/queries/getTimetable/getTimetable.dart';
class TestTimeTable extends StatefulWidget {
const TestTimeTable({Key? key}) : super(key: key);
@override
State<TestTimeTable> createState() => _TestTimeTableState();
}
class _TestTimeTableState extends State<TestTimeTable> {
late Future<GetTimetableResponse> data;
@override
void initState() {
data = GetTimetable(
GetTimetableParams(
options: GetTimetableParamsOptions(
element: GetTimetableParamsOptionsElement(
id: 92,
type: 5,
keyType: GetTimetableParamsOptionsElementKeyType.id,
),
startDate: 20230206,
endDate: 20230212,
)
)
).run();
GetRooms().run().then((value) => {
log(value.rawResponse.body)
});
super.initState();
}
@override
Widget build(BuildContext context) {
return FutureBuilder(
builder: (BuildContext context, AsyncSnapshot<GetTimetableResponse> snapshot) {
if(snapshot.hasData) {
return Center(
child: TimetableView(
laneEventsList: _buildLaneEvents(snapshot.data!),
onEventTap: (TableEvent event) {},
timetableStyle: CustomTableStyle(context),
onEmptySlotTap: (int laneIndex, TableEventTime start, TableEventTime end) => {},
),
);
} else if(snapshot.hasError) {
return const OfflineBanner(text: "Der Stundenplan konnte nicht geladen werden!");
} else {
return const Center(
child: CircularProgressIndicator(),
);
}
},
future: data,
);
}
List<LaneEvents> _buildLaneEvents(GetTimetableResponse data) {
List<LaneEvents> laneEvents = List<LaneEvents>.empty(growable: true);
Jiffy.locale("de");
List<int> dayList = data.result.map((e) => e.date).toSet().toList();
dayList.sort((a, b) => a-b);
dayList.forEach((day) {
//Every Day
laneEvents.add(
LaneEvents(
lane: Lane(
laneIndex: day,
name: "${Jiffy(day.toString()).format("dd.MM.yy")}\n${Jiffy(day.toString()).format("EEEE")}",
textStyle: TextStyle(
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.bold,
fontSize: 14
)
),
events: List<TableEvent>.generate(
data.result.where((element) => element.date == day).length,
(index) {
GetTimetableResponseObject tableEvent = data.result.where((element) => element.date == day).elementAt(index);
return TableEvent(
title: "${tableEvent.substText}",
eventId: tableEvent.id,
laneIndex: day,
startTime: parseTime(tableEvent.startTime),
endTime: parseTime(tableEvent.endTime),
padding: const EdgeInsets.all(5),
backgroundColor: Theme.of(context).primaryColor,
location: "\n${tableEvent.statflags}",
);
}
)
)
);
});
return laneEvents;
}
TableEventTime parseTime(int input) {
String time = input.toString().length < 4 ? "0$input" : input.toString();
return TableEventTime(hour: int.parse(time.substring(0, 2)), minute: int.parse(time.substring(2, 4)));
}
}
class CustomTableStyle extends TimetableStyle {
dynamic context;
CustomTableStyle(this.context);
@override
int get startHour => 07;
@override
int get endHour => 17;
@override
double get laneWidth => 100;
@override
Color get cornerColor => Theme.of(context).primaryColor;
@override
Color get timeItemTextColor => Theme.of(context).primaryColor;
@override
double get timeItemHeight => 60;
@override
double get timeItemWidth => 40;
}

View File

@ -0,0 +1,32 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class OfflineBanner extends StatelessWidget {
final IconData icon;
final String text;
const OfflineBanner({Key? key, this.icon = Icons.report_gmailerrorred, this.text = "Es ist ein Fehler aufgetreten!"}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Container(
margin: const EdgeInsets.only(top: 100, left: 20, right: 20),
child: Column(
children: [
Container(
margin: const EdgeInsets.all(30),
child: Icon(icon, color: Colors.grey, size: 60),
),
Text(text,
style: const TextStyle(
fontSize: 20,
color: Colors.grey,
),
textAlign: TextAlign.center,
),
],
),
),
);
}
}

View File

@ -46,10 +46,13 @@ dependencies:
web_socket_channel: ^2.2.0 web_socket_channel: ^2.2.0
jiffy: ^5.0.0 jiffy: ^5.0.0
timetable_view: ^0.3.0 timetable_view: ^0.3.0
json_annotation: ^4.8.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
json_serializable: ^6.6.1
build_runner: ^2.3.3
# The "flutter_lints" package below contains a set of recommended lints to # The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is # encourage good coding practices. The lint set provided by the package is