CKT 1.0.1
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../main.dart' show supabase;
|
||||
import '../widgets/app_gradients.dart';
|
||||
import '../widgets/entrance.dart';
|
||||
@@ -97,9 +98,33 @@ class _QuizResultScreenState extends State<QuizResultScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
void _goToVideo() {
|
||||
Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute<void>(
|
||||
builder: (_) => QuizVideoGuideScreen(
|
||||
youtubeId: _resultGuideYoutubeId,
|
||||
heading: 'Visualize o seguinte vídeo',
|
||||
caption:
|
||||
'Assista para compreender a importância de um diagnóstico '
|
||||
'precoce e de realizar tratamento ortodôntico intercetivo, '
|
||||
'ou seja, uma intervenção realizada na infância, tipicamente '
|
||||
'durante a fase de dentição mista (presença tanto de dentes '
|
||||
'de leite como de permanentes).\n\nO seu propósito é '
|
||||
'identificar, prevenir ou reduzir a gravidade de maloclusões '
|
||||
'e problemas no desenvolvimento dos maxilares enquanto os '
|
||||
'ossos e dentes ainda estão em crescimento.',
|
||||
onAdvance: (context) =>
|
||||
Navigator.of(context).popUntil((r) => r.isFirst),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final recommend = _recommendsEvaluation(widget.finalScore);
|
||||
final signs = widget.finalScore.signs;
|
||||
final factors = widget.finalScore.factors;
|
||||
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
@@ -116,31 +141,16 @@ class _QuizResultScreenState extends State<QuizResultScreen> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: TextButton(
|
||||
onPressed: () =>
|
||||
Navigator.of(context).popUntil((r) => r.isFirst),
|
||||
child: const Text(''),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const SizedBox(height: 6),
|
||||
const SizedBox(height: 10),
|
||||
FadeSlideIn(
|
||||
child: const QuizGuideVideoCard(
|
||||
youtubeId: _resultGuideYoutubeId,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 22),
|
||||
FadeSlideIn(
|
||||
delay: const Duration(milliseconds: 60),
|
||||
child: const Text(
|
||||
'Resultado da avaliação',
|
||||
'O resultado avaliado é de:',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
@@ -152,20 +162,20 @@ class _QuizResultScreenState extends State<QuizResultScreen> {
|
||||
),
|
||||
const SizedBox(height: 18),
|
||||
FadeSlideIn(
|
||||
delay: const Duration(milliseconds: 100),
|
||||
delay: const Duration(milliseconds: 60),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
_ResultRing(
|
||||
value: widget.finalScore.signs,
|
||||
value: signs,
|
||||
max: kSignsMax,
|
||||
color: const Color(0xFF2F9E94),
|
||||
label:
|
||||
'Sinais de má\noclusão instalados',
|
||||
),
|
||||
_ResultRing(
|
||||
value: widget.finalScore.factors,
|
||||
value: factors,
|
||||
max: kFactorsMax,
|
||||
color: const Color(0xFFFF55A7),
|
||||
label: 'Fatores de\nrisco associados',
|
||||
@@ -173,35 +183,38 @@ class _QuizResultScreenState extends State<QuizResultScreen> {
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const SizedBox(height: 22),
|
||||
FadeSlideIn(
|
||||
delay: const Duration(milliseconds: 120),
|
||||
child: Text(
|
||||
'Conclusões:',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.black.withValues(
|
||||
alpha: 0.75,
|
||||
),
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
delay: const Duration(milliseconds: 100),
|
||||
child: _ResultSection(
|
||||
heading: 'Conclusões:',
|
||||
body:
|
||||
'Foram identificados $signs de $kSignsMax '
|
||||
'sinais de má oclusão já instalada e '
|
||||
'$factors de $kFactorsMax fatores de '
|
||||
'risco frequentemente associados a '
|
||||
'má oclusão.',
|
||||
bodyColor: const Color(0xFFFF55A7),
|
||||
bodyWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const SizedBox(height: 16),
|
||||
FadeSlideIn(
|
||||
delay: const Duration(milliseconds: 160),
|
||||
child: Text(
|
||||
recommend
|
||||
? 'Recomenda-se o agendamento de uma consulta com um dentista/ortodontista.\nEsta avaliação é apenas educativa.'
|
||||
: 'Não foram encontrados sinais ou fatores de risco relevantes.\nEsta avaliação é apenas educativa.',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.black.withValues(
|
||||
alpha: 0.70,
|
||||
),
|
||||
fontWeight: FontWeight.w600,
|
||||
height: 1.25,
|
||||
),
|
||||
delay: const Duration(milliseconds: 140),
|
||||
child: _ResultSection(
|
||||
heading: 'O que deve fazer agora',
|
||||
body: recommend
|
||||
? 'Com base neste resultado, recomendamos a marcação de uma consulta com Odontopediatra ou Ortodontista para uma avaliação presencial.'
|
||||
: 'Não foram encontrados sinais ou fatores de risco relevantes. Continue a acompanhar a saúde oral do seu filho/a com as consultas de rotina habituais.',
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
FadeSlideIn(
|
||||
delay: const Duration(milliseconds: 180),
|
||||
child: _ResultSection(
|
||||
heading: 'Importante saber',
|
||||
body:
|
||||
'Este resultado não substitui uma avaliação presencial, nem tem função de diagnóstico. O objetivo é ajudá-lo a estar mais atento aos sinais identificados e a não adiar uma consulta que pode fazer a diferença no desenvolvimento oral do seu filho/a.',
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -232,9 +245,7 @@ class _QuizResultScreenState extends State<QuizResultScreen> {
|
||||
onPressed: () async {
|
||||
await _saveResultFuture;
|
||||
if (!context.mounted) return;
|
||||
Navigator.of(
|
||||
context,
|
||||
).popUntil((r) => r.isFirst);
|
||||
_goToVideo();
|
||||
},
|
||||
child: const Text('Avançar'),
|
||||
),
|
||||
@@ -255,6 +266,52 @@ class _QuizResultScreenState extends State<QuizResultScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Bloco de texto "título + parágrafo" reutilizado nas secções de
|
||||
/// conclusão do resultado ("Conclusões:", "O que deve fazer agora",
|
||||
/// "Importante saber").
|
||||
class _ResultSection extends StatelessWidget {
|
||||
const _ResultSection({
|
||||
required this.heading,
|
||||
required this.body,
|
||||
this.bodyColor,
|
||||
this.bodyWeight = FontWeight.w600,
|
||||
});
|
||||
|
||||
final String heading;
|
||||
final String body;
|
||||
final Color? bodyColor;
|
||||
final FontWeight bodyWeight;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Text(
|
||||
heading,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.black.withValues(alpha: 0.75),
|
||||
fontWeight: FontWeight.w900,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
body,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: bodyColor ?? Colors.black.withValues(alpha: 0.70),
|
||||
fontWeight: bodyWeight,
|
||||
height: 1.35,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Anel de progresso — usado para os dois indicadores do resultado
|
||||
/// (sinais / fatores de risco), com o valor no centro e a legenda por
|
||||
/// baixo.
|
||||
class _ResultRing extends StatelessWidget {
|
||||
const _ResultRing({
|
||||
required this.value,
|
||||
@@ -280,14 +337,14 @@ class _ResultRing extends StatelessWidget {
|
||||
tween: Tween<double>(begin: 0, end: progress),
|
||||
builder: (context, animatedProgress, _) {
|
||||
return SizedBox(
|
||||
width: 150,
|
||||
height: 150,
|
||||
width: 130,
|
||||
height: 130,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 132,
|
||||
height: 132,
|
||||
width: 130,
|
||||
height: 130,
|
||||
child: CircularProgressIndicator(
|
||||
value: animatedProgress,
|
||||
strokeWidth: 12,
|
||||
|
||||
Reference in New Issue
Block a user