"cambios en iconos de la app android"

This commit is contained in:
2024-10-09 16:41:16 +02:00
parent be701d6e50
commit a7a97bfeae
39 changed files with 133 additions and 136 deletions

View File

@ -3,7 +3,7 @@ import 'package:html/parser.dart' as htmlParser;
class DataService {
Future<List<Map<String, dynamic>>> obtenerDatos() async {
final response = await http.get(Uri.parse('http://www.crcivan.com/escaparate/noticias.cgi?idnoticias=192683'));
final response = await http.get(Uri.parse('https://crcivan.asociacionador.es/contenedores.html'));
if (response.statusCode == 200) {
final document = htmlParser.parse(response.body);

View File

@ -15,9 +15,9 @@ class MyBloc extends Cubit<MyState> {
MyBloc() : super(MyState());
}
//mejorar código
Future<List<String>> obtenerDatos() async {
final response = await http.get(Uri.parse('http://www.crcivan.com/escaparate/noticias.cgi?idnoticias=192683'));
final response = await http.get(Uri.parse('https://crcivan.asociacionador.es/contenedores.html'));
if (response.statusCode == 200) {
final document = htmlParser.parse(response.body);
final elementosSpan = document.querySelectorAll('html > body > div > center > table > tbody > tr > td > div > center > table > tbody > tr > td > table > tbody > tr > td > font > font > table > tbody > tr > td > span');

30
lib/main.dart Normal file
View File

@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_project/BloC/contenedores_event.dart';
import '../pages/my_home_page.dart';
void main() {
runApp(
BlocProvider(
create: (context) => MyBloc(),
child: const MyApp(),
),
);
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Color.fromARGB(255, 0, 67, 168)),
useMaterial3: true,
),
home: const MyHomePage(title: 'COMUNIDAD DE REGANTES DE CIVÁN'),
);
}
}

View File

@ -16,7 +16,7 @@ class _NoticiasPageState extends State<NoticiasPage> {
List<Map<String, String>> noticias = [];
bool _isLoading = true;
static const String url = 'http://www.crcivan.com/escaparate/noticias.cgi?idpadre=92776&idempresa=31637';
static const String url = 'https://crcivan.asociacionador.es/noticias.html';
@override
void initState() {
@ -39,12 +39,18 @@ class _NoticiasPageState extends State<NoticiasPage> {
var tituloElement = element.querySelector('b > a');
if (tituloElement != null) {
var titulo = tituloElement.text.trim();
var href = tituloElement.attributes['href'];
var contenido = '';
var fontElements = element.querySelectorAll('font');
for (var font in fontElements) {
contenido += '${font.text.trim()}\n';
}
noticiasTemp.add({'titulo': titulo, 'contenido': contenido.trim()});
noticiasTemp.add({
'titulo': titulo,
'contenido': contenido.trim(),
'href': href ?? ''
});
}
}
@ -75,6 +81,7 @@ class _NoticiasPageState extends State<NoticiasPage> {
itemBuilder: (context, index) {
var titulo = noticias[index]['titulo'];
var contenido = noticias[index]['contenido'];
var href = noticias[index]['href'];
return Container(
color: Colors.white.withOpacity(0.5), // Fondo blanco con 50% de opacidad
@ -93,6 +100,17 @@ class _NoticiasPageState extends State<NoticiasPage> {
style: TextStyle(fontSize: 16.0), // Mantener el texto del contenido en estilo regular
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
href ?? 'Enlace no disponible',
style: TextStyle(
fontSize: 14.0,
color: Colors.blue,
decoration: TextDecoration.underline,
),
),
),
],
),
);
@ -103,4 +121,3 @@ class _NoticiasPageState extends State<NoticiasPage> {
);
}
}

View File

@ -7,7 +7,6 @@ import 'package:flutter_project/bars/bottom_bar';
import 'package:flutter_project/widgets/background_widget.dart';
class Pregon extends StatefulWidget {
const Pregon({Key? key}) : super(key: key);
@ -25,7 +24,7 @@ class _PregonState extends State<Pregon> {
}
Future<void> obtenerDatos() async {
final response = await http.get(Uri.parse('http://www.crcivan.com/escaparate/noticias.cgi?idnoticias=192680'));
final response = await http.get(Uri.parse('https://crcivan.asociacionador.es/pregon.html'));
if (response.statusCode == 200) {
final document = htmlParser.parse(response.body);

View File

@ -19,4 +19,4 @@ class BackgroundWidget extends StatelessWidget {
],
);
}
}
}