Auto-sync: 20260315_180000

This commit is contained in:
Paolo 2026-03-15 18:00:01 +01:00
parent 917a532529
commit a7cde5deab
4 changed files with 113 additions and 62 deletions

BIN
.DS_Store vendored

Binary file not shown.

View file

@ -73,6 +73,12 @@
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "-FIRDebugEnabled"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Profile" buildConfiguration = "Profile"

View file

@ -43,8 +43,22 @@ class StorageService {
String get lastIp => _prefs.getString('last_ip') ?? 'Sconosciuto'; String get lastIp => _prefs.getString('last_ip') ?? 'Sconosciuto';
String get lastCity => _prefs.getString('last_city') ?? 'Sconosciuta'; String get lastCity => _prefs.getString('last_city') ?? 'Sconosciuta';
// --- METODI TEMA AGGIORNATI A STRINGHE --- // --- METODI TEMA AGGIORNATI CON GESTIONE MIGRAZIONE SICURA ---
String getTheme() => _prefs.getString('theme') ?? AppThemeType.doodle.toString(); String getTheme() {
final Object? savedTheme = _prefs.get('theme');
if (savedTheme is String) {
return savedTheme;
} else if (savedTheme is int) {
// Trovato un vecchio salvataggio in formato intero (causa del crash).
// Puliamo la memoria per evitare futuri problemi.
_prefs.remove('theme');
return AppThemeType.doodle.toString();
}
return AppThemeType.doodle.toString();
}
Future<void> saveTheme(String themeStr) async => await _prefs.setString('theme', themeStr); Future<void> saveTheme(String themeStr) async => await _prefs.setString('theme', themeStr);
int get savedRadius => _prefs.getInt('radius') ?? 2; int get savedRadius => _prefs.getInt('radius') ?? 2;

View file

@ -2,6 +2,7 @@
// FILE: lib/ui/settings/settings_screen.dart // FILE: lib/ui/settings/settings_screen.dart
// =========================================================================== // ===========================================================================
import 'dart:ui'; // <--- IMPORTANTE: Aggiunto per ImageFilter.blur
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../core/theme_manager.dart'; import '../../core/theme_manager.dart';
@ -33,15 +34,37 @@ class _SettingsScreenState extends State<SettingsScreen> {
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 80 * vScale, toolbarHeight: 80 * vScale,
title: Text( title: Container(
"SELEZIONA TEMA", padding: EdgeInsets.symmetric(horizontal: 24 * vScale, vertical: 10 * vScale),
style: getSharedTextStyle(themeType, TextStyle( decoration: BoxDecoration(
fontWeight: FontWeight.w900, gradient: LinearGradient(
color: Colors.white, begin: Alignment.topLeft,
letterSpacing: 2.0, end: Alignment.bottomRight,
fontSize: 20 * vScale, colors: [
shadows: [Shadow(color: Colors.black.withOpacity(0.8), blurRadius: 5, offset: const Offset(2, 2))] Colors.white.withOpacity(0.3),
)) Colors.white.withOpacity(0.05),
],
),
borderRadius: BorderRadius.circular(15),
border: Border.all(color: Colors.white.withOpacity(0.5), width: 1.5),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.2),
blurRadius: 10,
offset: const Offset(0, 4),
)
],
),
child: Text(
"SELEZIONA TEMA",
style: getSharedTextStyle(themeType, TextStyle(
fontWeight: FontWeight.w900,
color: Colors.white,
letterSpacing: 2.0,
fontSize: 20 * vScale,
shadows: [Shadow(color: Colors.black.withOpacity(0.8), blurRadius: 5, offset: const Offset(2, 2))]
))
),
), ),
centerTitle: true, centerTitle: true,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
@ -159,7 +182,6 @@ class _ThemeCard extends StatelessWidget {
if (type == AppThemeType.grimorio) bgImage = 'assets/images/grimorio.jpg'; if (type == AppThemeType.grimorio) bgImage = 'assets/images/grimorio.jpg';
Border border; Border border;
// OMBRA MARCATA PER DARE SPESSORE AL TASTO (Offset 0, 10)
List<BoxShadow> shadows = [ List<BoxShadow> shadows = [
BoxShadow(color: Colors.black.withOpacity(0.8), offset: const Offset(0, 10), blurRadius: 15) BoxShadow(color: Colors.black.withOpacity(0.8), offset: const Offset(0, 10), blurRadius: 15)
]; ];
@ -197,17 +219,16 @@ class _ThemeCard extends StatelessWidget {
}, },
child: AnimatedContainer( child: AnimatedContainer(
duration: const Duration(milliseconds: 300), duration: const Duration(milliseconds: 300),
height: 140 * vScale, // Leggermente più alto per ospitare la cornice del testo height: 140 * vScale,
padding: EdgeInsets.symmetric(horizontal: 20 * vScale, vertical: 15 * vScale), padding: EdgeInsets.symmetric(horizontal: 20 * vScale, vertical: 15 * vScale),
decoration: BoxDecoration( decoration: BoxDecoration(
color: isLocked ? Colors.black87 : previewColors.background, color: isLocked ? Colors.black87 : previewColors.background,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
border: border, border: border,
boxShadow: shadows, // L'ombra per lo spessore viene applicata qui boxShadow: shadows,
image: bgImage != null ? DecorationImage( image: bgImage != null ? DecorationImage(
image: AssetImage(bgImage!), image: AssetImage(bgImage!),
fit: BoxFit.cover, fit: BoxFit.cover,
// Scuriamo leggermente di più le card per far risaltare la targa chiara
colorFilter: type == AppThemeType.doodle colorFilter: type == AppThemeType.doodle
? ColorFilter.mode(Colors.white.withOpacity(isLocked ? 0.9 : 0.4), BlendMode.lighten) ? ColorFilter.mode(Colors.white.withOpacity(isLocked ? 0.9 : 0.4), BlendMode.lighten)
: ColorFilter.mode(Colors.black.withOpacity(isLocked ? 0.85 : 0.5), BlendMode.darken), : ColorFilter.mode(Colors.black.withOpacity(isLocked ? 0.85 : 0.5), BlendMode.darken),
@ -222,55 +243,65 @@ class _ThemeCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
// --- LA NUOVA CORNICE CHIARA PER IL TESTO --- // --- CORNICE EFFETTO VETRO (GLASSMORPHISM) ---
child: Container( child: ClipRRect(
padding: EdgeInsets.symmetric(horizontal: 15 * vScale, vertical: 10 * vScale), borderRadius: BorderRadius.circular(12),
decoration: BoxDecoration( child: BackdropFilter(
color: Colors.white.withOpacity(0.9), // Sfondo chiaro semitrasparente filter: ImageFilter.blur(sigmaX: 6.0, sigmaY: 6.0),
borderRadius: BorderRadius.circular(12), child: Container(
border: Border.all(color: Colors.white, width: 2), padding: EdgeInsets.symmetric(horizontal: 15 * vScale, vertical: 10 * vScale),
boxShadow: [ decoration: BoxDecoration(
BoxShadow(color: Colors.black.withOpacity(0.3), blurRadius: 8, offset: const Offset(2, 4)) gradient: LinearGradient(
] begin: Alignment.topLeft,
), end: Alignment.bottomRight,
child: Column( colors: [
crossAxisAlignment: CrossAxisAlignment.start, Colors.white.withOpacity(0.5), // Più visibile in alto a sx
mainAxisAlignment: MainAxisAlignment.center, Colors.white.withOpacity(0.1), // Quasi trasparente in basso a dx
mainAxisSize: MainAxisSize.min, ],
children: [
FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
title,
style: getSharedTextStyle(
type,
TextStyle(
fontSize: (type == AppThemeType.arcade ? 15 : 22) * vScale,
fontWeight: FontWeight.w900,
color: const Color(0xFF111122), // Testo scuro per contrastare lo sfondo chiaro
letterSpacing: type == AppThemeType.music ? 1.5 : 0.5,
)
)
), ),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.white.withOpacity(0.3), width: 1.5),
), ),
SizedBox(height: 4 * vScale), child: Column(
FittedBox( crossAxisAlignment: CrossAxisAlignment.start,
fit: BoxFit.scaleDown, mainAxisAlignment: MainAxisAlignment.center,
alignment: Alignment.centerLeft, mainAxisSize: MainAxisSize.min,
child: Text( children: [
subtitle, FittedBox(
style: getSharedTextStyle( fit: BoxFit.scaleDown,
type, alignment: Alignment.centerLeft,
TextStyle( child: Text(
fontSize: (type == AppThemeType.arcade ? 8 : 12) * vScale, title,
color: const Color(0xFF333344), // Grigio scuro per il sottotitolo style: getSharedTextStyle(
fontWeight: FontWeight.bold, type,
TextStyle(
fontSize: (type == AppThemeType.arcade ? 15 : 22) * vScale,
fontWeight: FontWeight.w900,
color: const Color(0xFF111122),
letterSpacing: type == AppThemeType.music ? 1.5 : 0.5,
)
) )
) ),
), ),
SizedBox(height: 4 * vScale),
FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
subtitle,
style: getSharedTextStyle(
type,
TextStyle(
fontSize: (type == AppThemeType.arcade ? 8 : 12) * vScale,
color: const Color(0xFF333344),
fontWeight: FontWeight.bold,
)
)
),
),
],
), ),
], ),
), ),
), ),
), ),
@ -280,7 +311,7 @@ class _ThemeCard extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: previewColors.playerRed, color: previewColors.playerRed,
shape: type == AppThemeType.arcade ? BoxShape.rectangle : BoxShape.circle, shape: type == AppThemeType.arcade ? BoxShape.rectangle : BoxShape.circle,
border: Border.all(color: Colors.white, width: 2), // Bordino bianco per far risaltare il colore border: Border.all(color: Colors.white, width: 2),
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.5), blurRadius: 5, offset: const Offset(1, 2))] boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.5), blurRadius: 5, offset: const Offset(1, 2))]
) )
), ),
@ -290,7 +321,7 @@ class _ThemeCard extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: previewColors.playerBlue, color: previewColors.playerBlue,
shape: type == AppThemeType.arcade ? BoxShape.rectangle : BoxShape.circle, shape: type == AppThemeType.arcade ? BoxShape.rectangle : BoxShape.circle,
border: Border.all(color: Colors.white, width: 2), // Bordino bianco per far risaltare il colore border: Border.all(color: Colors.white, width: 2),
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.5), blurRadius: 5, offset: const Offset(1, 2))] boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.5), blurRadius: 5, offset: const Offset(1, 2))]
) )
), ),