Compare commits
2 Commits
2bc428976a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| e0007dcf33 | |||
| 4e808e234d |
7
.idea/App-Gaslieferung.iml
generated
@ -2,10 +2,15 @@
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/.pub" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Dart SDK" level="project" />
|
||||
<orderEntry type="library" name="Dart Packages" level="project" />
|
||||
<orderEntry type="library" name="Flutter Plugins" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
520
.idea/libraries/Dart_Packages.xml
generated
@ -2,6 +2,55 @@
|
||||
<library name="Dart Packages" type="DartPackagesLibraryType">
|
||||
<properties>
|
||||
<option name="packageNameToDirsMap">
|
||||
<entry key="_fe_analyzer_shared">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-93.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="analyzer">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/analyzer-10.0.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="app_links">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/app_links-7.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="app_links_linux">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/app_links_linux-1.0.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="app_links_platform_interface">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/app_links_platform_interface-2.0.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="app_links_web">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/app_links_web-1.0.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="args">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/args-2.7.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="async">
|
||||
<value>
|
||||
<list>
|
||||
@ -9,6 +58,13 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="bloc">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/bloc-9.2.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="boolean_selector">
|
||||
<value>
|
||||
<list>
|
||||
@ -16,6 +72,48 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="build">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/build-4.0.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="build_config">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/build_config-1.2.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="build_daemon">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/build_daemon-4.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="build_runner">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/build_runner-2.10.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="built_collection">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/built_collection-5.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="built_value">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/built_value-8.12.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="characters">
|
||||
<value>
|
||||
<list>
|
||||
@ -23,6 +121,13 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="checked_yaml">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/checked_yaml-2.0.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="clock">
|
||||
<value>
|
||||
<list>
|
||||
@ -30,6 +135,13 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="code_builder">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/code_builder-4.11.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="collection">
|
||||
<value>
|
||||
<list>
|
||||
@ -37,6 +149,20 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="convert">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/convert-3.1.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="crypto">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/crypto-3.0.7/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="cupertino_icons">
|
||||
<value>
|
||||
<list>
|
||||
@ -44,6 +170,13 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="dart_style">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/dart_style-3.1.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="fake_async">
|
||||
<value>
|
||||
<list>
|
||||
@ -51,6 +184,27 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="ffi">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/ffi-2.1.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="file">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/file-7.0.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="fixnum">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/fixnum-1.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter">
|
||||
<value>
|
||||
<list>
|
||||
@ -58,6 +212,13 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_bloc">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_bloc-9.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_lints">
|
||||
<value>
|
||||
<list>
|
||||
@ -72,6 +233,83 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_web_plugins">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/flutter/flutter/packages/flutter_web_plugins/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="glob">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/glob-2.1.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="graphs">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/graphs-2.3.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="gtk">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/gtk-2.1.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="http">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/http-1.6.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="http_multi_server">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/http_multi_server-3.2.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="http_parser">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/http_parser-4.1.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="io">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/io-1.0.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="json_annotation">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/json_annotation-4.10.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="json_schema">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/json_schema-5.2.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="json_serializable">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/json_serializable-6.12.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="leak_tracker">
|
||||
<value>
|
||||
<list>
|
||||
@ -100,6 +338,13 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="logging">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/logging-1.3.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="matcher">
|
||||
<value>
|
||||
<list>
|
||||
@ -121,6 +366,27 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="mime">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/mime-2.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="nested">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/nested-1.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="package_config">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/package_config-2.2.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="path">
|
||||
<value>
|
||||
<list>
|
||||
@ -128,6 +394,69 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="plugin_platform_interface">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.8/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="pool">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/pool-1.5.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="provider">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/provider-6.1.5+1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="pub_semver">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/pub_semver-2.2.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="pubspec_parse">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/pubspec_parse-1.5.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="quiver">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/quiver-3.2.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="rfc_6901">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/rfc_6901-0.2.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="shelf">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/shelf-1.4.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="shelf_web_socket">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/shelf_web_socket-3.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="sky_engine">
|
||||
<value>
|
||||
<list>
|
||||
@ -135,6 +464,20 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="source_gen">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/source_gen-4.2.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="source_helper">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/source_helper-1.3.10/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="source_span">
|
||||
<value>
|
||||
<list>
|
||||
@ -156,6 +499,13 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="stream_transform">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/stream_transform-2.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="string_scanner">
|
||||
<value>
|
||||
<list>
|
||||
@ -177,6 +527,76 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="typed_data">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/typed_data-1.4.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="uri">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/uri-1.0.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher-6.3.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher_android">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.28/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher_ios">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.6/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher_linux">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher_macos">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher_platform_interface">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_platform_interface-2.3.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher_web">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="url_launcher_windows">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.5/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="vector_math">
|
||||
<value>
|
||||
<list>
|
||||
@ -191,36 +611,136 @@
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="watcher">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/watcher-1.2.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="web">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/web-1.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="web_socket">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/web_socket-1.0.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="web_socket_channel">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/web_socket_channel-3.0.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="yaml">
|
||||
<value>
|
||||
<list>
|
||||
<option value="$USER_HOME$/.pub-cache/hosted/pub.dev/yaml-3.1.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
</option>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-93.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/analyzer-10.0.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/app_links-7.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/app_links_linux-1.0.3/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/app_links_platform_interface-2.0.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/app_links_web-1.0.4/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/args-2.7.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/async-2.13.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/bloc-9.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/build-4.0.4/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/build_config-1.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/build_daemon-4.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/build_runner-2.10.5/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/built_collection-5.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/built_value-8.12.3/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/characters-1.4.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/checked_yaml-2.0.4/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/clock-1.1.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/code_builder-4.11.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/collection-1.19.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/convert-3.1.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/crypto-3.0.7/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/cupertino_icons-1.0.8/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/dart_style-3.1.5/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/fake_async-1.3.3/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/ffi-2.1.5/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/file-7.0.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/fixnum-1.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_bloc-9.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/flutter_lints-6.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/glob-2.1.3/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/graphs-2.3.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/gtk-2.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/http-1.6.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/http_multi_server-3.2.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/http_parser-4.1.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/io-1.0.5/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/json_annotation-4.10.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/json_schema-5.2.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/json_serializable-6.12.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/leak_tracker-11.0.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/leak_tracker_flutter_testing-3.0.10/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/leak_tracker_testing-3.0.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/lints-6.1.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/logging-1.3.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/matcher-0.12.17/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/material_color_utilities-0.11.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/meta-1.17.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/mime-2.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/nested-1.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/package_config-2.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/path-1.9.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/plugin_platform_interface-2.1.8/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/pool-1.5.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/provider-6.1.5+1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/pub_semver-2.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/pubspec_parse-1.5.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/quiver-3.2.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/rfc_6901-0.2.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/shelf-1.4.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/shelf_web_socket-3.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/source_gen-4.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/source_helper-1.3.10/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/source_span-1.10.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/stack_trace-1.12.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/stream_channel-2.1.4/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/stream_transform-2.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/string_scanner-1.4.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/term_glyph-1.2.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/test_api-0.7.7/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/typed_data-1.4.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/uri-1.0.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher-6.3.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.28/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.6/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.5/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_platform_interface-2.3.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.5/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/vector_math-2.2.0/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/vm_service-15.0.2/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/watcher-1.2.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/web-1.1.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/web_socket-1.0.1/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/web_socket_channel-3.0.3/lib" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/yaml-3.1.3/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/flutter/bin/cache/pkg/sky_engine/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/flutter/packages/flutter/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/flutter/packages/flutter_test/lib" />
|
||||
<root url="file://$USER_HOME$/flutter/flutter/packages/flutter_web_plugins/lib" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
|
||||
14
.idea/libraries/Flutter_Plugins.xml
generated
@ -1,6 +1,18 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Flutter Plugins" type="FlutterPluginsLibraryType">
|
||||
<CLASSES />
|
||||
<CLASSES>
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/app_links-7.0.0" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/app_links_linux-1.0.3" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/app_links_web-1.0.4" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/gtk-2.1.0" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.28" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_windows-3.1.5" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_web-2.4.2" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.6" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher-6.3.2" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_linux-3.2.2" />
|
||||
<root url="file://$USER_HOME$/.pub-cache/hosted/pub.dev/url_launcher_macos-3.2.5" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
|
||||
10
.idea/material_theme_project_new.xml
generated
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MaterialThemeProjectNewConfig">
|
||||
<option name="metadata">
|
||||
<MTProjectMetadataState>
|
||||
<option name="userId" value="61c21d43:19c18f07a9d:-7fff" />
|
||||
</MTProjectMetadataState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@ -24,6 +24,20 @@
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
|
||||
<!-- Bestehende Intent-Filter bleiben -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
|
||||
<!-- Füge diesen Intent-Filter hinzu -->
|
||||
<intent-filter android:autoVerify="true">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="myapp" android:host="callback" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!-- Don't delete the meta-data below.
|
||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||
|
||||
BIN
assets/fonts/Inter-Italic-VariableFont_opsz,wght.ttf
Normal file
BIN
assets/fonts/Inter-VariableFont_opsz,wght.ttf
Normal file
BIN
assets/graphics/bg-carrier-cylinder-duo.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
assets/graphics/bg-supplier-clouds-white-bg.png
Normal file
|
After Width: | Height: | Size: 304 KiB |
BIN
assets/graphics/bg-supplier-clouds.png
Normal file
|
After Width: | Height: | Size: 460 KiB |
BIN
assets/graphics/gas-carrier.png
Normal file
|
After Width: | Height: | Size: 159 KiB |
BIN
assets/graphics/gas-tank-group.png
Normal file
|
After Width: | Height: | Size: 276 KiB |
BIN
assets/graphics/gas-tank.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
assets/graphics/location-pin-cloud.png
Normal file
|
After Width: | Height: | Size: 715 KiB |
BIN
assets/graphics/supplier.png
Normal file
|
After Width: | Height: | Size: 289 KiB |
BIN
assets/graphics/truck.png
Normal file
|
After Width: | Height: | Size: 265 KiB |
@ -45,5 +45,19 @@
|
||||
<true/>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>CFBundleURLName</key>
|
||||
<string>myapp</string>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>myapp</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
82
lib/bloc/authentication/auth_bloc.dart
Normal file
@ -0,0 +1,82 @@
|
||||
import 'package:app_gaslieferung/bloc/authentication/auth_event.dart';
|
||||
import 'package:app_gaslieferung/bloc/authentication/auth_state.dart';
|
||||
import 'package:app_gaslieferung/bloc/message_wrapper/message_bloc.dart';
|
||||
import 'package:app_gaslieferung/bloc/message_wrapper/message_event.dart';
|
||||
import 'package:app_links/app_links.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../exceptions/login.dart';
|
||||
import '../../util/login.dart';
|
||||
|
||||
class AuthBloc extends Bloc<AuthEvent, AuthState> {
|
||||
final _appLinks = AppLinks();
|
||||
final MessageBloc msgBloc;
|
||||
final String url;
|
||||
|
||||
AuthBloc({required this.url, required this.msgBloc}) : super(UnauthenticatedState()) {
|
||||
on<AuthLoginEvent>(_onLoginEvent);
|
||||
on<AuthLogoutEvent>(_onLogoutEvent);
|
||||
on<AuthFailedEvent>(_onFailedEvent);
|
||||
on<AuthLoginSuccessEvent>(_onLoginSuccessEvent);
|
||||
|
||||
_initDeepLinks();
|
||||
}
|
||||
|
||||
void _initDeepLinks() async {
|
||||
// Listen to the stream if any further deeplink is coming in.
|
||||
_appLinks.uriLinkStream.listen((uri) {
|
||||
_handleDeepLink(uri);
|
||||
});
|
||||
}
|
||||
|
||||
/// Handle Deeplink if login request is coming in.
|
||||
void _handleDeepLink(Uri uri) {
|
||||
if (state is UnauthenticatedState) {
|
||||
try {
|
||||
add(AuthLoginSuccessEvent(getSessionIdFromUrl(uri)));
|
||||
} on LoginInvalidUrlException catch (e) {
|
||||
msgBloc.add(MessageShow(message: e.toString()));
|
||||
} on LoginNoSessionIdException catch (e) {
|
||||
msgBloc.add(MessageShow(message: e.toString()));
|
||||
} catch (e, st) {
|
||||
debugPrint("Fehler beim Login. Stacktrace: $st");
|
||||
debugPrint("Fehler beim Login. Message: $e");
|
||||
|
||||
add(
|
||||
AuthFailedEvent(
|
||||
message:
|
||||
"Es ist ein unbekannter Fehler aufgetreten. Versuchen Sie es später erneut oder wenden Sie sich an die Zentrale.",
|
||||
),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// TODO: handle message if user is already logged in
|
||||
debugPrint("NOT STATE");
|
||||
debugPrint("$state");
|
||||
}
|
||||
}
|
||||
|
||||
void _onLoginSuccessEvent(
|
||||
AuthLoginSuccessEvent event,
|
||||
Emitter<AuthState> emit,
|
||||
) {
|
||||
emit(AuthenticatedState(sessionId: event.sessionId));
|
||||
}
|
||||
|
||||
void _onLoginEvent(AuthLoginEvent event, Emitter<AuthState> emit) async {
|
||||
await launchUrl(
|
||||
Uri.parse(url),
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
}
|
||||
|
||||
void _onLogoutEvent(AuthLogoutEvent event, Emitter<AuthState> emit) {
|
||||
|
||||
}
|
||||
|
||||
void _onFailedEvent(AuthFailedEvent event, Emitter<AuthState> emit) {
|
||||
emit(UnauthenticatedState());
|
||||
}
|
||||
}
|
||||
17
lib/bloc/authentication/auth_event.dart
Normal file
@ -0,0 +1,17 @@
|
||||
abstract class AuthEvent {}
|
||||
|
||||
class AuthLoginEvent extends AuthEvent {}
|
||||
|
||||
class AuthLoginSuccessEvent extends AuthEvent {
|
||||
String sessionId;
|
||||
|
||||
AuthLoginSuccessEvent(this.sessionId);
|
||||
}
|
||||
|
||||
class AuthLogoutEvent extends AuthEvent {}
|
||||
|
||||
class AuthFailedEvent extends AuthEvent {
|
||||
String message;
|
||||
|
||||
AuthFailedEvent({required this.message});
|
||||
}
|
||||
17
lib/bloc/authentication/auth_state.dart
Normal file
@ -0,0 +1,17 @@
|
||||
abstract class AuthState {}
|
||||
|
||||
class AuthInitialState extends AuthState {}
|
||||
|
||||
class UnauthenticatedState extends AuthState {}
|
||||
|
||||
class AuthenticatedState extends AuthState {
|
||||
String sessionId;
|
||||
|
||||
AuthenticatedState({required this.sessionId});
|
||||
}
|
||||
|
||||
class AuthFailedState extends AuthState {
|
||||
String message;
|
||||
|
||||
AuthFailedState({required this.message});
|
||||
}
|
||||
21
lib/bloc/message_wrapper/message_bloc.dart
Normal file
@ -0,0 +1,21 @@
|
||||
import 'package:bloc/bloc.dart';
|
||||
|
||||
import 'message_event.dart';
|
||||
import 'message_state.dart';
|
||||
|
||||
class MessageBloc extends Bloc<MessageEvent, MessageState> {
|
||||
MessageBloc() : super(MessageInitialState()) {
|
||||
on<MessageShow>(_show);
|
||||
on<MessageHide>(_hide);
|
||||
}
|
||||
|
||||
void _show(MessageShow event, Emitter<MessageState> emit) async {
|
||||
emit(MessageShowState(message: event.message));
|
||||
await Future.delayed(event.duration);
|
||||
emit(MessageHideState());
|
||||
}
|
||||
|
||||
void _hide(MessageHide event, Emitter<MessageState> emit) {
|
||||
emit(MessageHideState());
|
||||
}
|
||||
}
|
||||
10
lib/bloc/message_wrapper/message_event.dart
Normal file
@ -0,0 +1,10 @@
|
||||
abstract class MessageEvent {}
|
||||
|
||||
class MessageShow extends MessageEvent {
|
||||
String message;
|
||||
Duration duration;
|
||||
|
||||
MessageShow({required this.message}) : duration = Duration(seconds: 5);
|
||||
}
|
||||
|
||||
class MessageHide extends MessageEvent {}
|
||||
7
lib/bloc/message_wrapper/message_state.dart
Normal file
@ -0,0 +1,7 @@
|
||||
abstract class MessageState {}
|
||||
class MessageInitialState extends MessageState {}
|
||||
class MessageShowState extends MessageState {
|
||||
String message;
|
||||
MessageShowState({required this.message});
|
||||
}
|
||||
class MessageHideState extends MessageState {}
|
||||
25
lib/bloc/tour/tour_bloc.dart
Normal file
@ -0,0 +1,25 @@
|
||||
import 'package:app_gaslieferung/repository/tour_repository.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import 'tour_event.dart';
|
||||
import 'tour_state.dart';
|
||||
|
||||
class TourBloc extends Bloc<TourEvent, TourState> {
|
||||
TourRepository tour;
|
||||
|
||||
TourBloc({required this.tour}) : super(TourInitial()) {
|
||||
on<TourLoadEvent>(_onTourLoadEvent);
|
||||
}
|
||||
|
||||
void _onTourLoadEvent(TourLoadEvent event, Emitter<TourState> emit) async {
|
||||
emit(TourLoading());
|
||||
try {
|
||||
final tour = await this.tour.getTour(event.sessionId, event.carId);
|
||||
emit(TourLoaded(tour: tour));
|
||||
} catch (e, st) {
|
||||
debugPrint(st.toString());
|
||||
emit(TourLoadingFailed(message: e.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
8
lib/bloc/tour/tour_event.dart
Normal file
@ -0,0 +1,8 @@
|
||||
abstract class TourEvent {}
|
||||
|
||||
class TourLoadEvent extends TourEvent {
|
||||
String carId;
|
||||
String sessionId;
|
||||
|
||||
TourLoadEvent({required this.carId, required this.sessionId});
|
||||
}
|
||||
20
lib/bloc/tour/tour_state.dart
Normal file
@ -0,0 +1,20 @@
|
||||
import 'package:app_gaslieferung/model/delivery.dart';
|
||||
import 'package:app_gaslieferung/model/tour.dart';
|
||||
|
||||
abstract class TourState {}
|
||||
|
||||
class TourInitial extends TourState {}
|
||||
|
||||
class TourLoaded extends TourState {
|
||||
Tour tour;
|
||||
|
||||
TourLoaded({required this.tour});
|
||||
}
|
||||
|
||||
class TourLoading extends TourState {}
|
||||
|
||||
class TourLoadingFailed extends TourState {
|
||||
String message;
|
||||
|
||||
TourLoadingFailed({required this.message});
|
||||
}
|
||||
27
lib/bloc/tour_select/bloc.dart
Normal file
@ -0,0 +1,27 @@
|
||||
import 'package:app_gaslieferung/model/car.dart';
|
||||
import 'package:app_gaslieferung/repository/tour_repository.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'event.dart';
|
||||
import 'state.dart';
|
||||
|
||||
class TourSelectBloc extends Bloc<TourSelectEvent, TourSelectState> {
|
||||
TourRepository repository;
|
||||
|
||||
TourSelectBloc({required this.repository}) : super(TourSelectInitial()) {
|
||||
on<TourSelectLoadMetadataEvent>(_onTourSelectLoadCarsEvent);
|
||||
}
|
||||
|
||||
void _onTourSelectLoadCarsEvent(
|
||||
TourSelectLoadMetadataEvent event,
|
||||
Emitter<TourSelectState> emit,
|
||||
) async {
|
||||
emit(TourSelectLoading());
|
||||
try {
|
||||
emit(TourSelectLoaded(data: await repository.getSupplierTourMetadata(event.sessionId)));
|
||||
} catch (e,st) {
|
||||
debugPrint("Error on loading cars: $e\n$st");
|
||||
emit(TourSelectError(message: "Es ist ein unbekannter Fehler aufgetreten. Versuchen Sie es erneut."));
|
||||
}
|
||||
}
|
||||
}
|
||||
7
lib/bloc/tour_select/event.dart
Normal file
@ -0,0 +1,7 @@
|
||||
abstract class TourSelectEvent {}
|
||||
|
||||
class TourSelectLoadMetadataEvent extends TourSelectEvent {
|
||||
String sessionId;
|
||||
|
||||
TourSelectLoadMetadataEvent({required this.sessionId});
|
||||
}
|
||||
19
lib/bloc/tour_select/state.dart
Normal file
@ -0,0 +1,19 @@
|
||||
import 'package:app_gaslieferung/model/supplier.dart';
|
||||
|
||||
abstract class TourSelectState {}
|
||||
|
||||
class TourSelectInitial extends TourSelectState {}
|
||||
|
||||
class TourSelectLoading extends TourSelectState {}
|
||||
|
||||
class TourSelectLoaded extends TourSelectState {
|
||||
SupplierTourMetadata data;
|
||||
|
||||
TourSelectLoaded({required this.data});
|
||||
}
|
||||
|
||||
class TourSelectError extends TourSelectState {
|
||||
String message;
|
||||
|
||||
TourSelectError({required this.message});
|
||||
}
|
||||
25
lib/dto/car_dto.dart
Normal file
@ -0,0 +1,25 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'car_dto.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class CarDTO {
|
||||
@JsonKey(name: 'id')
|
||||
final int id;
|
||||
|
||||
@JsonKey(name: 'driver_name')
|
||||
final String? driverName;
|
||||
|
||||
@JsonKey(name: 'car_name')
|
||||
final String carName;
|
||||
|
||||
CarDTO({
|
||||
required this.id,
|
||||
required this.carName,
|
||||
required this.driverName,
|
||||
});
|
||||
|
||||
factory CarDTO.fromJson(Map<String, dynamic> json) => _$CarDTOFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$CarDTOToJson(this);
|
||||
}
|
||||
19
lib/dto/car_dto.g.dart
Normal file
@ -0,0 +1,19 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'car_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
CarDTO _$CarDTOFromJson(Map<String, dynamic> json) => CarDTO(
|
||||
id: (json['id'] as num).toInt(),
|
||||
carName: json['car_name'] as String,
|
||||
driverName: json['driver_name'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CarDTOToJson(CarDTO instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'driver_name': instance.driverName,
|
||||
'car_name': instance.carName,
|
||||
};
|
||||
20
lib/dto/delivery_dto.dart
Normal file
@ -0,0 +1,20 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'car_dto.dart';
|
||||
|
||||
part 'delivery_dto.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class DeliveryDTO {
|
||||
@JsonKey(name: 'amount_deliveries')
|
||||
final int amountDeliveries;
|
||||
|
||||
final CarDTO car;
|
||||
|
||||
DeliveryDTO({
|
||||
required this.amountDeliveries,
|
||||
required this.car,
|
||||
});
|
||||
|
||||
factory DeliveryDTO.fromJson(Map<String, dynamic> json) => _$DeliveryDTOFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$DeliveryDTOToJson(this);
|
||||
}
|
||||
18
lib/dto/delivery_dto.g.dart
Normal file
@ -0,0 +1,18 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'delivery_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
DeliveryDTO _$DeliveryDTOFromJson(Map<String, dynamic> json) => DeliveryDTO(
|
||||
amountDeliveries: (json['amount_deliveries'] as num).toInt(),
|
||||
car: CarDTO.fromJson(json['car'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeliveryDTOToJson(DeliveryDTO instance) =>
|
||||
<String, dynamic>{
|
||||
'amount_deliveries': instance.amountDeliveries,
|
||||
'car': instance.car.toJson(),
|
||||
};
|
||||
14
lib/dto/fail_response_dto.dart
Normal file
@ -0,0 +1,14 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'fail_response_dto.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class FailResponseDTO {
|
||||
int? code;
|
||||
String message;
|
||||
|
||||
FailResponseDTO({required this.message, required this.code});
|
||||
|
||||
factory FailResponseDTO.fromJson(Map<String, dynamic> json) => _$FailResponseDTOFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$FailResponseDTOToJson(this);
|
||||
}
|
||||
16
lib/dto/fail_response_dto.g.dart
Normal file
@ -0,0 +1,16 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'fail_response_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
FailResponseDTO _$FailResponseDTOFromJson(Map<String, dynamic> json) =>
|
||||
FailResponseDTO(
|
||||
message: json['message'] as String,
|
||||
code: (json['code'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$FailResponseDTOToJson(FailResponseDTO instance) =>
|
||||
<String, dynamic>{'code': instance.code, 'message': instance.message};
|
||||
19
lib/dto/get_deliveries_dto.dart
Normal file
@ -0,0 +1,19 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'delivery_dto.dart';
|
||||
|
||||
part 'get_deliveries_dto.g.dart';
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
class GetDeliveriesDTO {
|
||||
final List<DeliveryDTO> deliveries;
|
||||
final String date;
|
||||
|
||||
GetDeliveriesDTO({
|
||||
required this.deliveries,
|
||||
required this.date
|
||||
});
|
||||
|
||||
factory GetDeliveriesDTO.fromJson(Map<String, dynamic> json) => _$GetDeliveriesDTOFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$GetDeliveriesDTOToJson(this);
|
||||
}
|
||||
21
lib/dto/get_deliveries_dto.g.dart
Normal file
@ -0,0 +1,21 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'get_deliveries_dto.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GetDeliveriesDTO _$GetDeliveriesDTOFromJson(Map<String, dynamic> json) =>
|
||||
GetDeliveriesDTO(
|
||||
deliveries: (json['deliveries'] as List<dynamic>)
|
||||
.map((e) => DeliveryDTO.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
date: json['date'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetDeliveriesDTOToJson(GetDeliveriesDTO instance) =>
|
||||
<String, dynamic>{
|
||||
'deliveries': instance.deliveries.map((e) => e.toJson()).toList(),
|
||||
'date': instance.date,
|
||||
};
|
||||
20
lib/exceptions/login.dart
Normal file
@ -0,0 +1,20 @@
|
||||
class LoginInvalidUrlException implements Exception {
|
||||
@override
|
||||
String toString() {
|
||||
return "Invalid url";
|
||||
}
|
||||
}
|
||||
|
||||
class LoginNoSessionIdException implements Exception {
|
||||
@override
|
||||
String toString() {
|
||||
return "No session id found in url";
|
||||
}
|
||||
}
|
||||
|
||||
class LoginUnauthorizedException implements Exception {
|
||||
@override
|
||||
String toString() {
|
||||
return "Unauthorized";
|
||||
}
|
||||
}
|
||||
8
lib/exceptions/server.dart
Normal file
@ -0,0 +1,8 @@
|
||||
class ServerErrorException implements Exception {
|
||||
final String message;
|
||||
|
||||
ServerErrorException({required this.message});
|
||||
|
||||
@override
|
||||
String toString() => message;
|
||||
}
|
||||
145
lib/main.dart
@ -1,121 +1,54 @@
|
||||
import 'package:app_gaslieferung/bloc/authentication/auth_bloc.dart';
|
||||
import 'package:app_gaslieferung/bloc/tour/tour_bloc.dart';
|
||||
import 'package:app_gaslieferung/bloc/tour_select/bloc.dart';
|
||||
import 'package:app_gaslieferung/repository/tour_repository.dart';
|
||||
import 'package:app_gaslieferung/service/tour_service.dart';
|
||||
import 'package:app_gaslieferung/ui/page/login.dart';
|
||||
import 'package:app_gaslieferung/ui/theme/theme.dart';
|
||||
import 'package:app_gaslieferung/ui/widgets/message_wrapper/message_wrapper.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import 'bloc/message_wrapper/message_bloc.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
runApp(GasDeliveryApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
class GasDeliveryApp extends StatefulWidget {
|
||||
const GasDeliveryApp({super.key});
|
||||
|
||||
// This widget is the root of your application.
|
||||
@override
|
||||
State<StatefulWidget> createState() => _GasDeliveryAppState();
|
||||
}
|
||||
|
||||
class _GasDeliveryAppState extends State<GasDeliveryApp> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Flutter Demo',
|
||||
theme: ThemeData(
|
||||
// This is the theme of your application.
|
||||
//
|
||||
// TRY THIS: Try running your application with "flutter run". You'll see
|
||||
// the application has a purple toolbar. Then, without quitting the app,
|
||||
// try changing the seedColor in the colorScheme below to Colors.green
|
||||
// and then invoke "hot reload" (save your changes or press the "hot
|
||||
// reload" button in a Flutter-supported IDE, or press "r" if you used
|
||||
// the command line to start the app).
|
||||
//
|
||||
// Notice that the counter didn't reset back to zero; the application
|
||||
// state is not lost during the reload. To reset the state, use hot
|
||||
// restart instead.
|
||||
//
|
||||
// This works for code too, not just values: Most code changes can be
|
||||
// tested with just a hot reload.
|
||||
colorScheme: .fromSeed(seedColor: Colors.deepPurple),
|
||||
return MultiBlocProvider(
|
||||
providers: [
|
||||
BlocProvider(create: (context) => MessageBloc()),
|
||||
BlocProvider(
|
||||
create: (context) => AuthBloc(
|
||||
url: "http://127.0.0.1:3000/login",
|
||||
msgBloc: context.read<MessageBloc>(),
|
||||
),
|
||||
),
|
||||
BlocProvider(
|
||||
create: (context) => TourBloc(
|
||||
tour: TourRepository(
|
||||
service: TourService(baseUrl: "http://127.0.0.1:3000"),
|
||||
),
|
||||
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MyHomePage extends StatefulWidget {
|
||||
const MyHomePage({super.key, required this.title});
|
||||
|
||||
// This widget is the home page of your application. It is stateful, meaning
|
||||
// that it has a State object (defined below) that contains fields that affect
|
||||
// how it looks.
|
||||
|
||||
// This class is the configuration for the state. It holds the values (in this
|
||||
// case the title) provided by the parent (in this case the App widget) and
|
||||
// used by the build method of the State. Fields in a Widget subclass are
|
||||
// always marked "final".
|
||||
|
||||
final String title;
|
||||
|
||||
@override
|
||||
State<MyHomePage> createState() => _MyHomePageState();
|
||||
}
|
||||
|
||||
class _MyHomePageState extends State<MyHomePage> {
|
||||
int _counter = 0;
|
||||
|
||||
void _incrementCounter() {
|
||||
setState(() {
|
||||
// This call to setState tells the Flutter framework that something has
|
||||
// changed in this State, which causes it to rerun the build method below
|
||||
// so that the display can reflect the updated values. If we changed
|
||||
// _counter without calling setState(), then the build method would not be
|
||||
// called again, and so nothing would appear to happen.
|
||||
_counter++;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// This method is rerun every time setState is called, for instance as done
|
||||
// by the _incrementCounter method above.
|
||||
//
|
||||
// The Flutter framework has been optimized to make rerunning build methods
|
||||
// fast, so that you can just rebuild anything that needs updating rather
|
||||
// than having to individually change instances of widgets.
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
// TRY THIS: Try changing the color here to a specific color (to
|
||||
// Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
|
||||
// change color while the other colors stay the same.
|
||||
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
|
||||
// Here we take the value from the MyHomePage object that was created by
|
||||
// the App.build method, and use it to set our appbar title.
|
||||
title: Text(widget.title),
|
||||
),
|
||||
body: Center(
|
||||
// Center is a layout widget. It takes a single child and positions it
|
||||
// in the middle of the parent.
|
||||
child: Column(
|
||||
// Column is also a layout widget. It takes a list of children and
|
||||
// arranges them vertically. By default, it sizes itself to fit its
|
||||
// children horizontally, and tries to be as tall as its parent.
|
||||
//
|
||||
// Column has various properties to control how it sizes itself and
|
||||
// how it positions its children. Here we use mainAxisAlignment to
|
||||
// center the children vertically; the main axis here is the vertical
|
||||
// axis because Columns are vertical (the cross axis would be
|
||||
// horizontal).
|
||||
//
|
||||
// TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
|
||||
// action in the IDE, or press "p" in the console), to see the
|
||||
// wireframe for each widget.
|
||||
mainAxisAlignment: .center,
|
||||
children: [
|
||||
const Text('You have pushed the button this many times:'),
|
||||
Text(
|
||||
'$_counter',
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: _incrementCounter,
|
||||
tooltip: 'Increment',
|
||||
child: const Icon(Icons.add),
|
||||
child: MaterialApp(
|
||||
builder: (context, child) => MessageWrapperWidget(child: child!),
|
||||
theme: AppTheme.light(),
|
||||
darkTheme: AppTheme.dark(),
|
||||
themeMode: ThemeMode.light,
|
||||
// oder ThemeMode.dark / light
|
||||
home: LoginPage(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
15
lib/model/address.dart
Normal file
@ -0,0 +1,15 @@
|
||||
class Address {
|
||||
String street;
|
||||
String housingNumber;
|
||||
String postalCode;
|
||||
String city;
|
||||
String country;
|
||||
|
||||
Address({
|
||||
required this.street,
|
||||
required this.housingNumber,
|
||||
required this.postalCode,
|
||||
required this.city,
|
||||
required this.country,
|
||||
});
|
||||
}
|
||||
31
lib/model/article.dart
Normal file
@ -0,0 +1,31 @@
|
||||
class Article {
|
||||
String articleId;
|
||||
|
||||
/// The quantity of delivered gas cylinders.
|
||||
double quantity;
|
||||
|
||||
/// The price per cylinder in euros.
|
||||
double pricePerQuantity;
|
||||
|
||||
/// The price of the deposit in euros per cylinder.
|
||||
double depositPricePerQuantity;
|
||||
|
||||
/// The amount of cylinders delivered.
|
||||
double quantityDelivered;
|
||||
|
||||
/// The amount of cylinders returned by the customer.
|
||||
double quantityReturned;
|
||||
|
||||
/// The amount of cylinders left to be deposited.
|
||||
double quantityToDeposit;
|
||||
|
||||
Article({
|
||||
required this.articleId,
|
||||
required this.quantity,
|
||||
required this.pricePerQuantity,
|
||||
required this.depositPricePerQuantity,
|
||||
required this.quantityDelivered,
|
||||
required this.quantityReturned,
|
||||
required this.quantityToDeposit,
|
||||
});
|
||||
}
|
||||
19
lib/model/car.dart
Normal file
@ -0,0 +1,19 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'car.g.dart';
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class Car {
|
||||
final int id;
|
||||
final String carName;
|
||||
final String? driverName;
|
||||
|
||||
Car({
|
||||
required this.id,
|
||||
required this.carName,
|
||||
this.driverName,
|
||||
});
|
||||
|
||||
factory Car.fromJson(Map<String, dynamic> json) => _$CarFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$CarToJson(this);
|
||||
}
|
||||
19
lib/model/car.g.dart
Normal file
@ -0,0 +1,19 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'car.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Car _$CarFromJson(Map<String, dynamic> json) => Car(
|
||||
id: (json['id'] as num).toInt(),
|
||||
carName: json['car_name'] as String,
|
||||
driverName: json['driver_name'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CarToJson(Car instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'car_name': instance.carName,
|
||||
'driver_name': instance.driverName,
|
||||
};
|
||||
9
lib/model/customer.dart
Normal file
@ -0,0 +1,9 @@
|
||||
import 'address.dart';
|
||||
|
||||
class Customer {
|
||||
String name;
|
||||
String id;
|
||||
Address address;
|
||||
|
||||
Customer({required this.name, required this.address, required this.id});
|
||||
}
|
||||
20
lib/model/delivery.dart
Normal file
@ -0,0 +1,20 @@
|
||||
import 'package:app_gaslieferung/model/receipt.dart';
|
||||
|
||||
enum PaymentMethod { creditCard, cash }
|
||||
|
||||
class Delivery {
|
||||
Receipt receipt;
|
||||
|
||||
DateTime? deliveredAt;
|
||||
DateTime? desiredDeliveryTime;
|
||||
|
||||
String? informationForDriver;
|
||||
|
||||
Delivery({
|
||||
required this.receipt,
|
||||
|
||||
this.desiredDeliveryTime,
|
||||
this.informationForDriver,
|
||||
this.deliveredAt
|
||||
});
|
||||
}
|
||||
18
lib/model/receipt.dart
Normal file
@ -0,0 +1,18 @@
|
||||
import 'package:app_gaslieferung/model/customer.dart';
|
||||
|
||||
import 'article.dart';
|
||||
|
||||
class Receipt {
|
||||
Customer customer;
|
||||
List<Article> articles;
|
||||
|
||||
double totalGrossPrice;
|
||||
double totalNetPrice;
|
||||
|
||||
Receipt({
|
||||
required this.articles,
|
||||
required this.customer,
|
||||
required this.totalGrossPrice,
|
||||
required this.totalNetPrice,
|
||||
});
|
||||
}
|
||||
36
lib/model/supplier.dart
Normal file
@ -0,0 +1,36 @@
|
||||
import 'package:app_gaslieferung/model/address.dart';
|
||||
|
||||
import 'car.dart';
|
||||
|
||||
class Supplier {
|
||||
String id;
|
||||
String name;
|
||||
Address address;
|
||||
String? phoneNumber;
|
||||
List<Car> cars;
|
||||
|
||||
Supplier({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.cars,
|
||||
required this.address,
|
||||
});
|
||||
}
|
||||
|
||||
/// Contains information about the cars the supplier has and how many
|
||||
/// deliveries they have per car.
|
||||
class SupplierTourMetadata {
|
||||
String date;
|
||||
|
||||
/// The list of cars the supplier has and how many deliveries they have per car.
|
||||
List<TourMetadata> tours;
|
||||
|
||||
SupplierTourMetadata({required this.date, required this.tours});
|
||||
}
|
||||
|
||||
class TourMetadata {
|
||||
Car car;
|
||||
int amountDeliveries;
|
||||
|
||||
TourMetadata({required this.car, required this.amountDeliveries});
|
||||
}
|
||||
129
lib/model/tour.dart
Normal file
@ -0,0 +1,129 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import 'car.dart';
|
||||
|
||||
part 'tour.g.dart';
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class Article {
|
||||
final int id;
|
||||
final String title;
|
||||
final int quantity;
|
||||
final double pricePerQuantity;
|
||||
final double depositPricePerQuantity;
|
||||
final int quantityDelivered;
|
||||
final int quantityReturned;
|
||||
final int quantityToDeposit;
|
||||
final int? referenceTo;
|
||||
|
||||
Article({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.quantity,
|
||||
required this.pricePerQuantity,
|
||||
required this.depositPricePerQuantity,
|
||||
required this.quantityDelivered,
|
||||
required this.quantityReturned,
|
||||
required this.quantityToDeposit,
|
||||
this.referenceTo,
|
||||
});
|
||||
|
||||
factory Article.fromJson(Map<String, dynamic> json) => _$ArticleFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$ArticleToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class Address {
|
||||
final String street;
|
||||
final String housingNumber;
|
||||
final String postalCode;
|
||||
final String city;
|
||||
final String? country;
|
||||
|
||||
Address({
|
||||
required this.street,
|
||||
required this.housingNumber,
|
||||
required this.postalCode,
|
||||
required this.city,
|
||||
this.country,
|
||||
});
|
||||
|
||||
factory Address.fromJson(Map<String, dynamic> json) => _$AddressFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$AddressToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class Customer {
|
||||
final String name;
|
||||
final int id;
|
||||
final Address address;
|
||||
|
||||
Customer({
|
||||
required this.name,
|
||||
required this.id,
|
||||
required this.address,
|
||||
});
|
||||
|
||||
String get displayAddress => "${address.street} ${address.housingNumber}, ${address.postalCode} ${address.city}";
|
||||
|
||||
factory Customer.fromJson(Map<String, dynamic> json) => _$CustomerFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$CustomerToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class Receipt {
|
||||
final List<Article> articles;
|
||||
final Customer customer;
|
||||
final double totalGrossPrice;
|
||||
final double totalNetPrice;
|
||||
|
||||
Receipt({
|
||||
required this.articles,
|
||||
required this.customer,
|
||||
required this.totalGrossPrice,
|
||||
required this.totalNetPrice,
|
||||
});
|
||||
|
||||
factory Receipt.fromJson(Map<String, dynamic> json) => _$ReceiptFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$ReceiptToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class Delivery {
|
||||
final Receipt receipt;
|
||||
final String informationForDriver;
|
||||
final DateTime desiredDeliveryTime;
|
||||
final DateTime? timeDelivered;
|
||||
|
||||
Delivery({
|
||||
required this.receipt,
|
||||
required this.informationForDriver,
|
||||
required this.desiredDeliveryTime,
|
||||
required this.timeDelivered,
|
||||
});
|
||||
|
||||
factory Delivery.fromJson(Map<String, dynamic> json) => _$DeliveryFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$DeliveryToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class Tour {
|
||||
final Car car;
|
||||
final String date;
|
||||
final List<Delivery> deliveries;
|
||||
|
||||
Tour({
|
||||
required this.car,
|
||||
required this.date,
|
||||
required this.deliveries,
|
||||
});
|
||||
|
||||
int get amountDeliveries => deliveries.length;
|
||||
int get amountFinishedDeliveries => deliveries.where((delivery) => delivery.timeDelivered != null).length;
|
||||
int get amountDeliveriesLeft => amountDeliveries - amountFinishedDeliveries;
|
||||
double get progress => amountFinishedDeliveries / amountDeliveries;
|
||||
int get progressPercentage => (progress * 100).toInt();
|
||||
|
||||
factory Tour.fromJson(Map<String, dynamic> json) => _$TourFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$TourToJson(this);
|
||||
}
|
||||
106
lib/model/tour.g.dart
Normal file
@ -0,0 +1,106 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'tour.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
Article _$ArticleFromJson(Map<String, dynamic> json) => Article(
|
||||
id: (json['id'] as num).toInt(),
|
||||
title: json['title'] as String,
|
||||
quantity: (json['quantity'] as num).toInt(),
|
||||
pricePerQuantity: (json['price_per_quantity'] as num).toDouble(),
|
||||
depositPricePerQuantity: (json['deposit_price_per_quantity'] as num)
|
||||
.toDouble(),
|
||||
quantityDelivered: (json['quantity_delivered'] as num).toInt(),
|
||||
quantityReturned: (json['quantity_returned'] as num).toInt(),
|
||||
quantityToDeposit: (json['quantity_to_deposit'] as num).toInt(),
|
||||
referenceTo: (json['reference_to'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ArticleToJson(Article instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'title': instance.title,
|
||||
'quantity': instance.quantity,
|
||||
'price_per_quantity': instance.pricePerQuantity,
|
||||
'deposit_price_per_quantity': instance.depositPricePerQuantity,
|
||||
'quantity_delivered': instance.quantityDelivered,
|
||||
'quantity_returned': instance.quantityReturned,
|
||||
'quantity_to_deposit': instance.quantityToDeposit,
|
||||
'reference_to': instance.referenceTo,
|
||||
};
|
||||
|
||||
Address _$AddressFromJson(Map<String, dynamic> json) => Address(
|
||||
street: json['street'] as String,
|
||||
housingNumber: json['housing_number'] as String,
|
||||
postalCode: json['postal_code'] as String,
|
||||
city: json['city'] as String,
|
||||
country: json['country'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AddressToJson(Address instance) => <String, dynamic>{
|
||||
'street': instance.street,
|
||||
'housing_number': instance.housingNumber,
|
||||
'postal_code': instance.postalCode,
|
||||
'city': instance.city,
|
||||
'country': instance.country,
|
||||
};
|
||||
|
||||
Customer _$CustomerFromJson(Map<String, dynamic> json) => Customer(
|
||||
name: json['name'] as String,
|
||||
id: (json['id'] as num).toInt(),
|
||||
address: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CustomerToJson(Customer instance) => <String, dynamic>{
|
||||
'name': instance.name,
|
||||
'id': instance.id,
|
||||
'address': instance.address,
|
||||
};
|
||||
|
||||
Receipt _$ReceiptFromJson(Map<String, dynamic> json) => Receipt(
|
||||
articles: (json['articles'] as List<dynamic>)
|
||||
.map((e) => Article.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
customer: Customer.fromJson(json['customer'] as Map<String, dynamic>),
|
||||
totalGrossPrice: (json['total_gross_price'] as num).toDouble(),
|
||||
totalNetPrice: (json['total_net_price'] as num).toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ReceiptToJson(Receipt instance) => <String, dynamic>{
|
||||
'articles': instance.articles,
|
||||
'customer': instance.customer,
|
||||
'total_gross_price': instance.totalGrossPrice,
|
||||
'total_net_price': instance.totalNetPrice,
|
||||
};
|
||||
|
||||
Delivery _$DeliveryFromJson(Map<String, dynamic> json) => Delivery(
|
||||
receipt: Receipt.fromJson(json['receipt'] as Map<String, dynamic>),
|
||||
informationForDriver: json['information_for_driver'] as String,
|
||||
desiredDeliveryTime: DateTime.parse(json['desired_delivery_time'] as String),
|
||||
timeDelivered: json['time_delivered'] == null
|
||||
? null
|
||||
: DateTime.parse(json['time_delivered'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeliveryToJson(Delivery instance) => <String, dynamic>{
|
||||
'receipt': instance.receipt,
|
||||
'information_for_driver': instance.informationForDriver,
|
||||
'desired_delivery_time': instance.desiredDeliveryTime.toIso8601String(),
|
||||
'time_delivered': instance.timeDelivered?.toIso8601String(),
|
||||
};
|
||||
|
||||
Tour _$TourFromJson(Map<String, dynamic> json) => Tour(
|
||||
car: Car.fromJson(json['car'] as Map<String, dynamic>),
|
||||
date: json['date'] as String,
|
||||
deliveries: (json['deliveries'] as List<dynamic>)
|
||||
.map((e) => Delivery.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$TourToJson(Tour instance) => <String, dynamic>{
|
||||
'car': instance.car,
|
||||
'date': instance.date,
|
||||
'deliveries': instance.deliveries,
|
||||
};
|
||||
39
lib/repository/tour_repository.dart
Normal file
@ -0,0 +1,39 @@
|
||||
import 'package:app_gaslieferung/model/supplier.dart';
|
||||
import 'package:app_gaslieferung/model/tour.dart';
|
||||
import 'package:app_gaslieferung/service/tour_service.dart';
|
||||
|
||||
import '../model/car.dart';
|
||||
|
||||
class TourRepository {
|
||||
TourService service;
|
||||
|
||||
TourRepository({required this.service});
|
||||
|
||||
/// Lists the possible tours of cars existing for a supplier.
|
||||
Future<SupplierTourMetadata> getSupplierTourMetadata(String sessionId) async {
|
||||
final dto = await service.getCars(sessionId);
|
||||
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
|
||||
return SupplierTourMetadata(
|
||||
date: dto.date,
|
||||
tours: dto.deliveries
|
||||
.map(
|
||||
(delivery) => TourMetadata(
|
||||
car: Car(id: delivery.car.id, carName: delivery.car.carName, driverName: delivery.car.driverName),
|
||||
amountDeliveries: delivery.amountDeliveries,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Lists the possible tours of cars existing for a supplier.
|
||||
Future<Tour> getTour(String sessionId, String carId) async {
|
||||
final tour = await service.getTour(sessionId, carId);
|
||||
|
||||
await Future.delayed(Duration(seconds: 1));
|
||||
|
||||
return tour;
|
||||
}
|
||||
}
|
||||
0
lib/service/login_service.dart
Normal file
49
lib/service/tour_service.dart
Normal file
@ -0,0 +1,49 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:app_gaslieferung/dto/fail_response_dto.dart';
|
||||
import 'package:app_gaslieferung/dto/get_deliveries_dto.dart';
|
||||
import 'package:app_gaslieferung/exceptions/login.dart';
|
||||
import 'package:app_gaslieferung/exceptions/server.dart';
|
||||
import 'package:app_gaslieferung/model/tour.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
|
||||
class TourService {
|
||||
final String baseUrl;
|
||||
|
||||
TourService({required this.baseUrl});
|
||||
|
||||
Future<GetDeliveriesDTO> getCars(String sessionId) async {
|
||||
final response = await http.get(
|
||||
Uri.parse('$baseUrl/cars'),
|
||||
headers: {'Cookie': 'session_id=$sessionId'},
|
||||
);
|
||||
|
||||
int statusCode = response.statusCode;
|
||||
if (statusCode == HttpStatus.unauthorized) {
|
||||
throw LoginUnauthorizedException();
|
||||
} else if (statusCode != HttpStatus.ok) {
|
||||
final dto = FailResponseDTO.fromJson(jsonDecode(response.body));
|
||||
throw ServerErrorException(message: dto.message);
|
||||
}
|
||||
|
||||
return GetDeliveriesDTO.fromJson(jsonDecode(response.body));
|
||||
}
|
||||
|
||||
Future<Tour> getTour(String sessionId, String carId) async {
|
||||
final response = await http.get(
|
||||
Uri.parse('$baseUrl/tour/$carId'),
|
||||
headers: {'Cookie': 'session_id=$sessionId'},
|
||||
);
|
||||
|
||||
int statusCode = response.statusCode;
|
||||
if (statusCode == HttpStatus.unauthorized) {
|
||||
throw LoginUnauthorizedException();
|
||||
} else if (statusCode != HttpStatus.ok) {
|
||||
final dto = FailResponseDTO.fromJson(jsonDecode(response.body));
|
||||
throw ServerErrorException(message: dto.message);
|
||||
}
|
||||
|
||||
return Tour.fromJson(jsonDecode(response.body));
|
||||
}
|
||||
}
|
||||
0
lib/ui/page/delivery.dart
Normal file
89
lib/ui/page/login.dart
Normal file
@ -0,0 +1,89 @@
|
||||
import 'package:app_gaslieferung/bloc/authentication/auth_bloc.dart';
|
||||
import 'package:app_gaslieferung/bloc/authentication/auth_event.dart';
|
||||
import 'package:app_gaslieferung/bloc/authentication/auth_state.dart';
|
||||
import 'package:app_gaslieferung/bloc/message_wrapper/message_bloc.dart';
|
||||
import 'package:app_gaslieferung/bloc/message_wrapper/message_event.dart';
|
||||
import 'package:app_gaslieferung/exceptions/login.dart';
|
||||
import 'package:app_links/app_links.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../../bloc/tour_select/bloc.dart';
|
||||
import '../../repository/tour_repository.dart';
|
||||
import '../../service/tour_service.dart';
|
||||
import '../../util/login.dart';
|
||||
import 'tour_select.dart';
|
||||
|
||||
class LoginPage extends StatefulWidget {
|
||||
const LoginPage({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _LoginPageState();
|
||||
}
|
||||
|
||||
class _LoginPageState extends State<LoginPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: BlocConsumer<AuthBloc, AuthState>(
|
||||
builder: (context, state) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: MediaQuery.of(context).size.height * 0.1,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/graphics/bg-supplier-clouds.png",
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
Text(
|
||||
"Willkommen bei\nGaslieferung!",
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
|
||||
Text(
|
||||
"\nMelden Sie sich an, um Ihre Tour zu starten.",
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(50),
|
||||
child: FilledButton(
|
||||
onPressed: () {
|
||||
context.read<AuthBloc>().add(AuthLoginEvent());
|
||||
},
|
||||
child: Text("Einloggen"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
listener: (context, state) {
|
||||
if (state is AuthenticatedState) {
|
||||
Navigator.pushReplacement(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => BlocProvider(
|
||||
create: (context) => TourSelectBloc(
|
||||
repository: TourRepository(
|
||||
service: TourService(
|
||||
baseUrl: "http://127.0.0.1:3000",
|
||||
),
|
||||
),
|
||||
),
|
||||
child: TourSelectPage(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
425
lib/ui/page/tour.dart
Normal file
@ -0,0 +1,425 @@
|
||||
import 'package:app_gaslieferung/bloc/authentication/auth_bloc.dart';
|
||||
import 'package:app_gaslieferung/bloc/authentication/auth_state.dart';
|
||||
import 'package:app_gaslieferung/bloc/tour/tour_bloc.dart';
|
||||
import 'package:app_gaslieferung/bloc/tour/tour_event.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../bloc/tour/tour_state.dart';
|
||||
import '../../model/tour.dart';
|
||||
|
||||
class TourPage extends StatefulWidget {
|
||||
final String carId;
|
||||
|
||||
const TourPage({super.key, required this.carId});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _TourPageState();
|
||||
}
|
||||
|
||||
class _TourPageState extends State<TourPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
var authState = context.read<AuthBloc>().state as AuthenticatedState;
|
||||
context.read<TourBloc>().add(
|
||||
TourLoadEvent(carId: "1234", sessionId: authState.sessionId),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _upperInfo(Tour tour) {
|
||||
return Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 128,
|
||||
height: 128,
|
||||
child: Image.asset(
|
||||
"assets/graphics/bg-supplier-clouds.png",
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 15),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Heutige Lieferungen",
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: Text(
|
||||
"Sie haben ${tour.deliveries.length.toString()} Lieferungen für heute",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _progressCard(Tour tour) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 12, right: 12, bottom: 10),
|
||||
child: Card(
|
||||
color: Theme.of(context).colorScheme.surfaceContainerLowest,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 48,
|
||||
height: 48,
|
||||
child: Image.asset(
|
||||
"assets/graphics/truck.png",
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Text(
|
||||
"Tour-Fortschritt",
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 0),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"${tour.progressPercentage.toStringAsFixed(0)}% erledigt",
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8, bottom: 16),
|
||||
child: LinearProgressIndicator(
|
||||
value: tour.progress,
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Padding(padding: const EdgeInsets.only(bottom: 15)),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check_circle,
|
||||
color: Theme.of(context).colorScheme.tertiary,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Text(
|
||||
"Erledigte Lieferungen",
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Text(
|
||||
"${tour.amountFinishedDeliveries} von ${tour.amountDeliveries}",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const VerticalDivider(
|
||||
width: 20,
|
||||
thickness: 1,
|
||||
indent: 20,
|
||||
endIndent: 1,
|
||||
color: Colors.black,
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.event_note_outlined,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Text(
|
||||
"Offene Lieferungen",
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Text(
|
||||
"${tour.amountDeliveriesLeft} übrig",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _nextDeliveryCard(Tour tour) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
||||
child: Card(
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Nächste Lieferung",
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
width: 48,
|
||||
height: 48,
|
||||
child: Image.asset(
|
||||
"assets/graphics/location-pin-cloud.png",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 0),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.surfaceContainerLowest,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
tour.deliveries[0].receipt.customer.name,
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.titleSmall,
|
||||
),
|
||||
Text(
|
||||
tour
|
||||
.deliveries[0]
|
||||
.receipt
|
||||
.customer
|
||||
.displayAddress,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: Icon(Icons.map, size: 32),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.secondary,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
),
|
||||
child: const Divider(),
|
||||
),
|
||||
|
||||
Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.location_pin,
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.secondary,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 2),
|
||||
child: Text("10km"),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 15),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.access_time_filled,
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.primary,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 2),
|
||||
child: Text("Ankunft in 10min"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _openDeliveries(Tour tour) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 10, right: 10),
|
||||
child: Card(
|
||||
color: Theme.of(context).colorScheme.surfaceContainer,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Lieferungen",
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
final delivery = tour.deliveries[index];
|
||||
return ListTile(
|
||||
leading: SizedBox(
|
||||
width: 32,
|
||||
height: 32,
|
||||
child: Image.asset("assets/graphics/gas-tank.png"),
|
||||
),
|
||||
tileColor: Theme.of(
|
||||
context,
|
||||
).colorScheme.surfaceContainerLowest,
|
||||
title: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
delivery.receipt.customer.name,
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text(delivery.receipt.customer.displayAddress, style: TextStyle(fontSize: 13)),
|
||||
],
|
||||
),
|
||||
trailing: Icon(Icons.arrow_forward_ios),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (context, index) =>
|
||||
Padding(padding: const EdgeInsets.only(top: 10)),
|
||||
itemCount: tour.amountDeliveries,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _listTour(Tour tour) {
|
||||
return ListView(
|
||||
children: [
|
||||
_upperInfo(tour),
|
||||
_progressCard(tour),
|
||||
_nextDeliveryCard(tour),
|
||||
_openDeliveries(tour),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text("Lieferungen")),
|
||||
body: BlocBuilder<TourBloc, TourState>(
|
||||
builder: (context, state) {
|
||||
if (state is TourLoading) {
|
||||
return Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
if (state is TourLoaded) {
|
||||
return _listTour(state.tour);
|
||||
}
|
||||
|
||||
if (state is TourLoadingFailed) {
|
||||
return Center(child: Text(state.message));
|
||||
}
|
||||
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
19
lib/ui/page/tour_detail.dart
Normal file
@ -0,0 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TourDetailPage extends StatefulWidget {
|
||||
/// The id of the car that has been chosen a step before.
|
||||
final String supplierCarId;
|
||||
|
||||
const TourDetailPage({super.key, required this.supplierCarId});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _TourDetailPageState();
|
||||
}
|
||||
|
||||
class _TourDetailPageState extends State<TourDetailPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// TODO: implement build
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
173
lib/ui/page/tour_select.dart
Normal file
@ -0,0 +1,173 @@
|
||||
import 'package:app_gaslieferung/bloc/authentication/auth_bloc.dart';
|
||||
import 'package:app_gaslieferung/bloc/authentication/auth_state.dart';
|
||||
import 'package:app_gaslieferung/bloc/tour_select/bloc.dart';
|
||||
import 'package:app_gaslieferung/model/supplier.dart';
|
||||
import 'package:app_gaslieferung/ui/page/tour.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../bloc/tour_select/event.dart';
|
||||
import '../../bloc/tour_select/state.dart';
|
||||
|
||||
class TourSelectPage extends StatefulWidget {
|
||||
const TourSelectPage({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _TourSelectPageState();
|
||||
}
|
||||
|
||||
class _TourSelectPageState extends State<TourSelectPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
context.read<TourSelectBloc>().add(
|
||||
TourSelectLoadMetadataEvent(
|
||||
sessionId:
|
||||
(context.read<AuthBloc>().state as AuthenticatedState).sessionId,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _listTour(SupplierTourMetadata data) {
|
||||
return ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
TourMetadata tourData = data.tours[index];
|
||||
|
||||
return ListTile(
|
||||
leading: Icon(Icons.local_shipping_outlined),
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => TourPage(carId: tourData.car.id.toString()),
|
||||
),
|
||||
),
|
||||
title: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [Text(tourData.car.driverName ?? tourData.car.carName)],
|
||||
),
|
||||
subtitle: Row(
|
||||
children: [
|
||||
tourData.car.driverName != null
|
||||
? Text("${tourData.car.carName} | ")
|
||||
: Container(),
|
||||
|
||||
Text("${tourData.amountDeliveries} Lieferungen"),
|
||||
],
|
||||
),
|
||||
tileColor: Theme.of(context).colorScheme.surface,
|
||||
trailing: Icon(Icons.arrow_forward_ios),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) =>
|
||||
SizedBox(height: 10),
|
||||
itemCount: data.tours.length,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: BlocBuilder<TourSelectBloc, TourSelectState>(
|
||||
builder: (context, state) {
|
||||
if (state is TourSelectLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
if (state is TourSelectError) {
|
||||
return Center(child: Text(state.message));
|
||||
}
|
||||
|
||||
if (state is TourSelectLoaded) {
|
||||
return Center(
|
||||
child: ListView(
|
||||
children: [
|
||||
Image.asset(
|
||||
"assets/graphics/bg-carrier-cylinder-duo.png",
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 25),
|
||||
child: Text(
|
||||
"Wählen Sie Ihre Tour aus:",
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: Card(
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.surfaceContainerHighest,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 10,
|
||||
),
|
||||
child: Icon(Icons.tour),
|
||||
),
|
||||
Text(
|
||||
"Touren",
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.titleMedium,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 10,
|
||||
),
|
||||
child: Icon(Icons.calendar_month),
|
||||
),
|
||||
Text(
|
||||
state.data.date,
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.labelLarge,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 15),
|
||||
child: _listTour(state.data),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
27
lib/ui/theme/font.dart
Normal file
@ -0,0 +1,27 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppTypography {
|
||||
static TextTheme interTextTheme() {
|
||||
return const TextTheme(
|
||||
displayLarge: TextStyle(fontFamily: 'Inter', fontSize: 57, fontWeight: FontWeight.w600, height: 64 / 57, letterSpacing: -0.25),
|
||||
displayMedium: TextStyle(fontFamily: 'Inter', fontSize: 45, fontWeight: FontWeight.w600, height: 52 / 45),
|
||||
displaySmall: TextStyle(fontFamily: 'Inter', fontSize: 36, fontWeight: FontWeight.w600, height: 44 / 36),
|
||||
|
||||
headlineLarge: TextStyle(fontFamily: 'Inter', fontSize: 32, fontWeight: FontWeight.w600, height: 40 / 32),
|
||||
headlineMedium: TextStyle(fontFamily: 'Inter', fontSize: 28, fontWeight: FontWeight.w600, height: 36 / 28),
|
||||
headlineSmall: TextStyle(fontFamily: 'Inter', fontSize: 24, fontWeight: FontWeight.w600, height: 32 / 24),
|
||||
|
||||
titleLarge: TextStyle(fontFamily: 'Inter', fontSize: 22, fontWeight: FontWeight.w600, height: 28 / 22),
|
||||
titleMedium: TextStyle(fontFamily: 'Inter', fontSize: 16, fontWeight: FontWeight.w600, height: 24 / 16, letterSpacing: 0.15),
|
||||
titleSmall: TextStyle(fontFamily: 'Inter', fontSize: 14, fontWeight: FontWeight.w600, height: 20 / 14, letterSpacing: 0.10),
|
||||
|
||||
bodyLarge: TextStyle(fontFamily: 'Inter', fontSize: 16, fontWeight: FontWeight.w400, height: 24 / 16, letterSpacing: 0.50),
|
||||
bodyMedium: TextStyle(fontFamily: 'Inter', fontSize: 14, fontWeight: FontWeight.w400, height: 20 / 14, letterSpacing: 0.25),
|
||||
bodySmall: TextStyle(fontFamily: 'Inter', fontSize: 12, fontWeight: FontWeight.w400, height: 16 / 12, letterSpacing: 0.40),
|
||||
|
||||
labelLarge: TextStyle(fontFamily: 'Inter', fontSize: 14, fontWeight: FontWeight.w600, height: 20 / 14, letterSpacing: 0.10),
|
||||
labelMedium: TextStyle(fontFamily: 'Inter', fontSize: 12, fontWeight: FontWeight.w600, height: 16 / 12, letterSpacing: 0.50),
|
||||
labelSmall: TextStyle(fontFamily: 'Inter', fontSize: 11, fontWeight: FontWeight.w600, height: 16 / 11, letterSpacing: 0.50),
|
||||
);
|
||||
}
|
||||
}
|
||||
184
lib/ui/theme/theme.dart
Normal file
@ -0,0 +1,184 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'font.dart';
|
||||
|
||||
/// Gaslieferung – Material 3 Theme (Light + Dark)
|
||||
class AppTheme {
|
||||
// ---- LIGHT COLORSCHEME (aus deiner Palette) ----
|
||||
static const ColorScheme lightScheme = ColorScheme(
|
||||
brightness: Brightness.light,
|
||||
|
||||
primary: Color(0xFFF7931E),
|
||||
onPrimary: Color(0xFFFFFFFF),
|
||||
primaryContainer: Color(0xFFFFD8A8),
|
||||
onPrimaryContainer: Color(0xFF4A2A00),
|
||||
|
||||
secondary: Color(0xFF2F5DA8),
|
||||
onSecondary: Color(0xFFFFFFFF),
|
||||
secondaryContainer: Color(0xFFD6E3FF),
|
||||
onSecondaryContainer: Color(0xFF0B1D36),
|
||||
|
||||
tertiary: Color(0xFF3FAE6A),
|
||||
onTertiary: Color(0xFFFFFFFF),
|
||||
tertiaryContainer: Color(0xFFCFF5DF),
|
||||
onTertiaryContainer: Color(0xFF0F3D24),
|
||||
|
||||
error: Color(0xFFB3261E),
|
||||
onError: Color(0xFFFFFFFF),
|
||||
errorContainer: Color(0xFFF9DEDC),
|
||||
onErrorContainer: Color(0xFF410E0B),
|
||||
|
||||
surface: Color(0xFFFFF8F2),
|
||||
surfaceContainerLowest: Color(0xFFFFFFFF),
|
||||
surfaceContainerLow: Color(0xFFFFF4EB),
|
||||
surfaceContainer: Color(0xFFFAEFE5),
|
||||
surfaceContainerHigh: Color(0xFFF5E9DE),
|
||||
surfaceContainerHighest: Color(0xFFEFE3D8),
|
||||
onSurface: Color(0xFF1F1F1F),
|
||||
|
||||
//surfaceContainerHighest: Color(0xFFF2E6DA),
|
||||
onSurfaceVariant: Color(0xFF4A4A4A),
|
||||
|
||||
outline: Color(0xFFC8BEB4),
|
||||
outlineVariant: Color(0xFFE1D6CC),
|
||||
|
||||
shadow: Color(0xFF000000),
|
||||
scrim: Color(0xFF000000),
|
||||
|
||||
inverseSurface: Color(0xFF34302D),
|
||||
onInverseSurface: Color(0xFFF7F1EC),
|
||||
inversePrimary: Color(0xFFFFB95C),
|
||||
);
|
||||
|
||||
// ---- DARK COLORSCHEME (abgeleitet) ----
|
||||
static const ColorScheme darkScheme = ColorScheme(
|
||||
brightness: Brightness.dark,
|
||||
|
||||
primary: Color(0xFFFFB95C),
|
||||
onPrimary: Color(0xFF3A1F00),
|
||||
primaryContainer: Color(0xFF5C3A00),
|
||||
onPrimaryContainer: Color(0xFFFFDDB3),
|
||||
|
||||
secondary: Color(0xFF9FC1FF),
|
||||
onSecondary: Color(0xFF0B1D36),
|
||||
secondaryContainer: Color(0xFF1E3F73),
|
||||
onSecondaryContainer: Color(0xFFD6E3FF),
|
||||
|
||||
tertiary: Color(0xFF7ED6A3),
|
||||
onTertiary: Color(0xFF00391F),
|
||||
tertiaryContainer: Color(0xFF1F4D33),
|
||||
onTertiaryContainer: Color(0xFFCFF5DF),
|
||||
|
||||
error: Color(0xFFF2B8B5),
|
||||
onError: Color(0xFF601410),
|
||||
errorContainer: Color(0xFF8C1D18),
|
||||
onErrorContainer: Color(0xFFF9DEDC),
|
||||
|
||||
background: Color(0xFF121212),
|
||||
onBackground: Color(0xFFE6E1DC),
|
||||
|
||||
surface: Color(0xFF1C1B1A),
|
||||
onSurface: Color(0xFFE6E1DC),
|
||||
|
||||
surfaceVariant: Color(0xFF3A2F25),
|
||||
onSurfaceVariant: Color(0xFFD6CFC7),
|
||||
|
||||
outline: Color(0xFF8F857A),
|
||||
outlineVariant: Color(0xFF51463C),
|
||||
|
||||
shadow: Color(0xFF000000),
|
||||
scrim: Color(0xFF000000),
|
||||
|
||||
inverseSurface: Color(0xFFE6E1DC),
|
||||
onInverseSurface: Color(0xFF1C1B1A),
|
||||
inversePrimary: Color(0xFFF7931E),
|
||||
);
|
||||
|
||||
static ThemeData light() => _theme(lightScheme);
|
||||
|
||||
static ThemeData dark() => _theme(darkScheme);
|
||||
|
||||
static ThemeData _theme(ColorScheme scheme) {
|
||||
return ThemeData(
|
||||
useMaterial3: true,
|
||||
colorScheme: scheme,
|
||||
fontFamily: "Inter",
|
||||
|
||||
textTheme: AppTypography.interTextTheme(),
|
||||
|
||||
// Optional: Schrift/Shapes minimal „MD3-like“
|
||||
scaffoldBackgroundColor: scheme.surface,
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: scheme.primary,
|
||||
foregroundColor: scheme.onPrimary,
|
||||
elevation: 0,
|
||||
),
|
||||
|
||||
listTileTheme: ListTileThemeData(shape:RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), iconColor: scheme.primary),
|
||||
//iconTheme: IconThemeData(color: scheme.primary),
|
||||
|
||||
dropdownMenuTheme: DropdownMenuThemeData(
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
// Falls du das Eingabefeld selbst auch abrunden willst:
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(14)),
|
||||
),
|
||||
menuStyle: MenuStyle(
|
||||
shape: WidgetStateProperty.all<OutlinedBorder>(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
20,
|
||||
), // Hier den gewünschten Radius für das Overlay
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Buttons (M3)
|
||||
filledButtonTheme: FilledButtonThemeData(
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: scheme.primary,
|
||||
foregroundColor: scheme.onPrimary,
|
||||
minimumSize: const Size.fromHeight(52),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
),
|
||||
),
|
||||
),
|
||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||
style: ElevatedButton.styleFrom(
|
||||
minimumSize: const Size.fromHeight(52),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
),
|
||||
),
|
||||
),
|
||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||
style: OutlinedButton.styleFrom(
|
||||
minimumSize: const Size.fromHeight(52),
|
||||
foregroundColor: scheme.primary,
|
||||
side: BorderSide(color: scheme.outline),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Inputs
|
||||
inputDecorationTheme: InputDecorationTheme(
|
||||
filled: true,
|
||||
fillColor: scheme.surfaceVariant,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
),
|
||||
|
||||
// Cards
|
||||
cardTheme: CardThemeData(
|
||||
color: scheme.surface,
|
||||
elevation: 1,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
70
lib/ui/widgets/message_wrapper/message_wrapper.dart
Normal file
@ -0,0 +1,70 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../../bloc/message_wrapper/message_bloc.dart';
|
||||
import '../../../bloc/message_wrapper/message_state.dart';
|
||||
|
||||
class MessageWrapperWidget extends StatefulWidget {
|
||||
final Widget child;
|
||||
|
||||
const MessageWrapperWidget({super.key, required this.child});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => MessageWrapperWidgetState();
|
||||
|
||||
static MessageWrapperWidgetState of(BuildContext context) {
|
||||
return context.findAncestorStateOfType<MessageWrapperWidgetState>()!;
|
||||
}
|
||||
}
|
||||
|
||||
class MessageWrapperWidgetState extends State<MessageWrapperWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<MessageBloc, MessageState>(
|
||||
builder: (context, state) {
|
||||
if (state is MessageShowState) {
|
||||
return Stack(
|
||||
children: [
|
||||
widget.child,
|
||||
Positioned(
|
||||
top: 50,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
padding: EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Row(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 15),
|
||||
child: Icon(Icons.info, size: 32),
|
||||
),
|
||||
Expanded(child: Text(state.message)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
return widget.child;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
10
lib/ui/widgets/tour/progress_card.dart
Normal file
@ -0,0 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TourProgressCard extends StatelessWidget {
|
||||
const TourProgressCard({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(child: const Text("TEST"));
|
||||
}
|
||||
}
|
||||
15
lib/util/login.dart
Normal file
@ -0,0 +1,15 @@
|
||||
import 'package:app_gaslieferung/exceptions/login.dart';
|
||||
import 'package:app_links/app_links.dart';
|
||||
|
||||
String getSessionIdFromUrl(Uri uri) {
|
||||
if (uri.scheme == 'myapp' && uri.host == 'callback') {
|
||||
final code = uri.queryParameters['session_id'];
|
||||
if (code != null) {
|
||||
return code;
|
||||
} else {
|
||||
throw LoginNoSessionIdException();
|
||||
}
|
||||
}
|
||||
|
||||
throw LoginInvalidUrlException();
|
||||
}
|
||||
25
pubspec.yaml
@ -34,6 +34,12 @@ dependencies:
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.8
|
||||
bloc: ^9.2.0
|
||||
app_links: ^7.0.0
|
||||
url_launcher: ^6.3.2
|
||||
flutter_bloc: ^9.1.1
|
||||
http: ^1.6.0
|
||||
json_serializable: ^6.12.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
@ -45,6 +51,7 @@ dev_dependencies:
|
||||
# package. See that file for information about deactivating specific lint
|
||||
# rules and activating additional ones.
|
||||
flutter_lints: ^6.0.0
|
||||
build_runner: ^2.10.5
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
@ -58,10 +65,14 @@ flutter:
|
||||
uses-material-design: true
|
||||
|
||||
# To add assets to your application, add an assets section, like this:
|
||||
# assets:
|
||||
# - images/a_dot_burr.jpeg
|
||||
# - images/a_dot_ham.jpeg
|
||||
|
||||
assets:
|
||||
- assets/graphics/bg-supplier-clouds.png
|
||||
- assets/graphics/gas-tank.png
|
||||
- assets/graphics/gas-carrier.png
|
||||
- assets/graphics/supplier.png
|
||||
- assets/graphics/location-pin-cloud.png
|
||||
- assets/graphics/bg-carrier-cylinder-duo.png
|
||||
- assets/graphics/truck.png
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
# https://flutter.dev/to/resolution-aware-images
|
||||
|
||||
@ -73,6 +84,12 @@ flutter:
|
||||
# "family" key with the font family name, and a "fonts" key with a
|
||||
# list giving the asset and other descriptors for the font. For
|
||||
# example:
|
||||
|
||||
fonts:
|
||||
- family: Inter,
|
||||
fonts:
|
||||
- asset: assets/fonts/Inter-VariableFont_opsz,wght.ttf
|
||||
|
||||
# fonts:
|
||||
# - family: Schyler
|
||||
# fonts:
|
||||
|
||||
@ -13,7 +13,7 @@ import 'package:app_gaslieferung/main.dart';
|
||||
void main() {
|
||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||
// Build our app and trigger a frame.
|
||||
await tester.pumpWidget(const MyApp());
|
||||
await tester.pumpWidget(const GasDeliveryApp());
|
||||
|
||||
// Verify that our counter starts at 0.
|
||||
expect(find.text('0'), findsOneWidget);
|
||||
|
||||