import 'package:flutter/material.dart'; import 'package:furman_now/src/services/events/event.dart'; import 'package:furman_now/src/utils/theme.dart'; import 'package:furman_now/src/widgets/events/event_modal.dart'; import 'package:furman_now/src/widgets/text_with_icon.dart'; import 'package:intl/intl.dart'; class EventCard extends StatelessWidget { const EventCard ( this.event, { Key? key } ) : super(key: key); final Event event; String get eventHour { var formatter = DateFormat('hh:mm'); return formatter.format(event.time); } String get eventAmPm { var formatter = DateFormat('a'); return formatter.format(event.time); } @override Widget build(BuildContext context) { return GestureDetector( onTap: () { showEventsModal( context, event, ); }, child: Container( decoration: const BoxDecoration( color: Color(0xfff9f9fb), borderRadius: BorderRadius.all(Radius.circular(10)) ), child: IntrinsicHeight( child: Row( children: [ Container( padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 5), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text(eventHour, style: furmanTextStyle(TextStyle( color: Colors.grey[800], fontWeight: FontWeight.w700 ))), Text(eventAmPm, style: Theme.of(context).textTheme.labelMedium), ], ), ), VerticalDivider( width: 2, thickness: 2, color: Colors.grey[200], ), Flexible( child: Container( padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(event.title, style: Theme.of(context).textTheme.titleSmall), const SizedBox(height: 6), TextWithIcon( icon: Icons.place_outlined, text: event.location, size: TextWithIconSize.small, ), const SizedBox(height: 2), TextWithIcon( icon: Icons.sell_outlined, text: event.category, size: TextWithIconSize.small, ), ], ), ), ), ], ), ), ), ); } }