a
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
|
||||
// Classe privata per gestire i percorsi in modo ordinato
|
||||
class _FluxSvgPaths {
|
||||
class _FluxLogoPaths {
|
||||
// Nota: Usa l'estensione .svg
|
||||
static const String logoLight = 'assets/svg/flux_logo_light.svg';
|
||||
static const String logoDark = 'assets/svg/flux_logo_dark.svg';
|
||||
static const String logoLight = 'assets/images/flux_logo_light.png';
|
||||
static const String logoDark = 'assets/images/flux_logo_dark.png';
|
||||
}
|
||||
|
||||
/// Widget base generico per il logo FLUX in formato SVG.
|
||||
@@ -20,18 +19,13 @@ class _FluxLogoBase extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// Usiamo SvgPicture.asset per gli SVG
|
||||
return SvgPicture.asset(
|
||||
return Image.asset(
|
||||
assetPath,
|
||||
width: width,
|
||||
height: height,
|
||||
// BoxFit.contain assicura che il logo si adatti perfettamente
|
||||
// alle dimensioni fornite senza mai distorcersi.
|
||||
fit: BoxFit.contain,
|
||||
// Opzionale: previene sfarfallii al caricamento
|
||||
placeholderBuilder: (BuildContext context) => Container(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: const CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -48,7 +42,7 @@ class FluxLogoLight extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return _FluxLogoBase(
|
||||
assetPath: _FluxSvgPaths.logoLight,
|
||||
assetPath: _FluxLogoPaths.logoLight,
|
||||
width: width,
|
||||
height: height,
|
||||
);
|
||||
@@ -65,7 +59,7 @@ class FluxLogoDark extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return _FluxLogoBase(
|
||||
assetPath: _FluxSvgPaths.logoDark,
|
||||
assetPath: _FluxLogoPaths.logoDark,
|
||||
width: width,
|
||||
height: height,
|
||||
);
|
||||
@@ -90,7 +84,9 @@ class FluxLogoAuto extends StatelessWidget {
|
||||
|
||||
return _FluxLogoBase(
|
||||
// Sceglie l'asset giusto
|
||||
assetPath: isDarkMode ? _FluxSvgPaths.logoLight : _FluxSvgPaths.logoDark,
|
||||
assetPath: isDarkMode
|
||||
? _FluxLogoPaths.logoLight
|
||||
: _FluxLogoPaths.logoDark,
|
||||
width: width,
|
||||
height: height,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user