slrpg-app/lib/src/features/gamification/presentation/screens/codex_screen.dart

170 lines
5.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import '../../../../core/theme/app_theme.dart';
import '../../../../core/constants/asset_paths.dart';
class CodexScreen extends StatelessWidget {
const CodexScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Creature Codex'),
leading: IconButton(
icon: const Icon(Icons.arrow_back),
onPressed: () => context.go('/hub'),
),
),
body: ListView(
padding: const EdgeInsets.all(16),
children: const [
_LoreCard(
name: 'Iron Golem',
title: 'The Weight of the Earth',
description:
'Forged from the tectonic plates of the Deep Earth, the Iron Golem exists only to crush the weak. '
'It embodies the unrelenting force of gravity acting on a heavy load.\n\n'
'It respects only one thing: The raw power of the LEGS that can stand up against its crushing weight.',
assetPath: AssetPaths.enemyIronGolem,
exercise: 'Squat Nemesis',
color: Colors.redAccent,
),
SizedBox(height: 24),
_LoreCard(
name: 'Gravity Demon',
title: 'The Abyssal Pull',
description:
'A spirit of pure downward force that clings to the back of adventurers. '
'It whispers lies of weakness into your ear while dragging you towards the abyss.\n\n'
'Only those with a back of steel and the will to pull themselves up can escape its grasp.',
assetPath: AssetPaths.enemyGravityDemon,
exercise: 'Pull-up Nemesis',
color: Colors.purpleAccent,
),
SizedBox(height: 24),
_LoreCard(
name: 'Pressure Phantom',
title: 'The Invisible Crusher',
description:
'An ethereal entity that compresses the very air around you. '
'It seeks to collapse the chest and shoulders of any who dare to push against it.\n\n'
'Defeat it by pushing through the pain with explosive dipping power.',
assetPath: AssetPaths.enemyPressurePhantom,
exercise: 'Dip Nemesis',
color: Colors.cyanAccent,
),
],
),
);
}
}
class _LoreCard extends StatelessWidget {
final String name;
final String title;
final String description;
final String assetPath;
final String exercise;
final Color color;
const _LoreCard({
required this.name,
required this.title,
required this.description,
required this.assetPath,
required this.exercise,
required this.color,
});
@override
Widget build(BuildContext context) {
return Card(
clipBehavior: Clip.antiAlias,
child: Container(
decoration: BoxDecoration(
border: Border.all(color: color.withValues(alpha: 0.5), width: 1),
borderRadius: BorderRadius.circular(16),
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
AppTheme.surfaceColor,
color.withValues(alpha: 0.1),
],
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Container(
height: 200,
padding: const EdgeInsets.all(24),
decoration: BoxDecoration(
color: Colors.black26,
image: DecorationImage(
image: AssetImage(AssetPaths.bgUndergroundGym),
fit: BoxFit.cover,
opacity: 0.3,
),
),
child: Center(
child: Image.asset(
assetPath,
fit: BoxFit.contain,
color: Colors.white.withValues(alpha: 0.9),
colorBlendMode: BlendMode.modulate,
),
),
),
Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
name.toUpperCase(),
style:
Theme.of(context).textTheme.headlineSmall?.copyWith(
color: color,
fontWeight: FontWeight.bold,
letterSpacing: 1.5,
),
),
Chip(
label: Text(exercise,
style: const TextStyle(
fontSize: 10, color: Colors.white)),
backgroundColor: Colors.black54,
padding: EdgeInsets.zero,
visualDensity: VisualDensity.compact,
),
],
),
Text(
title,
style: TextStyle(
color: AppTheme.textSecondary,
fontStyle: FontStyle.italic,
),
),
const Divider(height: 24),
Text(
description,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
height: 1.5,
color: Colors.white70,
),
),
],
),
),
],
),
),
);
}
}