Nenhuma descrição

detail_page.dart 1.4KB

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