From 1cec89598b3ff4f7cde15561bbe17597bfa77971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Bl=C3=A5man?= Date: Fri, 18 Sep 2026 01:09:24 +0200 Subject: [PATCH] Fixed closed events still showing signup card --- lib/screens/event/event.dart | 146 +++++++++++++++++------------------ 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/lib/screens/event/event.dart b/lib/screens/event/event.dart index d1784a33..cd4c80bf 100644 --- a/lib/screens/event/event.dart +++ b/lib/screens/event/event.dart @@ -671,7 +671,7 @@ class _EventPageState extends State { Widget signupInfoWidget() { var t = AppLocalizations.of(context)!; - Widget signup; + Widget? signup = null; String locale = Localizations.localeOf(context).toString(); // If no event if (event == null) { @@ -727,56 +727,80 @@ class _EventPageState extends State { ), ); } - if (event!.canSignup) { - if (isSignupOpen(event!) == "open") { - signup = signupWidget(t); - } else { - if (isSignupOpen(event!) == "closed") { - if (eventSignup == null) { - signup = Row( - children: [ - Icon( - Icons.info_outline_rounded, - color: Colors - .red[300], // I don't like it, but this hardcoding kinda just works - ), - Text( - t.eventNotSignedUp, - style: TextStyle(color: Colors.red[300]), - ), - ], - ); - } else { - String? groupName = eventSignup!.groupName; - String userType = eventSignup!.priority; - if (event!.eventUsersConfirmed) { - if (!eventSignup!.confirmedStatus) { - signup = Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Icon(Icons.cancel, color: Colors.red[300]), - Text( - t.eventNoSpot, - style: TextStyle(color: Colors.red[300]), - ), - ], - ), - Divider(color: null), - ..._signupDetails(groupName, userType), - ], - ); + if (!event!.closed) { + if (event!.canSignup) { + if (isSignupOpen(event!) == "open") { + signup = signupWidget(t); + } else { + if (isSignupOpen(event!) == "closed") { + if (eventSignup == null) { + signup = Row( + children: [ + Icon( + Icons.info_outline_rounded, + color: Colors + .red[300], // I don't like it, but this hardcoding kinda just works + ), + Text( + t.eventNotSignedUp, + style: TextStyle(color: Colors.red[300]), + ), + ], + ); + } else { + String? groupName = eventSignup!.groupName; + String userType = eventSignup!.priority; + if (event!.eventUsersConfirmed) { + if (!eventSignup!.confirmedStatus) { + signup = Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(Icons.cancel, color: Colors.red[300]), + Text( + t.eventNoSpot, + style: TextStyle(color: Colors.red[300]), + ), + ], + ), + Divider(color: null), + ..._signupDetails(groupName, userType), + ], + ); + } else { + signup = Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(Icons.check_circle, color: Colors.green[300]), + Text( + t.eventGotSpot, + style: TextStyle(color: Colors.green[300]), + ), + ], + ), + Divider(color: null), + ..._signupDetails(groupName, userType), + ], + ); + } } else { signup = Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ - Icon(Icons.check_circle, color: Colors.green[300]), + Icon( + Icons.info_outline_rounded, + color: Theme.of(context).colorScheme.primary, + ), Text( - t.eventGotSpot, - style: TextStyle(color: Colors.green[300]), + t.eventLotterySpot, + style: TextStyle( + color: Theme.of(context).colorScheme.primary, + ), ), ], ), @@ -785,36 +809,10 @@ class _EventPageState extends State { ], ); } - } else { - signup = Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Icon( - Icons.info_outline_rounded, - color: Theme.of(context).colorScheme.primary, - ), - Text( - t.eventLotterySpot, - style: TextStyle( - color: Theme.of(context).colorScheme.primary, - ), - ), - ], - ), - Divider(color: null), - ..._signupDetails(groupName, userType), - ], - ); } - } - } else { - signup = SizedBox.shrink(); + } } } - } else { - signup = SizedBox.shrink(); } return Container( @@ -882,8 +880,10 @@ class _EventPageState extends State { ), ), Divider(color: null), - signup, - Divider(color: null), + if (signup != null) ...[ + signup, + Divider(color: null), + ], Container( margin: EdgeInsets.all(10), child: Column(