Separacion de codigo por carpetas, cambio de estilo, clase pregon integrada
This commit is contained in:
43
lib/bars/bottom_bar
Normal file
43
lib/bars/bottom_bar
Normal 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');
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user