import 'package:flutter/material.dart'; import 'package:hiddingsel_app/constants/constant.dart'; import 'package:intl/intl.dart'; import '../appflow/model/event.dart'; class CalendarListTile extends StatelessWidget { final EventModel _event; const CalendarListTile(this._event); @override Widget build(BuildContext context) { String time; if (_event.schedule.isAllDay) { time = 'Ganztägig'; } else { time = '${DateFormat('kk:mm').format(_event.schedule.startTime)} - ${DateFormat('kk:mm').format(_event.schedule.endTime)} Uhr'; } return Card(child: ExpansionTile( leading: ShaderMask( shaderCallback: (Rect bounds) { return UIGradiants.yellow.createShader(bounds); }, child: Container( width: UIShapes.paddingSimple, decoration: new BoxDecoration( color: Colors.white, shape: BoxShape.circle, ), ), ), title: Text(_event.name, style: UITheme.theme.textTheme.displaySmall,), childrenPadding: EdgeInsets.all(UIShapes.paddingSimple), children: [ Container( width: 1000, child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('Termin: $time', style: UITheme.theme.textTheme.bodyLarge,), Divider(), Text('Ort: ${_event.contact.location?.address ?? 'Keine Angabe'}', style: UITheme.theme.textTheme.bodyLarge,), Divider(), Text('Veranstalter: ${_event.eventOrganizer.map((e) => e.name).toList().join(', ')}', style: UITheme.theme.textTheme.bodyLarge,), ], ),), ], ), ); } }