From 05f54e6a37dc9f96603a79f71f64ef69aacb3b5a Mon Sep 17 00:00:00 2001 From: 240405 <240405@epvc.pt> Date: Thu, 5 Mar 2026 16:56:25 +0000 Subject: [PATCH] Uso correto de app_colors.dart --- lib/bluetooth_screen.dart | 70 +++++++++----------- lib/constants/app_colors.dart | 8 ++- lib/constants/app_strings.dart | 19 ++++-- lib/main.dart | 54 +++++++-------- lib/screens/bluetooth_connection_screen.dart | 42 ++++++------ 5 files changed, 102 insertions(+), 91 deletions(-) diff --git a/lib/bluetooth_screen.dart b/lib/bluetooth_screen.dart index 4cbf610..c2fe2f3 100644 --- a/lib/bluetooth_screen.dart +++ b/lib/bluetooth_screen.dart @@ -3,6 +3,7 @@ import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:permission_handler/permission_handler.dart'; import 'dart:async'; import 'constants/app_colors.dart'; +import 'constants/app_strings.dart'; class BluetoothScreen extends StatefulWidget { const BluetoothScreen({super.key}); @@ -21,18 +22,16 @@ class _BluetoothScreenState extends State { void initState() { super.initState(); - // Ouvir os resultados da busca e ordenar _scanResultsSubscription = FlutterBluePlus.scanResults.listen((results) { if (mounted) { - // Criar uma cópia da lista e ordenar List sortedResults = List.from(results); sortedResults.sort((a, b) { bool aHasName = _hasRealName(a); bool bHasName = _hasRealName(b); - if (aHasName && !bHasName) return -1; // 'a' vem primeiro - if (!aHasName && bHasName) return 1; // 'b' vem primeiro - return 0; // Mantém a ordem original entre iguais + if (aHasName && !bHasName) return -1; + if (!aHasName && bHasName) return 1; + return 0; }); setState(() { @@ -41,7 +40,6 @@ class _BluetoothScreenState extends State { } }); - // Ouvir o estado da busca _isScanningSubscription = FlutterBluePlus.isScanning.listen((state) { if (mounted) { setState(() { @@ -51,7 +49,6 @@ class _BluetoothScreenState extends State { }); } - // Função auxiliar para verificar se tem nome real bool _hasRealName(ScanResult r) { return r.advertisementData.advName.isNotEmpty || r.device.platformName.isNotEmpty; } @@ -83,15 +80,15 @@ class _BluetoothScreenState extends State { Future.delayed(const Duration(seconds: 8), () { if (mounted && _scanResults.isEmpty && _isScanning) { - _showSnackBar("Nenhum dispositivo encontrado.", AppColors.coral); + _showSnackBar(AppStrings.noDevicesFound, AppColors.coral); } }); } catch (e) { - _showSnackBar("Erro ao iniciar busca: $e", Colors.red); + _showSnackBar("${AppStrings.scanError}$e", AppColors.error); } } else { - _showSnackBar("Permissões negadas.", AppColors.coral); + _showSnackBar(AppStrings.permissionsDenied, AppColors.coral); } } @@ -99,22 +96,21 @@ class _BluetoothScreenState extends State { try { await FlutterBluePlus.stopScan(); } catch (e) { - _showSnackBar("Erro ao parar busca: $e", Colors.red); + _showSnackBar("${AppStrings.stopScanError}$e", AppColors.error); } } Future connectToDevice(BluetoothDevice device) async { try { - String name = device.platformName.isNotEmpty ? device.platformName : "Dispositivo"; - _showSnackBar("Conectando a $name...", Colors.white70); + String name = device.platformName.isNotEmpty ? device.platformName : AppStrings.defaultDeviceName; + _showSnackBar("${AppStrings.connectingTo}$name...", AppColors.white.withValues(alpha: 0.7)); await device.connect(); - _showSnackBar("Conectado com sucesso!", Colors.green); + _showSnackBar(AppStrings.connectedSuccess, AppColors.success); } catch (e) { - _showSnackBar("Falha ao conectar: $e", Colors.red); + _showSnackBar("${AppStrings.connectFail}$e", AppColors.error); } } - // Lógica para capturar o nome String _getDeviceName(ScanResult r) { if (r.advertisementData.advName.isNotEmpty) { return r.advertisementData.advName; @@ -122,7 +118,7 @@ class _BluetoothScreenState extends State { return r.device.platformName; } else { String id = r.device.remoteId.toString(); - return "Disp. [${id.length > 5 ? id.substring(id.length - 5) : id}]"; + return "${AppStrings.deviceIdPrefix}${id.length > 5 ? id.substring(id.length - 5) : id}]"; } } @@ -142,9 +138,9 @@ class _BluetoothScreenState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: const Text('Bluetooth', style: TextStyle(fontWeight: FontWeight.bold)), + title: const Text(AppStrings.bluetoothTitle, style: TextStyle(fontWeight: FontWeight.bold)), centerTitle: true, - backgroundColor: Colors.transparent, + backgroundColor: AppColors.transparent, elevation: 0, foregroundColor: AppColors.white, ), @@ -156,7 +152,7 @@ class _BluetoothScreenState extends State { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - AppColors.coral.withOpacity(0.1), + AppColors.coral.withValues(alpha: 0.1), AppColors.background, ], ), @@ -173,8 +169,8 @@ class _BluetoothScreenState extends State { decoration: BoxDecoration( shape: BoxShape.circle, color: _isScanning - ? AppColors.coral.withOpacity(0.1) - : AppColors.backgroundGrey.withOpacity(0.3), + ? AppColors.coral.withValues(alpha: 0.1) + : AppColors.backgroundGrey.withValues(alpha: 0.3), border: Border.all( color: _isScanning ? AppColors.coral : AppColors.backgroundGrey, width: 2, @@ -183,7 +179,7 @@ class _BluetoothScreenState extends State { child: Icon( _isScanning ? Icons.bluetooth_searching : Icons.bluetooth, size: 60, - color: _isScanning ? AppColors.coral : AppColors.white.withOpacity(0.7), + color: _isScanning ? AppColors.coral : AppColors.white.withValues(alpha: 0.7), ), ), const SizedBox(height: 30), @@ -217,7 +213,7 @@ class _BluetoothScreenState extends State { ), ), Text( - _isScanning ? 'PARAR BUSCA' : 'BUSCAR AGORA', + _isScanning ? AppStrings.stopSearch : AppStrings.startSearch, style: const TextStyle( fontSize: 14, fontWeight: FontWeight.bold, @@ -239,7 +235,7 @@ class _BluetoothScreenState extends State { child: Row( children: [ Text( - _isScanning ? "Procurando..." : "Dispositivos próximos", + _isScanning ? AppStrings.searching : AppStrings.nearbyDevices, style: const TextStyle( color: AppColors.white, fontSize: 14, @@ -251,11 +247,11 @@ class _BluetoothScreenState extends State { Container( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2), decoration: BoxDecoration( - color: AppColors.coral.withOpacity(0.2), + color: AppColors.coral.withValues(alpha: 0.2), borderRadius: BorderRadius.circular(10), ), child: const Text( - "ATIVO", + AppStrings.active, style: TextStyle(color: AppColors.coral, fontSize: 10, fontWeight: FontWeight.bold), ), ), @@ -270,11 +266,11 @@ class _BluetoothScreenState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon(Icons.bluetooth_disabled, size: 40, color: AppColors.white.withOpacity(0.1)), + Icon(Icons.bluetooth_disabled, size: 40, color: AppColors.white.withValues(alpha: 0.1)), const SizedBox(height: 16), Text( - "Inicie a busca para conectar", - style: TextStyle(color: AppColors.white.withOpacity(0.3)), + AppStrings.startSearchInstruction, + style: TextStyle(color: AppColors.white.withValues(alpha: 0.3)), ), ], ), @@ -285,35 +281,35 @@ class _BluetoothScreenState extends State { itemBuilder: (context, index) { final r = _scanResults[index]; final name = _getDeviceName(r); - final isUnknown = name.startsWith("Disp. ["); + final isUnknown = name.startsWith(AppStrings.deviceIdPrefix); return Container( margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 6), decoration: BoxDecoration( - color: AppColors.backgroundGrey.withOpacity(0.2), + color: AppColors.backgroundGrey.withValues(alpha: 0.2), borderRadius: BorderRadius.circular(15), ), child: ListTile( contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4), leading: CircleAvatar( - backgroundColor: AppColors.backgroundGrey.withOpacity(0.3), + backgroundColor: AppColors.backgroundGrey.withValues(alpha: 0.3), child: Icon( isUnknown ? Icons.devices_other : Icons.bluetooth, - color: isUnknown ? AppColors.white.withOpacity(0.4) : AppColors.white, + color: isUnknown ? AppColors.white.withValues(alpha: 0.4) : AppColors.white, size: 20 ), ), title: Text( name, style: TextStyle( - color: isUnknown ? AppColors.white.withOpacity(0.5) : AppColors.white, + color: isUnknown ? AppColors.white.withValues(alpha: 0.5) : AppColors.white, fontWeight: FontWeight.w600, fontSize: 15, ), ), subtitle: Text( r.device.remoteId.toString(), - style: TextStyle(color: AppColors.white.withOpacity(0.3), fontSize: 11), + style: TextStyle(color: AppColors.white.withValues(alpha: 0.3), fontSize: 11), ), trailing: ElevatedButton( onPressed: () => connectToDevice(r.device), @@ -324,7 +320,7 @@ class _BluetoothScreenState extends State { shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), elevation: 0, ), - child: const Text("CONECTAR", style: TextStyle(fontSize: 11, fontWeight: FontWeight.bold)), + child: const Text(AppStrings.connect, style: TextStyle(fontSize: 11, fontWeight: FontWeight.bold)), ), ), ); diff --git a/lib/constants/app_colors.dart b/lib/constants/app_colors.dart index 88efd53..8c10458 100644 --- a/lib/constants/app_colors.dart +++ b/lib/constants/app_colors.dart @@ -11,4 +11,10 @@ class AppColors { // Neutral colors static const Color backgroundGrey = Color.fromARGB(255, 89, 89, 89); -} \ No newline at end of file + static const Color black = Colors.black; + + // Status colors + static const Color error = Colors.red; + static const Color success = Colors.green; + static const Color transparent = Colors.transparent; +} diff --git a/lib/constants/app_strings.dart b/lib/constants/app_strings.dart index 7efae11..b0bc29b 100644 --- a/lib/constants/app_strings.dart +++ b/lib/constants/app_strings.dart @@ -14,24 +14,33 @@ class AppStrings { // Bluetooth Screen static const String bluetoothTitle = "DISPOSITIVOS"; static const String bluetoothConnect = "CONECTAR BLUETOOTH"; - static const String statusSearching = "STATUS: BUSCANDO..."; + static const String stopSearch = "PARAR BUSCA"; + static const String startSearch = "BUSCAR AGORA"; + static const String searching = "STATUS: BUSCANDO..."; static const String statusReady = "STATUS: PRONTO"; static const String statusConnected = "STATUS: CONECTADO"; + static const String nearbyDevices = "Dispositivos próximos"; + static const String active = "ATIVO"; + static const String startSearchInstruction = "Inicie a busca para conectar"; + static const String connect = "CONECTAR"; + static const String noDevicesFound = "Nenhum dispositivo encontrado."; static const String foundDevices = "Encontrados"; static const String oneDevice = "1 Dispositivo"; - static const String permissionDenied = "Permissões de Bluetooth negadas."; + static const String permissionsDenied = "Permissões de Bluetooth negadas."; static const String turnOnBluetooth = "Ligue o Bluetooth para buscar dispositivos."; static const String scanError = "Erro ao iniciar scan: "; static const String stopScanError = "Erro ao parar scan: "; + static const String defaultDeviceName = "Dispositivo"; static const String connectingTo = "Conectando a "; - static const String connectionSuccess = "Conectado com sucesso!"; - static const String connectionError = "Erro ao conectar: "; + static const String connectedSuccess = "Conectado com sucesso!"; + static const String connectFail = "Falha ao conectar: "; + static const String deviceIdPrefix = "Disp. ["; static const String unknownDevice = "Dispositivo Desconhecido"; // Map Screen static const String mapTitleTracking = "TRACKING ATIVO"; static const String mapTitlePlanning = "PLANEJAR TRAJETO"; - static const String mapTitleRunning = "TOUHOU VIVA"; + static const String mapTitleRunning = "CORRIDA"; static const String mapPace = "RITMO"; static const String mapRoute = "TRAJETO"; static const String kmhUnit = "KM/H"; diff --git a/lib/main.dart b/lib/main.dart index 22b5734..2dd0f19 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -55,7 +55,7 @@ class _RunningScreenState extends State shape: BoxShape.circle, boxShadow: [ BoxShadow( - color: AppColors.white.withOpacity(0.05), + color: AppColors.white.withValues(alpha: 0.05), blurRadius: 30, spreadRadius: 10, ), @@ -74,7 +74,7 @@ class _RunningScreenState extends State progress: value, strokeWidth: 14, progressColor: AppColors.white, - backgroundColor: AppColors.white.withOpacity(0.15), + backgroundColor: AppColors.white.withValues(alpha: 0.15), ), ); }, @@ -95,14 +95,14 @@ class _RunningScreenState extends State style: const TextStyle( fontSize: 42, fontWeight: FontWeight.w900, - color: Colors.white, + color: AppColors.white, letterSpacing: -1, ), ), Text( AppStrings.complete, style: TextStyle( - color: Colors.white.withOpacity(0.5), + color: AppColors.white.withValues(alpha: 0.5), fontSize: 11, fontWeight: FontWeight.bold, letterSpacing: 1.5, @@ -140,9 +140,9 @@ class _RunningScreenState extends State child: Container( padding: const EdgeInsets.symmetric(horizontal: 22, vertical: 10), decoration: BoxDecoration( - color: Colors.white.withOpacity(0.08), + color: AppColors.white.withValues(alpha: 0.08), borderRadius: BorderRadius.circular(25), - border: Border.all(color: Colors.white.withOpacity(0.1)), + border: Border.all(color: AppColors.white.withValues(alpha: 0.1)), ), child: Text( "${currentDistance.toStringAsFixed(1)} ${AppStrings.kmUnit} | ${targetDistance.toStringAsFixed(1)} ${AppStrings.kmUnit}", @@ -169,7 +169,7 @@ class _RunningScreenState extends State borderRadius: BorderRadius.circular(30), boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.3), + color: AppColors.black.withValues(alpha: 0.3), blurRadius: 20, offset: const Offset(0, 10), ), @@ -186,9 +186,9 @@ class _RunningScreenState extends State mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ _buildStatItem(Icons.directions_run_rounded, "3219", AppStrings.steps), - Divider(color: Colors.white.withOpacity(0.1), height: 1), + Divider(color: AppColors.white.withValues(alpha: 0.1), height: 1), _buildStatItem(Icons.favorite_rounded, "98", AppStrings.bpm), - Divider(color: Colors.white.withOpacity(0.1), height: 1), + Divider(color: AppColors.white.withValues(alpha: 0.1), height: 1), _buildStatItem(Icons.local_fire_department_rounded, "480", AppStrings.kcal), ], ), @@ -222,8 +222,8 @@ class _RunningScreenState extends State begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - Colors.transparent, - Colors.black.withOpacity(0.4), + AppColors.transparent, + AppColors.black.withValues(alpha: 0.4), ], ), ), @@ -234,10 +234,10 @@ class _RunningScreenState extends State child: Container( padding: const EdgeInsets.all(6), decoration: BoxDecoration( - color: AppColors.background.withOpacity(0.8), + color: AppColors.background.withValues(alpha: 0.8), shape: BoxShape.circle, ), - child: const Icon(Icons.fullscreen_rounded, color: Colors.white, size: 20), + child: const Icon(Icons.fullscreen_rounded, color: AppColors.white, size: 20), ), ), const Positioned( @@ -246,7 +246,7 @@ class _RunningScreenState extends State child: Text( AppStrings.mapPreview, style: TextStyle( - color: Colors.white, + color: AppColors.white, fontSize: 10, fontWeight: FontWeight.w900, letterSpacing: 1, @@ -274,7 +274,7 @@ class _RunningScreenState extends State child: LinearProgressIndicator( value: progress, minHeight: 8, - backgroundColor: Colors.white.withOpacity(0.1), + backgroundColor: AppColors.white.withValues(alpha: 0.1), valueColor: const AlwaysStoppedAnimation(AppColors.white), ), ), @@ -301,18 +301,18 @@ class _RunningScreenState extends State Positioned( top: 60, right: 25, - child: _buildSmallActionButton(Icons.bluetooth, Colors.red), + child: _buildSmallActionButton(Icons.bluetooth, AppColors.error), ), ], ), ); } - /// Item de estatística com design refinado. + /// Item de estatística with design refinado. Widget _buildStatItem(IconData icon, String value, String label) { return Row( children: [ - Icon(icon, color: AppColors.coral.withOpacity(0.8), size: 22), + Icon(icon, color: AppColors.coral.withValues(alpha: 0.8), size: 22), const SizedBox(width: 12), Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -321,7 +321,7 @@ class _RunningScreenState extends State Text( value, style: const TextStyle( - color: Colors.white, + color: AppColors.white, fontSize: 19, fontWeight: FontWeight.w900, ), @@ -329,7 +329,7 @@ class _RunningScreenState extends State Text( label, style: TextStyle( - color: Colors.white.withOpacity(0.4), + color: AppColors.white.withValues(alpha: 0.4), fontSize: 9, fontWeight: FontWeight.bold, letterSpacing: 0.5, @@ -373,9 +373,9 @@ class _RunningScreenState extends State decoration: BoxDecoration( color: AppColors.backgroundGrey, borderRadius: BorderRadius.circular(18), - border: Border.all(color: Colors.white.withOpacity(0.05)), + border: Border.all(color: AppColors.white.withValues(alpha: 0.05)), ), - child: Icon(icon, color: Colors.white.withOpacity(0.9), size: 24), + child: Icon(icon, color: AppColors.white.withValues(alpha: 0.9), size: 24), ), if (showBadge) Positioned( @@ -411,11 +411,11 @@ class _RunningScreenState extends State decoration: BoxDecoration( color: AppColors.backgroundGrey, shape: BoxShape.circle, - border: Border.all(color: Colors.white.withOpacity(0.05)), + border: Border.all(color: AppColors.white.withValues(alpha: 0.05)), ), child: Stack( children: [ - Icon(icon, color: Colors.white, size: 20), + Icon(icon, color: AppColors.white, size: 20), Positioned( right: 0, top: 0, @@ -441,7 +441,7 @@ class MapPainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { final paintPath = Paint() - ..color = AppColors.coral.withOpacity(0.5) + ..color = AppColors.coral.withValues(alpha: 0.5) ..strokeWidth = 3 ..style = PaintingStyle.stroke ..strokeCap = StrokeCap.round; @@ -452,7 +452,7 @@ class MapPainter extends CustomPainter { path.quadraticBezierTo(size.width * 0.7, size.height * 0.1, size.width * 0.9, size.height * 0.3); final paintRoad = Paint() - ..color = Colors.white.withOpacity(0.1) + ..color = AppColors.white.withValues(alpha: 0.1) ..strokeWidth = 10 ..style = PaintingStyle.stroke; @@ -465,7 +465,7 @@ class MapPainter extends CustomPainter { final markerPaint = Paint()..color = AppColors.coral; canvas.drawCircle(Offset(size.width * 0.5, size.height * 0.5), 5, markerPaint); - canvas.drawCircle(Offset(size.width * 0.5, size.height * 0.5), 8, Paint()..color = AppColors.coral.withOpacity(0.3)); + canvas.drawCircle(Offset(size.width * 0.5, size.height * 0.5), 8, Paint()..color = AppColors.coral.withValues(alpha: 0.3)); } @override diff --git a/lib/screens/bluetooth_connection_screen.dart b/lib/screens/bluetooth_connection_screen.dart index 406e3d3..afa5e8a 100644 --- a/lib/screens/bluetooth_connection_screen.dart +++ b/lib/screens/bluetooth_connection_screen.dart @@ -63,8 +63,8 @@ class _BluetoothConnectionScreenState extends State { } else { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text(AppStrings.permissionDenied), + SnackBar( + content: Text(AppStrings.permissionsDenied), behavior: SnackBarBehavior.floating, ), ); @@ -80,7 +80,7 @@ class _BluetoothConnectionScreenState extends State { if (await FlutterBluePlus.adapterState.first != BluetoothAdapterState.on) { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( + SnackBar( content: Text(AppStrings.turnOnBluetooth), behavior: SnackBarBehavior.floating, ), @@ -135,9 +135,9 @@ class _BluetoothConnectionScreenState extends State { }); FlutterBluePlus.stopScan(); ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text(AppStrings.connectionSuccess), - backgroundColor: Colors.green, + SnackBar( + content: Text(AppStrings.connectedSuccess), + backgroundColor: AppColors.success, behavior: SnackBarBehavior.floating, ), ); @@ -146,8 +146,8 @@ class _BluetoothConnectionScreenState extends State { if (mounted) { ScaffoldMessenger.of(context).showSnackBar( SnackBar( - content: Text('${AppStrings.connectionError}$e'), - backgroundColor: Colors.red, + content: Text('${AppStrings.connectFail}$e'), + backgroundColor: AppColors.error, behavior: SnackBarBehavior.floating, ), ); @@ -198,10 +198,10 @@ class _BluetoothConnectionScreenState extends State { decoration: BoxDecoration( color: AppColors.backgroundGrey, borderRadius: BorderRadius.circular(30), - border: Border.all(color: Colors.white.withOpacity(0.05)), + border: Border.all(color: Colors.white.withValues(alpha: 0.05)), boxShadow: [ BoxShadow( - color: Colors.black.withOpacity(0.3), + color: Colors.black.withValues(alpha: 0.3), blurRadius: 20, offset: const Offset(0, 10), ), @@ -216,7 +216,7 @@ class _BluetoothConnectionScreenState extends State { Text( _connectedDevice != null ? AppStrings.statusConnected - : (_isScanning ? AppStrings.statusSearching : AppStrings.statusReady), + : (_isScanning ? AppStrings.searching : AppStrings.statusReady), style: TextStyle( color: _connectedDevice != null ? Colors.greenAccent : (_isScanning ? AppColors.coral : Colors.white54), fontSize: 10, @@ -243,10 +243,10 @@ class _BluetoothConnectionScreenState extends State { child: Container( padding: const EdgeInsets.all(15), decoration: BoxDecoration( - color: _isScanning ? Colors.red.withOpacity(0.1) : AppColors.coral.withOpacity(0.1), + color: _isScanning ? Colors.red.withValues(alpha: 0.1) : AppColors.coral.withValues(alpha: 0.1), shape: BoxShape.circle, border: Border.all( - color: _isScanning ? Colors.red.withOpacity(0.5) : AppColors.coral.withOpacity(0.5), + color: _isScanning ? Colors.red.withValues(alpha: 0.5) : AppColors.coral.withValues(alpha: 0.5), width: 2, ), ), @@ -263,10 +263,10 @@ class _BluetoothConnectionScreenState extends State { child: Container( padding: const EdgeInsets.all(15), decoration: BoxDecoration( - color: Colors.red.withOpacity(0.1), + color: Colors.red.withValues(alpha: 0.1), shape: BoxShape.circle, border: Border.all( - color: Colors.red.withOpacity(0.5), + color: Colors.red.withValues(alpha: 0.5), width: 2, ), ), @@ -297,21 +297,21 @@ class _BluetoothConnectionScreenState extends State { child: Container( padding: const EdgeInsets.all(20), decoration: BoxDecoration( - color: AppColors.backgroundGrey.withOpacity(0.4), + color: AppColors.backgroundGrey.withValues(alpha: 0.4), borderRadius: BorderRadius.circular(25), - border: Border.all(color: Colors.white.withOpacity(0.03)), + border: Border.all(color: Colors.white.withValues(alpha: 0.03)), ), child: Row( children: [ Container( padding: const EdgeInsets.all(12), decoration: BoxDecoration( - color: AppColors.background.withOpacity(0.8), + color: AppColors.background.withValues(alpha: 0.8), borderRadius: BorderRadius.circular(15), ), child: Icon( Icons.bluetooth_audio_rounded, - color: _connectedDevice != null ? Colors.greenAccent : AppColors.coral.withOpacity(0.8), + color: _connectedDevice != null ? Colors.greenAccent : AppColors.coral.withValues(alpha: 0.8), size: 24 ), ), @@ -357,13 +357,13 @@ class _BluetoothConnectionScreenState extends State { ], ), if (_isScanning) - Positioned( + const Positioned( bottom: 0, left: 0, right: 0, child: LinearProgressIndicator( backgroundColor: Colors.transparent, - valueColor: const AlwaysStoppedAnimation(AppColors.coral), + valueColor: AlwaysStoppedAnimation(AppColors.coral), minHeight: 2, ), ),