Files
CheckTheethKids/lib/screens/credits_screen.dart
Carlos Correia 89b27e5e86 CTK 1.1.0
2026-07-22 01:34:26 +01:00

251 lines
7.7 KiB
Dart

import 'package:flutter/material.dart';
import '../colors/app_colors.dart';
import '../colors/app_gradients.dart';
import '../strings/credits_strings.dart';
import '../widgets/entrance.dart';
const Color _pink = AppColors.pink;
const Color _teal = AppColors.teal;
class _CreditPerson {
const _CreditPerson(this.name, this.role, {this.logoPath});
final String name;
final String role;
/// Quando definido, mostra este logótipo em vez do círculo com a
/// inicial do nome — usado na instituição colaboradora.
final String? logoPath;
}
class _CreditSection {
const _CreditSection(this.label, this.people);
final String label;
final List<_CreditPerson> people;
}
const List<_CreditSection> _kCreditSections = [
_CreditSection(CreditsStrings.originalCreatorSection, [
_CreditPerson(
'Francisca Salgado Ferreira Pacheco Silva',
CreditsStrings.originalCreatorRole,
),
]),
_CreditSection(CreditsStrings.developmentSection, [
_CreditPerson('Carlos Eduardo Correia', CreditsStrings.developerRole),
_CreditPerson('Fábio Oliveira Ceia', CreditsStrings.developerRole),
_CreditPerson('Dinis Maria Grulha Filipe', CreditsStrings.developerRole),
_CreditPerson('Rúben Silva Gandra', CreditsStrings.developerRole),
]),
_CreditSection(CreditsStrings.advisorsSection, [
_CreditPerson('Augusta Pureza Alves Silveira', CreditsStrings.medRole),
_CreditPerson('Cristina Lopes Cardoso Silva', CreditsStrings.medRole),
_CreditPerson('João Carlos Rodrigues L. Miranda',CreditsStrings.infRole,),
_CreditPerson('Tiago Órfãos', CreditsStrings.otoringoRole),
]),
_CreditSection(CreditsStrings.institutionSection, [
_CreditPerson('Universidade Fernando Pessoa', ''),
_CreditPerson(
'Escola Profissional de Vila do Conde',
'',
logoPath: 'assets/logo2.png',
),
]),
];
class CreditsScreen extends StatelessWidget {
const CreditsScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: PreferredSize(
preferredSize: const Size.fromHeight(kToolbarHeight),
child: Container(
decoration: const BoxDecoration(gradient: kAppBarGradient),
child: AppBar(
backgroundColor: Colors.transparent,
foregroundColor: Colors.white,
surfaceTintColor: Colors.transparent,
elevation: 0,
scrolledUnderElevation: 0,
title: const Text(
CreditsStrings.pageTitle,
style: TextStyle(fontWeight: FontWeight.w900),
),
),
),
),
body: Container(
color: AppColors.background,
child: SafeArea(
child: SingleChildScrollView(
padding: const EdgeInsets.fromLTRB(20, 24, 20, 24),
child: Column(
children: [
FadeSlideIn(
child: Column(
children: [
Container(
width: 76,
height: 76,
decoration: BoxDecoration(
color: _pink.withValues(alpha: 0.12),
shape: BoxShape.circle,
),
child: const Icon(
Icons.diversity_3_rounded,
color: _pink,
size: 36,
),
),
const SizedBox(height: 16),
const Text(
CreditsStrings.header,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w900,
color: Colors.black,
),
),
],
),
),
const SizedBox(height: 22),
for (var s = 0; s < _kCreditSections.length; s++) ...[
if (s > 0) const SizedBox(height: 18),
FadeSlideIn(
delay: Duration(milliseconds: 60 * (s + 1)),
child: _CreditSectionCard(section: _kCreditSections[s]),
),
],
],
),
),
),
),
);
}
}
class _CreditSectionCard extends StatelessWidget {
const _CreditSectionCard({required this.section});
final _CreditSection section;
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Padding(
padding: const EdgeInsets.only(left: 4, bottom: 8),
child: Text(
section.label,
style: const TextStyle(
color: _teal,
fontWeight: FontWeight.w900,
fontSize: 14,
),
),
),
Container(
padding: const EdgeInsets.symmetric(vertical: 6),
decoration: BoxDecoration(
color: Colors.white.withValues(alpha: 0.9),
borderRadius: BorderRadius.circular(20),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.05),
blurRadius: 14,
offset: const Offset(0, 6),
),
],
),
child: Column(
children: [
for (var i = 0; i < section.people.length; i++) ...[
if (i > 0) const Divider(height: 1, indent: 18, endIndent: 18),
_CreditPersonRow(person: section.people[i]),
],
],
),
),
],
);
}
}
class _CreditPersonRow extends StatelessWidget {
const _CreditPersonRow({required this.person});
final _CreditPerson person;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
child: Row(
children: [
Container(
width: 40,
height: 40,
alignment: Alignment.center,
decoration: BoxDecoration(
color: _teal.withValues(alpha: 0.12),
shape: BoxShape.circle,
),
clipBehavior: Clip.antiAlias,
child: person.logoPath != null
? Padding(
padding: const EdgeInsets.all(6),
child: Image.asset(
person.logoPath!,
fit: BoxFit.contain,
),
)
: Text(
person.name[0].toUpperCase(),
style: const TextStyle(
color: _teal,
fontWeight: FontWeight.w900,
fontSize: 16,
),
),
),
const SizedBox(width: 14),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
person.name,
style: const TextStyle(
fontWeight: FontWeight.w800,
fontSize: 14.5,
color: Colors.black87,
),
),
if (person.role.isNotEmpty) ...[
const SizedBox(height: 2),
Text(
person.role,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12.5,
color: Colors.black.withValues(alpha: 0.55),
),
),
],
],
),
),
],
),
);
}
}