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,7 +34,28 @@ class _SettingsScreenState extends State<SettingsScreen> {
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: AppBar( appBar: AppBar(
toolbarHeight: 80 * vScale, toolbarHeight: 80 * vScale,
title: Text( title: Container(
padding: EdgeInsets.symmetric(horizontal: 24 * vScale, vertical: 10 * vScale),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
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", "SELEZIONA TEMA",
style: getSharedTextStyle(themeType, TextStyle( style: getSharedTextStyle(themeType, TextStyle(
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
@ -43,6 +65,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
shadows: [Shadow(color: Colors.black.withOpacity(0.8), blurRadius: 5, offset: const Offset(2, 2))] 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,
elevation: 0, elevation: 0,
@ -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,16 +243,24 @@ 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: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 6.0, sigmaY: 6.0),
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 15 * vScale, vertical: 10 * vScale), padding: EdgeInsets.symmetric(horizontal: 15 * vScale, vertical: 10 * vScale),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white.withOpacity(0.9), // Sfondo chiaro semitrasparente gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Colors.white.withOpacity(0.5), // Più visibile in alto a sx
Colors.white.withOpacity(0.1), // Quasi trasparente in basso a dx
],
),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.white, width: 2), border: Border.all(color: Colors.white.withOpacity(0.3), width: 1.5),
boxShadow: [
BoxShadow(color: Colors.black.withOpacity(0.3), blurRadius: 8, offset: const Offset(2, 4))
]
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -248,7 +277,7 @@ class _ThemeCard extends StatelessWidget {
TextStyle( TextStyle(
fontSize: (type == AppThemeType.arcade ? 15 : 22) * vScale, fontSize: (type == AppThemeType.arcade ? 15 : 22) * vScale,
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
color: const Color(0xFF111122), // Testo scuro per contrastare lo sfondo chiaro color: const Color(0xFF111122),
letterSpacing: type == AppThemeType.music ? 1.5 : 0.5, letterSpacing: type == AppThemeType.music ? 1.5 : 0.5,
) )
) )
@ -264,7 +293,7 @@ class _ThemeCard extends StatelessWidget {
type, type,
TextStyle( TextStyle(
fontSize: (type == AppThemeType.arcade ? 8 : 12) * vScale, fontSize: (type == AppThemeType.arcade ? 8 : 12) * vScale,
color: const Color(0xFF333344), // Grigio scuro per il sottotitolo color: const Color(0xFF333344),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
) )
) )
@ -274,13 +303,15 @@ class _ThemeCard extends StatelessWidget {
), ),
), ),
), ),
),
),
SizedBox(width: 15 * vScale), SizedBox(width: 15 * vScale),
Container( Container(
width: 28 * vScale, height: 28 * vScale, width: 28 * vScale, height: 28 * vScale,
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))]
) )
), ),