diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index fb709ee..f409c8f 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -11,7 +11,7 @@ plugins { android { namespace = "dev.solsynth.solian" compileSdk = flutter.compileSdkVersion - ndkVersion = "27.0.12077973" + ndkVersion = "29.0.13113456" compileOptions { sourceCompatibility = JavaVersion.VERSION_17 diff --git a/android/app/src/main/kotlin/com/example/island/MainActivity.kt b/android/app/src/main/kotlin/com/example/island/MainActivity.kt deleted file mode 100644 index 4e87962..0000000 --- a/android/app/src/main/kotlin/com/example/island/MainActivity.kt +++ /dev/null @@ -1,5 +0,0 @@ -package dev.solsynth.solian - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity : FlutterActivity() diff --git a/android/app/src/main/kotlin/com/example/solian/MainActivity.kt b/android/app/src/main/kotlin/com/example/solian/MainActivity.kt new file mode 100644 index 0000000..ad7dbfd --- /dev/null +++ b/android/app/src/main/kotlin/com/example/solian/MainActivity.kt @@ -0,0 +1,14 @@ +package dev.solsynth.solian + +import io.flutter.embedding.android.FlutterActivity +import io.flutter.embedding.engine.FlutterEngine +import io.flutter.plugins.sharedpreferences.LegacySharedPreferencesPlugin + +class MainActivity : FlutterActivity() +{ + override fun configureFlutterEngine(flutterEngine: FlutterEngine) { + super.configureFlutterEngine(flutterEngine) + // https://github.com/flutter/flutter/issues/153075#issuecomment-2693189362 + flutterEngine.plugins.add(LegacySharedPreferencesPlugin()) + } +} diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index afa1e8e..efdcc4a 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/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.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index 9e2d35c..6f49e92 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -18,7 +18,7 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.7.0" apply false + id("com.android.application") version "8.10.1" apply false // START: FlutterFire Configuration id("com.google.gms.google-services") version("4.3.15") apply false // END: FlutterFire Configuration diff --git a/assets/i18n/en-US.json b/assets/i18n/en-US.json index 5dcab48..5cc23d4 100644 --- a/assets/i18n/en-US.json +++ b/assets/i18n/en-US.json @@ -308,5 +308,7 @@ "accountDataExportRequested": "Data export requested. You'll receive an email when it's ready.", "accountDeletionDescription": "Permanently delete your account and all your data", "accountSettingsHelp": "Account Settings Help", - "accountSettingsHelpContent": "This page allows you to manage your account security, privacy, and other settings. If you need assistance, please contact support." + "accountSettingsHelpContent": "This page allows you to manage your account security, privacy, and other settings. If you need assistance, please contact support.", + "unauthorized": "Unauthorized", + "unauthorizedHint": "You're not signed in or session expired, please sign in again." } diff --git a/lib/widgets/response.dart b/lib/widgets/response.dart index 9790e2b..2c86afa 100644 --- a/lib/widgets/response.dart +++ b/lib/widgets/response.dart @@ -1,3 +1,4 @@ +import 'package:dio/dio.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:gap/gap.dart'; @@ -7,11 +8,8 @@ import 'package:styled_widget/styled_widget.dart'; class ResponseErrorWidget extends StatelessWidget { final dynamic error; final VoidCallback onRetry; - const ResponseErrorWidget({ - super.key, - required this.error, - required this.onRetry, - }); + + const ResponseErrorWidget({super.key, required this.error, required this.onRetry}); @override Widget build(BuildContext context) { @@ -20,14 +18,33 @@ class ResponseErrorWidget extends StatelessWidget { children: [ const Icon(Symbols.error_outline, size: 48), const Gap(4), - ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 320), - child: Text( - error.toString(), - textAlign: TextAlign.center, - style: const TextStyle(color: Color(0xFF757575)), - ), - ).center(), + if (error is DioException && error.response?.statusCode == 401) + ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 320), + child: Column( + children: [ + Text( + 'unauthorized'.tr(), + textAlign: TextAlign.center, + style: const TextStyle(color: Color(0xFF757575)), + ).bold(), + Text( + 'unauthorizedHint'.tr(), + textAlign: TextAlign.center, + style: const TextStyle(color: Color(0xFF757575)), + ), + ], + ), + ).center() + else + ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 320), + child: Text( + error.toString(), + textAlign: TextAlign.center, + style: const TextStyle(color: Color(0xFF757575)), + ), + ).center(), const Gap(8), TextButton(onPressed: onRetry, child: const Text('retry').tr()), ], diff --git a/pubspec.lock b/pubspec.lock index f60d709..e4f63cd 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -77,10 +77,10 @@ packages: dependency: "direct main" description: name: auto_route - sha256: eae18fcd3e3762eb6074a3560c0f411d1e36bd9f8d3eed9c15ed1c577e8d1815 + sha256: b8c036fa613a98a759cf0fdcba26e62f4985dcbff01a5e760ab411e8554bbaf0 url: "https://pub.dev" source: hosted - version: "10.1.0" + version: "10.1.0+1" auto_route_generator: dependency: "direct dev" description: @@ -205,10 +205,10 @@ packages: dependency: transitive description: name: built_value - sha256: ea90e81dc4a25a043d9bee692d20ed6d1c4a1662a28c03a96417446c093ed6b4 + sha256: "082001b5c3dc495d4a42f1d5789990505df20d8547d42507c29050af6933ee27" url: "https://pub.dev" source: hosted - version: "8.9.5" + version: "8.10.1" cached_network_image: dependency: "direct main" description: @@ -589,10 +589,10 @@ packages: dependency: transitive description: name: file_selector_macos - sha256: "271ab9986df0c135d45c3cdb6bd0faa5db6f4976d3e4b437cf7d0f258d941bfc" + sha256: "8c9250b2bd2d8d4268e39c82543bacbaca0fda7d29e0728c3c4bbb7c820fd711" url: "https://pub.dev" source: hosted - version: "0.9.4+2" + version: "0.9.4+3" file_selector_platform_interface: dependency: transitive description: