Uso correto de app_colors.dart

This commit is contained in:
2026-03-05 16:56:25 +00:00
parent 85b00f6763
commit 05f54e6a37
5 changed files with 102 additions and 91 deletions

View File

@@ -55,7 +55,7 @@ class _RunningScreenState extends State<RunningScreen>
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<RunningScreen>
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<RunningScreen>
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<RunningScreen>
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<RunningScreen>
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<RunningScreen>
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<RunningScreen>
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<RunningScreen>
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<RunningScreen>
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<RunningScreen>
child: LinearProgressIndicator(
value: progress,
minHeight: 8,
backgroundColor: Colors.white.withOpacity(0.1),
backgroundColor: AppColors.white.withValues(alpha: 0.1),
valueColor: const AlwaysStoppedAnimation<Color>(AppColors.white),
),
),
@@ -301,18 +301,18 @@ class _RunningScreenState extends State<RunningScreen>
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<RunningScreen>
Text(
value,
style: const TextStyle(
color: Colors.white,
color: AppColors.white,
fontSize: 19,
fontWeight: FontWeight.w900,
),
@@ -329,7 +329,7 @@ class _RunningScreenState extends State<RunningScreen>
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<RunningScreen>
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<RunningScreen>
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