From c936a02836aca9ceed0575d6b357c24d95a75a0f Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sun, 2 Mar 2025 16:49:19 +0100 Subject: [PATCH 1/3] re-organisation login info --- covas_mobile/lib/classes/MyDrawer.dart | 40 ++- covas_mobile/lib/classes/auth_service.dart | 152 ++++++++++ covas_mobile/lib/main.dart | 264 +----------------- covas_mobile/lib/pages/AddProfile.dart | 2 +- covas_mobile/lib/pages/EditProfile.dart | 2 +- covas_mobile/lib/pages/LoginDemo.dart | 192 +++++++++++++ .../flutter/generated_plugin_registrant.cc | 4 + .../linux/flutter/generated_plugins.cmake | 1 + .../Flutter/GeneratedPluginRegistrant.swift | 6 + covas_mobile/pubspec.lock | 140 +++++++++- covas_mobile/pubspec.yaml | 2 + .../flutter/generated_plugin_registrant.cc | 3 + .../windows/flutter/generated_plugins.cmake | 1 + 13 files changed, 522 insertions(+), 287 deletions(-) create mode 100644 covas_mobile/lib/classes/auth_service.dart create mode 100644 covas_mobile/lib/pages/LoginDemo.dart diff --git a/covas_mobile/lib/classes/MyDrawer.dart b/covas_mobile/lib/classes/MyDrawer.dart index df4bc42..14eab93 100644 --- a/covas_mobile/lib/classes/MyDrawer.dart +++ b/covas_mobile/lib/classes/MyDrawer.dart @@ -9,7 +9,7 @@ import 'alert.dart'; import '../variable/globals.dart' as globals; -import '../main.dart'; +import '../pages/LoginDemo.dart'; class MyDrawer extends StatelessWidget with ShowAlertDialog { Future logout(BuildContext context) async { @@ -24,43 +24,41 @@ class MyDrawer extends StatelessWidget with ShowAlertDialog { "Content-Type": "application/json", HttpHeaders.cookieHeader: "access_token=${accessToken}" }); + print("Status code logout ${response.statusCode}"); if (response.statusCode == 200) { - await prefs.setString("access_token", ""); // Clear the token - Navigator.pushReplacement( - context, MaterialPageRoute(builder: (_) => LoginDemo())); + await prefs.remove("access_token"); // Correctly remove the token + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (_) => LoginDemo()), + (route) => false, // Remove all previous routes + ); } else { + String errorMessage; switch (response.statusCode) { case 400: - print("Bad Request: Please check your input."); - showAlertDialog( - context, "Bad Request", "Please check your input."); + errorMessage = "Bad Request: Please check your input."; break; case 401: - print("Unauthorized: Invalid credentials."); - showAlertDialog(context, "Unauthorized", "Invalid credentials."); + errorMessage = "Unauthorized: Invalid credentials."; break; case 403: - print("Forbidden: You don't have permission."); - showAlertDialog(context, "Forbidden", - "You don't have permission to access this."); + errorMessage = "Forbidden: You don't have permission."; break; case 404: - print("Not Found: The resource was not found."); - showAlertDialog( - context, "Not Found", "The resource was not found."); + errorMessage = "Not Found: The resource was not found."; break; case 500: - print("Server Error: Something went wrong on the server."); - showAlertDialog(context, "Server Error", - "Something went wrong on the server."); + errorMessage = + "Server Error: Something went wrong on the server."; break; default: - print("Unexpected Error: ${response.statusCode}"); - showAlertDialog(context, "Error", "Unexpected Error occurred."); + errorMessage = "Unexpected Error: ${response.statusCode}"; break; } + print(errorMessage); + showAlertDialog(context, "Error", errorMessage); } } catch (e) { print("Error: $e"); @@ -68,7 +66,7 @@ class MyDrawer extends StatelessWidget with ShowAlertDialog { context, "Error", "An error occurred. Please try again."); } } else { - showAlertDialog(context, "Error", "Token invalide."); + showAlertDialog(context, "Error", "Invalid token."); } } diff --git a/covas_mobile/lib/classes/auth_service.dart b/covas_mobile/lib/classes/auth_service.dart new file mode 100644 index 0000000..f17bb1e --- /dev/null +++ b/covas_mobile/lib/classes/auth_service.dart @@ -0,0 +1,152 @@ +import 'dart:convert'; +import 'package:flutter_facebook_auth/flutter_facebook_auth.dart'; +import 'package:google_sign_in/google_sign_in.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:http/http.dart' as http; +import '../variable/globals.dart' as globals; +import 'dart:io'; + +class AuthService { + final GoogleSignIn _googleSignIn = GoogleSignIn(); + + // Login with username and password + Future login(String username, String password) async { + final url = Uri.parse("${globals.api}/token"); + + try { + final response = await http.post( + url, + headers: { + 'accept': 'application/json', + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: { + "username": username, + "password": password, + }, + ); + + if (response.statusCode == 200 || response.statusCode == 201) { + final prefs = await SharedPreferences.getInstance(); + final cookies = response.headers["set-cookie"]?.split(";") ?? []; + + for (final cookie in cookies) { + final cookieParts = cookie.split(","); + for (final part in cookieParts) { + final keyValue = part.split("="); + if (keyValue.length == 2 && keyValue[0] == "access_token") { + prefs.setString("access_token", keyValue[1]); + } + } + } + return true; + } else { + return false; + } + } catch (e) { + print("Login error: $e"); + return false; + } + } + + // Logout + Future logout() async { + final prefs = await SharedPreferences.getInstance(); + await prefs.remove("access_token"); + await _googleSignIn.signOut(); + } + + Future isLoggedIn() async { + final prefs = await SharedPreferences.getInstance(); + final accessToken = prefs.getString("access_token"); + + if (accessToken == null || accessToken.isEmpty) { + print("No access token found."); + return false; + } + + print("Checking token validity..."); + var url = Uri.parse("${globals.api}/token"); + + try { + final response = await http.get( + url, + headers: { + HttpHeaders.cookieHeader: "access_token=$accessToken", + "Content-Type": "application/json", + }, + ); + + if (response.statusCode == 200) { + print("Token is valid."); + return true; + } else { + print("Token is invalid. Status code: ${response.statusCode}"); + await prefs.remove("access_token"); // Clear invalid token + return false; + } + } catch (e) { + print("Error while checking token: $e"); + return false; + } + } + + // Get stored access token + Future getAccessToken() async { + final prefs = await SharedPreferences.getInstance(); + return prefs.getString("access_token"); + } + + // Login with Facebook + Future signInWithFacebook() async { + try { + final LoginResult result = await FacebookAuth.instance.login(); + if (result.status == LoginStatus.success && result.accessToken != null) { + final AccessToken? accessToken = result.accessToken; + + final response = await http.post( + Uri.parse("${globals.api}/auth/facebook"), + headers: {"Content-Type": "application/json"}, + body: jsonEncode({"token": accessToken!.tokenString}), + ); + + if (response.statusCode == 200) { + final data = json.decode(response.body); + final prefs = await SharedPreferences.getInstance(); + prefs.setString("access_token", data["access_token"]); + return data["access_token"]; + } + } + } catch (e) { + print("Facebook login error: $e"); + } + return null; + } + + // Login with Google + Future signInWithGoogle() async { + try { + final GoogleSignInAccount? googleUser = await _googleSignIn.signIn(); + if (googleUser == null) return null; // User canceled login + + final GoogleSignInAuthentication googleAuth = + await googleUser.authentication; + + final response = await http.post( + Uri.parse("${globals.api}/auth/google"), + headers: {"Content-Type": "application/json"}, + body: jsonEncode({"token": googleAuth.idToken}), + ); + + if (response.statusCode == 200) { + final data = json.decode(response.body); + final prefs = await SharedPreferences.getInstance(); + prefs.setString("access_token", data["access_token"]); + return data["access_token"]; + } + } catch (e) { + print("Google login error: $e"); + } + return null; + } +} diff --git a/covas_mobile/lib/main.dart b/covas_mobile/lib/main.dart index 1d4665a..76ea006 100644 --- a/covas_mobile/lib/main.dart +++ b/covas_mobile/lib/main.dart @@ -1,25 +1,11 @@ import 'package:flutter/material.dart'; -import 'package:shared_preferences/shared_preferences.dart'; -import 'package:http/http.dart' as http; -import 'dart:convert'; - -import 'classes/ad_helper.dart'; import 'package:google_mobile_ads/google_mobile_ads.dart'; - -import 'dart:io'; - -//import 'MyHomePage.dart'; -import 'pages/ListItemMenu.dart'; -import 'pages/AddProfile.dart'; -import 'pages/ForgotPassword.dart'; -import 'classes/alert.dart'; - -import 'variable/globals.dart' as globals; -import 'package:permission_handler/permission_handler.dart'; +import 'pages/LoginDemo.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await MobileAds.instance.initialize(); + runApp(MyApp()); } @@ -32,249 +18,3 @@ class MyApp extends StatelessWidget { ); } } - -class LoginDemo extends StatefulWidget { - @override - _LoginDemoState createState() => _LoginDemoState(); -} - -class _LoginDemoState extends State with ShowAlertDialog { - BannerAd? _bannerAd; - TextEditingController inputPseudo = TextEditingController(); - TextEditingController inputPassword = TextEditingController(); - Future _login(BuildContext context) async { - final url = Uri.parse("${globals.api}/token"); - final pseudo = inputPseudo.text; - final password = inputPassword.text; - - print("Attempting login"); - if (pseudo.isEmpty || password.isEmpty) { - showAlertDialog(context, "Erreur", "Champ vide"); - return; - } - - print("Request URL: $url"); - try { - final response = await http.post( - url, - headers: { - 'accept': 'application/json', - 'Content-Type': 'application/x-www-form-urlencoded', - }, - body: { - "username": pseudo, - "password": password, - }, - ); - - print("Response status code: ${response.statusCode}"); - - if (response.statusCode == 200 || response.statusCode == 201) { - final prefs = await SharedPreferences.getInstance(); - final cookies = response.headers["set-cookie"]?.split(";") ?? []; - - for (final cookie in cookies) { - final cookieParts = cookie.split(","); - for (final part in cookieParts) { - final keyValue = part.split("="); - if (keyValue.length == 2 && keyValue[0] == "access_token") { - prefs.setString("access_token", keyValue[1]); - } - } - } - - Navigator.push( - context, - MaterialPageRoute(builder: (_) => ListItemMenu()), - ); - } else { - _handleErrorResponse(context, response.statusCode); - } - } catch (e) { - showAlertDialog(context, "Erreur", e.toString()); - } - } - - void _handleErrorResponse(BuildContext context, int statusCode) { - final errorMessages = { - 400: "Requête mal construite", - 406: "Mot de passe incorrect", - 404: "Utilisateur inconnu", - 403: "Utilisateur désactivé", - 410: "Token invalide", - 500: "Problème interne du serveur", - }; - - final errorMessage = - errorMessages[statusCode] ?? "Problème d'authentification inconnu"; - showAlertDialog(context, "Erreur serveur", errorMessage); - } - - void start() async { - SharedPreferences prefs = await SharedPreferences.getInstance(); - var access_token = prefs.getString("access_token") ?? ""; - print("Get access token"); - - if (access_token.isNotEmpty) { - print("Appel HTTP"); - var urlToken = Uri.parse("${globals.api}/token"); - - var responseToken = await http.get(urlToken, - headers: {HttpHeaders.cookieHeader: 'access_token: ${access_token}'}); - print(responseToken.statusCode); - if (responseToken.statusCode == 200) { - print("route to item list"); - Navigator.push( - context, MaterialPageRoute(builder: (_) => ListItemMenu())); - } else { - prefs.remove("access_token"); - } - } - } - - @override - void initState() { - super.initState(); - AdHelper.createBannerAd(() => setState(() {})).then((ad) { - setState(() { - _bannerAd = ad; - }); - }); - - _checkLocationPermission(); - start(); - } - - Future _checkLocationPermission() async { - PermissionStatus status = await Permission.location.status; - - if (status.isGranted) { - print("Location permission granted"); - } else if (status.isDenied) { - print("Location permission denied"); - _requestLocationPermission(); - } else if (status.isPermanentlyDenied) { - print("Location permission permanently denied"); - openAppSettings(); - } - } - - // Request location permission - Future _requestLocationPermission() async { - PermissionStatus status = await Permission.location.request(); - - if (status.isGranted) { - print("Location permission granted"); - } else if (status.isDenied) { - print("Location permission denied"); - } else if (status.isPermanentlyDenied) { - print("Location permission permanently denied"); - openAppSettings(); - } - } - - // Open app settings to allow user to grant permission manually - Future _openAppSettings() async { - bool opened = await openAppSettings(); - if (opened) { - print("App settings opened"); - } else { - print("Failed to open app settings"); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Colors.white, - appBar: AppBar( - title: Text("Login Page"), - backgroundColor: Colors.blue, - foregroundColor: Colors.white, - ), - body: SingleChildScrollView( - child: Column( - children: [ - _bannerAd == null - ? SizedBox.shrink() - : SizedBox( - height: _bannerAd!.size.height.toDouble(), - width: _bannerAd!.size.width.toDouble(), - child: AdWidget(ad: _bannerAd!), - ), - Padding( - padding: const EdgeInsets.only(top: 60.0), - child: Center( - child: Container( - width: 200, - height: 150, - decoration: BoxDecoration( - color: Colors.red, - borderRadius: BorderRadius.circular(50.0)), - child: Image.asset('./images/flutter.png')), - ), - ), - Padding( - //padding: const EdgeInsets.only(left:15.0,right: 15.0,top:0,bottom: 0), - padding: EdgeInsets.symmetric(horizontal: 15), - child: TextField( - controller: inputPseudo, - decoration: InputDecoration( - border: OutlineInputBorder(), - labelText: 'Pseudo', - hintText: 'Enter pseudo existent'), - ), - ), - Padding( - padding: const EdgeInsets.only( - left: 15.0, right: 15.0, top: 15, bottom: 0), - //padding: EdgeInsets.symmetric(horizontal: 15), - child: TextField( - controller: inputPassword, - obscureText: true, - decoration: InputDecoration( - border: OutlineInputBorder(), - labelText: 'Password', - hintText: 'Enter secure password'), - ), - ), - TextButton( - onPressed: () { - Navigator.push(context, - MaterialPageRoute(builder: (_) => PasswordForgot())); - }, - child: Text( - 'Forgot Password', - style: TextStyle(color: Colors.blue, fontSize: 15), - ), - ), - Container( - height: 50, - width: 250, - decoration: BoxDecoration( - color: Colors.blue, borderRadius: BorderRadius.circular(20)), - child: TextButton( - onPressed: () { - _login(context); - }, - child: Text( - 'Login', - style: TextStyle(color: Colors.white, fontSize: 25), - ), - ), - ), - SizedBox( - height: 130, - ), - InkWell( - child: Text('New User? Create Account'), - onTap: () { - Navigator.push( - context, MaterialPageRoute(builder: (_) => AddProfile())); - }), - ], - ), - ), - ); - } -} diff --git a/covas_mobile/lib/pages/AddProfile.dart b/covas_mobile/lib/pages/AddProfile.dart index f97fae4..ed154b1 100644 --- a/covas_mobile/lib/pages/AddProfile.dart +++ b/covas_mobile/lib/pages/AddProfile.dart @@ -5,7 +5,7 @@ import 'package:intl/intl.dart'; import 'dart:convert'; import 'dart:io'; -import '../main.dart'; +import '../pages/LoginDemo.dart'; import '../classes/alert.dart'; diff --git a/covas_mobile/lib/pages/EditProfile.dart b/covas_mobile/lib/pages/EditProfile.dart index 50a9aee..31bde9e 100644 --- a/covas_mobile/lib/pages/EditProfile.dart +++ b/covas_mobile/lib/pages/EditProfile.dart @@ -8,7 +8,7 @@ import 'dart:convert'; import 'dart:io'; import '../classes/MyDrawer.dart'; -import '../main.dart'; +import '../pages/LoginDemo.dart'; import '../classes/alert.dart'; import '../classes/eventAdded.dart'; diff --git a/covas_mobile/lib/pages/LoginDemo.dart b/covas_mobile/lib/pages/LoginDemo.dart new file mode 100644 index 0000000..9700639 --- /dev/null +++ b/covas_mobile/lib/pages/LoginDemo.dart @@ -0,0 +1,192 @@ +import 'package:flutter/material.dart'; +import 'package:google_mobile_ads/google_mobile_ads.dart'; +import 'package:google_sign_in/google_sign_in.dart'; +import 'package:permission_handler/permission_handler.dart'; +import '../classes/auth_service.dart'; +import '../pages/ListItemMenu.dart'; +import '../pages/AddProfile.dart'; +import '../pages/ForgotPassword.dart'; +import '../classes/alert.dart'; +import '../classes/ad_helper.dart'; + +class LoginDemo extends StatefulWidget { + @override + _LoginDemoState createState() => _LoginDemoState(); +} + +class _LoginDemoState extends State with ShowAlertDialog { + BannerAd? _bannerAd; + TextEditingController inputPseudo = TextEditingController(); + TextEditingController inputPassword = TextEditingController(); + final AuthService _authService = AuthService(); + + Future _login(BuildContext context) async { + final pseudo = inputPseudo.text; + final password = inputPassword.text; + + if (pseudo.isEmpty || password.isEmpty) { + showAlertDialog(context, "Erreur", "Champ vide"); + return; + } + + bool success = await _authService.login(pseudo, password); + + if (success) { + Navigator.push( + context, MaterialPageRoute(builder: (_) => ListItemMenu())); + } else { + showAlertDialog(context, "Erreur", "Échec de l'authentification"); + } + } + + Future _loginWithFacebook(BuildContext context) async { + String? token = await _authService.signInWithFacebook(); + if (token != null) { + Navigator.push( + context, MaterialPageRoute(builder: (_) => ListItemMenu())); + } else { + showAlertDialog(context, "Erreur", "Échec de la connexion Facebook"); + } + } + + Future _loginWithGoogle(BuildContext context) async { + String? token = await _authService.signInWithGoogle(); + if (token != null) { + Navigator.push( + context, MaterialPageRoute(builder: (_) => ListItemMenu())); + } else { + showAlertDialog(context, "Erreur", "Échec de la connexion Google"); + } + } + + @override + void initState() { + super.initState(); + AdHelper.createBannerAd(() => setState(() {})).then((ad) { + setState(() { + _bannerAd = ad; + }); + }); + + _checkLocationPermission(); + _checkLoginStatus(); + } + + Future _checkLoginStatus() async { + bool loggedIn = await _authService.isLoggedIn(); + print("logged status : ${loggedIn}"); + if (loggedIn) { + Navigator.push( + context, MaterialPageRoute(builder: (_) => ListItemMenu())); + } + } + + Future _checkLocationPermission() async { + PermissionStatus status = await Permission.location.status; + if (!status.isGranted) { + await Permission.location.request(); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: AppBar( + title: Text("Login Page"), + backgroundColor: Colors.blue, + foregroundColor: Colors.white, + ), + body: SingleChildScrollView( + child: Column( + children: [ + _bannerAd == null + ? SizedBox.shrink() + : SizedBox( + height: _bannerAd!.size.height.toDouble(), + width: _bannerAd!.size.width.toDouble(), + child: AdWidget(ad: _bannerAd!), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 15), + child: TextField( + controller: inputPseudo, + decoration: InputDecoration( + border: OutlineInputBorder(), + labelText: 'Pseudo', + hintText: 'Enter pseudo existant', + ), + ), + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 15, vertical: 15), + child: TextField( + controller: inputPassword, + obscureText: true, + decoration: InputDecoration( + border: OutlineInputBorder(), + labelText: 'Password', + hintText: 'Enter secure password', + ), + ), + ), + TextButton( + onPressed: () { + Navigator.push(context, + MaterialPageRoute(builder: (_) => PasswordForgot())); + }, + child: Text('Forgot Password', + style: TextStyle(color: Colors.blue, fontSize: 15)), + ), + Container( + height: 50, + width: 250, + decoration: BoxDecoration( + color: Colors.blue, borderRadius: BorderRadius.circular(20)), + child: TextButton( + onPressed: () => _login(context), + child: Text('Login', + style: TextStyle(color: Colors.white, fontSize: 25)), + ), + ), + SizedBox(height: 20), + Container( + height: 50, + width: 250, + decoration: BoxDecoration( + color: Colors.blueAccent, + borderRadius: BorderRadius.circular(20)), + child: TextButton( + onPressed: () => _loginWithFacebook(context), + child: Text('Login with Facebook', + style: TextStyle(color: Colors.white, fontSize: 20)), + ), + ), + SizedBox(height: 20), + // Google Login Button + Container( + height: 50, + width: 250, + decoration: BoxDecoration( + color: Colors.redAccent, + borderRadius: BorderRadius.circular(20)), + child: TextButton( + onPressed: () => _loginWithGoogle(context), + child: Text('Login with Google', + style: TextStyle(color: Colors.white, fontSize: 20)), + ), + ), + SizedBox(height: 130), + InkWell( + child: Text('New User? Create Account'), + onTap: () { + Navigator.push( + context, MaterialPageRoute(builder: (_) => AddProfile())); + }, + ), + ], + ), + ), + ); + } +} diff --git a/covas_mobile/linux/flutter/generated_plugin_registrant.cc b/covas_mobile/linux/flutter/generated_plugin_registrant.cc index 7299b5c..3ccd551 100644 --- a/covas_mobile/linux/flutter/generated_plugin_registrant.cc +++ b/covas_mobile/linux/flutter/generated_plugin_registrant.cc @@ -7,12 +7,16 @@ #include "generated_plugin_registrant.h" #include +#include #include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); file_selector_plugin_register_with_registrar(file_selector_linux_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); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/covas_mobile/linux/flutter/generated_plugins.cmake b/covas_mobile/linux/flutter/generated_plugins.cmake index 786ff5c..9ce94c4 100644 --- a/covas_mobile/linux/flutter/generated_plugins.cmake +++ b/covas_mobile/linux/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_linux + flutter_secure_storage_linux url_launcher_linux ) diff --git a/covas_mobile/macos/Flutter/GeneratedPluginRegistrant.swift b/covas_mobile/macos/Flutter/GeneratedPluginRegistrant.swift index 3f99c38..af2c06e 100644 --- a/covas_mobile/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/covas_mobile/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,16 +5,22 @@ import FlutterMacOS import Foundation +import facebook_auth_desktop import file_selector_macos +import flutter_secure_storage_macos import geolocator_apple +import google_sign_in_ios import path_provider_foundation import shared_preferences_foundation import url_launcher_macos import webview_flutter_wkwebview func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + FacebookAuthDesktopPlugin.register(with: registry.registrar(forPlugin: "FacebookAuthDesktopPlugin")) FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) + FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) + FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) diff --git a/covas_mobile/pubspec.lock b/covas_mobile/pubspec.lock index 86ac378..d0131d4 100644 --- a/covas_mobile/pubspec.lock +++ b/covas_mobile/pubspec.lock @@ -137,6 +137,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.0" + facebook_auth_desktop: + dependency: transitive + description: + name: facebook_auth_desktop + sha256: "219d559a33891e937c1913430505eae01fb946cb35729167bbdc747e3ebbd9ff" + url: "https://pub.dev" + source: hosted + version: "2.1.1" fake_async: dependency: transitive description: @@ -214,6 +222,30 @@ packages: url: "https://pub.dev" source: hosted version: "5.2.1" + flutter_facebook_auth: + dependency: "direct main" + description: + name: flutter_facebook_auth + sha256: d542743aee9571fad59aa4cfb645640dbb49f23b039d07c34b5e21bc3d5857e9 + url: "https://pub.dev" + source: hosted + version: "7.1.1" + flutter_facebook_auth_platform_interface: + dependency: transitive + description: + name: flutter_facebook_auth_platform_interface + sha256: e04b8dbfa77702bea45a79993163ad5d20b2c0084109bec591fdc2b9ee505779 + url: "https://pub.dev" + source: hosted + version: "6.1.2" + flutter_facebook_auth_web: + dependency: transitive + description: + name: flutter_facebook_auth_web + sha256: f682400d61cf8d52dd8b6458b5ee106ed57e95309a117dc32875d3da129ce47c + url: "https://pub.dev" + source: hosted + version: "6.1.2" flutter_gemini: dependency: "direct main" description: @@ -238,6 +270,54 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.23" + flutter_secure_storage: + dependency: transitive + description: + name: flutter_secure_storage + sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" + url: "https://pub.dev" + source: hosted + version: "9.2.4" + flutter_secure_storage_linux: + dependency: transitive + description: + name: flutter_secure_storage_linux + sha256: bf7404619d7ab5c0a1151d7c4e802edad8f33535abfbeff2f9e1fe1274e2d705 + url: "https://pub.dev" + source: hosted + version: "1.2.2" + flutter_secure_storage_macos: + dependency: transitive + description: + name: flutter_secure_storage_macos + sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" + url: "https://pub.dev" + source: hosted + version: "3.1.3" + flutter_secure_storage_platform_interface: + dependency: transitive + description: + name: flutter_secure_storage_platform_interface + sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + url: "https://pub.dev" + source: hosted + version: "1.1.2" + flutter_secure_storage_web: + dependency: transitive + description: + name: flutter_secure_storage_web + sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + flutter_secure_storage_windows: + dependency: transitive + description: + name: flutter_secure_storage_windows + sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 + url: "https://pub.dev" + source: hosted + version: "3.1.2" flutter_test: dependency: "direct dev" description: flutter @@ -304,6 +384,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.3" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "55580f436822d64c8ff9a77e37d61f5fb1e6c7ec9d632a43ee324e2a05c3c6c9" + url: "https://pub.dev" + source: hosted + version: "0.3.3" google_mobile_ads: dependency: "direct main" description: @@ -312,6 +400,46 @@ packages: url: "https://pub.dev" source: hosted version: "5.3.1" + google_sign_in: + dependency: "direct main" + description: + name: google_sign_in + sha256: fad6ddc80c427b0bba705f2116204ce1173e09cf299f85e053d57a55e5b2dd56 + url: "https://pub.dev" + source: hosted + version: "6.2.2" + google_sign_in_android: + dependency: transitive + description: + name: google_sign_in_android + sha256: "7af72e5502c313865c729223b60e8ae7bce0a1011b250c24edcf30d3d7032748" + url: "https://pub.dev" + source: hosted + version: "6.1.35" + google_sign_in_ios: + dependency: transitive + description: + name: google_sign_in_ios + sha256: "8468465516a6fdc283ffbbb06ec03a860ee34e9ff84b0454074978705b42379b" + url: "https://pub.dev" + source: hosted + version: "5.8.0" + google_sign_in_platform_interface: + dependency: transitive + description: + name: google_sign_in_platform_interface + sha256: "1f6e5787d7a120cc0359ddf315c92309069171306242e181c09472d1b00a2971" + url: "https://pub.dev" + source: hosted + version: "2.4.5" + google_sign_in_web: + dependency: transitive + description: + name: google_sign_in_web + sha256: ada595df6c30cead48e66b1f3a050edf0c5cf2ba60c185d69690e08adcc6281b + url: "https://pub.dev" + source: hosted + version: "0.12.4+3" http: dependency: "direct main" description: @@ -913,10 +1041,18 @@ packages: dependency: transitive description: name: webview_flutter_wkwebview - sha256: "7310de7efa4e6df8b3d2ff14aef3f290bc00b43363f2d0028845e6de46507fc9" + sha256: d183aa3d0fbc1f4d0715ce06c5a44cad636598c3340ae8d359fbc61b4016fb60 url: "https://pub.dev" source: hosted - version: "3.18.1" + version: "3.18.3" + win32: + dependency: transitive + description: + name: win32 + sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e + url: "https://pub.dev" + source: hosted + version: "5.10.1" xdg_directories: dependency: transitive description: diff --git a/covas_mobile/pubspec.yaml b/covas_mobile/pubspec.yaml index a8ac907..1651912 100644 --- a/covas_mobile/pubspec.yaml +++ b/covas_mobile/pubspec.yaml @@ -51,6 +51,8 @@ dependencies: url_launcher: ^6.3.1 mapbox_gl: ^0.16.0 google_mobile_ads: ^5.3.1 + google_sign_in: ^6.2.2 + flutter_facebook_auth: ^7.1.1 dev_dependencies: flutter_test: diff --git a/covas_mobile/windows/flutter/generated_plugin_registrant.cc b/covas_mobile/windows/flutter/generated_plugin_registrant.cc index b2cbd25..6e4a5a7 100644 --- a/covas_mobile/windows/flutter/generated_plugin_registrant.cc +++ b/covas_mobile/windows/flutter/generated_plugin_registrant.cc @@ -7,6 +7,7 @@ #include "generated_plugin_registrant.h" #include +#include #include #include #include @@ -14,6 +15,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { FileSelectorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("FileSelectorWindows")); + FlutterSecureStorageWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); GeolocatorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("GeolocatorWindows")); PermissionHandlerWindowsPluginRegisterWithRegistrar( diff --git a/covas_mobile/windows/flutter/generated_plugins.cmake b/covas_mobile/windows/flutter/generated_plugins.cmake index 92c9a0d..aca1540 100644 --- a/covas_mobile/windows/flutter/generated_plugins.cmake +++ b/covas_mobile/windows/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_windows + flutter_secure_storage_windows geolocator_windows permission_handler_windows url_launcher_windows From 7f3240242d1b256f4fe854ad8e0fe3a188345f23 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Thu, 6 Mar 2025 20:21:59 +0100 Subject: [PATCH 2/3] remove google and facebook auth --- covas_mobile/android/gradle.properties | 1 + covas_mobile/lib/classes/auth_service.dart | 56 ---------------------- covas_mobile/lib/pages/LoginDemo.dart | 47 ------------------ 3 files changed, 1 insertion(+), 103 deletions(-) diff --git a/covas_mobile/android/gradle.properties b/covas_mobile/android/gradle.properties index 94adc3a..f489260 100644 --- a/covas_mobile/android/gradle.properties +++ b/covas_mobile/android/gradle.properties @@ -1,3 +1,4 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true +flutter.compileSdkVersion=35 \ No newline at end of file diff --git a/covas_mobile/lib/classes/auth_service.dart b/covas_mobile/lib/classes/auth_service.dart index f17bb1e..507c3e4 100644 --- a/covas_mobile/lib/classes/auth_service.dart +++ b/covas_mobile/lib/classes/auth_service.dart @@ -1,14 +1,10 @@ import 'dart:convert'; -import 'package:flutter_facebook_auth/flutter_facebook_auth.dart'; -import 'package:google_sign_in/google_sign_in.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:http/http.dart' as http; import '../variable/globals.dart' as globals; import 'dart:io'; class AuthService { - final GoogleSignIn _googleSignIn = GoogleSignIn(); - // Login with username and password Future login(String username, String password) async { final url = Uri.parse("${globals.api}/token"); @@ -53,7 +49,6 @@ class AuthService { Future logout() async { final prefs = await SharedPreferences.getInstance(); await prefs.remove("access_token"); - await _googleSignIn.signOut(); } Future isLoggedIn() async { @@ -97,56 +92,5 @@ class AuthService { return prefs.getString("access_token"); } - // Login with Facebook - Future signInWithFacebook() async { - try { - final LoginResult result = await FacebookAuth.instance.login(); - if (result.status == LoginStatus.success && result.accessToken != null) { - final AccessToken? accessToken = result.accessToken; - - final response = await http.post( - Uri.parse("${globals.api}/auth/facebook"), - headers: {"Content-Type": "application/json"}, - body: jsonEncode({"token": accessToken!.tokenString}), - ); - - if (response.statusCode == 200) { - final data = json.decode(response.body); - final prefs = await SharedPreferences.getInstance(); - prefs.setString("access_token", data["access_token"]); - return data["access_token"]; - } - } - } catch (e) { - print("Facebook login error: $e"); - } - return null; - } - // Login with Google - Future signInWithGoogle() async { - try { - final GoogleSignInAccount? googleUser = await _googleSignIn.signIn(); - if (googleUser == null) return null; // User canceled login - - final GoogleSignInAuthentication googleAuth = - await googleUser.authentication; - - final response = await http.post( - Uri.parse("${globals.api}/auth/google"), - headers: {"Content-Type": "application/json"}, - body: jsonEncode({"token": googleAuth.idToken}), - ); - - if (response.statusCode == 200) { - final data = json.decode(response.body); - final prefs = await SharedPreferences.getInstance(); - prefs.setString("access_token", data["access_token"]); - return data["access_token"]; - } - } catch (e) { - print("Google login error: $e"); - } - return null; - } } diff --git a/covas_mobile/lib/pages/LoginDemo.dart b/covas_mobile/lib/pages/LoginDemo.dart index 9700639..da04d52 100644 --- a/covas_mobile/lib/pages/LoginDemo.dart +++ b/covas_mobile/lib/pages/LoginDemo.dart @@ -39,26 +39,6 @@ class _LoginDemoState extends State with ShowAlertDialog { } } - Future _loginWithFacebook(BuildContext context) async { - String? token = await _authService.signInWithFacebook(); - if (token != null) { - Navigator.push( - context, MaterialPageRoute(builder: (_) => ListItemMenu())); - } else { - showAlertDialog(context, "Erreur", "Échec de la connexion Facebook"); - } - } - - Future _loginWithGoogle(BuildContext context) async { - String? token = await _authService.signInWithGoogle(); - if (token != null) { - Navigator.push( - context, MaterialPageRoute(builder: (_) => ListItemMenu())); - } else { - showAlertDialog(context, "Erreur", "Échec de la connexion Google"); - } - } - @override void initState() { super.initState(); @@ -149,33 +129,6 @@ class _LoginDemoState extends State with ShowAlertDialog { style: TextStyle(color: Colors.white, fontSize: 25)), ), ), - SizedBox(height: 20), - Container( - height: 50, - width: 250, - decoration: BoxDecoration( - color: Colors.blueAccent, - borderRadius: BorderRadius.circular(20)), - child: TextButton( - onPressed: () => _loginWithFacebook(context), - child: Text('Login with Facebook', - style: TextStyle(color: Colors.white, fontSize: 20)), - ), - ), - SizedBox(height: 20), - // Google Login Button - Container( - height: 50, - width: 250, - decoration: BoxDecoration( - color: Colors.redAccent, - borderRadius: BorderRadius.circular(20)), - child: TextButton( - onPressed: () => _loginWithGoogle(context), - child: Text('Login with Google', - style: TextStyle(color: Colors.white, fontSize: 20)), - ), - ), SizedBox(height: 130), InkWell( child: Text('New User? Create Account'), From e4d8648fcc01fe1e38c784494ab99e71274f9ae1 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Thu, 6 Mar 2025 20:26:02 +0100 Subject: [PATCH 3/3] remove pakcage --- .../flutter/generated_plugin_registrant.cc | 4 - .../linux/flutter/generated_plugins.cmake | 1 - .../Flutter/GeneratedPluginRegistrant.swift | 6 - covas_mobile/pubspec.lock | 136 ------------------ covas_mobile/pubspec.yaml | 2 - .../flutter/generated_plugin_registrant.cc | 3 - .../windows/flutter/generated_plugins.cmake | 1 - 7 files changed, 153 deletions(-) diff --git a/covas_mobile/linux/flutter/generated_plugin_registrant.cc b/covas_mobile/linux/flutter/generated_plugin_registrant.cc index 3ccd551..7299b5c 100644 --- a/covas_mobile/linux/flutter/generated_plugin_registrant.cc +++ b/covas_mobile/linux/flutter/generated_plugin_registrant.cc @@ -7,16 +7,12 @@ #include "generated_plugin_registrant.h" #include -#include #include void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); file_selector_plugin_register_with_registrar(file_selector_linux_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); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/covas_mobile/linux/flutter/generated_plugins.cmake b/covas_mobile/linux/flutter/generated_plugins.cmake index 9ce94c4..786ff5c 100644 --- a/covas_mobile/linux/flutter/generated_plugins.cmake +++ b/covas_mobile/linux/flutter/generated_plugins.cmake @@ -4,7 +4,6 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_linux - flutter_secure_storage_linux url_launcher_linux ) diff --git a/covas_mobile/macos/Flutter/GeneratedPluginRegistrant.swift b/covas_mobile/macos/Flutter/GeneratedPluginRegistrant.swift index af2c06e..3f99c38 100644 --- a/covas_mobile/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/covas_mobile/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,22 +5,16 @@ import FlutterMacOS import Foundation -import facebook_auth_desktop import file_selector_macos -import flutter_secure_storage_macos import geolocator_apple -import google_sign_in_ios import path_provider_foundation import shared_preferences_foundation import url_launcher_macos import webview_flutter_wkwebview func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - FacebookAuthDesktopPlugin.register(with: registry.registrar(forPlugin: "FacebookAuthDesktopPlugin")) FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) - FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) - FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) diff --git a/covas_mobile/pubspec.lock b/covas_mobile/pubspec.lock index d0131d4..e908575 100644 --- a/covas_mobile/pubspec.lock +++ b/covas_mobile/pubspec.lock @@ -137,14 +137,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.0" - facebook_auth_desktop: - dependency: transitive - description: - name: facebook_auth_desktop - sha256: "219d559a33891e937c1913430505eae01fb946cb35729167bbdc747e3ebbd9ff" - url: "https://pub.dev" - source: hosted - version: "2.1.1" fake_async: dependency: transitive description: @@ -222,30 +214,6 @@ packages: url: "https://pub.dev" source: hosted version: "5.2.1" - flutter_facebook_auth: - dependency: "direct main" - description: - name: flutter_facebook_auth - sha256: d542743aee9571fad59aa4cfb645640dbb49f23b039d07c34b5e21bc3d5857e9 - url: "https://pub.dev" - source: hosted - version: "7.1.1" - flutter_facebook_auth_platform_interface: - dependency: transitive - description: - name: flutter_facebook_auth_platform_interface - sha256: e04b8dbfa77702bea45a79993163ad5d20b2c0084109bec591fdc2b9ee505779 - url: "https://pub.dev" - source: hosted - version: "6.1.2" - flutter_facebook_auth_web: - dependency: transitive - description: - name: flutter_facebook_auth_web - sha256: f682400d61cf8d52dd8b6458b5ee106ed57e95309a117dc32875d3da129ce47c - url: "https://pub.dev" - source: hosted - version: "6.1.2" flutter_gemini: dependency: "direct main" description: @@ -270,54 +238,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.23" - flutter_secure_storage: - dependency: transitive - description: - name: flutter_secure_storage - sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" - url: "https://pub.dev" - source: hosted - version: "9.2.4" - flutter_secure_storage_linux: - dependency: transitive - description: - name: flutter_secure_storage_linux - sha256: bf7404619d7ab5c0a1151d7c4e802edad8f33535abfbeff2f9e1fe1274e2d705 - url: "https://pub.dev" - source: hosted - version: "1.2.2" - flutter_secure_storage_macos: - dependency: transitive - description: - name: flutter_secure_storage_macos - sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" - url: "https://pub.dev" - source: hosted - version: "3.1.3" - flutter_secure_storage_platform_interface: - dependency: transitive - description: - name: flutter_secure_storage_platform_interface - sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 - url: "https://pub.dev" - source: hosted - version: "1.1.2" - flutter_secure_storage_web: - dependency: transitive - description: - name: flutter_secure_storage_web - sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - flutter_secure_storage_windows: - dependency: transitive - description: - name: flutter_secure_storage_windows - sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 - url: "https://pub.dev" - source: hosted - version: "3.1.2" flutter_test: dependency: "direct dev" description: flutter @@ -384,14 +304,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.3" - google_identity_services_web: - dependency: transitive - description: - name: google_identity_services_web - sha256: "55580f436822d64c8ff9a77e37d61f5fb1e6c7ec9d632a43ee324e2a05c3c6c9" - url: "https://pub.dev" - source: hosted - version: "0.3.3" google_mobile_ads: dependency: "direct main" description: @@ -400,46 +312,6 @@ packages: url: "https://pub.dev" source: hosted version: "5.3.1" - google_sign_in: - dependency: "direct main" - description: - name: google_sign_in - sha256: fad6ddc80c427b0bba705f2116204ce1173e09cf299f85e053d57a55e5b2dd56 - url: "https://pub.dev" - source: hosted - version: "6.2.2" - google_sign_in_android: - dependency: transitive - description: - name: google_sign_in_android - sha256: "7af72e5502c313865c729223b60e8ae7bce0a1011b250c24edcf30d3d7032748" - url: "https://pub.dev" - source: hosted - version: "6.1.35" - google_sign_in_ios: - dependency: transitive - description: - name: google_sign_in_ios - sha256: "8468465516a6fdc283ffbbb06ec03a860ee34e9ff84b0454074978705b42379b" - url: "https://pub.dev" - source: hosted - version: "5.8.0" - google_sign_in_platform_interface: - dependency: transitive - description: - name: google_sign_in_platform_interface - sha256: "1f6e5787d7a120cc0359ddf315c92309069171306242e181c09472d1b00a2971" - url: "https://pub.dev" - source: hosted - version: "2.4.5" - google_sign_in_web: - dependency: transitive - description: - name: google_sign_in_web - sha256: ada595df6c30cead48e66b1f3a050edf0c5cf2ba60c185d69690e08adcc6281b - url: "https://pub.dev" - source: hosted - version: "0.12.4+3" http: dependency: "direct main" description: @@ -1045,14 +917,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.18.3" - win32: - dependency: transitive - description: - name: win32 - sha256: daf97c9d80197ed7b619040e86c8ab9a9dad285e7671ee7390f9180cc828a51e - url: "https://pub.dev" - source: hosted - version: "5.10.1" xdg_directories: dependency: transitive description: diff --git a/covas_mobile/pubspec.yaml b/covas_mobile/pubspec.yaml index 1651912..a8ac907 100644 --- a/covas_mobile/pubspec.yaml +++ b/covas_mobile/pubspec.yaml @@ -51,8 +51,6 @@ dependencies: url_launcher: ^6.3.1 mapbox_gl: ^0.16.0 google_mobile_ads: ^5.3.1 - google_sign_in: ^6.2.2 - flutter_facebook_auth: ^7.1.1 dev_dependencies: flutter_test: diff --git a/covas_mobile/windows/flutter/generated_plugin_registrant.cc b/covas_mobile/windows/flutter/generated_plugin_registrant.cc index 6e4a5a7..b2cbd25 100644 --- a/covas_mobile/windows/flutter/generated_plugin_registrant.cc +++ b/covas_mobile/windows/flutter/generated_plugin_registrant.cc @@ -7,7 +7,6 @@ #include "generated_plugin_registrant.h" #include -#include #include #include #include @@ -15,8 +14,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { FileSelectorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("FileSelectorWindows")); - FlutterSecureStorageWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); GeolocatorWindowsRegisterWithRegistrar( registry->GetRegistrarForPlugin("GeolocatorWindows")); PermissionHandlerWindowsPluginRegisterWithRegistrar( diff --git a/covas_mobile/windows/flutter/generated_plugins.cmake b/covas_mobile/windows/flutter/generated_plugins.cmake index aca1540..92c9a0d 100644 --- a/covas_mobile/windows/flutter/generated_plugins.cmake +++ b/covas_mobile/windows/flutter/generated_plugins.cmake @@ -4,7 +4,6 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_windows - flutter_secure_storage_windows geolocator_windows permission_handler_windows url_launcher_windows