diff --git a/frontend/app/android/app/src/main/AndroidManifest.xml b/frontend/app/android/app/src/main/AndroidManifest.xml index 996a45e..18e29e5 100644 --- a/frontend/app/android/app/src/main/AndroidManifest.xml +++ b/frontend/app/android/app/src/main/AndroidManifest.xml @@ -4,6 +4,7 @@ + diff --git a/frontend/app/android/app/src/main/res/ic_launcher-web.png b/frontend/app/android/app/src/main/res/ic_launcher-web.png new file mode 100644 index 0000000..3e91b38 Binary files /dev/null and b/frontend/app/android/app/src/main/res/ic_launcher-web.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/frontend/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/frontend/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/frontend/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/frontend/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/frontend/app/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/frontend/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/frontend/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index db77bb4..1734165 100644 Binary files a/frontend/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/frontend/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/frontend/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..b2c1ca9 Binary files /dev/null and b/frontend/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/frontend/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..2702233 Binary files /dev/null and b/frontend/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-ldpi/ic_launcher.png b/frontend/app/android/app/src/main/res/mipmap-ldpi/ic_launcher.png new file mode 100644 index 0000000..3c3f546 Binary files /dev/null and b/frontend/app/android/app/src/main/res/mipmap-ldpi/ic_launcher.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/frontend/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 17987b7..5ce7fcc 100644 Binary files a/frontend/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/frontend/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/frontend/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..e0fc69e Binary files /dev/null and b/frontend/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/frontend/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..06970a0 Binary files /dev/null and b/frontend/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/frontend/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 09d4391..3c9dff8 100644 Binary files a/frontend/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/frontend/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/frontend/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..aa8fe78 Binary files /dev/null and b/frontend/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/frontend/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..3ad31cb Binary files /dev/null and b/frontend/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/frontend/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index d5f1c8d..8b87f3d 100644 Binary files a/frontend/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/frontend/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/frontend/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..f799808 Binary files /dev/null and b/frontend/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/frontend/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..1ff1577 Binary files /dev/null and b/frontend/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/frontend/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 4d6372e..dea517d 100644 Binary files a/frontend/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/frontend/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/frontend/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..ac54bb3 Binary files /dev/null and b/frontend/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/frontend/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/frontend/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..c74e3f0 Binary files /dev/null and b/frontend/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/frontend/app/android/app/src/main/res/playstore-icon.png b/frontend/app/android/app/src/main/res/playstore-icon.png new file mode 100644 index 0000000..e9da18f Binary files /dev/null and b/frontend/app/android/app/src/main/res/playstore-icon.png differ diff --git a/frontend/app/android/app/src/main/res/values/ic_launcher_background.xml b/frontend/app/android/app/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 0000000..04f8a66 --- /dev/null +++ b/frontend/app/android/app/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #040404 + \ No newline at end of file diff --git a/frontend/app/assets/JPEG.jpg b/frontend/app/assets/JPEG.jpg index 51faa38..d5397b6 100644 Binary files a/frontend/app/assets/JPEG.jpg and b/frontend/app/assets/JPEG.jpg differ diff --git a/frontend/app/assets/icon.png b/frontend/app/assets/icon.png new file mode 100644 index 0000000..90a9712 Binary files /dev/null and b/frontend/app/assets/icon.png differ diff --git a/frontend/app/assets/icon.svg b/frontend/app/assets/icon.svg new file mode 100644 index 0000000..a37845f --- /dev/null +++ b/frontend/app/assets/icon.svg @@ -0,0 +1,107 @@ + + + + diff --git a/frontend/app/assets/icon_round.png b/frontend/app/assets/icon_round.png new file mode 100644 index 0000000..977c00b Binary files /dev/null and b/frontend/app/assets/icon_round.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png new file mode 100644 index 0000000..5053027 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/102.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/102.png new file mode 100644 index 0000000..0e1279c Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/102.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png new file mode 100644 index 0000000..4f6eb0a Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png new file mode 100644 index 0000000..dc2a250 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png new file mode 100644 index 0000000..d404311 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png new file mode 100644 index 0000000..9bc09f0 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png new file mode 100644 index 0000000..fc344a6 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png new file mode 100644 index 0000000..acaaa54 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png new file mode 100644 index 0000000..0eaa2af Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png new file mode 100644 index 0000000..debb71a Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png new file mode 100644 index 0000000..5737940 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png new file mode 100644 index 0000000..975aabd Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png new file mode 100644 index 0000000..f92c934 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png new file mode 100644 index 0000000..85431d6 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png new file mode 100644 index 0000000..aa5069c Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png new file mode 100644 index 0000000..59e3d1a Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png new file mode 100644 index 0000000..3951b9f Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png new file mode 100644 index 0000000..c27ede1 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png new file mode 100644 index 0000000..7bbcefa Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png new file mode 100644 index 0000000..84421de Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png new file mode 100644 index 0000000..3e0ca10 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png new file mode 100644 index 0000000..640c836 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png new file mode 100644 index 0000000..976259b Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png new file mode 100644 index 0000000..cb0359a Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png new file mode 100644 index 0000000..a511426 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png new file mode 100644 index 0000000..03b6e23 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png new file mode 100644 index 0000000..74ffcb1 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/66.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/66.png new file mode 100644 index 0000000..1bf68c3 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/66.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png new file mode 100644 index 0000000..923c9d8 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png new file mode 100644 index 0000000..e50231c Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png new file mode 100644 index 0000000..d73c453 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png new file mode 100644 index 0000000..5c03d33 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png new file mode 100644 index 0000000..6367e53 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/92.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/92.png new file mode 100644 index 0000000..5b1abeb Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/92.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index d36b1fa..e83c3bf 100644 --- a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,122 +1,128 @@ { - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" + "images":[ + { + "idiom":"iphone", + "size":"20x20", + "scale":"2x", + "filename":"Icon-App-20x20@2x.png" + }, + { + "idiom":"iphone", + "size":"20x20", + "scale":"3x", + "filename":"Icon-App-20x20@3x.png" + }, + { + "idiom":"iphone", + "size":"29x29", + "scale":"1x", + "filename":"Icon-App-29x29@1x.png" + }, + { + "idiom":"iphone", + "size":"29x29", + "scale":"2x", + "filename":"Icon-App-29x29@2x.png" + }, + { + "idiom":"iphone", + "size":"29x29", + "scale":"3x", + "filename":"Icon-App-29x29@3x.png" + }, + { + "idiom":"iphone", + "size":"40x40", + "scale":"2x", + "filename":"Icon-App-40x40@2x.png" + }, + { + "idiom":"iphone", + "size":"40x40", + "scale":"3x", + "filename":"Icon-App-40x40@3x.png" + }, + { + "idiom":"iphone", + "size":"60x60", + "scale":"2x", + "filename":"Icon-App-60x60@2x.png" + }, + { + "idiom":"iphone", + "size":"60x60", + "scale":"3x", + "filename":"Icon-App-60x60@3x.png" + }, + { + "idiom":"iphone", + "size":"76x76", + "scale":"2x", + "filename":"Icon-App-76x76@2x.png" + }, + { + "idiom":"ipad", + "size":"20x20", + "scale":"1x", + "filename":"Icon-App-20x20@1x.png" + }, + { + "idiom":"ipad", + "size":"20x20", + "scale":"2x", + "filename":"Icon-App-20x20@2x.png" + }, + { + "idiom":"ipad", + "size":"29x29", + "scale":"1x", + "filename":"Icon-App-29x29@1x.png" + }, + { + "idiom":"ipad", + "size":"29x29", + "scale":"2x", + "filename":"Icon-App-29x29@2x.png" + }, + { + "idiom":"ipad", + "size":"40x40", + "scale":"1x", + "filename":"Icon-App-40x40@1x.png" + }, + { + "idiom":"ipad", + "size":"40x40", + "scale":"2x", + "filename":"Icon-App-40x40@2x.png" + }, + { + "idiom":"ipad", + "size":"76x76", + "scale":"1x", + "filename":"Icon-App-76x76@1x.png" + }, + { + "idiom":"ipad", + "size":"76x76", + "scale":"2x", + "filename":"Icon-App-76x76@2x.png" + }, + { + "idiom":"ipad", + "size":"83.5x83.5", + "scale":"2x", + "filename":"Icon-App-83.5x83.5@2x.png" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "scale" : "1x", + "filename" : "ItunesArtwork@2x.png" + } + ], + "info":{ + "version":1, + "author":"easyappicon" } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } } diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png index 7353c41..6353928 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png index 797d452..7a28563 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png index 6ed2d93..1d64359 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png index 4cd7b00..3473c72 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png index fe73094..0127b69 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png index 321773c..587d475 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png index 797d452..7a28563 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png index 502f463..172ddd1 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png index 0ec3034..2aa0b55 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png index 0ec3034..2aa0b55 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png index e9f5fea..22795a0 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png index 84ac32a..04707a5 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png index 8953cba..a8fd2ab 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png index 0467bf1..5eb11b3 100644 Binary files a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png new file mode 100644 index 0000000..181feda Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/AppIcon.appiconset/ItunesArtwork@2x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/iTunesArtwork@1x.png b/frontend/app/ios/Runner/Assets.xcassets/iTunesArtwork@1x.png new file mode 100644 index 0000000..e9da18f Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/iTunesArtwork@1x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/iTunesArtwork@2x.png b/frontend/app/ios/Runner/Assets.xcassets/iTunesArtwork@2x.png new file mode 100644 index 0000000..181feda Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/iTunesArtwork@2x.png differ diff --git a/frontend/app/ios/Runner/Assets.xcassets/iTunesArtwork@3x.png b/frontend/app/ios/Runner/Assets.xcassets/iTunesArtwork@3x.png new file mode 100644 index 0000000..47bdf34 Binary files /dev/null and b/frontend/app/ios/Runner/Assets.xcassets/iTunesArtwork@3x.png differ diff --git a/frontend/app/lib/main.dart b/frontend/app/lib/main.dart index c421f10..fbfe95b 100644 --- a/frontend/app/lib/main.dart +++ b/frontend/app/lib/main.dart @@ -1,6 +1,12 @@ import 'package:app/model/services/auth_service.dart'; import 'package:app/model/services/storage_service.dart'; +import 'package:app/model/view_model/base_vm.dart'; +import 'package:app/pages/notifications_page.dart'; +import 'package:app/pages/registration_page.dart'; +import 'package:app/pages/security_page.dart'; import 'package:app/pages/start_page.dart'; +import 'package:app/pages/verify_email_page.dart'; +import 'package:app/pb/account.pb.dart'; import 'package:app/util/colors.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart' @@ -63,8 +69,12 @@ class DigitalerFrieden extends StatefulWidget { class _DigitalerFriedenState extends State { final StorageService _storageService = StorageService(); + final BaseViewModel _vm = BaseViewModel(); int? accountLevel; - bool? authenticated; + String? accessToken; + bool authenticated = false; + Account? account; + bool verified = false; bool _loading = true; @override void initState() { @@ -74,14 +84,29 @@ class _DigitalerFriedenState extends State { void _init() async { accountLevel = await _storageService.accountLevel; - if (accountLevel! > 0) { + accessToken = await _storageService.accessToken; + verified = await _storageService.verified; + if (accountLevel! > 1) { authenticated = await AuthService.authenticateWithBiometrics(); } + if (authenticated && accountLevel != null && accountLevel! > 3) { + account = await _vm.account; + } + + if (account != null && !verified && account!.emailVerified) { + await _storageService.setVerified(account!.emailVerified); + verified = account!.emailVerified; + } + + print( + 'ACCOUNTLEVEL: $accountLevel ======= VERIFIED: $verified ======= ID: ${account?.id}\nTOKEN: $accessToken'); setState(() { _loading = false; }); } + Future getAccount(BuildContext context) async {} + @override Widget build(BuildContext context) { if (_loading) { @@ -107,6 +132,28 @@ class _DigitalerFriedenState extends State { ), ); } - return const StartPage(); + if (verified) { + switch (accountLevel) { + default: + return const StartPage(); + } + } else { + switch (accountLevel) { + case 1: + return const SecurityPage(); + case 2: + return const NotificationsPage(); + case 4: + return const VerifyEmailPage(); + case 3: + if (accessToken != null) { + return const VerifyEmailPage(); + } else { + return const RegistrationPage(); + } + default: + return const StartPage(); + } + } } } diff --git a/frontend/app/lib/model/services/backend_service.dart b/frontend/app/lib/model/services/backend_service.dart index a09ceaf..040f915 100644 --- a/frontend/app/lib/model/services/backend_service.dart +++ b/frontend/app/lib/model/services/backend_service.dart @@ -126,13 +126,13 @@ class BackendService { Future createAccount( {required String email, required String password}) async { try { - final resp = - await BackendService.client.createAccount(CreateAccountRequest( + // final resp = + await BackendService.client.createAccount(CreateAccountRequest( email: email, password: password, )); - print(resp); - await _storageService.setAccountId(resp.account.id); + // print(resp); + // await _storageService.setAccountId(resp.account.id); return await login(email: email, password: password); } on SocketException { throw FetchDataException('Keine Internet Verbindung'); @@ -162,6 +162,29 @@ class BackendService { } } + Future get account async { + try { + final id = await _storageService.accountId; + if (id == 0) { + return null; + } + final resp = await _client.getAccount(GetAccountRequest(id: id), + options: CallOptions(metadata: { + 'Authorization': 'Bearer ${await _storageService.accessToken}' + })); + if (resp.account.id < 1) { + return null; + } + return resp.account; + } on SocketException { + throw FetchDataException('Keine Internet Verbindung'); + } on GrpcError catch (err) { + throw FetchDataException('${err.message}'); + } catch (err) { + throw InternalException(err.toString()); + } + } + Future getAccount() async { Session? session = await _isLoggedIn(); if (session == null) { @@ -399,6 +422,7 @@ class BackendService { // ); await _storageService.setAccessToken(response.accessToken); + await _storageService.setAccountId(response.accountId); // await Session.newSession(s); return response.accessToken != ''; diff --git a/frontend/app/lib/model/services/storage_service.dart b/frontend/app/lib/model/services/storage_service.dart index 1ea5ffd..785eb59 100644 --- a/frontend/app/lib/model/services/storage_service.dart +++ b/frontend/app/lib/model/services/storage_service.dart @@ -73,6 +73,14 @@ class StorageService { return await readData('access_token'); } + Future setVerified(bool verified) async { + return await writeData(StorageItem('verified', verified ? '1' : '0')); + } + + Future get verified async { + return await readData('verified') == '1'; + } + Future setAccountId(Int64 accountId) async { return await writeData(StorageItem('account_id', '$accountId')); } diff --git a/frontend/app/lib/model/view_model/account_vm.dart b/frontend/app/lib/model/view_model/account_vm.dart deleted file mode 100644 index bbdbbac..0000000 --- a/frontend/app/lib/model/view_model/account_vm.dart +++ /dev/null @@ -1,33 +0,0 @@ -import 'package:app/model/apis/api_response.dart'; -import 'package:app/model/services/backend_service.dart'; -import 'package:app/model/view_model/base_vm.dart'; -import 'package:app/pb/account.pb.dart'; - -class AccountViewModel extends BaseViewModel { - AccountViewModel() { - _init(); - } - final ApiResponse _apiResponse = ApiResponse.initial('Keine Daten'); - - final BackendService _service = BackendService(); - Account? _account; - - @override - ApiResponse get response { - return _apiResponse; - } - - Account? get account { - return _account; - } - - void _init() async { - // super.init(); - // try { - // _apiResponse = ApiResponse.completed(await _service.getAccount()); - // } catch (e) { - // _apiResponse = ApiResponse.error(e.toString()); - // } - // notifyListeners(); - } -} diff --git a/frontend/app/lib/model/view_model/base_vm.dart b/frontend/app/lib/model/view_model/base_vm.dart index df85f21..1a93248 100644 --- a/frontend/app/lib/model/view_model/base_vm.dart +++ b/frontend/app/lib/model/view_model/base_vm.dart @@ -1,7 +1,7 @@ import 'package:app/model/apis/api_response.dart'; import 'package:app/model/services/backend_service.dart'; import 'package:app/model/services/storage_service.dart'; -import 'package:app/pages_draft/home_page.dart'; +import 'package:app/pb/account.pb.dart'; import 'package:app/util/colors.dart'; import 'package:flutter/material.dart'; @@ -29,51 +29,59 @@ class BaseViewModel with ChangeNotifier { // // } // } - Future isLoggedIn(BuildContext context) async { - final messenger = ScaffoldMessenger.of(context); - final navigator = Navigator.of(context); - bool loggedIn = false; - try { - loggedIn = await BackendService.isLoggedIn; - } catch (err) { - if (err.toString().contains('session is blocked')) { - _apiResponse = ApiResponse.error('Sitzung ist abgelaufen'); - navigator.pushAndRemoveUntil( - MaterialPageRoute( - builder: (builder) => HomePage( - loggedOut: true, - )), - (route) => false); - messenger.showSnackBar(SnackBar( - backgroundColor: CustomColors.error, - content: const Text( - 'Sitzung ist abgelaufen', - style: TextStyle(color: Colors.white), - ), - // action: SnackBarAction( - // label: 'Details', - // onPressed: () { - // if (context.mounted) { - // showDialog( - // context: context, - // builder: (context) => AlertDialog( - // backgroundColor: Colors.black, - // icon: Icon( - // Icons.error, - // color: CustomColors.error, - // ), - // content: Text( - // err.toString(), - // textAlign: TextAlign.center, - // ), - // )); - // } - // }, - // ), - )); - } - } - return loggedIn; + // Future isLoggedIn(BuildContext context) async { + // final messenger = ScaffoldMessenger.of(context); + // final navigator = Navigator.of(context); + // bool loggedIn = false; + // try { + // loggedIn = await BackendService.isLoggedIn; + // } catch (err) { + // if (err.toString().contains('session is blocked')) { + // _apiResponse = ApiResponse.error('Sitzung ist abgelaufen'); + // navigator.pushAndRemoveUntil( + // MaterialPageRoute( + // builder: (builder) => HomePage( + // loggedOut: true, + // )), + // (route) => false); + // messenger.showSnackBar(SnackBar( + // backgroundColor: CustomColors.error, + // content: const Text( + // 'Sitzung ist abgelaufen', + // style: TextStyle(color: Colors.white), + // ), + // // action: SnackBarAction( + // // label: 'Details', + // // onPressed: () { + // // if (context.mounted) { + // // showDialog( + // // context: context, + // // builder: (context) => AlertDialog( + // // backgroundColor: Colors.black, + // // icon: Icon( + // // Icons.error, + // // color: CustomColors.error, + // // ), + // // content: Text( + // // err.toString(), + // // textAlign: TextAlign.center, + // // ), + // // )); + // // } + // // }, + // // ), + // )); + // } + // } + // return loggedIn; + // } + + Future get account async { + notifyListeners(); + final acc = await _service.account; + ApiResponse.completed(acc); + notifyListeners(); + return acc; } Future getAccount(BuildContext context) async { diff --git a/frontend/app/lib/pages/notifications_page.dart b/frontend/app/lib/pages/notifications_page.dart index a2f4690..b63214e 100644 --- a/frontend/app/lib/pages/notifications_page.dart +++ b/frontend/app/lib/pages/notifications_page.dart @@ -1,5 +1,7 @@ import 'package:app/model/services/storage_service.dart'; import 'package:app/pages/registration_page.dart'; +import 'package:app/pages/security_page.dart'; +import 'package:app/pages/verify_email_page.dart'; import 'package:app/util/colors.dart'; import 'package:flutter/material.dart'; @@ -25,18 +27,12 @@ class _NotificationsPageState extends State { } void _init() async { - final accountLevel = await _storageService.accountLevel; - if (accountLevel > 2 && mounted) { - await Navigator.push(context, - MaterialPageRoute(builder: (builder) => const RegistrationPage())); - setState(() { - _loading = false; - }); - } else { - setState(() { - _loading = false; - }); + if (await _storageService.accountLevel < 2) { + await _storageService.setAccountLevel(2); } + setState(() { + _loading = false; + }); } @override @@ -67,11 +63,12 @@ class _NotificationsPageState extends State { appBar: AppBar( leading: BackButton( color: CustomColors.primary, - onPressed: () async { - await _storageService.setAccountLevel(1); - if (mounted) { - Navigator.pop(context); - } + onPressed: () { + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute( + builder: (builder) => const SecurityPage()), + (route) => false); }, ), iconTheme: IconThemeData( @@ -125,15 +122,25 @@ class _NotificationsPageState extends State { ), onPressed: () async { await _setNotificationSetting(true); - await _storageService.setAccountLevel(3); - if (mounted) { - Navigator.push( - context, - MaterialPageRoute( - builder: (builder) => const RegistrationPage(), - // builder: (builder) => SecurityPage(), - ), - ); + if (await _storageService.accessToken != null) { + if (mounted) { + Navigator.push( + context, + MaterialPageRoute( + builder: (builder) => const VerifyEmailPage(), + ), + ); + } + } else { + if (mounted) { + Navigator.push( + context, + MaterialPageRoute( + builder: (builder) => + const RegistrationPage(), + ), + ); + } } }, child: const SizedBox( @@ -163,15 +170,26 @@ class _NotificationsPageState extends State { TextButton( onPressed: () async { await _setNotificationSetting(false); - await _storageService.setAccountLevel(3); - if (mounted) { - Navigator.push( - context, - MaterialPageRoute( - builder: (builder) => const RegistrationPage(), - // builder: (builder) => SecurityPage(), - ), - ); + if (await _storageService.accessToken != null) { + if (mounted) { + Navigator.push( + context, + MaterialPageRoute( + builder: (builder) => const VerifyEmailPage(), + // builder: (builder) => SecurityPage(), + ), + ); + } + } else { + if (mounted) { + Navigator.push( + context, + MaterialPageRoute( + builder: (builder) => const RegistrationPage(), + // builder: (builder) => SecurityPage(), + ), + ); + } } }, child: Text( diff --git a/frontend/app/lib/pages/password_page.dart b/frontend/app/lib/pages/password_page.dart index 9767dc4..2def444 100644 --- a/frontend/app/lib/pages/password_page.dart +++ b/frontend/app/lib/pages/password_page.dart @@ -1,4 +1,3 @@ -import 'package:app/model/services/storage_service.dart'; import 'package:app/model/view_model/base_vm.dart'; import 'package:app/pages/verify_email_page.dart'; import 'package:app/util/colors.dart'; @@ -17,7 +16,6 @@ class PasswordPage extends StatefulWidget { class _PasswordPageState extends State { final BaseViewModel _vm = BaseViewModel(); - final StorageService _storageService = StorageService(); final _formKey = GlobalKey(); final _passwordController1 = TextEditingController(); @@ -204,7 +202,6 @@ class _PasswordPageState extends State { ); } if (loggedin && mounted) { - await _storageService.setAccountLevel(4); navigator.push( MaterialPageRoute( builder: (builder) => diff --git a/frontend/app/lib/pages/registration_page.dart b/frontend/app/lib/pages/registration_page.dart index dd66e8c..ec87592 100644 --- a/frontend/app/lib/pages/registration_page.dart +++ b/frontend/app/lib/pages/registration_page.dart @@ -1,6 +1,6 @@ import 'package:app/model/services/storage_service.dart'; +import 'package:app/pages/notifications_page.dart'; import 'package:app/pages/password_page.dart'; -import 'package:app/pages/verify_email_page.dart'; import 'package:app/util/colors.dart'; import 'package:app/util/validation.dart'; import 'package:flutter/material.dart'; @@ -26,18 +26,12 @@ class _RegistrationPageState extends State { } void _init() async { - final accountLevel = await _storageService.accountLevel; - if (accountLevel > 3 && mounted) { - await Navigator.push(context, - MaterialPageRoute(builder: (builder) => const VerifyEmailPage())); - setState(() { - _loading = false; - }); - } else { - setState(() { - _loading = false; - }); + if (await _storageService.accountLevel < 3) { + await _storageService.setAccountLevel(3); } + setState(() { + _loading = false; + }); } @override @@ -73,11 +67,12 @@ class _RegistrationPageState extends State { appBar: AppBar( leading: BackButton( color: CustomColors.primary, - onPressed: () async { - await _storageService.setAccountLevel(2); - if (mounted) { - Navigator.pop(context); - } + onPressed: () { + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute( + builder: (builder) => const NotificationsPage()), + (route) => false); }, ), iconTheme: IconThemeData( diff --git a/frontend/app/lib/pages/security_page.dart b/frontend/app/lib/pages/security_page.dart index fd10999..64ddb46 100644 --- a/frontend/app/lib/pages/security_page.dart +++ b/frontend/app/lib/pages/security_page.dart @@ -1,6 +1,7 @@ import 'package:app/model/services/auth_service.dart'; import 'package:app/model/services/storage_service.dart'; import 'package:app/pages/notifications_page.dart'; +import 'package:app/pages/start_page.dart'; import 'package:app/util/colors.dart'; import 'package:flutter/material.dart'; @@ -22,18 +23,12 @@ class _SecurityPageState extends State { } void _init() async { - final accountLevel = await _storageService.accountLevel; - if (accountLevel > 1 && mounted) { - await Navigator.push(context, - MaterialPageRoute(builder: (builder) => const NotificationsPage())); - setState(() { - _loading = false; - }); - } else { - setState(() { - _loading = false; - }); + if (await _storageService.accountLevel < 1) { + await _storageService.setAccountLevel(1); } + setState(() { + _loading = false; + }); } @override @@ -63,11 +58,12 @@ class _SecurityPageState extends State { appBar: AppBar( leading: BackButton( color: CustomColors.primary, - onPressed: () async { - await _storageService.setAccountLevel(0); - if (mounted) { - Navigator.pop(context); - } + onPressed: () { + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute( + builder: (builder) => const StartPage()), + (route) => false); }, ), iconTheme: IconThemeData(color: CustomColors.primary), @@ -117,14 +113,14 @@ class _SecurityPageState extends State { bool isAuthenticated = await AuthService.authenticateWithBiometrics(); if (isAuthenticated) { - await _storageService.setAccountLevel(2); - // ignore: use_build_context_synchronously - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - const NotificationsPage()), - ); + if (mounted) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + const NotificationsPage()), + ); + } } }, child: const SizedBox( diff --git a/frontend/app/lib/pages/start_page.dart b/frontend/app/lib/pages/start_page.dart index 65fbf89..fe6e118 100644 --- a/frontend/app/lib/pages/start_page.dart +++ b/frontend/app/lib/pages/start_page.dart @@ -1,166 +1,112 @@ -import 'package:app/model/services/storage_service.dart'; import 'package:app/pages/agb_page.dart'; import 'package:app/pages/security_page.dart'; import 'package:app/util/colors.dart'; import 'package:flutter/material.dart'; -class StartPage extends StatefulWidget { +class StartPage extends StatelessWidget { const StartPage({super.key}); - @override - State createState() => _StartPageState(); -} - -class _StartPageState extends State { - final StorageService _storageService = StorageService(); - bool _loading = true; - - @override - void initState() { - _init(); - super.initState(); - } - - void _init() async { - int accountLevel = await _storageService.accountLevel; - if (accountLevel > 0 && mounted) { - await Navigator.push(context, - MaterialPageRoute(builder: (builder) => const SecurityPage())); - setState(() { - _loading = false; - }); - } else { - setState(() { - _loading = false; - }); - } - } - @override Widget build(BuildContext context) { return SafeArea( - child: _loading - ? Center( - child: Column( - children: [ - const SizedBox( - height: 150, - ), - Hero( - tag: 'logo', - child: Image.asset( - 'assets/JPEG.jpg', - height: 180, - ), - ), - CircularProgressIndicator( - color: CustomColors.primary, - ), - ], - ), - ) - : Scaffold( - appBar: AppBar( - iconTheme: IconThemeData(color: CustomColors.primary), - ), - body: Padding( - padding: const EdgeInsets.fromLTRB(16, 20, 16, 16), - child: Column( - children: [ - Hero( - tag: 'flow-icon', - child: Image.asset( - 'assets/JPEG.jpg', - height: 180, - ), - ), - const SizedBox( - height: 30, - ), - const Text( - 'Hallo. Digitale Spuren\nentfernen\nper Knopfdruck.', - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: 'sans-serif', - fontWeight: FontWeight.bold, - letterSpacing: 2.0, - fontSize: 25, - ), - ), - const SizedBox( - height: 20, - ), - const Text( - 'Mit uns finden Sie Ihre Digitalen Spuren und können diese entfernen.', - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: 'sans-serif', - fontSize: 18, - ), - ), - const Spacer( - flex: 1, - ), - Hero( - tag: 'flow-button', - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: CustomColors.primary, - ), - onPressed: () async { - await _storageService.setAccountLevel(1); - if (mounted) { - Navigator.push( - context, - MaterialPageRoute( - builder: (builder) => const SecurityPage(), - // builder: (builder) => SecurityPage(), - ), - ); - } - }, - child: const SizedBox( - height: 60, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'Weiter', - style: TextStyle( - fontSize: 20, - ), - ), - ], - ), - ), - ), - ), - const Spacer( - flex: 1, - ), - const Text( - 'Mit der weiteren Nutzung stimmst du den folgenden Bedingungen zu:', - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: 'sans-serif', - fontSize: 16, - ), - ), - TextButton( - onPressed: () { - showDialog( - context: context, - builder: (builder) => AgbPage()); - }, - child: Text( - 'AGB - Datenschutzerklärung', - textAlign: TextAlign.center, - style: TextStyle(color: CustomColors.primary), - )) - ], + child: Scaffold( + appBar: AppBar( + iconTheme: IconThemeData(color: CustomColors.primary), + ), + body: Padding( + padding: const EdgeInsets.fromLTRB(16, 20, 16, 16), + child: Column( + children: [ + Hero( + tag: 'flow-icon', + child: Image.asset( + 'assets/JPEG.jpg', + height: 180, ), ), - ), + const SizedBox( + height: 30, + ), + const Text( + 'Hallo. Digitale Spuren\nentfernen\nper Knopfdruck.', + textAlign: TextAlign.center, + style: TextStyle( + fontFamily: 'sans-serif', + fontWeight: FontWeight.bold, + letterSpacing: 2.0, + fontSize: 25, + ), + ), + const SizedBox( + height: 20, + ), + const Text( + 'Mit uns finden Sie Ihre Digitalen Spuren und können diese entfernen.', + textAlign: TextAlign.center, + style: TextStyle( + fontFamily: 'sans-serif', + fontSize: 18, + ), + ), + const Spacer( + flex: 1, + ), + Hero( + tag: 'flow-button', + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: CustomColors.primary, + ), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (builder) => const SecurityPage(), + // builder: (builder) => SecurityPage(), + ), + ); + }, + child: const SizedBox( + height: 60, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Weiter', + style: TextStyle( + fontSize: 20, + ), + ), + ], + ), + ), + ), + ), + const Spacer( + flex: 1, + ), + const Text( + 'Mit der weiteren Nutzung stimmst du den folgenden Bedingungen zu:', + textAlign: TextAlign.center, + style: TextStyle( + fontFamily: 'sans-serif', + fontSize: 16, + ), + ), + TextButton( + onPressed: () { + showDialog( + context: context, builder: (builder) => AgbPage()); + }, + child: Text( + 'AGB - Datenschutzerklärung', + textAlign: TextAlign.center, + style: TextStyle(color: CustomColors.primary), + )) + ], + ), + ), + ), ); } } diff --git a/frontend/app/lib/pages/verify_email_page.dart b/frontend/app/lib/pages/verify_email_page.dart index 046461d..0494fcf 100644 --- a/frontend/app/lib/pages/verify_email_page.dart +++ b/frontend/app/lib/pages/verify_email_page.dart @@ -1,5 +1,6 @@ import 'package:app/model/services/storage_service.dart'; import 'package:app/model/view_model/base_vm.dart'; +import 'package:app/pages/notifications_page.dart'; import 'package:app/util/colors.dart'; import 'package:flutter/material.dart'; @@ -18,6 +19,13 @@ class _VerifyEmailPageState extends State { @override void initState() { super.initState(); + _init(); + } + + void _init() async { + if (await _storageService.accountLevel < 4) { + await _storageService.setAccountLevel(4); + } setState(() { _loading = false; }); @@ -50,11 +58,12 @@ class _VerifyEmailPageState extends State { appBar: AppBar( leading: BackButton( color: CustomColors.primary, - onPressed: () async { - await _storageService.setAccountLevel(3); - if (mounted) { - Navigator.pop(context); - } + onPressed: () { + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute( + builder: (builder) => const NotificationsPage()), + (route) => false); }, ), iconTheme: IconThemeData( @@ -63,95 +72,112 @@ class _VerifyEmailPageState extends State { ), body: Padding( padding: const EdgeInsets.fromLTRB(20, 20, 20, 16), - child: Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: [ - const SizedBox( - height: 80, - ), - const Text( - 'Verifizieren', - textAlign: TextAlign.center, - style: TextStyle( - fontFamily: 'sans-serif', - fontWeight: FontWeight.bold, - letterSpacing: 2.0, - fontSize: 25, + child: Center( + child: Column( + children: [ + const SizedBox( + height: 80, ), - ), - const SizedBox( - height: 50, - ), - const Text( - 'Wir haben dir eine E-Mail geschickt.', - textAlign: TextAlign.center, - // textAlign: TextAlign.center, - ), - const SizedBox( - height: 20, - ), - const Text( - 'Bitte verifiziere deine E-Mail Adresse, dann geht es weiter.', - textAlign: TextAlign.center, - // textAlign: TextAlign.center, - ), - const SizedBox( - height: 80, - ), - Hero( - tag: 'flow-button', - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: CustomColors.primary, + const Text( + 'Verifizieren', + textAlign: TextAlign.center, + style: TextStyle( + fontFamily: 'sans-serif', + fontWeight: FontWeight.bold, + letterSpacing: 2.0, + fontSize: 25, ), - onPressed: () {}, - child: const SizedBox( - height: 50, - width: 100, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'Weiter', - style: TextStyle( - fontSize: 20, + ), + const SizedBox( + height: 50, + ), + const Text( + 'Wir haben dir eine E-Mail geschickt.', + textAlign: TextAlign.center, + // textAlign: TextAlign.center, + ), + const SizedBox( + height: 20, + ), + const Text( + 'Bitte verifiziere deine E-Mail Adresse, dann geht es weiter.', + textAlign: TextAlign.center, + // textAlign: TextAlign.center, + ), + const SizedBox( + height: 80, + ), + Hero( + tag: 'flow-button', + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: CustomColors.primary, + ), + onPressed: () {}, + child: const SizedBox( + height: 50, + width: 100, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Weiter', + style: TextStyle( + fontSize: 20, + ), ), - ), - ], + ], + ), ), ), ), - ), - const SizedBox( - height: 60, - ), - const Text( - 'Noch keine E-Mail erhalten?', - // textAlign: TextAlign.center, - ), - const Text( - 'Schon im Spam-Ordner nachgeschaut?', - // textAlign: TextAlign.center, - ), - const SizedBox( - height: 20, - ), - TextButton( - onPressed: () async { - await _vm.resendVerification(context); - }, - child: Text( - 'Erneut senden', + const SizedBox( + height: 60, + ), + const Text( + 'Noch keine E-Mail erhalten?', // textAlign: TextAlign.center, - style: TextStyle( - color: CustomColors.primary, + ), + const Text( + 'Schon im Spam-Ordner nachgeschaut?', + // textAlign: TextAlign.center, + ), + // const SizedBox( + // height: 20, + // ), + TextButton( + onPressed: () async { + await _vm.resendVerification(context); + }, + child: Text( + 'Erneut senden', + // textAlign: TextAlign.center, + style: TextStyle( + color: CustomColors.primary, + ), ), ), - ), - const Spacer( - flex: 2, - ), - ], + const Spacer( + flex: 2, + ), + const Text('Account versehentlich angelegt?'), + // const SizedBox( + // height: 10, + // ), + TextButton( + onPressed: () async {}, + child: Text( + 'Account löschen', + style: TextStyle( + color: CustomColors.primary, + ), + ), + ), + const SizedBox( + height: 30, + ), + ], + ), ), ), ), diff --git a/frontend/app/lib/pages_draft/home_page.dart b/frontend/app/lib/pages_draft/home_page.dart deleted file mode 100644 index 0774069..0000000 --- a/frontend/app/lib/pages_draft/home_page.dart +++ /dev/null @@ -1,221 +0,0 @@ -import 'package:app/model/services/backend_service.dart'; -import 'package:app/model/view_model/account_vm.dart'; -import 'package:app/model/view_model/base_vm.dart'; -import 'package:app/pages_draft/login_overlay.dart'; -import 'package:app/pages_draft/persons_page.dart'; -import 'package:app/widgets/background.dart'; -import 'package:app/widgets/bottom_navigation.dart'; -import 'package:app/widgets/bottom_navigation_item.dart'; -import 'package:app/widgets/drawer.dart'; -import 'package:app/widgets/side_drawer_item.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -// ignore: must_be_immutable -class HomePage extends StatefulWidget { - HomePage({super.key, required this.loggedOut}); - - bool loggedOut; - - @override - State createState() => _HomePageState(); -} - -class _HomePageState extends State { - @override - void initState() { - super.initState(); - _init(); - } - - AccountViewModel vm = AccountViewModel(); - void _init() async { - // _setLoading(true); - // _setLoading(widget.loggedOut); - // _loading = widget.loggedOut; - // _loggedin = await BackendService.isLoggedIn; - // if (!_loggedin) { - // await BackendService.logout(); - // final navigator = Navigator.of(context); - // navigator.pushAndRemoveUntil( - // MaterialPageRoute( - // builder: (builder) => HomePage( - // loggedOut: true, - // )), - // (route) => false); - // } - _setLoading(false); - } - - _isLoggedIn(BuildContext context) async { - bool logged = await vm.isLoggedIn(context); - setState(() { - _loggedin = logged; - }); - } - - void _setLoading(bool loading) { - setState(() { - _loading = loading; - }); - } - - bool _loading = true; - bool _loggedin = false; - @override - Widget build(BuildContext context) { - return Background( - child: Scaffold( - appBar: AppBar( - automaticallyImplyLeading: false, - // flexibleSpace: Image.asset( - // 'lib/assets/logo_300x200.png', - // // height: 400, - // ), - ), - drawer: SideDrawer( - children: [ - const Spacer( - flex: 3, - ), - SideDrawerItem( - onPressed: () {}, - icon: Icons.question_answer, - color: Colors.white, - label: 'About', - ), - SideDrawerItem( - onPressed: () {}, - icon: Icons.privacy_tip, - color: Colors.white, - label: 'Datenschutz', - ), - SideDrawerItem( - onPressed: () {}, - icon: Icons.apartment, - color: Colors.white, - label: 'Impressum', - ), - const Spacer( - flex: 1, - ), - if (_loggedin) - SideDrawerItem( - onPressed: () async { - setState(() { - _loading = true; - }); - await BackendService.logout(); - // ignore: use_build_context_synchronously - Navigator.of(context).pushAndRemoveUntil( - MaterialPageRoute( - builder: (builder) => HomePage( - loggedOut: true, - )), - (route) => false); - setState(() { - _loggedin = false; - _loading = false; - }); - }, - icon: Icons.logout, - color: Colors.white, - label: 'Logout', - ), - ], - ), - bottomNavigationBar: BottomNavigation( - children: [ - if (!_loggedin) ...[ - BottomNavigationItem( - onPressed: () async { - final bool res = await showLogin(context, registration: true); - setState(() { - _loggedin = res; - }); - }, - icon: Icons.person_add_alt, - color: Colors.white, - label: 'Registrieren', - ), - BottomNavigationItem( - onPressed: () async { - bool res = await showLogin(context); - setState(() { - _loggedin = res; - // vm.isLoggedIn(context); - }); - }, - icon: Icons.login, - color: Colors.white, - label: 'Login', - ), - ] else - BottomNavigationItem( - onPressed: () async { - final navigator = Navigator.of(context); - if (_loggedin) { - navigator.push(MaterialPageRoute( - builder: (builder) => const PersonsPage())); - } else { - navigator.pushAndRemoveUntil( - MaterialPageRoute( - builder: (builder) => const PersonsPage()), - (route) => false); - } - }, - icon: Icons.person_search, - color: Colors.white, - label: 'Personen', - ), - BottomNavigationItem( - onPressed: () {}, - icon: Icons.dashboard, - color: Colors.white, - label: 'Dashboard', - ), - ...[] - ], - ), - body: Padding( - padding: const EdgeInsets.fromLTRB(16, 45, 16, 16), - child: Center( - child: ChangeNotifierProvider( - create: (context) => BaseViewModel(), - child: Consumer(builder: (context, value, child) { - // _checkResponse(value.response); - if (!widget.loggedOut) { - _isLoggedIn(context); - } - return _loading - ? const CircularProgressIndicator( - color: Colors.grey, - ) - : Column( - children: [ - Image.asset( - 'lib/assets/logo_300x200.png', - ), - const SizedBox( - height: 40, - ), - Text( - 'Digitale Spuren auf Knopfdruck entfernen' - .toUpperCase(), - textAlign: TextAlign.center, - style: const TextStyle( - fontFamily: 'sans-serif', - fontSize: 24, - height: 1.6, - fontWeight: FontWeight.normal, - letterSpacing: 6, - ), - ), - ], - ); - })), - ), - ), - )); - } -} diff --git a/frontend/app/lib/pages_draft/login_overlay.dart b/frontend/app/lib/pages_draft/login_overlay.dart deleted file mode 100644 index ef927a5..0000000 --- a/frontend/app/lib/pages_draft/login_overlay.dart +++ /dev/null @@ -1,239 +0,0 @@ -import 'package:app/model/view_model/base_vm.dart'; -import 'package:app/widgets/background.dart'; -import 'package:app/widgets/bottom_navigation.dart'; -import 'package:app/widgets/bottom_navigation_item.dart'; -import 'package:app/widgets/side_drawer.dart'; -import 'package:app/widgets/side_drawer_item.dart'; -import 'package:flutter/material.dart'; -import 'package:app/util/validation.dart'; -import 'package:provider/provider.dart'; - -Future showLogin(BuildContext context, - {bool registration = false}) async { - final formKey = GlobalKey(); - final mailController = TextEditingController(); - final passwordController = TextEditingController(); - - BaseViewModel vm = BaseViewModel(); - bool submitted = false; - bool loggedin = false; - void login(BuildContext context) { - if (formKey.currentState!.validate()) { - submitted = true; - FocusScope.of(context).unfocus(); - vm - .login(context, - email: mailController.text, password: passwordController.text) - .then( - (r) { - if (r) { - loggedin = r; - Navigator.pop(context, true); - } - }, - ); - passwordController.clear(); - submitted = false; - } - } - - void register(BuildContext context) { - if (formKey.currentState!.validate()) { - submitted = true; - vm - .createAccount( - context, - email: mailController.text, - password: passwordController.text, - ) - .then( - (r) { - if (r) { - loggedin = r; - Navigator.pop(context, true); - } - }, - ); - } - } - - await showModalBottomSheet( - useSafeArea: true, - isScrollControlled: true, - backgroundColor: Colors.black, - context: context, - builder: (builder) { - return Background( - child: Scaffold( - drawer: SideDrawer( - children: [ - const Spacer( - flex: 3, - ), - SideDrawerItem( - onPressed: () {}, - icon: Icons.question_answer, - color: Colors.white, - label: 'About', - ), - SideDrawerItem( - onPressed: () {}, - icon: Icons.privacy_tip, - color: Colors.white, - label: 'Datenschutz', - ), - SideDrawerItem( - onPressed: () {}, - icon: Icons.apartment, - color: Colors.white, - label: 'Impressum', - ), - const Spacer( - flex: 1, - ), - ], - ), - bottomNavigationBar: BottomNavigation( - children: [ - BottomNavigationItem( - onPressed: () { - Navigator.pop(context, false); - }, - icon: Icons.arrow_back, - color: Colors.white, - label: 'Zurück', - ), - BottomNavigationItem( - onPressed: () { - Navigator.pop(context, false); - }, - icon: Icons.home, - color: Colors.white, - label: 'Home', - ), - ], - ), - body: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const SizedBox( - height: 50, - ), - const Image( - width: 180, - image: AssetImage( - 'lib/assets/logo_300x200.png', - ), - ), - const SizedBox( - height: 30, - ), - Text( - registration ? 'Registrieren' : 'Login', - style: const TextStyle( - fontFamily: 'sans-serif', - fontSize: 24, - height: 1.6, - fontWeight: FontWeight.normal, - letterSpacing: 6, - ), - ), - ChangeNotifierProvider( - create: (context) => BaseViewModel(), - child: Consumer( - builder: (context, value, child) => Form( - key: formKey, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox( - height: 40, - ), - TextFormField( - // autofocus: true, - // inputFormatters: [ - // FilteringTextInputFormatter.allow( - // emailRegExp, - // ), - // ], - controller: mailController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'E-Mail Adresse', - ), - keyboardType: TextInputType.emailAddress, - validator: (value) { - if (value == null || !value.isValidEmail) { - return 'Bitte eine gültige E-Mail Adresse eingeben'; - } - return null; - }, - ), - TextFormField( - style: const TextStyle( - color: Colors.white, - ), - // inputFormatters: [ - // FilteringTextInputFormatter.allow( - // passwordRegExp, - // ), - // ], - controller: passwordController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'Passwort', - ), - keyboardType: TextInputType.visiblePassword, - obscureText: true, - validator: (value) { - if (value == null || !value.isValidPassword) { - return 'Bitte geben Sie Ihr Passwort ein'; - } - return null; - }, - ), - const SizedBox( - height: 15, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - ElevatedButton( - onPressed: !submitted - ? !registration - ? () { - login(context); - } - : () { - register(context); - } - : null, - child: const Icon(Icons.login), - ), - ], - ) - ], - ), - ), - ), - ), - const Spacer(), - ], - ), - ), - ), - ); - }); - return loggedin; -} diff --git a/frontend/app/lib/pages_draft/person_details_page.dart b/frontend/app/lib/pages_draft/person_details_page.dart deleted file mode 100644 index 86f38b6..0000000 --- a/frontend/app/lib/pages_draft/person_details_page.dart +++ /dev/null @@ -1,339 +0,0 @@ -import 'package:app/model/view_model/persons_vm.dart'; -import 'package:app/pb/google/protobuf/timestamp.pb.dart'; -import 'package:app/pb/person.pb.dart'; -import 'package:app/util/validation.dart'; -import 'package:app/widgets/background.dart'; -import 'package:app/widgets/bottom_navigation.dart'; -import 'package:app/widgets/bottom_navigation_item.dart'; -import 'package:fixnum/fixnum.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:intl/intl.dart'; - -Future showPerson(BuildContext context, {Person? person}) async { - PersonsViewModel vm = PersonsViewModel(); - - final formKey = GlobalKey(); - final firstnameController = TextEditingController(); - final lastnameController = TextEditingController(); - final cityController = TextEditingController(); - final zipController = TextEditingController(); - final streetController = TextEditingController(); - final countryController = TextEditingController(); - final birthdayController = TextEditingController(); - - Future _init() async { - if (person == null) { - person ??= Person(); - // person ??= Person(accountId: await BackendService.accountId); - } else { - firstnameController.text = person!.firstname; - lastnameController.text = person!.lastname; - cityController.text = person!.city; - zipController.text = person!.zip; - streetController.text = person!.street; - countryController.text = person!.country; - birthdayController.text = - DateFormat('dd.MM.yyyy').format(person!.birthday.toDateTime()); - } - } - - await _init(); - - void _updateData() { - person!.firstname = firstnameController.text; - person!.lastname = lastnameController.text; - person!.city = cityController.text; - person!.street = streetController.text; - person!.zip = zipController.text; - person!.country = countryController.text; - } - - Future createPerson(BuildContext context) async { - final navigator = Navigator.of(context); - _updateData(); - person!.id = Int64(0); - person = await vm.createPerson(context, - firstname: person!.firstname, - lastname: person!.lastname, - street: person!.street, - zip: person!.zip, - city: person!.city, - country: person!.country, - birthday: person!.birthday); - - if (person!.id != 0) { - navigator.pop(person); - } - } - - Future updatePerson(BuildContext context) async { - final navigator = Navigator.of(context); - _updateData(); - final personUpdate = await vm.updatePerson(context, - id: person!.id, - firstname: person!.firstname != firstnameController.text - ? person!.firstname - : null, - lastname: person!.lastname != lastnameController.text - ? person!.lastname - : null, - street: person!.street != streetController.text ? person!.street : null, - zip: person!.zip != zipController.text ? person!.zip : null, - city: person!.city != cityController.text ? person!.city : null, - country: - person!.country != countryController.text ? person!.country : null, - birthday: - DateFormat('dd.MM.yyyy').format(person!.birthday.toDateTime()) != - birthdayController.text - ? person!.birthday - : null); - - if (personUpdate != person) { - navigator.pop(person); - } - } - - // ignore: use_build_context_synchronously - await showModalBottomSheet( - context: context, - builder: (builder) { - return Background( - child: Scaffold( - bottomNavigationBar: BottomNavigation( - hideMenu: true, - children: [ - BottomNavigationItem( - onPressed: () { - Navigator.pop(context, false); - }, - icon: Icons.arrow_back, - color: Colors.white, - label: 'Zurück', - ), - BottomNavigationItem( - onPressed: () { - Navigator.pop(context, false); - }, - icon: Icons.home, - color: Colors.white, - label: 'Home', - ), - ], - ), - body: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const SizedBox( - height: 50, - ), - Text( - person!.id == 0 ? 'Person anlegen' : 'Person anpassen', - style: const TextStyle( - fontFamily: 'sans-serif', - fontSize: 24, - height: 1.6, - fontWeight: FontWeight.normal, - letterSpacing: 6), - ), - ChangeNotifierProvider( - create: (context) => PersonsViewModel(), - child: Consumer( - builder: (context, value, child) => Form( - key: formKey, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const SizedBox( - height: 40, - ), - TextFormField( - controller: firstnameController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - suffix: Text('Vorname'), - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'Vorname', - ), - keyboardType: TextInputType.name, - validator: (value) { - if (value == null || !value.isValidName) { - return 'Bitte einen gültigen Vornamen eingeben'; - } - return null; - }, - ), - TextFormField( - controller: lastnameController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - suffix: Text('Nachname'), - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'Nachname', - ), - keyboardType: TextInputType.name, - validator: (value) { - if (value == null || !value.isValidName) { - return 'Bitte einen gültigen Nachnamen eingeben'; - } - return null; - }, - ), - TextFormField( - readOnly: true, - onTap: () async { - DateTime? pickedDate = await showDatePicker( - context: context, - locale: const Locale('de', 'DE'), - initialDate: DateTime.now(), - firstDate: DateTime(1930), - lastDate: DateTime(DateTime.now().year + 1), - builder: (context, child) => Theme( - data: ThemeData.dark(), - child: child != null ? child : Text(''), - ), - ); - - if (pickedDate != null) { - person!.birthday = - Timestamp.fromDateTime(pickedDate); - birthdayController.text = - DateFormat('dd.MM.yyyy') - .format(pickedDate); - } - }, - controller: birthdayController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - suffix: Text('Geburtstag'), - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'Geburtstag', - ), - keyboardType: TextInputType.name, - // validator: (value) { - // if (value == null || !value.isValidName) { - // return 'Bitte einen gültigen Nachnamen eingeben'; - // } - // return null; - // }, - ), - TextFormField( - controller: streetController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - suffix: Text('Straße'), - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'Straße mit Hausnummer', - ), - keyboardType: TextInputType.name, - validator: (value) { - if (value == null || !value.isValidName) { - return 'Bitte eine gültige Straße mit Hausnummer eingeben'; - } - return null; - }, - ), - TextFormField( - controller: zipController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - suffix: Text('PLZ'), - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'PLZ', - ), - keyboardType: TextInputType.name, - validator: (value) { - if (value == null || !value.isValidName) { - return 'Bitte eine gültige PLZ eingeben'; - } - return null; - }, - ), - TextFormField( - controller: cityController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - suffix: Text('Stadt'), - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'Stadt', - ), - keyboardType: TextInputType.name, - validator: (value) { - if (value == null || !value.isValidName) { - return 'Bitte eine gültige Stadt eingeben'; - } - return null; - }, - ), - TextFormField( - controller: countryController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - suffix: Text('Land'), - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'Land', - ), - keyboardType: TextInputType.name, - validator: (value) { - if (value == null || !value.isValidName) { - return 'Bitte ein gültiges Land eingeben'; - } - return null; - }, - ), - const SizedBox( - height: 15, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - ElevatedButton( - onPressed: () async { - person!.id.isZero - ? await createPerson(context) - : await updatePerson(context); - }, - child: const Icon(Icons.update), - ), - ], - ) - ], - ), - ), - ), - ), - ], - ), - ), - ), - ); - }, - useSafeArea: true, - isScrollControlled: true, - backgroundColor: Colors.black); - return person!; -} diff --git a/frontend/app/lib/pages_draft/persons_page.dart b/frontend/app/lib/pages_draft/persons_page.dart deleted file mode 100644 index 1f22ca9..0000000 --- a/frontend/app/lib/pages_draft/persons_page.dart +++ /dev/null @@ -1,241 +0,0 @@ -import 'package:app/model/apis/api_response.dart'; -import 'package:app/model/services/backend_service.dart'; -import 'package:app/model/view_model/persons_vm.dart'; -import 'package:app/pages_draft/home_page.dart'; -import 'package:app/pages_draft/person_details_page.dart'; -import 'package:app/pb/person.pb.dart'; -import 'package:app/util/validation.dart'; -import 'package:app/widgets/background.dart'; -import 'package:app/widgets/bottom_navigation.dart'; -import 'package:app/widgets/bottom_navigation_item.dart'; -import 'package:app/widgets/side_drawer.dart'; -import 'package:app/widgets/side_drawer_item.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - -class PersonsPage extends StatefulWidget { - const PersonsPage({super.key}); - - @override - State createState() => _PersonsPageState(); -} - -class _PersonsPageState extends State { - @override - void initState() { - super.initState(); - // _init(); - } - - // void _init() async { - // _setLoading(true); - // _loggedin = await BackendService.isLoggedIn; - // _setLoading(false); - // } - - // void _setLoading(bool loading) { - // setState(() { - // _loading = loading; - // }); - // } - - void _checkResponse(ApiResponse response) { - if (response.status == Status.ERROR && - (response.message!.contains('unauthenticated') || - response.message!.contains('blocked'))) { - BackendService.logout(); - Navigator.of(context).pushAndRemoveUntil( - MaterialPageRoute( - builder: (builder) => HomePage( - loggedOut: true, - )), - (route) => false); - } - } - - bool _loading = false; - bool _loggedin = false; - List persons = []; - - PersonsViewModel vm = PersonsViewModel(); - - void listPersons(BuildContext context) async { - persons = await vm.listPersons(); - } - - List _personsList(List persons) { - persons.sort((a, b) { - final comp = a.lastname.compareTo(b.lastname); - if (comp != 0) { - return comp; - } - return a.firstname.compareTo(b.firstname); - }); - final List list = []; - for (var p in persons) { - list.add(TextButton( - onPressed: () async { - final Person per = await showPerson(context, person: p); - if (!per.id.isZero && !persons.contains(per)) { - setState(() { - this.persons.add(per); - }); - } - }, - child: Card( - shape: - RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), - color: const Color.fromARGB(100, 89, 88, 88), - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 14), - child: Row( - children: [ - SizedBox( - height: 40, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - p.lastname.titleCase, - style: const TextStyle(color: Colors.white), - // overflow: TextOverflow.fade, - textAlign: TextAlign.start, - ), - const Spacer(), - Text( - p.firstname.titleCase, - style: const TextStyle(color: Colors.white), - textAlign: TextAlign.start, - // overflow: TextOverflow.fade, - ), - ], - ), - ), - const Spacer(), - const Text('STATUS') - ], - ), - ), - ), - )); - } - return list; - } - - @override - Widget build(BuildContext context) { - return Background( - child: Scaffold( - floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat, - floatingActionButton: FloatingActionButton( - onPressed: () async { - final p = await showPerson(context); - if (!p.id.isZero && !persons.contains(p)) { - setState(() { - persons.add(p); - }); - } - }, - child: const Icon(Icons.add), - ), - appBar: AppBar( - automaticallyImplyLeading: false, - ), - drawer: SideDrawer( - children: [ - const Spacer( - flex: 3, - ), - SideDrawerItem( - onPressed: () {}, - icon: Icons.question_answer, - color: Colors.white, - label: 'About', - ), - SideDrawerItem( - onPressed: () {}, - icon: Icons.privacy_tip, - color: Colors.white, - label: 'Datenschutz', - ), - SideDrawerItem( - onPressed: () {}, - icon: Icons.apartment, - color: Colors.white, - label: 'Impressum', - ), - const Spacer( - flex: 1, - ), - if (_loggedin) - SideDrawerItem( - onPressed: () async { - setState(() { - _loading = true; - }); - await BackendService.logout(); - // ignore: use_build_context_synchronously - Navigator.of(context).pushAndRemoveUntil( - MaterialPageRoute( - builder: (builder) => HomePage( - loggedOut: true, - )), - (route) => false); - setState(() { - _loggedin = false; - _loading = false; - }); - }, - icon: Icons.logout, - color: Colors.white, - label: 'Logout', - ), - ], - ), - bottomNavigationBar: BottomNavigation( - children: [ - BottomNavigationItem( - onPressed: () {}, - icon: Icons.dashboard, - color: Colors.white, - label: 'Dashboard', - ), - BottomNavigationItem( - onPressed: () { - Navigator.of(context).pop(); - }, - icon: Icons.home, - color: Colors.white, - label: 'Home', - ), - ], - ), - body: Padding( - padding: const EdgeInsets.all(16), - child: Center( - child: ChangeNotifierProvider( - create: (context) => PersonsViewModel(), - child: Consumer( - builder: (context, value, child) { - _checkResponse(value.response); - if (persons.isEmpty) { - listPersons(context); - } - return _loading - ? const CircularProgressIndicator( - color: Colors.grey, - ) - : value.response.status == Status.COMPLETED - ? value.response.data.length > 0 - ? ListView(children: _personsList(persons)) - : const Text('Noch keine Personen angelegt') - : const Text('Lade Daten...'); - }, - ), - ), - ), - ), - ), - ); - } -} diff --git a/frontend/app/lib/pages_old/dashboard_page.dart b/frontend/app/lib/pages_old/dashboard_page.dart deleted file mode 100644 index e012989..0000000 --- a/frontend/app/lib/pages_old/dashboard_page.dart +++ /dev/null @@ -1,298 +0,0 @@ -import 'package:app/pb/account_info.pb.dart'; -import 'package:app/widgets/background.dart'; -import 'package:app/widgets/loading_widget.dart'; -import 'package:app/widgets/side_drawer.dart'; -import 'package:flutter/material.dart'; - -class DashboardPage extends StatefulWidget { - const DashboardPage({ - super.key, - // required this.client, - }); - - // final GClient client; - - @override - State createState() => _DashboardPageState(); -} - -class _DashboardPageState extends State { - bool _loading = false; - late AccountInfo accountInfo; - - void _setLoading(bool loading) { - setState(() { - _loading = loading; - }); - } - - @override - void initState() { - super.initState(); - - _setLoading(true); - // widget.client.getAccountInfo( - // GetAccountInfoRequest( - // accountId: widget.client.session.accountId, - // ), - // onError: ({String? msg}) { - // ScaffoldMessenger.of(context).showSnackBar( - // SnackBar( - // content: const Text('AccountInfo konnte nicht geladen werden'), - // action: msg != null - // ? SnackBarAction( - // label: 'Details', - // textColor: Colors.grey, - // onPressed: () { - // showDialog( - // context: context, - // builder: (context) { - // return AlertDialog( - // content: Text( - // msg, - // textAlign: TextAlign.center, - // style: const TextStyle(color: Colors.black), - // ), - // icon: const Icon( - // Icons.warning, - // color: Colors.red, - // ), - // ); - // }, - // ); - // }) - // : null, - // ), - // ); - // }, - // ).then((value) { - // accountInfo = value.accountInfo; - // _setLoading(false); - // }); - } - - @override - Widget build(BuildContext context) { - return Background( - child: Scaffold( - appBar: AppBar( - automaticallyImplyLeading: false, - flexibleSpace: Image.asset( - 'lib/assets/logo_300x200.png', - height: 80, - ), - ), - drawer: Builder(builder: (context) { - return SideDrawer( - children: [ - const Spacer(), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'About', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.question_answer, - color: Colors.white, - ), - ], - ), - ), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'Datenschutz', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.privacy_tip, - color: Colors.white, - ), - ], - ), - ), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'Impressum', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.apartment, - color: Colors.white, - ), - ], - ), - ), - // if (widget.client.session.accessToken != null) - // TextButton( - // onPressed: () { - // widget.client.session.accessToken = null; - // widget.client.session - // .removeSession(widget.client.session.sessionId!); - - // Navigator.of(context).pushAndRemoveUntil( - // MaterialPageRoute( - // builder: (context) => - // StartPage(client: widget.client), - // ), - // (route) => false); - // }, - // child: const Row( - // children: [ - // Text( - // 'Log out', - // style: TextStyle(fontSize: 20), - // ), - // Spacer(), - // Icon( - // Icons.logout, - // color: Colors.white, - // ), - // ], - // ), - // ), - const SizedBox( - height: 250, - ) - ], - ); - }), - // bottomNavigationBar: Builder( - // builder: (context) { - // return BottomBar( - // children: widget.client.session.accessToken != null - // ? [ - // BottomNavigationBarItem( - // backgroundColor: Colors.white, - // label: 'Personen', - // icon: Column( - // children: [ - // IconButton( - // onPressed: () => - // Scaffold.of(context).openDrawer(), - // icon: const Icon( - // Icons.group, - // color: Colors.white, - // ), - // ), - // const Text( - // 'Personen', - // style: TextStyle( - // color: Colors.white, - // fontSize: 16, - // ), - // ) - // ], - // ), - // ), - // BottomNavigationBarItem( - // backgroundColor: Colors.white, - // label: 'Home', - // icon: Column( - // children: [ - // IconButton( - // onPressed: () { - // Navigator.of(context).push( - // MaterialPageRoute( - // builder: (context) => StartPage( - // client: widget.client, - // ), - // ), - // ); - // }, - // icon: const Icon( - // Icons.home, - // color: Colors.white, - // ), - // ), - // const Text( - // 'Home', - // style: TextStyle( - // color: Colors.white, - // fontSize: 16, - // ), - // ) - // ], - // ), - // ), - // BottomNavigationBarItem( - // backgroundColor: Colors.white, - // label: 'Menu', - // icon: IconButton( - // onPressed: () { - // Scaffold.of(context).openDrawer(); - // }, - // icon: const Icon( - // Icons.menu, - // color: Colors.white, - // ), - // ), - // ) - // ] - // : [ - // BottomNavigationBarItem( - // label: 'back', - // backgroundColor: Colors.white, - // icon: IconButton( - // onPressed: () {}, - // icon: const Icon( - // Icons.arrow_back, - // color: Colors.white, - // ), - // ), - // ), - // BottomNavigationBarItem( - // backgroundColor: Colors.white, - // label: 'Menu', - // icon: IconButton( - // onPressed: () => Scaffold.of(context).openDrawer(), - // icon: const Icon( - // Icons.menu, - // color: Colors.white, - // ), - // ), - // ), - // ], - // ); - // }, - // ), - body: !_loading - ? Background( - child: Center( - child: Column( - children: [ - const SizedBox( - height: 48, - ), - Text( - 'Willkommen ${accountInfo.firstname} ${accountInfo.lastname}!', - style: const TextStyle( - fontSize: 24, - ), - ), - ], - ), - ), - ) - : const LoadingWidget(), - ), - ); - } -} diff --git a/frontend/app/lib/pages_old/login_page.dart b/frontend/app/lib/pages_old/login_page.dart deleted file mode 100644 index 3bc0ae5..0000000 --- a/frontend/app/lib/pages_old/login_page.dart +++ /dev/null @@ -1,287 +0,0 @@ -import 'package:app/model/services/backend_service.dart'; -import 'package:app/widgets/background.dart'; -import 'package:app/widgets/bottom_bar.dart'; -import 'package:app/widgets/loading_widget.dart'; -import 'package:app/widgets/side_drawer.dart'; -import 'package:flutter/material.dart'; - -// GlobalKey scaffoldKey = GlobalKey(); - -class LoginPage extends StatefulWidget { - const LoginPage({ - super.key, - // required this.client, - // required this.onChangePage, - }); - - // final GClient client; - // void Function(Pages page) onChangePage; - - @override - State createState() => _LoginPageState(); -} - -class _LoginPageState extends State { - bool _loading = false; - final List bottombarButtons = []; - - // List _selectedBottomBarButtons = bottomBarButtons; - @override - void initState() { - super.initState(); - _addBottomBarButtons(); - } - - void _addBottomBarButtons() { - bottombarButtons.addAll([ - const BottomNavigationBarItem( - label: 'back', - backgroundColor: Colors.white, - icon: Icon( - Icons.arrow_back, - color: Colors.white, - ), - ), - BottomNavigationBarItem( - backgroundColor: Colors.white, - label: 'Menu', - icon: IconButton( - onPressed: () => Scaffold.of(context).openDrawer(), - icon: const Icon( - Icons.menu, - color: Colors.white, - ), - ), - ), - ]); - } - - void _setLoading(bool loading) { - setState(() { - _loading = loading; - }); - } - - // final GClient client = GClient(); - - final _formKey = GlobalKey(); - final mailController = TextEditingController(); - final passwordController = TextEditingController(); - - @override - Widget build(BuildContext context) { - return Background( - child: Scaffold( - appBar: AppBar( - automaticallyImplyLeading: false, - // flexibleSpace: Image.asset( - // 'lib/assets/logo_300x200.png', - // height: 80, - // ), - ), - bottomNavigationBar: BottomBar( - children: [ - BottomNavigationBarItem( - label: 'back', - backgroundColor: Colors.white, - icon: IconButton( - onPressed: () => Navigator.of(context).pop(), - icon: const Icon( - Icons.arrow_back, - color: Colors.white, - ), - ), - ), - BottomNavigationBarItem( - backgroundColor: Colors.white, - label: 'Menu', - icon: IconButton( - onPressed: () => Scaffold.of(context).openDrawer(), - icon: const Icon( - Icons.menu, - color: Colors.white, - ), - ), - ), - ], - ), - drawer: SideDrawer(children: [ - const Spacer(), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'About', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.question_answer, - color: Colors.white, - ), - ], - ), - ), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'Datenschutz', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.privacy_tip, - color: Colors.white, - ), - ], - ), - ), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'Impressum', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.apartment, - color: Colors.white, - ), - ], - ), - ), - const SizedBox( - height: 250, - ) - ]), - body: !_loading - ? Form( - key: _formKey, - child: Padding( - padding: const EdgeInsets.fromLTRB(16, 100, 16, 16), - child: SingleChildScrollView( - child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const Image( - width: 180, - image: AssetImage( - 'lib/assets/logo_300x200.png', - ), - ), - const SizedBox( - height: 30, - ), - const Text( - 'Login', - style: TextStyle( - fontFamily: 'sans-serif', - fontSize: 24, - height: 1.6, - fontWeight: FontWeight.normal, - letterSpacing: 6, - ), - ), - const SizedBox( - height: 20, - ), - TextFormField( - // style: TextStyle( - // color: Theme.of(context).colorScheme.primary, - // ), - controller: mailController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'E-Mail Adresse', - ), - keyboardType: TextInputType.emailAddress, - validator: (value) { - if (value == null || value.isEmpty) { - return 'Bitte eine gültige E-Mail Adresse eingeben'; - } - return null; - }, - ), - TextFormField( - style: const TextStyle( - color: Colors.white, - ), - controller: passwordController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'Passwort', - ), - keyboardType: TextInputType.visiblePassword, - obscureText: true, - validator: (value) { - if (value == null || value.isEmpty) { - return 'Bitte geben Sie Ihr Passwort ein'; - } - return null; - }, - ), - const SizedBox( - height: 15, - ), - ElevatedButton( - onPressed: () { - if (_formKey.currentState!.validate()) { - // final navigator = Navigator.of(context); - _setLoading(true); - // BackendService.login( - // email: mailController.text, - // password: passwordController.text, - // ).then( - // (r) { - // if (r) { - // Navigator.pop(context); - // Navigator.pop(context); - // // Navigator.pushAndRemoveUntil( - // // context, - // // MaterialPageRoute( - // // builder: (ctx) => const StartPage( - // // // client: widget.client, - // // ), - // // ), - // // (ctx) => false, - // // ); - // // widget.onChangePage( - // // Pages.dashboard, - // // ); - // } - // // _setLoading(false); - // }, - // ); - } - }, - child: const Icon(Icons.login)) - ], - ), - ), - ), - ) - : const LoadingWidget(), - ), - ); - } -} diff --git a/frontend/app/lib/pages_old/register_page.dart b/frontend/app/lib/pages_old/register_page.dart deleted file mode 100644 index 5532a09..0000000 --- a/frontend/app/lib/pages_old/register_page.dart +++ /dev/null @@ -1,221 +0,0 @@ -import 'package:app/widgets/background.dart'; -import 'package:app/widgets/bottom_bar.dart'; -import 'package:app/widgets/loading_widget.dart'; -import 'package:app/widgets/side_drawer.dart'; -import 'package:flutter/material.dart'; - -class RegisterPage extends StatefulWidget { - const RegisterPage({ - super.key, - // required this.client, - }); - - // final GClient client; - - @override - State createState() => _RegisterPageState(); -} - -class _RegisterPageState extends State { - bool _loading = false; - final _formKey = GlobalKey(); - final mailController = TextEditingController(); - final passwordController = TextEditingController(); - - void _setLoading(bool loading) { - setState(() { - _loading = loading; - }); - } - - @override - Widget build(BuildContext context) { - return Background( - child: Scaffold( - appBar: AppBar( - automaticallyImplyLeading: false, - flexibleSpace: Image.asset( - 'lib/assets/logo_300x200.png', - height: 80, - ), - ), - drawer: Builder(builder: (context) { - return SideDrawer( - children: [ - const Spacer(), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'About', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.question_answer, - color: Colors.white, - ), - ], - ), - ), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'Datenschutz', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.privacy_tip, - color: Colors.white, - ), - ], - ), - ), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'Impressum', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.apartment, - color: Colors.white, - ), - ], - ), - ), - const SizedBox( - height: 250, - ) - ], - ); - }), - bottomNavigationBar: BottomBar( - children: [ - BottomNavigationBarItem( - label: 'back', - backgroundColor: Colors.white, - icon: IconButton( - onPressed: () => Navigator.of(context).pop(), - icon: const Icon( - Icons.arrow_back, - color: Colors.white, - ), - ), - ), - BottomNavigationBarItem( - backgroundColor: Colors.white, - label: 'Menu', - icon: IconButton( - onPressed: () => Scaffold.of(context).openDrawer(), - icon: const Icon( - Icons.menu, - color: Colors.white, - ), - ), - ), - ], - ), - body: !_loading - ? Form( - key: _formKey, - child: Padding( - padding: const EdgeInsets.fromLTRB(16, 100, 16, 16), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const Image( - width: 180, - image: AssetImage( - 'lib/assets/logo_300x200.png', - ), - ), - const SizedBox( - height: 30, - ), - const Text( - 'Registrieren', - style: TextStyle( - fontFamily: 'sans-serif', - fontSize: 24, - height: 1.6, - fontWeight: FontWeight.normal, - letterSpacing: 6, - ), - ), - const SizedBox( - height: 20, - ), - TextFormField( - controller: mailController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'E-Mail Adresse', - ), - keyboardType: TextInputType.emailAddress, - validator: (value) { - if (value == null || value.isEmpty) { - return 'Bitte eine gültige E-Mail Adresse eingeben'; - } - return null; - }, - ), - TextFormField( - style: const TextStyle( - color: Colors.white, - ), - controller: passwordController, - decoration: const InputDecoration( - fillColor: Color.fromARGB(30, 255, 255, 255), - filled: true, - hintStyle: TextStyle( - color: Colors.white38, - ), - hintText: 'Passwort', - ), - keyboardType: TextInputType.visiblePassword, - obscureText: true, - validator: (value) { - if (value == null || value.isEmpty) { - return 'Bitte geben Sie Ihr Passwort ein'; - } - return null; - }, - ), - const SizedBox( - height: 15, - ), - ElevatedButton( - onPressed: () { - if (_formKey.currentState!.validate()) { - // _setLoading(true); - } - }, - child: const Icon(Icons.login)) - ], - ), - ), - ), - ) - : const LoadingWidget()), - ); - } -} diff --git a/frontend/app/lib/pages_old/start_page.dart b/frontend/app/lib/pages_old/start_page.dart deleted file mode 100644 index 4eb160f..0000000 --- a/frontend/app/lib/pages_old/start_page.dart +++ /dev/null @@ -1,370 +0,0 @@ -import 'package:app/model/apis/api_response.dart'; -import 'package:app/model/view_model/account_vm.dart'; -import 'package:app/pages_old/login_page.dart'; -import 'package:app/pb/account.pb.dart'; -import 'package:app/widgets/background.dart'; -import 'package:app/widgets/bottom_bar.dart'; -import 'package:app/widgets/side_drawer.dart'; -import 'package:flutter/material.dart'; -import 'dart:core'; - -import 'package:provider/provider.dart'; - -// ignore: must_be_immutable -class StartPage extends StatefulWidget { - const StartPage({ - super.key, - // required this.client, - }); - - // GClient client; - - @override - State createState() => _StartPageState(); -} - -class _StartPageState extends State { - final List bottombarButtons = []; - - // void _updateClient(GClient c) { - // setState(() { - // widget.client = c; - // }); - // } - - @override - void initState() { - super.initState(); - } - - SnackBar _snackBar(BuildContext context, String message, String label, - void Function() action) { - ScaffoldMessenger.of(context).removeCurrentSnackBar(); - // ScaffoldMessenger.of(context).clearSnackBars(); - return SnackBar( - content: Text( - message, - style: const TextStyle(color: Colors.black), - ), - backgroundColor: Colors.white, - action: SnackBarAction( - label: label, - onPressed: action, - ), - ); - } - - @override - Widget build(BuildContext context) { - return Background( - child: ChangeNotifierProvider( - create: (context) => AccountViewModel(), - child: Consumer(builder: (context, value, child) { - return Scaffold( - appBar: AppBar( - automaticallyImplyLeading: false, - ), - drawer: Builder(builder: (context) { - return SideDrawer(children: [ - const Spacer(), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'About', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.question_answer, - color: Colors.white, - ), - ], - ), - ), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'Datenschutz', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.privacy_tip, - color: Colors.white, - ), - ], - ), - ), - TextButton( - onPressed: () { - Scaffold.of(context).closeDrawer(); - }, - child: const Row( - children: [ - Text( - 'Impressum', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.apartment, - color: Colors.white, - ), - ], - ), - ), - TextButton( - onPressed: () { - value.logout(); - // ScaffoldMessenger.of(context).clearSnackBars(); - ScaffoldMessenger.of(context).showSnackBar( - _snackBar( - context, - value.response.message != null - ? value.response.message! - : value.response.status.toString(), - value.response.status.toString(), - () { - print('asdf'); - }, - ), - ); - }, - child: const Row( - children: [ - Text( - 'Log out', - style: TextStyle(fontSize: 20), - ), - Spacer(), - Icon( - Icons.logout, - color: Colors.white, - ), - ], - ), - ), - const SizedBox( - height: 250, - ) - ]); - }), - bottomNavigationBar: Builder(builder: (context) { - return BottomBar( - // onTap: (value) => _bottomBarAction(value), - children: value.response.data != null - ? [ - BottomNavigationBarItem( - backgroundColor: Colors.white, - label: 'Personen', - icon: Column( - children: [ - IconButton( - onPressed: () => - Scaffold.of(context).openDrawer(), - icon: const Icon( - Icons.group, - color: Colors.white, - ), - ), - const Text( - 'Personen', - style: TextStyle( - color: Colors.white, - fontSize: 16, - ), - ) - ], - ), - ), - BottomNavigationBarItem( - backgroundColor: Colors.white, - label: 'Dashboard', - icon: Column( - children: [ - IconButton( - onPressed: () {}, - icon: const Icon( - Icons.dashboard, - color: Colors.white, - ), - ), - const Text( - 'Dashboard', - style: TextStyle( - color: Colors.white, - fontSize: 16, - ), - ) - ], - ), - ), - BottomNavigationBarItem( - backgroundColor: Colors.white, - label: 'Menu', - icon: IconButton( - onPressed: () { - Scaffold.of(context).openDrawer(); - }, - icon: const Icon( - Icons.menu, - color: Colors.white, - ), - ), - ) - ] - : [ - BottomNavigationBarItem( - label: 'register', - backgroundColor: Colors.white, - icon: Column( - children: [ - IconButton( - onPressed: () {}, - icon: const Icon( - Icons.login, - color: Colors.white, - ), - ), - const Text( - 'Registrieren', - style: TextStyle( - color: Colors.white, - fontSize: 16, - ), - ) - ], - ), - ), - BottomNavigationBarItem( - label: 'login', - backgroundColor: Colors.white, - icon: Column( - children: [ - IconButton( - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (builder) => - const LoginPage())); - }, - icon: const Icon( - Icons.login, - color: Colors.white, - ), - ), - const Text( - 'Login', - style: TextStyle( - color: Colors.white, - fontSize: 16, - ), - ) - ], - ), - ), - BottomNavigationBarItem( - backgroundColor: Colors.white, - label: 'Menu', - icon: IconButton( - onPressed: () => Scaffold.of(context).openDrawer(), - icon: const Icon( - Icons.menu, - color: Colors.white, - ), - ), - ), - ], - ); - }), - body: Column( - children: [ - if (value.response.status == Status.COMPLETED && - value.response.data != null && - !(value.response.data as Account).emailVerified) - Card( - color: Colors.orange, - child: Center( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - const Text( - 'E-Mail ist noch nicht verifiziert.', - style: TextStyle( - fontWeight: FontWeight.bold, - fontFamily: 'sans-serif', - fontSize: 14), - ), - IconButton( - onPressed: () {}, - icon: const Icon( - Icons.restore, - color: Colors.white, - ), - ), - ], - ), - ), - ), - Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const Image( - image: AssetImage( - 'lib/assets/logo_300x200.png', - ), - ), - const SizedBox( - height: 40, - ), - Text( - 'Digitale Spuren auf Knopfdruck entfernen' - .toUpperCase(), - textAlign: TextAlign.center, - style: const TextStyle( - fontFamily: 'sans-serif', - fontSize: 24, - height: 1.6, - fontWeight: FontWeight.normal, - letterSpacing: 6, - ), - ), - TextButton( - onPressed: () { - // ScaffoldMessenger.of(context).clearSnackBars(); - ScaffoldMessenger.of(context).showSnackBar( - _snackBar( - context, - value.response.message != null - ? value.response.message! - : value.response.status.toString(), - value.response.status.toString(), - () { - print('asdf'); - }, - ), - ); - }, - child: const Text('asdf')) - ], - ), - ), - ], - ), - ); - }), - ), - ); - } -}