fix(scanner): riposiziona chip host e pulsanti su due righe per evitare overflow
This commit is contained in:
1 parent
6935020cac
commit
118311147d
3 files changed
+37
-28
No files matched your search
@@ -43,18 +43,18 @@ class ConnectionStatusChip extends StatelessWidget {
|
||||
},
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 7),
|
||||
decoration: BoxDecoration(
|
||||
color: AppTheme.darkCard.withValues(alpha: 0.85),
|
||||
color: AppTheme.darkCard.withValues(alpha: 0.9),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(
|
||||
color: dotColor.withValues(alpha: 0.4),
|
||||
color: dotColor.withValues(alpha: 0.5),
|
||||
width: 1,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.2),
|
||||
blurRadius: 8,
|
||||
color: Colors.black.withValues(alpha: 0.3),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
@@ -79,22 +79,22 @@ class ConnectionStatusChip extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 130),
|
||||
constraints: const BoxConstraints(maxWidth: 240),
|
||||
child: Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
color: AppTheme.darkTextPrimary,
|
||||
fontSize: 12,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
const SizedBox(width: 6),
|
||||
const Icon(
|
||||
Icons.arrow_forward_ios_rounded,
|
||||
size: 10,
|
||||
size: 11,
|
||||
color: AppTheme.darkTextSecondary,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -92,13 +92,27 @@ class _ScannerScreenState extends State<ScannerScreen> with WidgetsBindingObserv
|
||||
// 2. High-Tech Laser Reticle Overlay
|
||||
const ScannerOverlay(),
|
||||
|
||||
// 3. Top Floating Glass Control Bar
|
||||
// 3. Top Floating Glass Control Bar (disposto su due righe per evitare overflow)
|
||||
SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Row(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// Riga 1: Stato connessione / Nome host al centro
|
||||
const Center(
|
||||
child: ConnectionStatusChip(),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
|
||||
// Riga 2: Pulsanti di controllo rapidi
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// Gruppo Sinistra: Torcia e Inverti Fotocamera
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
// Torch Toggle
|
||||
_CircleGlassButton(
|
||||
icon: scannerState.isTorchOn
|
||||
? Icons.flash_on_rounded
|
||||
@@ -107,25 +121,19 @@ class _ScannerScreenState extends State<ScannerScreen> with WidgetsBindingObserv
|
||||
tooltip: 'Torcia',
|
||||
onPressed: _toggleTorch,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
|
||||
// Camera Flip
|
||||
const SizedBox(width: 10),
|
||||
_CircleGlassButton(
|
||||
icon: Icons.flip_camera_ios_rounded,
|
||||
tooltip: 'Inverti Fotocamera',
|
||||
onPressed: _switchCamera,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
|
||||
// Center: Connection Status Chip
|
||||
const Expanded(
|
||||
child: Center(
|
||||
child: ConnectionStatusChip(),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
|
||||
// History Button with Badge
|
||||
// Gruppo Destra: Cronologia e Impostazioni
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
BlocBuilder<HistoryCubit, HistoryState>(
|
||||
builder: (context, historyState) {
|
||||
final count = historyState.history.length;
|
||||
@@ -150,9 +158,7 @@ class _ScannerScreenState extends State<ScannerScreen> with WidgetsBindingObserv
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
|
||||
// Settings Button
|
||||
const SizedBox(width: 10),
|
||||
_CircleGlassButton(
|
||||
icon: Icons.settings_outlined,
|
||||
tooltip: 'Impostazioni',
|
||||
@@ -164,6 +170,10 @@ class _ScannerScreenState extends State<ScannerScreen> with WidgetsBindingObserv
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'package:barcode_reader_app/features/connection/data/datasources/connecti
|
||||
import 'package:barcode_reader_app/features/connection/data/datasources/connection_remote_datasource.dart';
|
||||
import 'package:barcode_reader_app/features/connection/data/datasources/udp_discovery_datasource.dart';
|
||||
import 'package:barcode_reader_app/features/connection/data/repositories/connection_repository_impl.dart';
|
||||
import 'package:barcode_reader_app/features/connection/domain/entities/server_connection_info.dart';
|
||||
import 'package:barcode_reader_app/features/connection/domain/repositories/connection_repository.dart';
|
||||
import 'package:barcode_reader_app/features/connection/presentation/cubit/connection_cubit.dart';
|
||||
import 'package:barcode_reader_app/features/scanner/data/datasources/scan_history_datasource.dart';
|
||||
|
||||
Reference in new issue
Block a user