CKT String|Colors

This commit is contained in:
Carlos Correia
2026-07-15 19:13:15 +01:00
parent 3214a07779
commit a8af2c6845
35 changed files with 1390 additions and 688 deletions

View File

@@ -1,7 +1,9 @@
import 'package:flutter/material.dart';
import '../colors/app_colors.dart';
import 'package:flutter/services.dart';
import '../screens/video_screen.dart';
import '../strings/quiz_ui_strings.dart';
import '../widgets/entrance.dart';
import '../widgets/liquid_waves_background.dart';
import '../widgets/tap_bounce.dart';
@@ -82,7 +84,7 @@ class QuizQuestionScreen extends StatefulWidget {
this.suggestedVideoTitle,
this.fallbackColor,
this.answerImageAspectRatio,
this.correctBadgeLabel = 'Posição certa',
this.correctBadgeLabel = QuizUiStrings.defaultCorrectBadgeLabel,
});
final String title;
@@ -197,7 +199,7 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
body: Stack(
clipBehavior: Clip.none,
children: [
Positioned.fill(child: Container(color: const Color(0xFFFAFAF7))),
Positioned.fill(child: Container(color: AppColors.background)),
const LiquidWavesBackground(),
SafeArea(
child: Column(
@@ -222,7 +224,7 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
padding: EdgeInsets.all(9),
child: Icon(
Icons.arrow_back_rounded,
color: Color(0xFF2F9E94),
color: AppColors.teal,
size: 20,
),
),
@@ -241,11 +243,11 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
1.0,
),
minHeight: 8,
backgroundColor: const Color(
0xFFFF55A7,
).withValues(alpha: 0.15),
backgroundColor: AppColors.pink.withValues(
alpha: 0.15,
),
valueColor: const AlwaysStoppedAnimation<Color>(
Color(0xFFFF55A7),
AppColors.pink,
),
),
),
@@ -304,7 +306,7 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
: _FallbackIconBlock(
color:
widget.fallbackColor ??
const Color(0xFF2F9E94),
AppColors.teal,
),
const SizedBox(height: 10),
if (hasSuggestedVideo) ...[
@@ -317,7 +319,8 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
title:
widget
.suggestedVideoTitle ??
'Vídeo',
QuizUiStrings
.videoFallbackTitle,
description: '',
videoPath: widget
.suggestedVideoPath,
@@ -328,13 +331,13 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
icon: const Icon(
Icons
.play_circle_outline_rounded,
color: Color(0xFF2F9E94),
color: AppColors.teal,
),
label: Text(
widget.suggestedVideoTitle ??
'Ver vídeo (opcional)',
QuizUiStrings.watchOptionalVideo,
style: const TextStyle(
color: Color(0xFF2F9E94),
color: AppColors.teal,
fontWeight: FontWeight.w800,
),
),
@@ -347,7 +350,7 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w900,
color: Color(0xFFFF55A7),
color: AppColors.pink,
height: 1.2,
),
),
@@ -355,11 +358,11 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
Text(
widget.answerType ==
QuizAnswerType.number
? 'Insira o número'
? QuizUiStrings.enterNumber
: widget.answerType ==
QuizAnswerType.yesNo
? 'Escolha uma opção'
: 'Escolha apenas uma opção',
? QuizUiStrings.chooseOneOption
: QuizUiStrings.chooseOnlyOneOption,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black.withValues(
@@ -495,9 +498,7 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
style:
FilledButton.styleFrom(
backgroundColor:
const Color(
0xFFFF55A7,
),
AppColors.pink,
foregroundColor:
Colors.white,
shape:
@@ -628,8 +629,8 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
},
child: Text(
widget.isFinal
? 'Concluir'
: 'Avançar',
? QuizUiStrings.finish
: QuizUiStrings.advance,
),
),
),
@@ -643,9 +644,8 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
),
TextButton(
style: TextButton.styleFrom(
foregroundColor: const Color(
0xFF2F9E94,
),
foregroundColor:
AppColors.teal,
textStyle: const TextStyle(
fontWeight: FontWeight.w800,
),
@@ -663,7 +663,7 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
(route) => route.isFirst,
),
child: const Text(
'Voltar para homepage',
QuizUiStrings.backToHomepage,
),
),
],
@@ -724,7 +724,7 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.w900,
color: Color(0xFF2F9E94),
color: AppColors.teal,
),
decoration: const InputDecoration(
border: InputBorder.none,
@@ -750,10 +750,10 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
!_numberDontKnow) ...[
const SizedBox(height: 10),
Text(
'Um número tão alto assim não é possível.\nO máximo é $_maxTeethCount.',
QuizUiStrings.teethCountTooHigh(_maxTeethCount),
textAlign: TextAlign.center,
style: const TextStyle(
color: Color(0xFFFF55A7),
color: AppColors.pink,
fontWeight: FontWeight.w700,
fontSize: 12,
),
@@ -780,12 +780,12 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
),
decoration: BoxDecoration(
color: _numberDontKnow
? const Color(0xFF2F9E94)
? AppColors.teal
: Colors.white.withValues(alpha: 0.70),
borderRadius: BorderRadius.circular(999),
border: Border.all(
color: _numberDontKnow
? const Color(0xFF2F9E94)
? AppColors.teal
: Colors.black.withValues(alpha: 0.12),
),
),
@@ -801,7 +801,7 @@ class _QuizQuestionScreenState extends State<QuizQuestionScreen> {
),
const SizedBox(width: 6),
Text(
'Não sei',
QuizUiStrings.dontKnow,
style: TextStyle(
fontWeight: FontWeight.w800,
fontSize: 13,
@@ -828,7 +828,7 @@ class _QuizAnswerTile extends StatelessWidget {
required this.onTap,
this.imageAspectRatio = 4 / 3,
this.reveal = false,
this.correctLabel = 'Posição certa',
this.correctLabel = QuizUiStrings.defaultCorrectBadgeLabel,
});
final QuizAnswer answer;
@@ -848,9 +848,9 @@ class _QuizAnswerTile extends StatelessWidget {
Widget build(BuildContext context) {
final bool isCorrect = answer.weight == 1;
final borderColor = reveal
? (isCorrect ? const Color(0xFF2F9E94) : const Color(0xFFFF55A7))
? (isCorrect ? AppColors.teal : AppColors.pink)
: selected
? const Color(0xFF2F9E94)
? AppColors.teal
: Colors.black.withValues(alpha: 0.12);
final bg = selected
? Colors.white.withValues(alpha: 0.88)
@@ -934,7 +934,7 @@ class _QuizAnswerTile extends StatelessWidget {
style: const TextStyle(
fontWeight: FontWeight.w900,
fontSize: 15,
color: Color(0xFF2F9E94),
color: AppColors.teal,
),
),
],
@@ -955,7 +955,7 @@ class _QuizAnswerTile extends StatelessWidget {
width: 22,
height: 22,
decoration: const BoxDecoration(
color: Color(0xFF2F9E94),
color: AppColors.teal,
shape: BoxShape.circle,
),
child: const Icon(
@@ -981,8 +981,8 @@ class _QuizAnswerTile extends StatelessWidget {
),
decoration: BoxDecoration(
color: isCorrect
? const Color(0xFF2F9E94)
: const Color(0xFFFF55A7),
? AppColors.teal
: AppColors.pink,
borderRadius: BorderRadius.circular(999),
boxShadow: [
BoxShadow(
@@ -1004,7 +1004,7 @@ class _QuizAnswerTile extends StatelessWidget {
),
const SizedBox(width: 4),
Text(
isCorrect ? correctLabel : 'Posição inadequada',
isCorrect ? correctLabel : QuizUiStrings.incorrectBadgeLabel,
style: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.w800,
@@ -1057,7 +1057,7 @@ class _QuestionReferenceImages extends StatelessWidget {
borderRadius: BorderRadius.circular(999),
),
child: const Text(
'Imagem de referência',
QuizUiStrings.referenceImage,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w700,
@@ -1159,12 +1159,12 @@ class _QuizAnswerPill extends StatelessWidget {
@override
Widget build(BuildContext context) {
final accent = _isYes
? const Color(0xFF2F9E94)
? AppColors.teal
: _isNo
? const Color(0xFFFF55A7)
? AppColors.pink
: Colors.black.withValues(alpha: 0.35);
final borderColor = selected
? const Color(0xFF2F9E94)
? AppColors.teal
: Colors.black.withValues(alpha: 0.10);
final helpVideo = _helpVideo;
final showHelp = selected && helpVideo != null;
@@ -1228,7 +1228,7 @@ class _QuizAnswerPill extends StatelessWidget {
style: const TextStyle(
fontWeight: FontWeight.w800,
fontSize: 15,
color: Color(0xFF2F9E94),
color: AppColors.teal,
),
),
),
@@ -1239,11 +1239,11 @@ class _QuizAnswerPill extends StatelessWidget {
decoration: BoxDecoration(
shape: BoxShape.circle,
color: selected
? const Color(0xFF2F9E94)
? AppColors.teal
: Colors.transparent,
border: Border.all(
color: selected
? const Color(0xFF2F9E94)
? AppColors.teal
: Colors.black.withValues(alpha: 0.25),
width: 1.6,
),
@@ -1291,7 +1291,7 @@ class _HelpVideoButton extends StatelessWidget {
return TapBounce(
scale: 0.97,
child: Material(
color: const Color(0xFF2F9E94).withValues(alpha: 0.10),
color: AppColors.teal.withValues(alpha: 0.10),
borderRadius: BorderRadius.circular(14),
child: InkWell(
borderRadius: BorderRadius.circular(14),
@@ -1302,23 +1302,23 @@ class _HelpVideoButton extends StatelessWidget {
children: [
const Icon(
Icons.play_circle_fill_rounded,
color: Color(0xFF2F9E94),
color: AppColors.teal,
size: 22,
),
const SizedBox(width: 10),
Expanded(
child: Text(
'Não tem a certeza? Veja o "${video.title}" para ajudar a responder',
QuizUiStrings.notSureSeeVideo(video.title),
style: const TextStyle(
fontWeight: FontWeight.w700,
fontSize: 12.5,
color: Color(0xFF2F9E94),
color: AppColors.teal,
),
),
),
const Icon(
Icons.chevron_right_rounded,
color: Color(0xFF2F9E94),
color: AppColors.teal,
size: 20,
),
],