Skip to content

Commit

Permalink
fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
floodoo committed Apr 25, 2022
1 parent e98dce2 commit 00da44e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
4 changes: 3 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:allowBackup="false"
android:fullBackupContent="false">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
Expand Down
5 changes: 5 additions & 0 deletions lib/core/service/time_table.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ class TimeTableService with ChangeNotifier {

Future<String> getSchool() async {
final prefs = await SharedPreferences.getInstance();
final school = prefs.getString("school");

if (school == null || school.isEmpty) {
return "bbs1-mainz";
}
return prefs.getString("school") ?? "bbs1-mainz";
}

Expand Down
6 changes: 3 additions & 3 deletions lib/ui/screens/login/login.screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LoginScreen extends ConsumerStatefulWidget {
class _LoginScreenState extends ConsumerState<LoginScreen> {
final usernameController = TextEditingController();
final passwordController = TextEditingController();
final schoolController = TextEditingController();
final schoolController = TextEditingController(text: "bbs1-mainz");
final passwordFocusNode = FocusNode();
final schoolFocusNode = FocusNode();

Expand All @@ -33,11 +33,11 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
Future<void> getUserDataFromStorage() async {
final username = await ref.read(timeTableService).getUserName();
final password = await ref.read(timeTableService).getPassword();
final school = await ref.read(timeTableService).getSchool();
const school = "bbs1-mainz";

usernameController.text = username;
passwordController.text = password;
schoolController.text = school;
schoolController.text = "bbs1-mainz";

if (username.isNotEmpty && password.isNotEmpty && school.isNotEmpty) {
ref.read(timeTableService).login(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
flutter:
sdk: flutter
flutter_search_bar: ^3.0.0-dev.1
flutter_secure_storage: ^5.0.2
flutter_secure_storage: 4.2.1
flutter_staggered_animations: ^1.0.0
fluttericon: ^2.0.0
google_fonts: 2.2.0
Expand Down
3 changes: 0 additions & 3 deletions windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@

#include "generated_plugin_registrant.h"

#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
#include <url_launcher_windows/url_launcher_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
1 change: 0 additions & 1 deletion windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
flutter_secure_storage_windows
url_launcher_windows
)

Expand Down

0 comments on commit 00da44e

Please sign in to comment.