diff --git a/patient/android/gradle/wrapper/gradle-wrapper.properties b/patient/android/gradle/wrapper/gradle-wrapper.properties index 55d061f..901b973 100644 --- a/patient/android/gradle/wrapper/gradle-wrapper.properties +++ b/patient/android/gradle/wrapper/gradle-wrapper.properties @@ -2,6 +2,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/patient/android/settings.gradle b/patient/android/settings.gradle index a42444d..4f52071 100644 --- a/patient/android/settings.gradle +++ b/patient/android/settings.gradle @@ -18,8 +18,8 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.2.1" apply false - id "org.jetbrains.kotlin.android" version "1.8.22" apply false + id "com.android.application" version "8.6.0" apply false + id "org.jetbrains.kotlin.android" version "2.1.0" apply false } include ":app" diff --git a/patient/lib/provider/auth_provider.dart b/patient/lib/provider/auth_provider.dart index 1a81a84..31a54e0 100644 --- a/patient/lib/provider/auth_provider.dart +++ b/patient/lib/provider/auth_provider.dart @@ -83,7 +83,7 @@ class AuthProvider extends ChangeNotifier { Future _handleWebSignIn() async { final supabaseUrl = dotenv.env['SUPABASE_URL'] ?? - (throw Exception("Supabase URL not found in .env")); + (throw Exception("Supabase URL not found in .env")); await supabase.auth.signInWithOAuth( OAuthProvider.google, @@ -93,29 +93,44 @@ class AuthProvider extends ChangeNotifier { } Future _handleMobileSignIn() async { - final webClientId = dotenv.env['GOOGLE_WEB_CLIENT_ID'] ?? - (throw Exception("WEB_CLIENT_ID not found in .env")); + final webClientId = dotenv.env['GOOGLE_WEB_CLIENT_ID'] ?? + (throw Exception("WEB_CLIENT_ID not found in .env")); final iosClientId = dotenv.env['GOOGLE_IOS_CLIENT_ID']; - - final GoogleSignIn googleSignIn = GoogleSignIn( + + // Get the singleton instance. + final GoogleSignIn googleSignIn = GoogleSignIn.instance; + + // Initialize the GoogleSignIn instance. + await googleSignIn.initialize( clientId: Platform.isIOS ? iosClientId : null, serverClientId: webClientId, - scopes: ['email', 'profile'], ); - final GoogleSignInAccount? googleUser = await googleSignIn.signIn(); - if (googleUser == null) throw 'Sign in cancelled'; + // Define scopes (they were moved from the constructor/initialize to the sign-in call). + const List scopes = ['email', 'profile']; - final GoogleSignInAuthentication googleAuth = - await googleUser.authentication; + // Sign-in logic + final GoogleSignInAccount? googleUser = await googleSignIn.authenticate( + scopeHint: scopes, + ); + if (googleUser == null) throw 'Sign in cancelled'; - if (googleAuth.idToken == null) throw 'No ID Token found'; - if (googleAuth.accessToken == null) throw 'No Access Token found'; + // Authorization to get access token + final authorization = await googleUser.authorizationClient.authorizeScopes( + scopes + ); + final String accessToken = authorization.accessToken; + // Authentication (It now synchronous as per v7.0+). + final GoogleSignInAuthentication googleAuth = googleUser.authentication; + final String? idToken = googleAuth.idToken; + if (idToken == null) throw 'No ID Token found'; + + // Supabase login (now with the retrieved accessToken) await supabase.auth.signInWithIdToken( provider: OAuthProvider.google, - idToken: googleAuth.idToken!, - accessToken: googleAuth.accessToken, + idToken: idToken, + accessToken: accessToken, ); } diff --git a/patient/pubspec.yaml b/patient/pubspec.yaml index 21998fa..50a7d51 100644 --- a/patient/pubspec.yaml +++ b/patient/pubspec.yaml @@ -57,9 +57,9 @@ dependencies: cupertino_icons: ^1.0.6 google_fonts: ^6.1.0 flutter_native_splash: ^2.3.6 - google_sign_in: ^6.1.6 - carousel_slider: ^4.0.0 - flutter_dotenv: ^5.2.1 + google_sign_in: ^7.2.0 + carousel_slider: ^5.1.1 + flutter_dotenv: ^6.0.0 # For information on the generic Dart part of this file, see the @@ -71,10 +71,10 @@ dependencies: intl: ^0.20.2 flutter_svg: ^2.0.17 vector_graphics: ^1.1.18 - dotted_border: ^2.1.0 + dotted_border: ^3.1.0 uuid: ^4.5.1 flutter_gemini: ^3.0.0 - get_it: ^8.2.0 + get_it: ^9.0.5 rxdart: ^0.28.0 dev_dependencies: @@ -82,7 +82,7 @@ dev_dependencies: sdk: flutter build_runner: ^2.4.15 dart_mappable_builder: ^4.4.0 - flutter_lints: ^3.0.0 + flutter_lints: ^6.0.0 flutter_gen_runner: # The following line ensures that the Material Icons font is diff --git a/therapist/android/gradle/wrapper/gradle-wrapper.properties b/therapist/android/gradle/wrapper/gradle-wrapper.properties index ec915a8..3c85cfe 100644 --- a/therapist/android/gradle/wrapper/gradle-wrapper.properties +++ b/therapist/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip diff --git a/therapist/lib/presentation/therapy_goals/widgets/therapy_dotted_empty_container.dart b/therapist/lib/presentation/therapy_goals/widgets/therapy_dotted_empty_container.dart index 749d867..0b51d67 100644 --- a/therapist/lib/presentation/therapy_goals/widgets/therapy_dotted_empty_container.dart +++ b/therapist/lib/presentation/therapy_goals/widgets/therapy_dotted_empty_container.dart @@ -36,8 +36,11 @@ class TherapyDottedEmptyContainer extends StatelessWidget { return GestureDetector( onTap: () => _addFromExistingTherapyDetails(context), child: DottedBorder( - color: const Color(0xffC5C3C3), - radius: const Radius.circular(16), + options: RoundedRectDottedBorderOptions( + // color and radius now go inside options + radius: const Radius.circular(16), + color: const Color(0xffC5C3C3), + ), child: Container( alignment: Alignment.center, width: double.infinity, diff --git a/therapist/lib/repository/supabase_auth_repository.dart b/therapist/lib/repository/supabase_auth_repository.dart index 727c318..bc79a10 100644 --- a/therapist/lib/repository/supabase_auth_repository.dart +++ b/therapist/lib/repository/supabase_auth_repository.dart @@ -74,29 +74,44 @@ class SupabaseAuthRepository implements AuthRepository { } Future _handleMobileSignIn() async { - final webClientId = dotenv.env['GOOGLE_WEB_CLIENT_ID'] ?? - (throw Exception("WEB_CLIENT_ID not found in .env")); + final webClientId = dotenv.env['GOOGLE_WEB_CLIENT_ID'] ?? + (throw Exception("WEB_CLIENT_ID not found in .env")); final iosClientId = dotenv.env['GOOGLE_IOS_CLIENT_ID']; - - final GoogleSignIn googleSignIn = GoogleSignIn( + + // Get the singleton instance. + final GoogleSignIn googleSignIn = GoogleSignIn.instance; + + // Initialize the GoogleSignIn instance. + await googleSignIn.initialize( clientId: Platform.isIOS ? iosClientId : null, serverClientId: webClientId, - scopes: ['email', 'profile'], ); - final GoogleSignInAccount? googleUser = await googleSignIn.signIn(); + // Define scopes (they were moved from the constructor/initialize to the sign-in call). + const List scopes = ['email', 'profile']; + + // Sign-in logic + final GoogleSignInAccount? googleUser = await googleSignIn.authenticate( + scopeHint: scopes, + ); if (googleUser == null) throw 'Sign in cancelled'; - final GoogleSignInAuthentication googleAuth = - await googleUser.authentication; + // Authorization to get access token + final authorization = await googleUser.authorizationClient.authorizeScopes( + scopes + ); + final String accessToken = authorization.accessToken; - if (googleAuth.idToken == null) throw 'No ID Token found'; - if (googleAuth.accessToken == null) throw 'No Access Token found'; + // Authentication (It now synchronous as per v7.0+). + final GoogleSignInAuthentication googleAuth = googleUser.authentication; + final String? idToken = googleAuth.idToken; + if (idToken == null) throw 'No ID Token found'; + // Supabase login (now with the retrieved accessToken) await _supabaseClient.auth.signInWithIdToken( provider: OAuthProvider.google, - idToken: googleAuth.idToken!, - accessToken: googleAuth.accessToken, + idToken: idToken, + accessToken: accessToken, ); } diff --git a/therapist/pubspec.yaml b/therapist/pubspec.yaml index 99d06ea..2c35525 100644 --- a/therapist/pubspec.yaml +++ b/therapist/pubspec.yaml @@ -30,7 +30,7 @@ environment: dependencies: flutter: sdk: flutter - easy_date_timeline: ^1.0.4 + easy_date_timeline: ^2.0.9 # State Management provider: ^6.1.2 @@ -42,25 +42,25 @@ dependencies: dart_mappable: ^4.4.0 google_fonts: ^6.1.0 flutter_native_splash: ^2.3.6 - google_sign_in: ^6.1.6 + google_sign_in: ^7.2.0 flutter_svg: ^2.0.9 smooth_page_indicator: ^1.1.0 # intl - intl: ^0.19.0 + intl: ^0.20.2 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.6 - flutter_dotenv: ^5.2.1 - dotted_border: ^2.1.0 + flutter_dotenv: ^6.0.0 + dotted_border: ^3.1.0 uuid: ^4.5.1 flutter_gemini: ^3.0.0 - get_it: ^8.2.0 + get_it: ^9.0.5 # Voice features - speech_to_text: ^6.6.0 - flutter_tts: ^3.8.5 + speech_to_text: ^7.3.0 + flutter_tts: ^4.2.3 dev_dependencies: flutter_test: @@ -73,7 +73,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^3.0.0 + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec