43 lines
1.4 KiB
Plaintext
43 lines
1.4 KiB
Plaintext
import 'package:flutter/material.dart';
|
|
import 'package:crcivan/pages/utils.dart'; // Importar la función global
|
|
|
|
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|
const CustomAppBar({Key? key}) : super(key: key);
|
|
|
|
double _getIconSize(BuildContext context) {
|
|
double screenWidth = MediaQuery.of(context).size.width;
|
|
return screenWidth > 600 ? 40.0 : 32.0;
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
double iconSize = _getIconSize(context);
|
|
|
|
return AppBar(
|
|
title: const Text(''),
|
|
centerTitle: true,
|
|
backgroundColor: const Color.fromARGB(255, 78, 169, 6),
|
|
iconTheme: IconThemeData(
|
|
color: Colors.white, // Cambia este color al que desees
|
|
size: iconSize, // Ajustar el tamaño del icono
|
|
),
|
|
flexibleSpace: Container(
|
|
padding: const EdgeInsets.all(8.0),
|
|
child: Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(top: 10.0),
|
|
child: Image.asset(
|
|
'assets/logo-civan.png',
|
|
height: getResponsiveFontSize(context, 200.0), // Ajustar la altura de la imagen
|
|
width: getResponsiveFontSize(context, 200.0), // Ajustar el ancho de la imagen
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
Size get preferredSize => const Size.fromHeight(kToolbarHeight); // Tamaño fijo para el AppBar
|
|
}
|