Separacion de codigo por carpetas, cambio de estilo, clase pregon integrada

This commit is contained in:
2024-04-30 16:55:25 +02:00
parent 325e6d4f63
commit 5014ad6bd3
13 changed files with 79 additions and 50 deletions

30
lib/bars/app_bar Normal file
View File

@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
const CustomAppBar({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return AppBar(
title: const Text(''),
centerTitle: true,
backgroundColor: Color.fromARGB(255, 78, 169, 6),
flexibleSpace: Container(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Padding(
padding: const EdgeInsets.only(top: 30.0),
child: Image.asset(
'assets/logo-civan.png',
height: 150,
width: 150,
),
),
),
),
);
}
@override
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
}

43
lib/bars/bottom_bar Normal file
View File

@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
class CustomBottomBar extends StatelessWidget {
const CustomBottomBar({Key? key}) : super(key: key);
Future<void> _launchURL(String url) async {
try {
await launch(url);
} catch (e) {
// Captura de la excepción
print('An error occurred: $e');
}
}
@override
Widget build(BuildContext context) {
return BottomNavigationBar(
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.call),
label: 'Llamar',
),
BottomNavigationBarItem(
icon: Icon(Icons.email),
label: 'Correo',
),
],
selectedItemColor: Colors.blue,
unselectedItemColor: Colors.blue,
backgroundColor: const Color.fromARGB(255, 255, 255, 255),
currentIndex: 0,
onTap: (int index) {
if (index == 0) {
_launchURL('tel:+348766361379');
} else if (index == 1) {
_launchURL('mailto:civan@crcivan.com');
}
},
);
}
}