Skip to content

Commit

Permalink
Merge pull request #304 from aeecleclair/fix/admin-pop-up-overflow
Browse files Browse the repository at this point in the history
Fix overflow on admin calendar pop up
  • Loading branch information
guillaumetavernier committed Mar 3, 2024
2 parents dc5b8a8 + e12bde5 commit 0d8b573
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 81 deletions.
155 changes: 77 additions & 78 deletions lib/booking/ui/calendar/calendar_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,103 +19,102 @@ class CalendarDialog extends StatelessWidget {
child: Stack(
clipBehavior: Clip.none,
children: [
Container(
ListView(
shrinkWrap: true,
padding: const EdgeInsets.all(20),
child: IntrinsicWidth(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
children: [
Text(
'${booking.room.name} - ${booking.reason}',
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
const SizedBox(height: 10),
Text(
formatRecurrenceRule(
booking.start, booking.end, booking.recurrenceRule, false),
style: TextStyle(
fontWeight: FontWeight.w400,
color: Colors.grey.shade400,
fontSize: 15,
),
),
const SizedBox(height: 10),
Text(
"${BookingTextConstants.bookedfor} ${booking.entity} ${BookingTextConstants.by} ${booking.applicant.getName()}",
style: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 15,
),
),
if (isManager) ...[
const SizedBox(height: 10),
const Divider(
thickness: 3,
),
const SizedBox(height: 10),
if (booking.note != null)
Text(
'${booking.room.name} - ${booking.reason}',
booking.note!,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
const SizedBox(height: 10),
Text(
formatRecurrenceRule(booking.start, booking.end,
booking.recurrenceRule, false),
style: TextStyle(
fontWeight: FontWeight.w400,
color: Colors.grey.shade400,
color: Colors.grey,
fontSize: 15,
),
),
const SizedBox(height: 10),
Text(
"${BookingTextConstants.bookedfor} ${booking.entity} ${BookingTextConstants.by} ${booking.applicant.getName()}",
style: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 15,
if (booking.note != null) const SizedBox(height: 20),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CalendarDialogButton(
uri: 'mailto:${booking.applicant.email}',
icon: HeroIcons.atSymbol,
),
),
if (isManager) ...[
const SizedBox(height: 10),
const Divider(
thickness: 3,
const SizedBox(
width: 20,
),
const SizedBox(height: 10),
if (booking.note != null)
Text(
booking.note!,
Flexible(
child: Text(
booking.applicant.email.toString(),
style: const TextStyle(
fontWeight: FontWeight.w400,
color: Colors.grey,
fontSize: 15,
),
),
if (booking.note != null) const SizedBox(height: 20),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CalendarDialogButton(
uri: 'mailto:${booking.applicant.email}',
heroIcons: HeroIcons.atSymbol,
),
const SizedBox(
width: 20,
),
Text(
booking.applicant.email.toString(),
style: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 15,
),
),
],
),
],
),
const SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CalendarDialogButton(
uri: (booking.applicant.phone != null)
? 'sms:${booking.applicant.phone}'
: null,
icon: HeroIcons.chatBubbleBottomCenterText,
),
const SizedBox(
height: 10,
width: 20,
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CalendarDialogButton(
uri: (booking.applicant.phone != null)
? 'sms:${booking.applicant.phone}'
: null,
heroIcons: HeroIcons.chatBubbleBottomCenterText,
),
const SizedBox(
width: 20,
),
Text(
booking.applicant.phone ??
BookingTextConstants.noPhoneRegistered,
style: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 15,
),
Flexible(
child: Text(
booking.applicant.phone ??
BookingTextConstants.noPhoneRegistered,
style: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 15,
),
],
),
),
]
],
),
),
],
),
],
],
),
Positioned(
top: -10,
Expand Down
6 changes: 3 additions & 3 deletions lib/booking/ui/calendar/calendar_dialog_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import 'package:url_launcher/url_launcher.dart';

class CalendarDialogButton extends StatelessWidget {
final String? uri;
final HeroIcons heroIcons;
final HeroIcons icon;
const CalendarDialogButton(
{super.key, required this.uri, required this.heroIcons});
{super.key, required this.uri, required this.icon});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -47,7 +47,7 @@ class CalendarDialogButton extends StatelessWidget {
],
),
child: HeroIcon(
heroIcons,
icon,
color: Colors.black,
),
),
Expand Down

0 comments on commit 0d8b573

Please sign in to comment.