1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import 'package:flutter/material.dart';
- void verificarHorarioModal(BuildContext context) {
- DateTime now = DateTime.now();
- int hora = now.hour;
- int minuto = now.minute;
- int weekday = now.weekday;
- print(now);
- // 1 = Lunes, 7 = Domingo
- bool isOpen = false;
- if (weekday >= 1 && weekday <= 6) {
- // Lunes a Sábado: 8:00 a.m. - 10:00 p.m.
- isOpen = (hora >= 8 && hora < 22) || (hora == 22 && minuto == 0);
- } else if (weekday == 7) {
- // Domingo: 4:00 p.m. - 10:00 p.m.
- isOpen = (hora >= 16 && hora < 22) || (hora == 22 && minuto == 0);
- }
- if (!isOpen) {}
- }
- class _DetallesD extends StatelessWidget {
- const _DetallesD({super.key});
- @override
- Widget build(BuildContext context) {
- return Container();
- }
- }
- Widget _buildScheduleRow(String day, String hours, bool isHighlighted) {
- return Container(
- padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
- decoration: BoxDecoration(
- color: isHighlighted ? Colors.blue[50] : Colors.transparent,
- borderRadius: BorderRadius.circular(8),
- ),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text(
- day,
- style: TextStyle(
- fontSize: 16,
- fontWeight: isHighlighted ? FontWeight.bold : FontWeight.normal,
- ),
- ),
- Row(
- children: [
- const Icon(Icons.access_time, size: 18),
- const SizedBox(width: 8),
- Text(
- hours,
- style: TextStyle(
- fontSize: 16,
- fontWeight: isHighlighted ? FontWeight.bold : FontWeight.normal,
- ),
- ),
- ],
- ),
- ],
- ),
- );
- }
|