Geen omschrijving

detail_page.dart 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import 'package:flutter/material.dart';
  2. class DetailPage extends StatelessWidget {
  3. final String title;
  4. final String texto;
  5. final String categoria;
  6. const DetailPage({
  7. super.key,
  8. required this.title,
  9. required this.texto,
  10. required this.categoria,
  11. });
  12. @override
  13. Widget build(BuildContext context) => Scaffold(
  14. appBar: AppBar(
  15. flexibleSpace: Padding(
  16. padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top - 20),
  17. child: Image.asset('assets/header_image.png', fit: BoxFit.cover),
  18. ),
  19. toolbarHeight: MediaQuery.of(context).size.height * 0.19,
  20. title: Text(
  21. categoria,
  22. style: const TextStyle(color: Colors.white, fontSize: 16),
  23. ),
  24. ),
  25. body: Container(
  26. decoration: const BoxDecoration(color: Color.fromARGB(255, 254, 242, 221)),
  27. child: Padding(
  28. padding: const EdgeInsets.all(16.0),
  29. child: SingleChildScrollView(
  30. child: Column(
  31. crossAxisAlignment: CrossAxisAlignment.start,
  32. children: [
  33. Text(
  34. title,
  35. style: const TextStyle(
  36. fontSize: 24,
  37. fontWeight: FontWeight.bold,
  38. color: Colors.black87,
  39. ),
  40. ),
  41. const SizedBox(height: 8),
  42. Container(
  43. padding: const EdgeInsets.all(12),
  44. decoration: BoxDecoration(
  45. color: Colors.white,
  46. borderRadius: BorderRadius.circular(8),
  47. ),
  48. child: Text(
  49. texto,
  50. style: const TextStyle(fontSize: 16, height: 1.5),
  51. textAlign: TextAlign.justify,
  52. ),
  53. ),
  54. ],
  55. ),
  56. ),
  57. ),
  58. ),
  59. );
  60. }