From b3417c209306987665dbe4295d352a5fc803b60c Mon Sep 17 00:00:00 2001 From: Vustron Date: Wed, 15 Nov 2023 19:24:21 +0800 Subject: [PATCH] Debugging part 1 --- android/app/build.gradle | 4 +- android/app/src/main/AndroidManifest.xml | 18 --- android/app/src/main/res/values/strings.xml | 7 -- lib/auth/signin.dart | 14 +-- lib/auth/signup.dart | 2 +- lib/components/changeLocationContent.dart | 2 +- lib/components/editProfileContent.dart | 2 +- lib/components/profileContent.dart | 2 +- ...gleAuthController.dart => googleAuth.dart} | 0 .../{authController.dart => localAuth.dart} | 2 +- lib/main.dart | 4 +- lib/model/{userModel.dart => user.dart} | 0 .../{worldtimeModel.dart => worldtime.dart} | 0 lib/utils/loader.dart | 2 +- lib/views/changeLocationView.dart | 2 +- lib/views/profileView.dart | 4 +- linux/flutter/generated_plugin_registrant.cc | 4 - linux/flutter/generated_plugins.cmake | 1 - macos/Flutter/GeneratedPluginRegistrant.swift | 6 - pubspec.lock | 104 ------------------ pubspec.yaml | 2 - .../flutter/generated_plugin_registrant.cc | 6 - windows/flutter/generated_plugins.cmake | 2 - 23 files changed, 19 insertions(+), 171 deletions(-) delete mode 100644 android/app/src/main/res/values/strings.xml rename lib/controller/{googleAuthController.dart => googleAuth.dart} (100%) rename lib/controller/{authController.dart => localAuth.dart} (98%) rename lib/model/{userModel.dart => user.dart} (100%) rename lib/model/{worldtimeModel.dart => worldtime.dart} (100%) diff --git a/android/app/build.gradle b/android/app/build.gradle index aa38986..32e882d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -46,6 +46,7 @@ android { // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion flutter.minSdkVersion + minSdkVersion 21 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName @@ -64,6 +65,3 @@ flutter { source '../..' } -dependencies { - implementation 'com.facebook.android:facebook-login:latest.release' -} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 27516c9..65ff2a7 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,4 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 24f0136..0000000 --- a/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - WorldTimeApp - 1002177454181865 - fb1002177454181865 - 56789 - \ No newline at end of file diff --git a/lib/auth/signin.dart b/lib/auth/signin.dart index e2f081f..2d9892f 100644 --- a/lib/auth/signin.dart +++ b/lib/auth/signin.dart @@ -1,13 +1,13 @@ // ignore_for_file: prefer_const_constructors, prefer_const_literals_to_create_immutables, library_private_types_in_public_api, camel_case_types, unused_import, avoid_unnecessary_containers, sort_child_properties_last, unused_field, unused_local_variable, avoid_print, use_build_context_synchronously, no_leading_underscores_for_local_identifiers import 'package:flutter/material.dart'; -import 'package:flutter_world_time_app/controller/googleAuthController.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; -import '../controller/authController.dart'; +import '../controller/localAuth.dart'; import 'package:social_auth_buttons/social_auth_buttons.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:google_sign_in/google_sign_in.dart'; +import '../controller/googleAuth.dart'; class SignIn extends StatefulWidget { const SignIn({super.key}); @@ -75,7 +75,7 @@ class _SignInState extends State { }, style: GoogleFonts.zenDots(color: Colors.amber), ), - SizedBox(height: 40.0), + SizedBox(height: 10.0), TextFormField( controller: _passwordController, decoration: InputDecoration( @@ -110,7 +110,7 @@ class _SignInState extends State { }, style: GoogleFonts.zenDots(color: Colors.amber), ), - SizedBox(height: 40.0), + SizedBox(height: 10.0), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ @@ -165,7 +165,7 @@ class _SignInState extends State { ), ], ), - SizedBox(height: 30.0), + SizedBox(height: 10.0), Divider( height: 20, thickness: 2, @@ -204,7 +204,7 @@ class _SignInState extends State { style: AuthButtonStyle.icon, ), Text( - 'Sign in with Google', + 'Sign in using Google ', style: GoogleFonts.zenDots( color: Colors.amberAccent, letterSpacing: 1.0, @@ -214,7 +214,7 @@ class _SignInState extends State { ), ], ), - SizedBox(height: 50.0), + SizedBox(height: 80.0), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/auth/signup.dart b/lib/auth/signup.dart index 2aa99b6..db66c0c 100644 --- a/lib/auth/signup.dart +++ b/lib/auth/signup.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import '../controller/authController.dart'; +import '../controller/localAuth.dart'; import 'package:social_auth_buttons/social_auth_buttons.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; diff --git a/lib/components/changeLocationContent.dart b/lib/components/changeLocationContent.dart index 4b870e6..f77b512 100644 --- a/lib/components/changeLocationContent.dart +++ b/lib/components/changeLocationContent.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import '../model/worldtimeModel.dart'; +import '../model/worldtime.dart'; class ChangeLocationContent extends StatefulWidget { final List locations; diff --git a/lib/components/editProfileContent.dart b/lib/components/editProfileContent.dart index b96b806..7dfaa68 100644 --- a/lib/components/editProfileContent.dart +++ b/lib/components/editProfileContent.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:google_fonts/google_fonts.dart'; -import '../controller/authController.dart'; +import '../controller/localAuth.dart'; class EditProfile extends StatefulWidget { const EditProfile({super.key}); diff --git a/lib/components/profileContent.dart b/lib/components/profileContent.dart index 8a76b1e..176848f 100644 --- a/lib/components/profileContent.dart +++ b/lib/components/profileContent.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import '../controller/authController.dart'; +import '../controller/localAuth.dart'; import 'package:firebase_auth/firebase_auth.dart'; class ProfileContent extends StatefulWidget { diff --git a/lib/controller/googleAuthController.dart b/lib/controller/googleAuth.dart similarity index 100% rename from lib/controller/googleAuthController.dart rename to lib/controller/googleAuth.dart diff --git a/lib/controller/authController.dart b/lib/controller/localAuth.dart similarity index 98% rename from lib/controller/authController.dart rename to lib/controller/localAuth.dart index 1199495..c10984d 100644 --- a/lib/controller/authController.dart +++ b/lib/controller/localAuth.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:google_sign_in/google_sign_in.dart'; -import '../model/userModel.dart'; +import '../model/user.dart'; class AuthController { final FirebaseAuth _auth = FirebaseAuth.instance; diff --git a/lib/main.dart b/lib/main.dart index fd17879..ab25305 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,9 +5,9 @@ import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'auth/signup.dart'; -import 'controller/authController.dart'; +import 'controller/localAuth.dart'; import 'auth/signin.dart'; -import 'controller/googleAuthController.dart'; +import 'controller/googleAuth.dart'; import 'utils/wrapper.dart'; import 'views/profileView.dart'; import 'views/worldtimeView.dart'; diff --git a/lib/model/userModel.dart b/lib/model/user.dart similarity index 100% rename from lib/model/userModel.dart rename to lib/model/user.dart diff --git a/lib/model/worldtimeModel.dart b/lib/model/worldtime.dart similarity index 100% rename from lib/model/worldtimeModel.dart rename to lib/model/worldtime.dart diff --git a/lib/utils/loader.dart b/lib/utils/loader.dart index 785e729..58daf11 100644 --- a/lib/utils/loader.dart +++ b/lib/utils/loader.dart @@ -1,7 +1,7 @@ // ignore_for_file: file_names, prefer_const_constructors, prefer_const_constructors_in_immutables, camel_case_types, unused_import, avoid_print, unused_local_variable, use_build_context_synchronously import 'package:flutter/material.dart'; -import '../model/worldtimeModel.dart'; +import '../model/worldtime.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; class Loading extends StatefulWidget { diff --git a/lib/views/changeLocationView.dart b/lib/views/changeLocationView.dart index a2a652f..5576c35 100644 --- a/lib/views/changeLocationView.dart +++ b/lib/views/changeLocationView.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import '../components/changeLocationContent.dart'; -import '../model/worldtimeModel.dart'; +import '../model/worldtime.dart'; class ChangeLocation extends StatefulWidget { const ChangeLocation({super.key}); diff --git a/lib/views/profileView.dart b/lib/views/profileView.dart index 9eca320..89befcb 100644 --- a/lib/views/profileView.dart +++ b/lib/views/profileView.dart @@ -7,9 +7,9 @@ import 'package:flutter_world_time_app/components/editProfileContent.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; import '../components/profileContent.dart'; -import '../controller/authController.dart'; +import '../controller/localAuth.dart'; import 'package:google_sign_in/google_sign_in.dart'; -import '../controller/googleAuthController.dart'; +import '../controller/googleAuth.dart'; class Profile extends StatefulWidget { const Profile({super.key}); diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 99787e1..1c65bab 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -7,13 +7,9 @@ #include "generated_plugin_registrant.h" #include -#include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) desktop_webview_auth_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "DesktopWebviewAuthPlugin"); desktop_webview_auth_plugin_register_with_registrar(desktop_webview_auth_registrar); - g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); - flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index a6c0c11..e5bf8b2 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -4,7 +4,6 @@ list(APPEND FLUTTER_PLUGIN_LIST desktop_webview_auth - flutter_secure_storage_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 7796100..abff7a5 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,20 +5,14 @@ import FlutterMacOS import Foundation -import cloud_firestore import desktop_webview_auth -import facebook_auth_desktop import firebase_auth import firebase_core -import flutter_secure_storage_macos import path_provider_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) DesktopWebviewAuthPlugin.register(with: registry.registrar(forPlugin: "DesktopWebviewAuthPlugin")) - FacebookAuthDesktopPlugin.register(with: registry.registrar(forPlugin: "FacebookAuthDesktopPlugin")) FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) - FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index 9c5d616..8abe786 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -89,30 +89,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.1" - cloud_firestore: - dependency: "direct main" - description: - name: cloud_firestore - sha256: "49c0e34a0de7150f6b46390263edd7a940776713bf188891f7fd07c7d750389c" - url: "https://pub.dev" - source: hosted - version: "4.13.0" - cloud_firestore_platform_interface: - dependency: transitive - description: - name: cloud_firestore_platform_interface - sha256: beb8a599bd619d5081469b7af43bf4e9bb0e778f3b005c1b45e21b97e836d1a5 - url: "https://pub.dev" - source: hosted - version: "6.0.4" - cloud_firestore_web: - dependency: transitive - description: - name: cloud_firestore_web - sha256: "7a21039c98e8b5e2e0c3f5c764b185fe18b353312613074e81262a246fb58ba4" - url: "https://pub.dev" - source: hosted - version: "3.8.4" collection: dependency: transitive description: @@ -161,14 +137,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.17" - facebook_auth_desktop: - dependency: transitive - description: - name: facebook_auth_desktop - sha256: "6df63a8882c2113fc76b5a09a26291bd2d6b2350593b53ace6c26ade5e090fee" - url: "https://pub.dev" - source: hosted - version: "1.0.1" fake_async: dependency: transitive description: @@ -302,30 +270,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.5" - flutter_facebook_auth: - dependency: "direct main" - description: - name: flutter_facebook_auth - sha256: "849a6772c3c698aabf05c675f914b3a76d235d3160aab99f8d55f3ddc4bed6a8" - url: "https://pub.dev" - source: hosted - version: "6.0.2" - flutter_facebook_auth_platform_interface: - dependency: transitive - description: - name: flutter_facebook_auth_platform_interface - sha256: "86630c4dbba1c20fba26ea9e59ad0d48f5ff59e7373cacd36f916160186f9ce9" - url: "https://pub.dev" - source: hosted - version: "5.0.0" - flutter_facebook_auth_web: - dependency: transitive - description: - name: flutter_facebook_auth_web - sha256: "22dca8091409309ad85b9f430fbd8f57b686276979da5195e7e97587352567ce" - url: "https://pub.dev" - source: hosted - version: "5.0.0" flutter_launcher_icons: dependency: "direct dev" description: @@ -347,54 +291,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_secure_storage: - dependency: transitive - description: - name: flutter_secure_storage - sha256: ffdbb60130e4665d2af814a0267c481bcf522c41ae2e43caf69fa0146876d685 - url: "https://pub.dev" - source: hosted - version: "9.0.0" - flutter_secure_storage_linux: - dependency: transitive - description: - name: flutter_secure_storage_linux - sha256: "3d5032e314774ee0e1a7d0a9f5e2793486f0dff2dd9ef5a23f4e3fb2a0ae6a9e" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - flutter_secure_storage_macos: - dependency: transitive - description: - name: flutter_secure_storage_macos - sha256: bd33935b4b628abd0b86c8ca20655c5b36275c3a3f5194769a7b3f37c905369c - url: "https://pub.dev" - source: hosted - version: "3.0.1" - flutter_secure_storage_platform_interface: - dependency: transitive - description: - name: flutter_secure_storage_platform_interface - sha256: "0d4d3a5dd4db28c96ae414d7ba3b8422fd735a8255642774803b2532c9a61d7e" - url: "https://pub.dev" - source: hosted - version: "1.0.2" - flutter_secure_storage_web: - dependency: transitive - description: - name: flutter_secure_storage_web - sha256: "30f84f102df9dcdaa2241866a958c2ec976902ebdaa8883fbfe525f1f2f3cf20" - url: "https://pub.dev" - source: hosted - version: "1.1.2" - flutter_secure_storage_windows: - dependency: transitive - description: - name: flutter_secure_storage_windows - sha256: "5809c66f9dd3b4b93b0a6e2e8561539405322ee767ac2f64d084e2ab5429d108" - url: "https://pub.dev" - source: hosted - version: "3.0.0" flutter_spinkit: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 7dfb883..d46dbb3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -41,12 +41,10 @@ dependencies: social_auth_buttons: ^2.0.2 firebase_core: ^2.22.0 firebase_auth: ^4.13.0 - cloud_firestore: ^4.13.0 provider: ^6.1.1 google_sign_in: ^6.1.6 firebase_ui_auth: ^1.10.0 google_fonts: ^6.1.0 - flutter_facebook_auth: ^6.0.2 dev_dependencies: flutter_launcher_icons: ^0.13.1 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index a4ca79d..171e6b2 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,21 +6,15 @@ #include "generated_plugin_registrant.h" -#include #include #include #include -#include void RegisterPlugins(flutter::PluginRegistry* registry) { - CloudFirestorePluginCApiRegisterWithRegistrar( - registry->GetRegistrarForPlugin("CloudFirestorePluginCApi")); DesktopWebviewAuthPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("DesktopWebviewAuthPlugin")); FirebaseAuthPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FirebaseAuthPluginCApi")); FirebaseCorePluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); - FlutterSecureStorageWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 2bc9989..1650ccb 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,11 +3,9 @@ # list(APPEND FLUTTER_PLUGIN_LIST - cloud_firestore desktop_webview_auth firebase_auth firebase_core - flutter_secure_storage_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST