diff --git a/packages/uni_app/android/app/src/main/AndroidManifest.xml b/packages/uni_app/android/app/src/main/AndroidManifest.xml index fbc9a782b..33195f621 100644 --- a/packages/uni_app/android/app/src/main/AndroidManifest.xml +++ b/packages/uni_app/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ - - + + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme"/> - - - - - + + + + - + android:value="2"/> - - - + + + - - - + + + - - + + - - + + - - - + + + - - - - - + + + + + \ No newline at end of file diff --git a/packages/uni_app/android/app/src/main/res/drawable-hdpi/android12splash.png b/packages/uni_app/android/app/src/main/res/drawable-hdpi/android12splash.png new file mode 100644 index 000000000..b6fcea198 Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable-hdpi/android12splash.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png b/packages/uni_app/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png index e8fd75734..61b4f62a8 100644 Binary files a/packages/uni_app/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png and b/packages/uni_app/android/app/src/main/res/drawable-hdpi/ic_launcher_foreground.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-hdpi/ic_notification.png b/packages/uni_app/android/app/src/main/res/drawable-hdpi/ic_notification.png deleted file mode 100644 index 075a4ab28..000000000 Binary files a/packages/uni_app/android/app/src/main/res/drawable-hdpi/ic_notification.png and /dev/null differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-hdpi/splash.png b/packages/uni_app/android/app/src/main/res/drawable-hdpi/splash.png deleted file mode 100644 index 35791be1a..000000000 Binary files a/packages/uni_app/android/app/src/main/res/drawable-hdpi/splash.png and /dev/null differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-mdpi/android12splash.png b/packages/uni_app/android/app/src/main/res/drawable-mdpi/android12splash.png new file mode 100644 index 000000000..fb972e0c4 Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable-mdpi/android12splash.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png b/packages/uni_app/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png index 8b68e1d01..331dce54d 100644 Binary files a/packages/uni_app/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png and b/packages/uni_app/android/app/src/main/res/drawable-mdpi/ic_launcher_foreground.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-mdpi/ic_notification.png b/packages/uni_app/android/app/src/main/res/drawable-mdpi/ic_notification.png deleted file mode 100644 index 3d32a5505..000000000 Binary files a/packages/uni_app/android/app/src/main/res/drawable-mdpi/ic_notification.png and /dev/null differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-mdpi/splash.png b/packages/uni_app/android/app/src/main/res/drawable-mdpi/splash.png deleted file mode 100644 index d91bf54ba..000000000 Binary files a/packages/uni_app/android/app/src/main/res/drawable-mdpi/splash.png and /dev/null differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-night-hdpi/android12splash.png b/packages/uni_app/android/app/src/main/res/drawable-night-hdpi/android12splash.png new file mode 100644 index 000000000..b6fcea198 Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable-night-hdpi/android12splash.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-night-mdpi/android12splash.png b/packages/uni_app/android/app/src/main/res/drawable-night-mdpi/android12splash.png new file mode 100644 index 000000000..fb972e0c4 Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable-night-mdpi/android12splash.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-night-v21/launch_background.xml b/packages/uni_app/android/app/src/main/res/drawable-night-v21/launch_background.xml new file mode 100644 index 000000000..f88598cf6 --- /dev/null +++ b/packages/uni_app/android/app/src/main/res/drawable-night-v21/launch_background.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/uni_app/android/app/src/main/res/drawable-night-xhdpi/android12splash.png b/packages/uni_app/android/app/src/main/res/drawable-night-xhdpi/android12splash.png new file mode 100644 index 000000000..de21b99bf Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable-night-xhdpi/android12splash.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png b/packages/uni_app/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png new file mode 100644 index 000000000..82d030c82 Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable-night-xxhdpi/android12splash.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png b/packages/uni_app/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png new file mode 100644 index 000000000..a878ebe56 Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable-night-xxxhdpi/android12splash.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-night/launch_background.xml b/packages/uni_app/android/app/src/main/res/drawable-night/launch_background.xml new file mode 100644 index 000000000..f88598cf6 --- /dev/null +++ b/packages/uni_app/android/app/src/main/res/drawable-night/launch_background.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/uni_app/android/app/src/main/res/drawable-v21/background.png b/packages/uni_app/android/app/src/main/res/drawable-v21/background.png new file mode 100644 index 000000000..b18377f5f Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable-v21/background.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/uni_app/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..f88598cf6 --- /dev/null +++ b/packages/uni_app/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/uni_app/android/app/src/main/res/drawable-xhdpi/android12splash.png b/packages/uni_app/android/app/src/main/res/drawable-xhdpi/android12splash.png new file mode 100644 index 000000000..de21b99bf Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable-xhdpi/android12splash.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png b/packages/uni_app/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png index 8ef9c741d..b41906211 100644 Binary files a/packages/uni_app/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png and b/packages/uni_app/android/app/src/main/res/drawable-xhdpi/ic_launcher_foreground.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-xhdpi/ic_notification.png b/packages/uni_app/android/app/src/main/res/drawable-xhdpi/ic_notification.png deleted file mode 100644 index 1095c8382..000000000 Binary files a/packages/uni_app/android/app/src/main/res/drawable-xhdpi/ic_notification.png and /dev/null differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-xhdpi/splash.png b/packages/uni_app/android/app/src/main/res/drawable-xhdpi/splash.png deleted file mode 100644 index 3f88c3319..000000000 Binary files a/packages/uni_app/android/app/src/main/res/drawable-xhdpi/splash.png and /dev/null differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/android12splash.png b/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/android12splash.png new file mode 100644 index 000000000..82d030c82 Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/android12splash.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png b/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png index 9aa99e6f6..a4038bee9 100644 Binary files a/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png and b/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/ic_launcher_foreground.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/ic_notification.png b/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/ic_notification.png deleted file mode 100644 index 9d7403851..000000000 Binary files a/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/ic_notification.png and /dev/null differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/splash.png b/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/splash.png deleted file mode 100644 index 7ba263a54..000000000 Binary files a/packages/uni_app/android/app/src/main/res/drawable-xxhdpi/splash.png and /dev/null differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/android12splash.png b/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/android12splash.png new file mode 100644 index 000000000..a878ebe56 Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/android12splash.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png b/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png index 100444f63..5334cadd2 100644 Binary files a/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png and b/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/ic_launcher_foreground.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/ic_notification.png b/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/ic_notification.png deleted file mode 100644 index 752925689..000000000 Binary files a/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/ic_notification.png and /dev/null differ diff --git a/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/splash.png b/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/splash.png deleted file mode 100644 index f3c47fa62..000000000 Binary files a/packages/uni_app/android/app/src/main/res/drawable-xxxhdpi/splash.png and /dev/null differ diff --git a/packages/uni_app/android/app/src/main/res/drawable/background.png b/packages/uni_app/android/app/src/main/res/drawable/background.png new file mode 100644 index 000000000..b18377f5f Binary files /dev/null and b/packages/uni_app/android/app/src/main/res/drawable/background.png differ diff --git a/packages/uni_app/android/app/src/main/res/drawable/by_niaefeup.xml b/packages/uni_app/android/app/src/main/res/drawable/by_niaefeup.xml deleted file mode 100644 index a46027da4..000000000 --- a/packages/uni_app/android/app/src/main/res/drawable/by_niaefeup.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/uni_app/android/app/src/main/res/drawable/launch_background.xml b/packages/uni_app/android/app/src/main/res/drawable/launch_background.xml index 696daa07c..f88598cf6 100644 --- a/packages/uni_app/android/app/src/main/res/drawable/launch_background.xml +++ b/packages/uni_app/android/app/src/main/res/drawable/launch_background.xml @@ -1,12 +1,6 @@ - - - - - - - + diff --git a/packages/uni_app/android/app/src/main/res/drawable/logo.xml b/packages/uni_app/android/app/src/main/res/drawable/logo.xml deleted file mode 100644 index cb516c80e..000000000 --- a/packages/uni_app/android/app/src/main/res/drawable/logo.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - diff --git a/packages/uni_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/uni_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index 3d64efe17..5c08fc44e 100644 Binary files a/packages/uni_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/packages/uni_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/packages/uni_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/uni_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index 6eb75c5ee..7ff601fba 100644 Binary files a/packages/uni_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/packages/uni_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/uni_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/uni_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 288a1522b..59e7d7f69 100644 Binary files a/packages/uni_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/packages/uni_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/packages/uni_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/uni_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index 9d2a46d00..98c8473ba 100644 Binary files a/packages/uni_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/packages/uni_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/packages/uni_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/uni_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 4a144be63..1bdc9c270 100644 Binary files a/packages/uni_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/packages/uni_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/packages/uni_app/android/app/src/main/res/values-night-v31/styles.xml b/packages/uni_app/android/app/src/main/res/values-night-v31/styles.xml new file mode 100644 index 000000000..e7c4d888a --- /dev/null +++ b/packages/uni_app/android/app/src/main/res/values-night-v31/styles.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/packages/uni_app/android/app/src/main/res/values-night/colors.xml b/packages/uni_app/android/app/src/main/res/values-night/colors.xml deleted file mode 100644 index 062b27317..000000000 --- a/packages/uni_app/android/app/src/main/res/values-night/colors.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - #1b1b1b - #D7D7D7 - \ No newline at end of file diff --git a/packages/uni_app/android/app/src/main/res/values-night/styles.xml b/packages/uni_app/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..dbc9ea9f1 --- /dev/null +++ b/packages/uni_app/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/packages/uni_app/android/app/src/main/res/values-v31/styles.xml b/packages/uni_app/android/app/src/main/res/values-v31/styles.xml index d382bd8c2..b43fcedd0 100644 --- a/packages/uni_app/android/app/src/main/res/values-v31/styles.xml +++ b/packages/uni_app/android/app/src/main/res/values-v31/styles.xml @@ -1,10 +1,21 @@ - - \ No newline at end of file + + + diff --git a/packages/uni_app/android/app/src/main/res/values/colors.xml b/packages/uni_app/android/app/src/main/res/values/colors.xml index 68aaacf74..849b761c1 100644 --- a/packages/uni_app/android/app/src/main/res/values/colors.xml +++ b/packages/uni_app/android/app/src/main/res/values/colors.xml @@ -1,7 +1,4 @@ - #ffffff - #75171E - #fafafa - #75171E + #75171E \ No newline at end of file diff --git a/packages/uni_app/android/app/src/main/res/values/styles.xml b/packages/uni_app/android/app/src/main/res/values/styles.xml index 268d6872e..0d1fa8fce 100644 --- a/packages/uni_app/android/app/src/main/res/values/styles.xml +++ b/packages/uni_app/android/app/src/main/res/values/styles.xml @@ -1,9 +1,14 @@ - @@ -16,39 +14,31 @@ - - - - - - - - - - - - - - - - + + - + - - + + + + + + + + - + - - + + diff --git a/packages/uni_app/ios/Runner/Info.plist b/packages/uni_app/ios/Runner/Info.plist index 7da9d6492..e7858d33b 100644 --- a/packages/uni_app/ios/Runner/Info.plist +++ b/packages/uni_app/ios/Runner/Info.plist @@ -1,92 +1,92 @@ - - BGTaskSchedulerPermittedIdentifiers - - pt.up.fe.ni.uni.notificationworker - - CADisableMinimumFrameDurationOnPhone - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Uni - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLocalizations - - pt - en - - CFBundleName - uni - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleURLTypes - - - CFBundleTypeRole - Viewer - CFBundleURLName - pt.up.fe.ni.uni - CFBundleURLSchemes - + + BGTaskSchedulerPermittedIdentifiers + + pt.up.fe.ni.uni.notificationworker + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Uni + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLocalizations + + pt + en + + CFBundleName + uni + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleURLTypes + + + CFBundleTypeRole + Viewer + CFBundleURLName pt.up.fe.ni.uni - + CFBundleURLSchemes + + pt.up.fe.ni.uni + + + + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSApplicationQueriesSchemes + + http + https + tel + mailto + + LSRequiresIPhoneOS + + NSCalendarsUsageDescription + Exportar exames e eventos para o calendário + UIApplicationSceneManifest + + UISceneConfigurations + - - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSApplicationQueriesSchemes - - http - https - tel - mailto - - LSRequiresIPhoneOS - - NSCalendarsUsageDescription - Exportar exames e eventos para o calendário - UIApplicationSceneManifest - - UISceneConfigurations - + UIApplicationSupportsIndirectInputEvents + + UIBackgroundModes + + fetch + processing + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIStatusBarHidden + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + - UIApplicationSupportsIndirectInputEvents - - UIBackgroundModes - - fetch - processing - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIStatusBarHidden - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - diff --git a/packages/uni_app/lib/generated/intl/messages_en.dart b/packages/uni_app/lib/generated/intl/messages_en.dart index 5968962c5..76b9897db 100644 --- a/packages/uni_app/lib/generated/intl/messages_en.dart +++ b/packages/uni_app/lib/generated/intl/messages_en.dart @@ -51,7 +51,7 @@ class MessageLookup extends MessageLookupByLibrary { "add_quota": MessageLookupByLibrary.simpleMessage("Add quota"), "add_widget": MessageLookupByLibrary.simpleMessage("Add widget"), "agree_terms": MessageLookupByLibrary.simpleMessage( - "By entering you confirm that you agree with these Terms and Conditions"), + "By entering you agree with these"), "all_widgets_added": MessageLookupByLibrary.simpleMessage( "All available widgets have already been added to your personal area!"), "at_least_one_college": @@ -155,7 +155,7 @@ class MessageLookup extends MessageLookupByLibrary { "Check your internet connection"), "invalid_credentials": MessageLookupByLibrary.simpleMessage("Invalid credentials"), - "keep_login": MessageLookupByLibrary.simpleMessage("Stay signed in"), + "keep_login": MessageLookupByLibrary.simpleMessage("Remember me"), "language": MessageLookupByLibrary.simpleMessage("Language"), "last_refresh_time": m0, "last_timestamp": m1, @@ -242,7 +242,7 @@ class MessageLookup extends MessageLookupByLibrary { "other_links": MessageLookupByLibrary.simpleMessage("Other links"), "pass_change_request": MessageLookupByLibrary.simpleMessage( "For security reasons, passwords must be changed periodically."), - "password": MessageLookupByLibrary.simpleMessage("password"), + "password": MessageLookupByLibrary.simpleMessage("Password"), "pendent_references": MessageLookupByLibrary.simpleMessage("Pending references"), "permission_denied": @@ -279,7 +279,7 @@ class MessageLookup extends MessageLookupByLibrary { "stcp_stops": MessageLookupByLibrary.simpleMessage("STCP - Upcoming Trips"), "student_number": - MessageLookupByLibrary.simpleMessage("student number"), + MessageLookupByLibrary.simpleMessage("Student Number"), "success": MessageLookupByLibrary.simpleMessage("Sent with success"), "successful_open": MessageLookupByLibrary.simpleMessage("File opened successfully"), @@ -292,8 +292,8 @@ class MessageLookup extends MessageLookupByLibrary { "theme": MessageLookupByLibrary.simpleMessage("Theme"), "title": MessageLookupByLibrary.simpleMessage("Title"), "try_again": MessageLookupByLibrary.simpleMessage("Try again"), - "try_different_login": MessageLookupByLibrary.simpleMessage( - "Problems with login? Try a different login"), + "try_different_login": + MessageLookupByLibrary.simpleMessage("Having trouble signing in?"), "uc_info": MessageLookupByLibrary.simpleMessage("Open UC page"), "unavailable": MessageLookupByLibrary.simpleMessage("Unavailable"), "valid_email": diff --git a/packages/uni_app/lib/generated/intl/messages_pt_PT.dart b/packages/uni_app/lib/generated/intl/messages_pt_PT.dart index f36592457..20354ea0d 100644 --- a/packages/uni_app/lib/generated/intl/messages_pt_PT.dart +++ b/packages/uni_app/lib/generated/intl/messages_pt_PT.dart @@ -51,7 +51,7 @@ class MessageLookup extends MessageLookupByLibrary { "add_quota": MessageLookupByLibrary.simpleMessage("Adicionar quota"), "add_widget": MessageLookupByLibrary.simpleMessage("Adicionar widget"), "agree_terms": MessageLookupByLibrary.simpleMessage( - "Ao entrares confirmas que concordas com estes Termos e Condições"), + "Ao entrares confirmas que concordas com estes"), "all_widgets_added": MessageLookupByLibrary.simpleMessage( "Todos os widgets disponíveis já foram adicionados à tua área pessoal!"), "at_least_one_college": MessageLookupByLibrary.simpleMessage( @@ -154,7 +154,7 @@ class MessageLookup extends MessageLookupByLibrary { "Verifique sua conexão com a internet"), "invalid_credentials": MessageLookupByLibrary.simpleMessage("Credenciais inválidas"), - "keep_login": MessageLookupByLibrary.simpleMessage("Manter sessão"), + "keep_login": MessageLookupByLibrary.simpleMessage("Lembre-se de mim"), "language": MessageLookupByLibrary.simpleMessage("Idioma"), "last_refresh_time": m0, "last_timestamp": m1, @@ -166,8 +166,8 @@ class MessageLookup extends MessageLookupByLibrary { "loading_terms": MessageLookupByLibrary.simpleMessage( "Carregando os Termos e Condições..."), "login": MessageLookupByLibrary.simpleMessage("Entrar"), - "login_with_credentials": MessageLookupByLibrary.simpleMessage( - "Iniciar sessão com credenciais"), + "login_with_credentials": + MessageLookupByLibrary.simpleMessage("Entrar com credenciais"), "logout": MessageLookupByLibrary.simpleMessage("Terminar sessão"), "menus": MessageLookupByLibrary.simpleMessage("Ementas"), "min_value_reference": @@ -243,7 +243,7 @@ class MessageLookup extends MessageLookupByLibrary { "other_links": MessageLookupByLibrary.simpleMessage("Outros links"), "pass_change_request": MessageLookupByLibrary.simpleMessage( "Por razões de segurança, as palavras-passe têm de ser alteradas periodicamente."), - "password": MessageLookupByLibrary.simpleMessage("palavra-passe"), + "password": MessageLookupByLibrary.simpleMessage("Palavra-passe"), "pendent_references": MessageLookupByLibrary.simpleMessage("Referências pendentes"), "permission_denied": @@ -280,7 +280,7 @@ class MessageLookup extends MessageLookupByLibrary { "stcp_stops": MessageLookupByLibrary.simpleMessage("STCP - Próximas Viagens"), "student_number": - MessageLookupByLibrary.simpleMessage("número de estudante"), + MessageLookupByLibrary.simpleMessage("Número de Estudante"), "success": MessageLookupByLibrary.simpleMessage("Enviado com sucesso"), "successful_open": MessageLookupByLibrary.simpleMessage("Ficheiro aberto com sucesso"), @@ -294,7 +294,7 @@ class MessageLookup extends MessageLookupByLibrary { "title": MessageLookupByLibrary.simpleMessage("Título"), "try_again": MessageLookupByLibrary.simpleMessage("Tentar de novo"), "try_different_login": MessageLookupByLibrary.simpleMessage( - "Problemas a iniciar sessão? Experimenta o login alternativo"), + "Problemas ao iniciar sessão?"), "uc_info": MessageLookupByLibrary.simpleMessage("Abrir página da UC"), "unavailable": MessageLookupByLibrary.simpleMessage("Indisponível"), "valid_email": MessageLookupByLibrary.simpleMessage( diff --git a/packages/uni_app/lib/generated/l10n.dart b/packages/uni_app/lib/generated/l10n.dart index 7907355bf..c62848eb4 100644 --- a/packages/uni_app/lib/generated/l10n.dart +++ b/packages/uni_app/lib/generated/l10n.dart @@ -180,10 +180,10 @@ class S { ); } - /// `By entering you confirm that you agree with these Terms and Conditions` + /// `By entering you agree with these` String get agree_terms { return Intl.message( - 'By entering you confirm that you agree with these Terms and Conditions', + 'By entering you agree with these', name: 'agree_terms', desc: '', args: [], @@ -740,10 +740,10 @@ class S { ); } - /// `Stay signed in` + /// `Remember me` String get keep_login { return Intl.message( - 'Stay signed in', + 'Remember me', name: 'keep_login', desc: '', args: [], @@ -1228,10 +1228,10 @@ class S { ); } - /// `password` + /// `Password` String get password { return Intl.message( - 'password', + 'Password', name: 'password', desc: '', args: [], @@ -1488,10 +1488,10 @@ class S { ); } - /// `student number` + /// `Student Number` String get student_number { return Intl.message( - 'student number', + 'Student Number', name: 'student_number', desc: '', args: [], @@ -1648,10 +1648,10 @@ class S { ); } - /// `Problems with login? Try a different login` + /// `Having trouble signing in?` String get try_different_login { return Intl.message( - 'Problems with login? Try a different login', + 'Having trouble signing in?', name: 'try_different_login', desc: '', args: [], diff --git a/packages/uni_app/lib/l10n/intl_en.arb b/packages/uni_app/lib/l10n/intl_en.arb index e98444d96..064daa4af 100644 --- a/packages/uni_app/lib/l10n/intl_en.arb +++ b/packages/uni_app/lib/l10n/intl_en.arb @@ -26,7 +26,7 @@ "@add_quota": {}, "add_widget": "Add widget", "@add_widget": {}, - "agree_terms": "By entering you confirm that you agree with these Terms and Conditions", + "agree_terms": "By entering you agree with these", "@agree_terms": {}, "all_widgets_added": "All available widgets have already been added to your personal area!", "@all_widgets_added": {}, @@ -138,7 +138,7 @@ "@increment": {}, "invalid_credentials": "Invalid credentials", "@invalid_credentials": {}, - "keep_login": "Stay signed in", + "keep_login": "Remember me", "@keep_login": {}, "last_refresh_time": "last refresh at {time}", "@last_refresh_time": { @@ -240,7 +240,7 @@ "@other_links": {}, "pass_change_request": "For security reasons, passwords must be changed periodically.", "@pass_change_request": {}, - "password": "password", + "password": "Password", "@password": {}, "pendent_references": "Pending references", "@pendent_references": {}, @@ -292,7 +292,7 @@ "@some_error": {}, "stcp_stops": "STCP - Upcoming Trips", "@stcp_stops": {}, - "student_number": "student number", + "student_number": "Student Number", "@student_number": {}, "success": "Sent with success", "@success": {}, @@ -324,7 +324,7 @@ "@usage_stats": {}, "try_again": "Try again", "@try_again": {}, - "try_different_login": "Problems with login? Try a different login", + "try_different_login": "Having trouble signing in?", "@try_different_login": {}, "login_with_credentials": "Login with credentials", "@login_with_credentials": {}, diff --git a/packages/uni_app/lib/l10n/intl_pt_PT.arb b/packages/uni_app/lib/l10n/intl_pt_PT.arb index 9835f0071..aa90575ba 100644 --- a/packages/uni_app/lib/l10n/intl_pt_PT.arb +++ b/packages/uni_app/lib/l10n/intl_pt_PT.arb @@ -28,7 +28,7 @@ "@add_quota": {}, "add_widget": "Adicionar widget", "@add_widget": {}, - "agree_terms": "Ao entrares confirmas que concordas com estes Termos e Condições", + "agree_terms": "Ao entrares confirmas que concordas com estes", "@agree_terms": {}, "all_widgets_added": "Todos os widgets disponíveis já foram adicionados à tua área pessoal!", "@all_widgets_added": {}, @@ -140,7 +140,7 @@ "@increment": {}, "invalid_credentials": "Credenciais inválidas", "@invalid_credentials": {}, - "keep_login": "Manter sessão", + "keep_login": "Lembre-se de mim", "@keep_login": {}, "last_refresh_time": "última atualização às {time}", "@last_refresh_time": { @@ -250,7 +250,7 @@ "@other_links": {}, "pass_change_request": "Por razões de segurança, as palavras-passe têm de ser alteradas periodicamente.", "@pass_change_request": {}, - "password": "palavra-passe", + "password": "Palavra-passe", "@password": {}, "pendent_references": "Referências pendentes", "@pendent_references": {}, @@ -292,7 +292,7 @@ "@some_error": {}, "stcp_stops": "STCP - Próximas Viagens", "@stcp_stops": {}, - "student_number": "número de estudante", + "student_number": "Número de Estudante", "@student_number": {}, "success": "Enviado com sucesso", "@success": {}, @@ -324,9 +324,9 @@ "@collect_usage_stats": {}, "try_again": "Tentar de novo", "@try_again": {}, - "try_different_login": "Problemas a iniciar sessão? Experimenta o login alternativo", + "try_different_login": "Problemas ao iniciar sessão?", "@try_different_login": {}, - "login_with_credentials": "Iniciar sessão com credenciais", + "login_with_credentials": "Entrar com credenciais", "@login_with_credentials": {}, "fail_to_authenticate": "Falha ao autenticar", "@fail_to_authenticate": {}, diff --git a/packages/uni_app/lib/main.dart b/packages/uni_app/lib/main.dart index 4d9c6cc44..05b68587c 100644 --- a/packages/uni_app/lib/main.dart +++ b/packages/uni_app/lib/main.dart @@ -47,6 +47,7 @@ import 'package:uni/view/profile/profile.dart'; import 'package:uni/view/restaurant/restaurant_page_view.dart'; import 'package:uni/view/schedule/schedule.dart'; import 'package:uni/view/settings/settings.dart'; +import 'package:uni/view/splash/splash.dart'; import 'package:uni/view/theme.dart'; import 'package:uni/view/theme_notifier.dart'; import 'package:uni/view/transports/transports.dart'; @@ -72,6 +73,22 @@ Future firstRoute() async { Future main() async { WidgetsFlutterBinding.ensureInitialized(); + await SystemChrome.setEnabledSystemUIMode( + SystemUiMode.edgeToEdge, + overlays: [ + SystemUiOverlay.top, + SystemUiOverlay.bottom, + ], + ); + SystemChrome.setSystemUIOverlayStyle( + const SystemUiOverlayStyle( + statusBarColor: Colors.transparent, + statusBarIconBrightness: Brightness.light, + systemNavigationBarColor: Colors.transparent, + systemNavigationBarIconBrightness: Brightness.light, + ), + ); + PreferencesController.prefs = await SharedPreferences.getInstance(); final stateProviders = StateProviders( @@ -124,7 +141,7 @@ Future main() async { final savedTheme = PreferencesController.getThemeMode(); final savedLocale = PreferencesController.getLocale(); - final route = await firstRoute(); + const route = '/splash'; await SentryFlutter.init( (options) { @@ -177,7 +194,7 @@ Future main() async { create: (_) => ThemeNotifier(savedTheme), ), ], - child: Application(route), + child: const Application(route), ), ), ); @@ -215,9 +232,6 @@ class ApplicationState extends State { @override Widget build(BuildContext context) { - SystemChrome.setPreferredOrientations([ - DeviceOrientation.portraitUp, - ]); return Consumer2( builder: (context, themeNotifier, localeNotifier, _) => UpgradeAlert( navigatorKey: Application.navigatorKey, @@ -240,8 +254,12 @@ class ApplicationState extends State { navigatorObservers: navigatorObservers, onGenerateRoute: (settings) { final transitions = { + '/splash': PageTransition.makePageTransition( + page: const SplashScreenView(), + settings: settings, + ), '/${NavigationItem.navLogin.route}': - PageTransition.makePageTransition( + PageTransition.splashTransitionRoute( page: const LoginPageView(), settings: settings, ), diff --git a/packages/uni_app/lib/view/common_widgets/page_transition.dart b/packages/uni_app/lib/view/common_widgets/page_transition.dart index 3ea44480a..01fc60e8c 100644 --- a/packages/uni_app/lib/view/common_widgets/page_transition.dart +++ b/packages/uni_app/lib/view/common_widgets/page_transition.dart @@ -39,6 +39,21 @@ class PageTransition { ); } + static Route splashTransitionRoute({ + required Widget page, + required RouteSettings settings, + bool maintainState = true, + }) { + return PageRouteBuilder( + pageBuilder: (context, animation, secondaryAnimation) => page, + settings: settings, + maintainState: maintainState, + transitionsBuilder: (context, animation, secondaryAnimation, child) { + return FadeTransition(opacity: animation, child: child); + }, + ); + } + static Future requestTermsAndConditionsAcceptanceIfNeeded( BuildContext context, ) async { diff --git a/packages/uni_app/lib/view/login/login.dart b/packages/uni_app/lib/view/login/login.dart index 9c1cbb45a..37e95adeb 100644 --- a/packages/uni_app/lib/view/login/login.dart +++ b/packages/uni_app/lib/view/login/login.dart @@ -18,8 +18,12 @@ import 'package:uni/utils/constants.dart'; import 'package:uni/utils/navigation_items.dart'; import 'package:uni/view/common_widgets/toast_message.dart'; import 'package:uni/view/home/widgets/exit_app_dialog.dart'; +import 'package:uni/view/login/widgets/create_link.dart'; +import 'package:uni/view/login/widgets/f_login_button.dart'; import 'package:uni/view/login/widgets/inputs.dart'; -import 'package:uni/view/theme.dart'; +import 'package:uni/view/login/widgets/remember_me_checkbox.dart'; +import 'package:uni/view/login/widgets/terms_and_conditions_button.dart'; +import 'package:uni_ui/theme.dart'; import 'package:url_launcher/url_launcher.dart'; class LoginPageView extends StatefulWidget { @@ -89,8 +93,6 @@ class LoginPageViewState extends State passwordController.clear(); if (mounted) { - usernameController.clear(); - passwordController.clear(); await Navigator.pushReplacementNamed( context, '/${NavigationItem.navPersonalArea.route}', @@ -133,6 +135,7 @@ class LoginPageViewState extends State ToastMessage.error(context, S.of(context).failed_login), ); } + break; } } // Handles other unexpected exceptions @@ -200,74 +203,139 @@ class LoginPageViewState extends State setState(() { _loggingIn = false; }); - Logger().e('Failed to authenticate'); if (mounted) { - unawaited(ToastMessage.error(context, 'Failed to authenticate')); + Logger().e(S.of(context).fail_to_authenticate); + unawaited( + ToastMessage.error(context, S.of(context).fail_to_authenticate), + ); } } } @override Widget build(BuildContext context) { - final queryData = MediaQuery.of(context); - return Theme( - data: applicationLightTheme.copyWith( - textSelectionTheme: const TextSelectionThemeData( - cursorColor: Colors.white, - selectionHandleColor: Colors.white, - ), - ), + data: lightTheme, child: Builder( builder: (context) => Scaffold( resizeToAvoidBottomInset: false, - backgroundColor: darkRed, + backgroundColor: const Color(0xFF280709), body: BackButtonExitWrapper( - child: Padding( - padding: EdgeInsets.only( - left: queryData.size.width / 8, - right: queryData.size.width / 8, - ), - child: Column( - children: [ - SizedBox(height: queryData.size.height / 20), - SizedBox( - width: 100, - // TODO(thePeras): Divide into two svgs to add color - child: SvgPicture.asset( - 'assets/images/logo_dark.svg', - colorFilter: const ColorFilter.mode( - Colors.white, - BlendMode.srcIn, + child: Stack( + children: [ + Center( + child: Align( + alignment: const Alignment(0, -0.4), + child: Hero( + tag: 'logo', + flightShuttleBuilder: ( + flightContext, + animation, + flightDirection, + fromHeroContext, + toHeroContext, + ) { + return ScaleTransition( + scale: animation.drive( + Tween(begin: 1, end: 1).chain( + CurveTween(curve: Curves.easeInOut), + ), + ), + child: SvgPicture.asset( + 'assets/images/logo_dark.svg', + width: 90, + height: 90, + colorFilter: const ColorFilter.mode( + Color(0xFFFFF5F3), + BlendMode.srcIn, + ), + ), + ); + }, + child: SvgPicture.asset( + 'assets/images/logo_dark.svg', + width: 90, + height: 90, + colorFilter: const ColorFilter.mode( + Color(0xFFFFF5F3), + BlendMode.srcIn, + ), ), ), ), - SizedBox(height: queryData.size.height / 5), - if (_loggingIn) - const CircularProgressIndicator( - color: Colors.white, + ), + Container( + decoration: const BoxDecoration( + gradient: RadialGradient( + center: Alignment(-0.95, -1), + colors: [ + Color(0x705F171D), + Color(0x02511515), + ], + stops: [0, 1], + ), + ), + ), + Container( + decoration: const BoxDecoration( + gradient: RadialGradient( + center: Alignment(0.1, 0.95), + radius: 0.3, + colors: [ + Color(0x705F171D), + Color(0x02511515), + ], + stops: [0, 1], + ), + ), + ), + if (_loggingIn) + const Align( + alignment: Alignment(0, 0.35), + child: CircularProgressIndicator(color: Colors.white), + ), + if (!_loggingIn) + Padding( + padding: EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width / 14, ), - if (!_loggingIn) - createAFLogInButton(queryData, context, _falogin), - const SizedBox(height: 10), - createSaveDataCheckBox( - context, - () { + child: Align( + alignment: const Alignment(0, 0.35), + child: FLoginButton(onPressed: _falogin), + ), + ), + Align( + alignment: const Alignment(0, 0.51), + child: RememberMeCheckBox( + keepSignedIn: _keepSignedIn, + onToggle: () { setState(() { _keepSignedIn = !_keepSignedIn; }); }, - keepSignedIn: _keepSignedIn, + padding: const EdgeInsets.symmetric(horizontal: 37), + theme: lightTheme.textTheme.bodyLarge?.copyWith( + color: const Color(0xFFFFFFFF), + ), ), - createLink( - context, - S.of(context).try_different_login, - _showAlternativeLogin, + ), + Align( + alignment: const Alignment(0, 0.58), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 35), + child: LinkWidget( + textStart: S.of(context).try_different_login, + textEnd: S.of(context).login_with_credentials, + recognizer: TapGestureRecognizer() + ..onTap = _showAlternativeLogin, + ), ), - SizedBox(height: queryData.size.height / 5), - createTermsAndConditionsButton(context), - ], - ), + ), + const Align( + alignment: Alignment(0, 0.88), + child: TermsAndConditionsButton(), + ), + ], ), ), ), @@ -275,46 +343,25 @@ class LoginPageViewState extends State ); } - /// Creates the widget for when the user forgets the password - Widget createLink(BuildContext context, String text, void Function() onTap) { - return RichText( - textAlign: TextAlign.center, - text: TextSpan( - text: text, - style: Theme.of(context).textTheme.bodyLarge!.copyWith( - decoration: TextDecoration.underline, - color: Colors.white, - decorationColor: Colors.white, - decorationThickness: 2, - ), - recognizer: TapGestureRecognizer()..onTap = onTap, - ), - ); - } - - /// Creates a widget for the user login depending on the status of his login. - Widget createStatusWidget(BuildContext context) { - return Consumer( - builder: (context, sessionProvider, _) { - if (_loggingIn) { - return const SizedBox( - height: 60, - child: - Center(child: CircularProgressIndicator(color: Colors.white)), - ); - } - return Container(); - }, - ); - } - Future _showAlternativeLogin() async { return showDialog( context: context, barrierDismissible: false, // user must tap button! builder: (_) { return AlertDialog( - title: Text(S.of(context).login_with_credentials), + title: Text( + S.of(context).login_with_credentials, + style: lightTheme.textTheme.headlineLarge?.copyWith( + color: const Color(0xFF280709), + ), + textAlign: TextAlign.center, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + contentPadding: const EdgeInsets.fromLTRB(20, 20, 20, 0), + backgroundColor: const Color(0xFFFFF5F3), + actionsAlignment: MainAxisAlignment.center, content: StatefulBuilder( builder: (context, setState) { return SingleChildScrollView( @@ -328,7 +375,7 @@ class LoginPageViewState extends State usernameFocus, passwordFocus, ), - const SizedBox(height: 20), + const SizedBox(height: 10), createPasswordInput( context, passwordController, @@ -341,16 +388,19 @@ class LoginPageViewState extends State _login, obscurePasswordInput: _obscurePasswordInput, ), - const SizedBox(height: 20), - createSaveDataCheckBox( - context, - () { + const SizedBox(height: 15), + RememberMeCheckBox( + keepSignedIn: _keepSignedIn, + onToggle: () { setState(() { _keepSignedIn = !_keepSignedIn; }); }, - keepSignedIn: _keepSignedIn, - textColor: Theme.of(context).indicatorColor, + textColor: const Color(0xFF280709), + padding: EdgeInsets.zero, + theme: lightTheme.textTheme.bodyLarge?.copyWith( + color: const Color(0xFF280709), + ), ), ], ), @@ -359,13 +409,30 @@ class LoginPageViewState extends State }, ), actions: [ - TextButton( - child: Text(S.of(context).cancel), + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFF3C0A0E), + foregroundColor: const Color(0xFFFFF5F3), + side: const BorderSide(color: Color(0xFF56272B)), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), onPressed: () { Navigator.of(context).pop(); }, + child: Text(S.of(context).cancel), ), + const SizedBox(width: 6), ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFF3C0A0E), + foregroundColor: const Color(0xFFFFF5F3), + side: const BorderSide(color: Color(0xFF56272B)), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), onPressed: () { _login(); if (_formKey.currentState!.validate()) { diff --git a/packages/uni_app/lib/view/login/widgets/create_link.dart b/packages/uni_app/lib/view/login/widgets/create_link.dart new file mode 100644 index 000000000..4c9cb945c --- /dev/null +++ b/packages/uni_app/lib/view/login/widgets/create_link.dart @@ -0,0 +1,42 @@ +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:uni_ui/theme.dart'; + +class LinkWidget extends StatelessWidget { + const LinkWidget({ + required this.textStart, + required this.textEnd, + required this.recognizer, + super.key, + }); + + final String textStart; + final String textEnd; + final GestureRecognizer recognizer; + + @override + Widget build(BuildContext context) { + return RichText( + textAlign: TextAlign.center, + text: TextSpan( + text: textStart, + style: lightTheme.textTheme.bodyMedium?.copyWith( + color: Colors.white, + ), + children: [ + const TextSpan(text: ' '), + TextSpan( + text: textEnd, + style: lightTheme.textTheme.bodyMedium?.copyWith( + color: Colors.white, + fontWeight: FontWeight.w700, + decoration: TextDecoration.underline, + decorationColor: Colors.white, + ), + recognizer: recognizer, + ), + ], + ), + ); + } +} diff --git a/packages/uni_app/lib/view/login/widgets/f_login_button.dart b/packages/uni_app/lib/view/login/widgets/f_login_button.dart new file mode 100644 index 000000000..9ecc97a58 --- /dev/null +++ b/packages/uni_app/lib/view/login/widgets/f_login_button.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:uni/generated/l10n.dart'; +import 'package:uni_ui/theme.dart'; + +class FLoginButton extends StatelessWidget { + const FLoginButton({ + required this.onPressed, + super.key, + }); + + final VoidCallback onPressed; + + @override + Widget build(BuildContext context) { + return ElevatedButton( + style: ElevatedButton.styleFrom( + padding: const EdgeInsets.all(18), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(28), + ), + ), + onPressed: onPressed, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset( + 'assets/images/AAI.svg', + height: 26, + ), + const SizedBox(width: 16), + Text( + S.of(context).login, + style: lightTheme.textTheme.headlineSmall?.copyWith( + color: const Color(0xFF303030), + ), + textAlign: TextAlign.left, + ), + ], + ), + ); + } +} diff --git a/packages/uni_app/lib/view/login/widgets/inputs.dart b/packages/uni_app/lib/view/login/widgets/inputs.dart index 258315b70..a4601b706 100644 --- a/packages/uni_app/lib/view/login/widgets/inputs.dart +++ b/packages/uni_app/lib/view/login/widgets/inputs.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; import 'package:uni/generated/l10n.dart'; -import 'package:uni/view/about/widgets/terms_and_conditions.dart'; +import 'package:uni_ui/theme.dart'; /// Creates the widget for the username input. Widget createUsernameInput( @@ -11,7 +10,7 @@ Widget createUsernameInput( FocusNode passwordFocus, ) { return TextFormField( - style: const TextStyle(fontSize: 20), + style: lightTheme.textTheme.titleMedium, enableSuggestions: false, autocorrect: false, controller: usernameController, @@ -39,7 +38,7 @@ Widget createPasswordInput( required bool obscurePasswordInput, }) { return TextFormField( - style: const TextStyle(fontSize: 20), + style: lightTheme.textTheme.titleMedium, enableSuggestions: false, autocorrect: false, controller: passwordController, @@ -62,75 +61,17 @@ Widget createPasswordInput( ); } -/// Creates the widget for the user to keep signed in (save his data). -Widget createSaveDataCheckBox( - BuildContext context, - void Function() toogleSignedIn, { - required bool keepSignedIn, - Color? textColor, -}) { - return CheckboxListTile( - value: keepSignedIn, - onChanged: (_) => toogleSignedIn(), - title: Text( - S.of(context).keep_login, - textAlign: TextAlign.center, - style: TextStyle( - color: textColor ?? Colors.white, - fontSize: 17, - fontWeight: FontWeight.w300, - ), - ), - ); -} - -Widget createAFLogInButton( - MediaQueryData queryData, - BuildContext context, - void Function() login, -) { - return ElevatedButton( - style: ElevatedButton.styleFrom( - padding: const EdgeInsets.all(7), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(25), - ), - ), - onPressed: login, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/images/AAI.svg', - height: 35, - ), - Text( - S.of(context).login, - style: TextStyle( - color: Theme.of(context).primaryColor, - fontWeight: FontWeight.w400, - fontSize: 20, - ), - textAlign: TextAlign.center, - ), - ], - ), - ); -} - /// Decoration for the username field. InputDecoration textFieldDecoration( String placeholder, { required Color textColor, }) { return InputDecoration( - hintStyle: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w300, - color: textColor, + hintStyle: lightTheme.textTheme.titleMedium?.copyWith( + color: const Color(0xFF3C0A0E), ), hintText: placeholder, - contentPadding: const EdgeInsets.fromLTRB(10, 10, 10, 10), + contentPadding: const EdgeInsets.fromLTRB(10, 20, 0, 0), border: const UnderlineInputBorder(), focusedBorder: const UnderlineInputBorder( borderSide: BorderSide(width: 2), @@ -145,17 +86,18 @@ InputDecoration passwordFieldDecoration( void Function() toggleObscurePasswordInput, { required bool obscurePasswordInput, }) { - final genericDecoration = textFieldDecoration( - placeholder, - textColor: Theme.of(context).indicatorColor, - ); return InputDecoration( - hintStyle: genericDecoration.hintStyle, - errorStyle: genericDecoration.errorStyle, - hintText: genericDecoration.hintText, - contentPadding: genericDecoration.contentPadding, - border: genericDecoration.border, - focusedBorder: genericDecoration.focusedBorder, + hintStyle: lightTheme.textTheme.titleMedium?.copyWith( + color: const Color(0xFF3C0A0E), + ), + hintText: placeholder, + contentPadding: const EdgeInsets.fromLTRB(10, 25, 0, 0), + border: const UnderlineInputBorder(), + focusedBorder: const UnderlineInputBorder( + borderSide: BorderSide(width: 2), + ), + + /// TO-DO change the Icon to a PhosphorIcon after the icons.dart is merged suffixIcon: IconButton( icon: Icon( obscurePasswordInput ? Icons.visibility : Icons.visibility_off, @@ -164,47 +106,3 @@ InputDecoration passwordFieldDecoration( ), ); } - -/// Displays terms and conditions -InkResponse createTermsAndConditionsButton(BuildContext context) { - return InkResponse( - onTap: () { - _showTermsAndConditions(context); - }, - splashColor: Colors.transparent, - highlightColor: Colors.transparent, - child: Container( - padding: const EdgeInsets.all(8), - child: Text( - S.of(context).agree_terms, - textAlign: TextAlign.center, - style: const TextStyle( - decoration: TextDecoration.underline, - color: Colors.white, - fontSize: 17, - fontWeight: FontWeight.w400, - decorationColor: Colors.white, - ), - ), - ), - ); -} - -/// Displays 'Terms and conditions' section. -Future _showTermsAndConditions(BuildContext context) async { - await showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text(S.of(context).terms), - content: const SingleChildScrollView(child: TermsAndConditions()), - actions: [ - SimpleDialogOption( - onPressed: () => Navigator.pop(context), - child: const Text('OK'), - ), - ], - ); - }, - ); -} diff --git a/packages/uni_app/lib/view/login/widgets/remember_me_checkbox.dart b/packages/uni_app/lib/view/login/widgets/remember_me_checkbox.dart new file mode 100644 index 000000000..edbd170a0 --- /dev/null +++ b/packages/uni_app/lib/view/login/widgets/remember_me_checkbox.dart @@ -0,0 +1,46 @@ +import 'package:flutter/material.dart'; +import 'package:uni/generated/l10n.dart'; + +class RememberMeCheckBox extends StatelessWidget { + const RememberMeCheckBox({ + required this.keepSignedIn, + required this.onToggle, + this.textColor, + required this.padding, + required this.theme, + super.key, + }); + + final bool keepSignedIn; + final VoidCallback onToggle; + final Color? textColor; + final EdgeInsets padding; + final TextStyle? theme; + + @override + Widget build(BuildContext context) { + return Padding( + padding: padding, + child: Row( + children: [ + Checkbox( + value: keepSignedIn, + onChanged: (_) => onToggle(), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(15), + ), + side: const BorderSide( + color: Color(0xFF56272B), + ), + fillColor: WidgetStateProperty.all(const Color(0xFF3C0A0E)), + checkColor: const Color(0xFFFFF5F3), + ), + Text( + S.of(context).keep_login, + style: theme, + ), + ], + ), + ); + } +} diff --git a/packages/uni_app/lib/view/login/widgets/terms_and_conditions_button.dart b/packages/uni_app/lib/view/login/widgets/terms_and_conditions_button.dart new file mode 100644 index 000000000..302666adb --- /dev/null +++ b/packages/uni_app/lib/view/login/widgets/terms_and_conditions_button.dart @@ -0,0 +1,66 @@ +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:uni/generated/l10n.dart'; +import 'package:uni/view/about/widgets/terms_and_conditions.dart'; +import 'package:uni_ui/theme.dart'; + +class TermsAndConditionsButton extends StatelessWidget { + const TermsAndConditionsButton({super.key}); + + @override + Widget build(BuildContext context) { + return InkResponse( + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + child: Container( + padding: const EdgeInsets.fromLTRB(40, 14, 40, 14), + child: RichText( + text: TextSpan( + text: S.of(context).agree_terms, + style: lightTheme.textTheme.bodyMedium?.copyWith( + color: Colors.white, + decorationColor: Colors.white, + ), + children: [ + const TextSpan( + text: ' ', + ), + TextSpan( + text: S.of(context).terms, + style: lightTheme.textTheme.bodyMedium?.copyWith( + color: Colors.white, + fontWeight: FontWeight.w700, + decoration: TextDecoration.underline, + decorationColor: Colors.white, + ), + recognizer: TapGestureRecognizer() + ..onTap = () { + _showTermsAndConditions(context); + }, + ), + ], + ), + textAlign: TextAlign.center, + ), + ), + ); + } + + Future _showTermsAndConditions(BuildContext context) async { + await showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text(S.of(context).terms), + content: const SingleChildScrollView(child: TermsAndConditions()), + actions: [ + SimpleDialogOption( + onPressed: () => Navigator.pop(context), + child: const Text('OK'), + ), + ], + ); + }, + ); + } +} diff --git a/packages/uni_app/lib/view/splash/splash.dart b/packages/uni_app/lib/view/splash/splash.dart new file mode 100644 index 000000000..12905e8fe --- /dev/null +++ b/packages/uni_app/lib/view/splash/splash.dart @@ -0,0 +1,107 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:uni/main.dart'; + +class SplashScreenView extends StatefulWidget { + const SplashScreenView({super.key}); + + @override + _SplashScreenViewState createState() => _SplashScreenViewState(); +} + +class _SplashScreenViewState extends State { + @override + Widget build(BuildContext context) { + Future.delayed(const Duration(milliseconds: 1500), () async { + if (mounted) { + final route = await firstRoute(); + if (context.mounted) { + await Navigator.pushReplacementNamed(context, route); + } + } + }); + return Scaffold( + extendBody: true, + extendBodyBehindAppBar: true, + backgroundColor: const Color(0xFF280709), + body: Stack( + children: [ + Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Hero( + tag: 'logo', + flightShuttleBuilder: ( + flightContext, + animation, + flightDirection, + fromHeroContext, + toHeroContext, + ) { + return ScaleTransition( + scale: animation.drive( + Tween(begin: 0, end: 1).chain( + CurveTween(curve: Curves.easeInOut), + ), + ), + child: SvgPicture.asset( + 'assets/images/logo_dark.svg', + colorFilter: const ColorFilter.mode( + Color(0xFFFFF5F3), + BlendMode.srcIn, + ), + ), + ); + }, + child: SvgPicture.asset( + 'assets/images/logo_dark.svg', + colorFilter: const ColorFilter.mode( + Color(0xFFFFF5F3), + BlendMode.srcIn, + ), + ), + ), + const SizedBox(height: 20), + const Text( + 'by NIAEFEUP', + style: TextStyle( + color: Color(0xFFFFF5F3), + fontFamily: 'Roboto', + fontSize: 20, + fontWeight: FontWeight.w400, + ), + ), + ], + ), + ), + Container( + decoration: const BoxDecoration( + gradient: RadialGradient( + center: Alignment(-0.95, -1), + colors: [ + Color(0x705F171D), + Color(0x02511515), + ], + stops: [0, 1], + ), + ), + ), + Container( + decoration: const BoxDecoration( + gradient: RadialGradient( + center: Alignment(0.1, 0.95), + radius: 0.3, + colors: [ + Color(0x705F171D), + Color(0x02511515), + ], + stops: [0, 1], + ), + ), + ), + ], + ), + ); + } +} diff --git a/packages/uni_app/pubspec.lock b/packages/uni_app/pubspec.lock index e9483f5c4..dd8b23dd3 100644 --- a/packages/uni_app/pubspec.lock +++ b/packages/uni_app/pubspec.lock @@ -46,6 +46,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.4" + ansicolor: + dependency: transitive + description: + name: ansicolor + sha256: "50e982d500bc863e1d703448afdbf9e5a72eb48840a4f766fa361ffd6877055f" + url: "https://pub.dev" + source: hosted + version: "2.0.3" app_links: dependency: "direct main" description: @@ -58,18 +66,18 @@ packages: dependency: transitive description: name: archive - sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d + sha256: "08064924cbf0ab88280a0c3f60db9dd24fec693927e725ecb176f16c629d1cb8" url: "https://pub.dev" source: hosted - version: "3.6.1" + version: "4.0.1" args: dependency: transitive description: name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.6.0" asn1lib: dependency: transitive description: @@ -536,6 +544,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.23" + flutter_native_splash: + dependency: "direct main" + description: + name: flutter_native_splash + sha256: "1152ab0067ca5a2ebeb862fe0a762057202cceb22b7e62692dcbabf6483891bb" + url: "https://pub.dev" + source: hosted + version: "2.4.3" flutter_secure_storage: dependency: "direct main" description: @@ -694,10 +710,10 @@ packages: dependency: "direct main" description: name: image - sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" + sha256: "20842a5ad1555be624c314b0c0cc0566e8ece412f61e859a42efeb6d4101a26c" url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.5.0" intl: dependency: "direct main" description: @@ -1099,6 +1115,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" + posix: + dependency: transitive + description: + name: posix + sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a + url: "https://pub.dev" + source: hosted + version: "6.0.1" proj4dart: dependency: transitive description: diff --git a/packages/uni_app/pubspec.yaml b/packages/uni_app/pubspec.yaml index a9d41f398..7c11f83bd 100644 --- a/packages/uni_app/pubspec.yaml +++ b/packages/uni_app/pubspec.yaml @@ -37,6 +37,7 @@ dependencies: flutter_map: ^5.0.0 flutter_map_marker_popup: ^5.0.0 flutter_markdown: ^0.6.0 + flutter_native_splash: ^2.4.3 flutter_secure_storage: ^9.2.2 flutter_svg: ^2.0.9 flutter_widget_from_html_core: ^0.14.11 @@ -129,3 +130,9 @@ flutter_icons: flutter_intl: enabled: true + +flutter_native_splash: + color: "#280709" + android_12: + image: assets/images/blank_splash.png + color: "280709" \ No newline at end of file diff --git a/packages/uni_app/web/index.html b/packages/uni_app/web/index.html index 09002994b..ccd71ae70 100644 --- a/packages/uni_app/web/index.html +++ b/packages/uni_app/web/index.html @@ -1,6 +1,4 @@ - - - + - + uni @@ -37,7 +35,76 @@ var serviceWorkerVersion = null; - + + + + + + + - - + + + \ No newline at end of file diff --git a/packages/uni_ui/pubspec.lock b/packages/uni_ui/pubspec.lock index 20675b329..5cf7c207a 100644 --- a/packages/uni_ui/pubspec.lock +++ b/packages/uni_ui/pubspec.lock @@ -271,18 +271,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -319,18 +319,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mime: dependency: transitive description: @@ -524,26 +524,26 @@ packages: dependency: "direct dev" description: name: test - sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" + sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e" url: "https://pub.dev" source: hosted - version: "1.25.2" + version: "1.25.7" test_api: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" test_core: dependency: transitive description: name: test_core - sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" + sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.4" typed_data: dependency: transitive description: @@ -572,10 +572,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.5" watcher: dependency: transitive description: