Aplicacion terminada v2
This commit is contained in:
@ -38,7 +38,6 @@ class _NoticiasPageState extends State<NoticiasPage> {
|
||||
}
|
||||
}
|
||||
|
||||
// Esperar todas las promesas para que se resuelvan
|
||||
await Future.wait(noticiasPorTitulo.values.expand((element) => element).toList());
|
||||
|
||||
setState(() {});
|
||||
@ -58,19 +57,16 @@ class _NoticiasPageState extends State<NoticiasPage> {
|
||||
|
||||
for (var element in paragraphAndLists) {
|
||||
if (element.localName == 'p') {
|
||||
// Guardar el contenido del párrafo actual
|
||||
if (currentParagraphContent.isNotEmpty) {
|
||||
content += currentParagraphContent + '\n';
|
||||
currentParagraphContent = '';
|
||||
}
|
||||
currentParagraphContent += element.text.trim() + '\n';
|
||||
} else if (element.localName == 'ul') {
|
||||
// Si hay un párrafo antes de la lista, agregarlo al contenido
|
||||
if (currentParagraphContent.isNotEmpty) {
|
||||
content += currentParagraphContent + '\n';
|
||||
currentParagraphContent = '';
|
||||
}
|
||||
// Agregar la lista al contenido
|
||||
var listItems = element.querySelectorAll('li');
|
||||
for (var listItem in listItems) {
|
||||
content += '- ${listItem.text.trim()}\n';
|
||||
@ -78,7 +74,6 @@ class _NoticiasPageState extends State<NoticiasPage> {
|
||||
}
|
||||
}
|
||||
|
||||
// Agregar el último párrafo si no hay lista después
|
||||
if (currentParagraphContent.isNotEmpty) {
|
||||
content += currentParagraphContent + '\n';
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ Widget build(BuildContext context) {
|
||||
children: [
|
||||
if (hasMes)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0), // Add padding to the divider
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
child: Divider(color: Colors.green, thickness: 3.0), // Divider antes del párrafo
|
||||
),
|
||||
hasText
|
||||
@ -97,7 +97,7 @@ Widget build(BuildContext context) {
|
||||
: SizedBox.shrink(),
|
||||
if (hasMes)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 100.0), // Add padding to the divider
|
||||
padding: const EdgeInsets.symmetric(horizontal: 100.0),
|
||||
child: Divider(color: Colors.green, thickness: 1.0), // Divider después del párrafo
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user