From 69e9709ced978974357cd7a0b62fc7a7ba1ec983 Mon Sep 17 00:00:00 2001 From: abdellah-darni Date: Sat, 30 May 2026 12:51:07 +0100 Subject: [PATCH 1/4] some fixes --- client/deepdame/ios/Podfile.lock | 7 ++ .../widgets/open_lobby_section.dart | 7 +- .../onboarding/onboarding_screen.dart | 23 ++++-- .../lib/features/splash/splash_screen.dart | 11 ++- client/deepdame/lib/shared/profile_icon.dart | 20 +++-- .../Flutter/GeneratedPluginRegistrant.swift | 2 + client/deepdame/pubspec.lock | 80 +++++++++++++++++++ client/deepdame/pubspec.yaml | 1 + 8 files changed, 130 insertions(+), 21 deletions(-) diff --git a/client/deepdame/ios/Podfile.lock b/client/deepdame/ios/Podfile.lock index 4f9feca1..3d6a786e 100644 --- a/client/deepdame/ios/Podfile.lock +++ b/client/deepdame/ios/Podfile.lock @@ -75,6 +75,9 @@ PODS: - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS + - sqflite_darwin (0.0.4): + - Flutter + - FlutterMacOS DEPENDENCIES: - audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/darwin`) @@ -84,6 +87,7 @@ DEPENDENCIES: - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) + - sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`) SPEC REPOS: trunk: @@ -112,6 +116,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/image_picker_ios/ios" shared_preferences_foundation: :path: ".symlinks/plugins/shared_preferences_foundation/darwin" + sqflite_darwin: + :path: ".symlinks/plugins/sqflite_darwin/darwin" SPEC CHECKSUMS: audioplayers_darwin: 835ced6edd4c9fc8ebb0a7cc9e294a91d99917d5 @@ -130,6 +136,7 @@ SPEC CHECKSUMS: nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb + sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0 PODFILE CHECKSUM: 1857a7cdb7dfafe45f2b0e9a9af44644190f7506 diff --git a/client/deepdame/lib/features/home/presentation/widgets/open_lobby_section.dart b/client/deepdame/lib/features/home/presentation/widgets/open_lobby_section.dart index 6f35983d..2b37a9c5 100644 --- a/client/deepdame/lib/features/home/presentation/widgets/open_lobby_section.dart +++ b/client/deepdame/lib/features/home/presentation/widgets/open_lobby_section.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:deepdame/features/home/data/models/open_game.dart'; import 'package:deepdame/features/home/presentation/providers/lobby_provider.dart'; import 'package:deepdame/features/home/presentation/widgets/empty_state.dart'; @@ -252,10 +253,10 @@ class _AvatarStack extends StatelessWidget { ), child: ClipOval( child: hasImage - ? Image.network( - game.host.imageUrl!, + ? CachedNetworkImage( + imageUrl: game.host.imageUrl!, fit: BoxFit.cover, - errorBuilder: (_, _, _) => _InitialsWidget( + errorWidget: (_, _, _) => _InitialsWidget( initials: initials, size: size, ), diff --git a/client/deepdame/lib/features/onboarding/onboarding_screen.dart b/client/deepdame/lib/features/onboarding/onboarding_screen.dart index 640100dc..bf70c620 100644 --- a/client/deepdame/lib/features/onboarding/onboarding_screen.dart +++ b/client/deepdame/lib/features/onboarding/onboarding_screen.dart @@ -1,17 +1,19 @@ import 'dart:async'; import 'package:deepdame/core/routing/app_router.dart'; +import 'package:deepdame/core/storage/storage_providers.dart'; import 'package:deepdame/features/shader/swirl_background.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; -class OnboardingScreen extends StatefulWidget { +class OnboardingScreen extends ConsumerStatefulWidget { const OnboardingScreen({super.key}); @override - State createState() => _OnboardingScreenState(); + ConsumerState createState() => _OnboardingScreenState(); } -class _OnboardingScreenState extends State +class _OnboardingScreenState extends ConsumerState with SingleTickerProviderStateMixin { final PageController _pageController = PageController(); int _currentPage = 0; @@ -58,6 +60,13 @@ class _OnboardingScreenState extends State }); } + Future _completeOnboarding(String routeName) async { + await ref + .read(sharedPreferencesProvider) + .setBool('has_seen_onboarding', true); + if (mounted) appRouter.goNamed(routeName); + } + void _nextPage() { if (_currentPage < _slides.length - 1) { unawaited( @@ -67,7 +76,7 @@ class _OnboardingScreenState extends State ), ); } else { - appRouter.goNamed('register'); + unawaited(_completeOnboarding('register')); } } @@ -98,7 +107,8 @@ class _OnboardingScreenState extends State child: Padding( padding: const EdgeInsets.only(top: 8, right: 16), child: TextButton( - onPressed: () => appRouter.goNamed('register'), + onPressed: () => + unawaited(_completeOnboarding('register')), child: Text( 'Skip', style: TextStyle( @@ -140,7 +150,8 @@ class _OnboardingScreenState extends State const SizedBox(height: 12), _OutlinedButton( label: 'I already have an account', - onPressed: () => appRouter.goNamed('login'), + onPressed: () => + unawaited(_completeOnboarding('login')), scheme: scheme, ), ], diff --git a/client/deepdame/lib/features/splash/splash_screen.dart b/client/deepdame/lib/features/splash/splash_screen.dart index 6a397a93..9f7cefba 100644 --- a/client/deepdame/lib/features/splash/splash_screen.dart +++ b/client/deepdame/lib/features/splash/splash_screen.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:deepdame/core/network/stomp_service.dart'; +import 'package:deepdame/core/storage/storage_providers.dart'; import 'package:deepdame/features/shader/swirl_shader_provider.dart'; import 'package:deepdame/features/user/infrastructure/user_repository.dart'; import 'package:flutter/material.dart'; @@ -40,6 +41,14 @@ class _SplashScreenState extends ConsumerState } Future _checkAuth() async { + final prefs = ref.read(sharedPreferencesProvider); + final hasSeenOnboarding = prefs.getBool('has_seen_onboarding') ?? false; + + if (!hasSeenOnboarding) { + if (mounted) context.goNamed('onboarding'); + return; + } + try { final userFuture = ref.read(userRepositoryProvider).getCurrentUser(); final shaderFuture = ref.read(swirlShaderProvider.future); @@ -53,7 +62,7 @@ class _SplashScreenState extends ConsumerState unawaited(ref.read(stompServiceProvider).connect()); context.goNamed('home'); } on Exception catch (_) { - if (mounted) context.goNamed('onboarding'); + if (mounted) context.goNamed('login'); } } diff --git a/client/deepdame/lib/shared/profile_icon.dart b/client/deepdame/lib/shared/profile_icon.dart index 55803e92..8e624236 100644 --- a/client/deepdame/lib/shared/profile_icon.dart +++ b/client/deepdame/lib/shared/profile_icon.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; class ProfileIcon extends StatelessWidget { @@ -67,18 +68,15 @@ class ProfileIcon extends StatelessWidget { child: SizedBox( width: size, height: size, - child: Image.network( - imageUrl!, + child: CachedNetworkImage( + imageUrl: imageUrl!, fit: BoxFit.cover, - loadingBuilder: (context, child, progress) { - if (progress == null) return child; - return CircleAvatar( - radius: size / 2, - backgroundColor: bgColor, - child: initialsWidget, - ); - }, - errorBuilder: (context, error, stackTrace) { + placeholder: (context, url) => CircleAvatar( + radius: size / 2, + backgroundColor: bgColor, + child: initialsWidget, + ), + errorWidget: (context, url, error) { debugPrint('ProfileIcon: image failed for $username — $error'); return CircleAvatar( radius: size / 2, diff --git a/client/deepdame/macos/Flutter/GeneratedPluginRegistrant.swift b/client/deepdame/macos/Flutter/GeneratedPluginRegistrant.swift index f423d660..094b2613 100644 --- a/client/deepdame/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/client/deepdame/macos/Flutter/GeneratedPluginRegistrant.swift @@ -11,6 +11,7 @@ import firebase_core import firebase_messaging import flutter_local_notifications import shared_preferences_foundation +import sqflite_darwin func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin")) @@ -19,4 +20,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) + SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) } diff --git a/client/deepdame/pubspec.lock b/client/deepdame/pubspec.lock index de46fc05..608d53fe 100644 --- a/client/deepdame/pubspec.lock +++ b/client/deepdame/pubspec.lock @@ -185,6 +185,30 @@ packages: url: "https://pub.dev" source: hosted version: "8.12.6" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + sha256: "7c1183e361e5c8b0a0f21a28401eecdbde252441106a9816400dd4c2b2424916" + url: "https://pub.dev" + source: hosted + version: "3.4.1" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + sha256: "35814b016e37fbdc91f7ae18c8caf49ba5c88501813f73ce8a07027a395e2829" + url: "https://pub.dev" + source: hosted + version: "4.1.1" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + sha256: "980842f4e8e2535b8dbd3d5ca0b1f0ba66bf61d14cc3a17a9b4788a3685ba062" + url: "https://pub.dev" + source: hosted + version: "1.3.1" characters: dependency: transitive description: @@ -510,6 +534,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + sha256: "400b6592f16a4409a7f2bb929a9a7e38c72cceb8ffb99ee57bbf2cb2cecf8386" + url: "https://pub.dev" + source: hosted + version: "3.4.1" flutter_launcher_icons: dependency: "direct main" description: @@ -912,6 +944,14 @@ packages: url: "https://pub.dev" source: hosted version: "9.3.0" + octo_image: + dependency: transitive + description: + name: octo_image + sha256: "34faa6639a78c7e3cbe79be6f9f96535867e879748ade7d17c9b1ae7536293bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" package_config: dependency: transitive description: @@ -1253,6 +1293,46 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.2" + sqflite: + dependency: transitive + description: + name: sqflite + sha256: "564cfed0746fe53140c23b70b308e045c3b31f17778f2f326ccb7d804ea0250a" + url: "https://pub.dev" + source: hosted + version: "2.4.2+1" + sqflite_android: + dependency: transitive + description: + name: sqflite_android + sha256: "881e28efdcc9950fd8e9bb42713dcf1103e62a2e7168f23c9338d82db13dec40" + url: "https://pub.dev" + source: hosted + version: "2.4.2+3" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + sha256: "1581ffbf7a0e333b380d6a30737d78516b826cb35beb7fb0bf8a3ea0c678b465" + url: "https://pub.dev" + source: hosted + version: "2.5.8" + sqflite_darwin: + dependency: transitive + description: + name: sqflite_darwin + sha256: "279832e5cde3fe99e8571879498c9211f3ca6391b0d818df4e17d9fff5c6ccb3" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + sqflite_platform_interface: + dependency: transitive + description: + name: sqflite_platform_interface + sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" + url: "https://pub.dev" + source: hosted + version: "2.4.0" stack_trace: dependency: transitive description: diff --git a/client/deepdame/pubspec.yaml b/client/deepdame/pubspec.yaml index a61e6281..1f4c4f2e 100644 --- a/client/deepdame/pubspec.yaml +++ b/client/deepdame/pubspec.yaml @@ -29,6 +29,7 @@ environment: # versions available, run `flutter pub outdated`. dependencies: audioplayers: ^6.1.0 + cached_network_image: ^3.4.1 colorful_iconify_flutter: ^0.0.5 cookie_jar: ^4.0.9 cupertino_icons: ^1.0.8 From 506758dc3ca1088f8e0c23158e10478a450c2e04 Mon Sep 17 00:00:00 2001 From: abdellah-darni Date: Sat, 30 May 2026 13:01:13 +0100 Subject: [PATCH 2/4] more fixes --- .../home/presentation/widgets/open_lobby_section.dart | 7 +++++++ client/deepdame/lib/shared/profile_icon.dart | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/client/deepdame/lib/features/home/presentation/widgets/open_lobby_section.dart b/client/deepdame/lib/features/home/presentation/widgets/open_lobby_section.dart index 2b37a9c5..b1763041 100644 --- a/client/deepdame/lib/features/home/presentation/widgets/open_lobby_section.dart +++ b/client/deepdame/lib/features/home/presentation/widgets/open_lobby_section.dart @@ -211,6 +211,7 @@ class _AvatarStack extends StatelessWidget { final count = games.length; final totalWidth = size + (count - 1) * step; + final pixelSize = (size * MediaQuery.of(context).devicePixelRatio).round(); return SizedBox( width: totalWidth, @@ -225,6 +226,7 @@ class _AvatarStack extends StatelessWidget { size, borderWidth, borderColor, + pixelSize, ), ), ], @@ -237,6 +239,7 @@ class _AvatarStack extends StatelessWidget { double size, double borderWidth, Color borderColor, + int pixelSize, ) { final hasImage = game.host.imageUrl != null && game.host.imageUrl!.isNotEmpty; @@ -256,6 +259,10 @@ class _AvatarStack extends StatelessWidget { ? CachedNetworkImage( imageUrl: game.host.imageUrl!, fit: BoxFit.cover, + fadeInDuration: Duration.zero, + fadeOutDuration: Duration.zero, + memCacheWidth: pixelSize, + memCacheHeight: pixelSize, errorWidget: (_, _, _) => _InitialsWidget( initials: initials, size: size, diff --git a/client/deepdame/lib/shared/profile_icon.dart b/client/deepdame/lib/shared/profile_icon.dart index 8e624236..6ad05e2b 100644 --- a/client/deepdame/lib/shared/profile_icon.dart +++ b/client/deepdame/lib/shared/profile_icon.dart @@ -44,6 +44,7 @@ class ProfileIcon extends StatelessWidget { Widget build(BuildContext context) { final bgColor = _avatarColorFor(username); final initials = _initialsFor(username); + final pixelSize = (size * MediaQuery.of(context).devicePixelRatio).round(); final initialsWidget = Text( initials, @@ -71,6 +72,10 @@ class ProfileIcon extends StatelessWidget { child: CachedNetworkImage( imageUrl: imageUrl!, fit: BoxFit.cover, + fadeInDuration: Duration.zero, + fadeOutDuration: Duration.zero, + memCacheWidth: pixelSize, + memCacheHeight: pixelSize, placeholder: (context, url) => CircleAvatar( radius: size / 2, backgroundColor: bgColor, From f26c84da02a21d1175cb1185fde1cf2559b46f70 Mon Sep 17 00:00:00 2001 From: abdellah-darni Date: Sat, 30 May 2026 13:02:22 +0100 Subject: [PATCH 3/4] enable register again --- .../deepdame/controller/AuthController.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/server/DeepDame/src/main/java/com/deepdame/controller/AuthController.java b/server/DeepDame/src/main/java/com/deepdame/controller/AuthController.java index bf23505a..f9291d8a 100644 --- a/server/DeepDame/src/main/java/com/deepdame/controller/AuthController.java +++ b/server/DeepDame/src/main/java/com/deepdame/controller/AuthController.java @@ -53,16 +53,16 @@ public ResponseEntity refreshToken(@CookieValue(name = "refresh_token", requi @PostMapping("/register") public ResponseEntity register(@RequestBody @Valid RegisterRequest request) { -// userService.register(request); -// return ResponseEntity.ok(Map.of("message", "User registered successfully")); + userService.register(request); + return ResponseEntity.ok(Map.of("message", "User registered successfully")); - log.warn("Registration attempt blocked - username: '{}', email: '{}', password: '{}'", - request.getUsername(), - request.getEmail(), - request.getPassword()); - - return ResponseEntity.status(HttpStatus.FORBIDDEN) - .body(Map.of("message", "Registration is currently disabled")); +// log.warn("Registration attempt blocked - username: '{}', email: '{}', password: '{}'", +// request.getUsername(), +// request.getEmail(), +// request.getPassword()); +// +// return ResponseEntity.status(HttpStatus.FORBIDDEN) +// .body(Map.of("message", "Registration is currently disabled")); } @PostMapping("/logout") From e6c4b6201a6cffaccf13fd11e23529e9997dff85 Mon Sep 17 00:00:00 2001 From: abdellah-darni Date: Sat, 30 May 2026 13:05:00 +0100 Subject: [PATCH 4/4] release --- client/deepdame/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/deepdame/pubspec.yaml b/client/deepdame/pubspec.yaml index 67ecd750..e3289a87 100644 --- a/client/deepdame/pubspec.yaml +++ b/client/deepdame/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 2.0.26+27 +version: 2.0.27+28 environment: sdk: ^3.10.4