import 'package:flutter/material.dart'; class DetailPage extends StatelessWidget { final String title; final String texto; const DetailPage({ super.key, required this.title, required this.texto, }); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( flexibleSpace: Padding( padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), child: Image.asset( 'assets/header_image.png', fit: BoxFit.cover, ), ), toolbarHeight: MediaQuery.of(context).size.height * 0.19, ), body: SingleChildScrollView( // Permite el desplazamiento child: Padding( padding: const EdgeInsets.all(16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( title, style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold), textAlign: TextAlign.center, ), const SizedBox(height: 8), Text( texto, style: const TextStyle(fontSize: 18, color: Colors.black), textAlign: TextAlign.justify, ), ], ), ), ), ); } }