diff --git a/assets/data/nollning_26/calendar/alcfree_icon.png b/assets/data/nollning_26/calendar/alcfree_icon.png new file mode 100644 index 00000000..1855cdea Binary files /dev/null and b/assets/data/nollning_26/calendar/alcfree_icon.png differ diff --git a/assets/data/nollning_26/calendar/alcfull_icon.png b/assets/data/nollning_26/calendar/alcfull_icon.png new file mode 100644 index 00000000..50831466 Binary files /dev/null and b/assets/data/nollning_26/calendar/alcfull_icon.png differ diff --git a/assets/data/nollning_26/calendar/byob_icon.png b/assets/data/nollning_26/calendar/byob_icon.png new file mode 100644 index 00000000..febad7d3 Binary files /dev/null and b/assets/data/nollning_26/calendar/byob_icon.png differ diff --git a/assets/data/nollning_26/calendar/event_background.png b/assets/data/nollning_26/calendar/event_background.png new file mode 100644 index 00000000..0145a400 Binary files /dev/null and b/assets/data/nollning_26/calendar/event_background.png differ diff --git a/assets/data/nollning_26/calendar/event_banner.png b/assets/data/nollning_26/calendar/event_banner.png new file mode 100644 index 00000000..d8f29fc1 Binary files /dev/null and b/assets/data/nollning_26/calendar/event_banner.png differ diff --git a/lib/screens/calendar/calendar.dart b/lib/screens/calendar/calendar.dart index 78ac6f2c..bf1aa02e 100644 --- a/lib/screens/calendar/calendar.dart +++ b/lib/screens/calendar/calendar.dart @@ -1,10 +1,12 @@ import 'package:flutter/material.dart'; -import 'package:fsek_mobile/api_client/lib/api_client.dart'; -import 'package:fsek_mobile/services/api.service.dart'; import 'package:intl/intl.dart'; import 'package:table_calendar/table_calendar.dart'; +import 'package:url_launcher/url_launcher.dart'; +import 'package:fsek_mobile/api_client/lib/api_client.dart'; +import 'package:fsek_mobile/services/api.service.dart'; import 'package:fsek_mobile/screens/event/event.dart'; import 'package:fsek_mobile/l10n/app_localizations.dart'; + class Calendar extends StatefulWidget { @override _CalendarState createState() => _CalendarState(); @@ -15,7 +17,10 @@ class _CalendarState extends State { DateTime _selectedDay = DateTime.now().toLocal(); List _selectedEvents = []; List _events = []; + + @override void initState() { + super.initState(); _selectedDay = DateTime.utc(_now.year, _now.month, _now.day); ApiService.apiClient .getEventsApi() @@ -24,235 +29,224 @@ class _CalendarState extends State { this._events = value.data!.toList(); _selectedEvents = _getEventsForDay(_selectedDay); })); - super.initState(); } + void openEventPage(EventRead event) { Navigator.push(context, - MaterialPageRoute(builder: (context) => EventPage(eventId: event.id))); + MaterialPageRoute(builder: (context) => EventPage(event: event, eventId: event.id))); } - List _getEventsForDay(DateTime day) { + List _getEventsForDay(DateTime day) { final events = this._events.where((item) => isSameDay(item.startsAt.toLocal(), day)).toList(); events.sort((a, b) => a.startsAt.compareTo(b.startsAt)); return events; } + Future _onRefresh() async { - ApiService.apiClient + return ApiService.apiClient .getEventsApi() .eventsGetAllEvents() - .then((value) => setState(() { - this._events = value.data!.toList(); - _selectedEvents = _getEventsForDay(_selectedDay); - })); + .then((value) { + if(!mounted) return; // We don't want to do a setstate when the state is no longer active. + setState(() { + this._events = value.data!.toList(); + _selectedEvents = _getEventsForDay(_selectedDay); + }); + }); } - Widget checkAlcoholEventType(String alcType, {bool isIcon = false}){ - final String alcServed = "assets/data/nollning_25/calendar/alkfullImg.png"; - final String noAlc = "assets/data/nollning_25/calendar/alkfriImg.png"; - final String byob = "assets/data/nollning_25/calendar/byobImg.png"; - final String alcServedIcon = "assets/data/nollning_25/calendar/alkfullIcon.png"; - final String noAlcIcon = "assets/data/nollning_25/calendar/alkfriIcon.png"; - final String byobIcon = "assets/data/nollning_25/calendar/byobIcon.png"; - + Widget? checkAlcoholEventType(String alcType, {bool isNollning = false}){ switch (alcType) { case "Alcohol-Served": - if (isIcon) return Image.asset(alcServedIcon, fit: BoxFit.fill); + if (isNollning) { + return Image.asset("assets/data/nollning_26/calendar/alcfull_icon.png"); + } - return Image.asset(alcServed, fit: BoxFit.fill); + return Icon(Icons.wine_bar_rounded); case "Alcohol": - if (isIcon) return Image.asset(byobIcon, fit: BoxFit.fill); + if (isNollning) { + return Image.asset("assets/data/nollning_26/calendar/byob_icon.png"); + } - return Image.asset(byob, fit: BoxFit.fill); + return null; default: - if (isIcon) return Image.asset(noAlcIcon, fit: BoxFit.fill); + if (isNollning) { + return Image.asset("assets/data/nollning_26/calendar/alcfree_icon.png"); + } - return Image.asset(noAlc, fit: BoxFit.fill); + return null; } } Widget createEventCard(EventRead event) { String locale = Localizations.localeOf(context).toString(); var t = AppLocalizations.of(context)!; - if(event.isNollningEvent) { - return Container( - child: Card( - shadowColor: Colors.transparent, - color: Colors.transparent, - surfaceTintColor: null, - child: InkWell( - onTap: () => openEventPage(event), - child: Container( - margin: EdgeInsets.zero, - child: Stack( - children: [ - Positioned.fill(child: checkAlcoholEventType(event.alcoholEventType)), - Container(child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding(padding: EdgeInsets.only(top: 5)), - Container( - margin: EdgeInsets.only(bottom: 7, left: 30), - child: Text( - t.localeName == "en" ? event.titleEn : event.titleSv, - style: TextStyle( - fontFamily: "MinionPro", - fontWeight: FontWeight.bold, - fontSize: 20, - color: Color(0xFFFCBD1D) - ), - textAlign: TextAlign.left, - ), - ), - Row( - children: [ - Padding(padding: EdgeInsets.only(left: 30)), - Icon( - Icons.access_time_rounded, - size: 20, - ), - Text( - /* better error checking */ - " " + - DateFormat("HH:mm") - .format(event.startsAt.toLocal()) + - " - " + - DateFormat("HH:mm").format(event.endsAt.toLocal()) + - ", " + - DateFormat("MMMMd", locale) - .format(event.startsAt.toLocal()), - style: TextStyle( - fontFamily: "MinionPro", - fontWeight: FontWeight.normal, - fontSize: 15, - ), - textAlign: TextAlign.left, - ), - ], - ), - Row( - children: [ - Padding(padding: EdgeInsets.only(left: 30)), - Icon( - Icons.room, - size: 20, - ), - Text( - " " + - event.location, - style: TextStyle( - fontSize: 14, - color: Theme.of(context).colorScheme.onSurface, - ), - textAlign: TextAlign.left, - ), - ], + + final formattedStartTime = DateFormat("HH:mm").format(event.startsAt.toLocal()); + final formattedEndTime = DateFormat("HH:mm").format(event.endsAt.toLocal()); + final formattedDay = DateFormat("MMMMd", locale).format(event.startsAt.toLocal()); + + final alcPolicyImage = checkAlcoholEventType(event.alcoholEventType, isNollning: event.isNollningEvent); + + return Card( + elevation: 5, + shadowColor: null, + color: null, + margin: const EdgeInsets.all(5), + child: InkWell( + onTap: () => openEventPage(event), + child: LayoutBuilder( + builder: (context, constraints) { + const imageWidth = 940; + // const imageHeight = 280; + + final scale = imageWidth / constraints.maxWidth; + + const horizontalSlice = 70.0; + const verticalSlice = 108.5; + final scaledCenterSlice = Rect.fromLTWH( + horizontalSlice / scale, + verticalSlice / scale, + (imageWidth - 2 * horizontalSlice) / scale, + 1 / scale + ); + + return Container( + padding: event.isNollningEvent ? const EdgeInsets.only(left: 20, top: 20, right: 20, bottom: 40) : const EdgeInsets.all(10), + decoration: !event.isNollningEvent ? null : BoxDecoration( + image: DecorationImage( + image: ResizeImage( // Can not just use scale in DecorationImage because it is prone to floating point errors + AssetImage("assets/data/nollning_26/calendar/event_banner.png"), + width: constraints.maxWidth.toInt() // imageWidth / scale + // height: (constraints.maxWidth * imageHeight / imageWidth).toInt() // imageHeight / scale ), - Padding(padding: EdgeInsets.only(bottom: 10)) - ])) - ], + invertColors: Theme.of(context).brightness == Brightness.dark, // is this the correct way to do this? + centerSlice: scaledCenterSlice // To hide stretching + ) ), - ), - ))); + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(bottom: 7), + child: Text( + t.localeName == "en" ? event.titleEn : event.titleSv, + style: TextStyle( + fontSize: 20, + color: Theme.of(context).colorScheme.primary, + ), + // overflow: TextOverflow.ellipsis + ) + ), - } else { + Row( + children: [ + const Icon( + Icons.access_time_rounded, + size: 20 + ), - return Container( - child: Card( - shadowColor: null, - color: null, - child: InkWell( - onTap: () => openEventPage(event), - child: Container( - margin: EdgeInsets.zero, - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(bottom: 7), - child: Text( - t.localeName == "en" ? event.titleEn : event.titleSv, - style: TextStyle( - fontSize: 20, - color: Theme.of(context).colorScheme.primary, - ), - textAlign: TextAlign.left, - ), - ), - Row( - children: [ - Icon( - Icons.access_time_rounded, - size: 20, - ), - Text( - /* better error checking */ - " " + - DateFormat("HH:mm") - .format(event.startsAt.toLocal()) + - " - " + - DateFormat("HH:mm").format(event.endsAt.toLocal()) + - ", " + - DateFormat("MMMMd", locale) - .format(event.startsAt.toLocal()), - style: TextStyle( - fontSize: 14, + Padding( + padding: const EdgeInsets.only(left: 10), + child: Text( + /* better error checking */ + "$formattedStartTime - $formattedEndTime, $formattedDay", + style: const TextStyle( + fontSize: 14, + ) + ) + ), + ] ), - textAlign: TextAlign.left, - ), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.end, + + Row( children: [ - // Alcohol is served - if (event.alcoholEventType == "Alcohol-Served") - Icon(Icons.wine_bar_rounded, size: 20), + const Icon( + Icons.room, + size: 20, + ), + + Padding( + padding: const EdgeInsets.only(left: 10), + child: Text( + event.location, + style: TextStyle( + fontSize: 14, + color: Theme.of(context).colorScheme.onSurface, + ) + ) + ), ], ), - ) - ], - ), - Row( - children: [ - Icon( - Icons.room, - size: 20, - ), - Text( - " " + - event.location, - style: TextStyle( - fontSize: 14, - color: Theme.of(context).colorScheme.onSurface, - ), - textAlign: TextAlign.left, - ), - ], + ], + ) ), - ], - ), - margin: EdgeInsets.all(10), - ), - ), - ), - // Introduction events background needs access to entire card - margin: EdgeInsets.all(4), - ), + + if (alcPolicyImage != null) + SizedBox( + width: 40, + height: 40, + child: alcPolicyImage + ), + ] + ) + ); + } + ) + ) ); - } } + Widget? _getMarkers(List events) { + if (events.isEmpty) return null; + + return FittedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: events.map((event) { + final alcPolicyImage = checkAlcoholEventType(event.alcoholEventType, isNollning: event.isNollningEvent); + + if (!event.isNollningEvent || alcPolicyImage == null) { + return Container( + width: 10, + height: 10, + margin: const EdgeInsets.symmetric(horizontal: 1), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.inverseSurface, + shape: BoxShape.circle + ) + ); + } + + return Container( + width: 16, + height: 16, + margin: const EdgeInsets.symmetric(horizontal: 1), + child: alcPolicyImage + ); + }).toList() + ) + ); + } + + Future openExportCalendarLink() async { + final uri = Uri.parse("https://fsektionen.se/calendar#subscribe"); + + await launchUrl( + uri, + mode: LaunchMode.externalApplication // for some reason it gives a PlatformError when not having this + ); +} + @override Widget build(BuildContext context) { String locale = Localizations.localeOf(context).toString(); - if (locale == "sv") { - DateFormat("MMMMEEEEd", "sv_SE").format(_selectedDay); - } else { - DateFormat("MMMMEEEEd", "en_US").format(_selectedDay); - } + return Container( height: MediaQuery.of(context).size.height, color: Theme.of(context).colorScheme.surface, @@ -293,37 +287,39 @@ class _CalendarState extends State { eventLoader: (day) { return _getEventsForDay(day); }, + headerStyle: HeaderStyle( + leftChevronIcon: Icon( + color: Theme.of(context).primaryColor, + Icons.chevron_left, + size: 25 + ), + + rightChevronIcon: Icon( + color: Theme.of(context).primaryColor, + Icons.chevron_right, + size: 25 + ) + ), calendarBuilders: CalendarBuilders( - markerBuilder: (context, day, events) { - if (events.isEmpty) return null; - - final defaultMarkerAnon = (Color color) => Container( - width: 8, - height: 8, - margin: const EdgeInsets.all(1), - decoration: BoxDecoration( - color: color, - shape: BoxShape.circle, + markerBuilder: (context, day, events) => _getMarkers(events), + headerTitleBuilder: (context, day) => Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + DateFormat("MMMM yyyy", locale).format(day), + style: const TextStyle( + fontSize: 18 + ) ), - ); - - return Row( - mainAxisAlignment: MainAxisAlignment.center, - children: events.map((event) { - if (!event.isNollningEvent) { - return defaultMarkerAnon(Theme.of(context).colorScheme.inverseSurface); - } - - return Container( - width: 13, - height: 13, - margin: EdgeInsets.all(1), - child: checkAlcoholEventType(event.alcoholEventType, isIcon: true), - ); - }).toList(), - ); - }, - ), + + IconButton( + icon: const Icon(Icons.open_in_browser_rounded), + color: Theme.of(context).primaryColor, + onPressed: openExportCalendarLink + ), + ] + ) + ) ), Container( alignment: Alignment.centerLeft, diff --git a/lib/screens/event/event.dart b/lib/screens/event/event.dart index 021da582..d1784a33 100644 --- a/lib/screens/event/event.dart +++ b/lib/screens/event/event.dart @@ -11,14 +11,21 @@ import 'package:fsek_mobile/api_client/lib/api_client.dart'; import 'package:flutter_markdown_plus/flutter_markdown_plus.dart'; class EventPage extends StatefulWidget { - final int eventId; - EventPage({Key? key, required this.eventId}) : super(key: key); + final EventRead? event; + final int? eventId; + + EventPage({ + super.key, + this.eventId, + this.event + }); + @override _EventPageState createState() => _EventPageState(); } class _EventPageState extends State { - EventRead? event; + late EventRead? event = widget.event; UserForEventSignupRead? user; String? userType; GroupRead? group; @@ -67,23 +74,29 @@ class _EventPageState extends State { "AlcoholFree": EventSignupCreateDrinkPackageEnum.alcoholFree, }; + @override void initState() { super.initState(); _loadInitData(); } Future _loadInitData() async { + // Loads/reloads event + try { + final usedEventId = widget.eventId ?? this.event?.id; + if (usedEventId == null) return; + final eventResponse = await ApiService.apiClient .getEventsApi() - .eventsGetSingleEvent(eventId: widget.eventId); + .eventsGetSingleEvent(eventId: usedEventId); final event = eventResponse.data; if (event == null) return; final userResponse = await ApiService.apiClient .getEventSignupApi() - .eventSignupGetMeForEventSignup(eventId: widget.eventId); + .eventSignupGetMeForEventSignup(eventId: event.id); final user = userResponse.data; if (user == null) return; @@ -215,182 +228,218 @@ class _EventPageState extends State { return Scaffold( appBar: AppBar(title: Text(t.eventTitle)), - body: Container( - width: double.infinity, - child: Padding( - padding: const EdgeInsets.all(16.0), - child: RefreshIndicator( - onRefresh: () => _onRefresh(), - child: ListView( - children: [ - Text( - locale == "sv" ? event!.titleSv : event!.titleEn, - style: Theme.of( - context, - ).textTheme.headlineMedium!.copyWith(fontSize: 30), + body: RefreshIndicator( + onRefresh: () => _onRefresh(), + child: SingleChildScrollView( + physics: const AlwaysScrollableScrollPhysics(), + child: LayoutBuilder( + builder: (context, constraints) { + const imageWidth = 579; + const imageHeight = 1000; + + final scale = imageWidth / constraints.maxWidth; + + const horizontalSlice = 50.0; + const verticalSlice = 50.0; + final scaledCenterSlice = Rect.fromLTWH( + horizontalSlice / scale, + verticalSlice / scale, + (imageWidth - 2 * horizontalSlice) / scale, + (imageHeight - 2 * verticalSlice) / scale + ); + + return Container( + padding: const EdgeInsets.all(16.0), + constraints: BoxConstraints( + minHeight: MediaQuery.of(context).size.height - kToolbarHeight - MediaQuery.of(context).padding.top, ), - Divider(color: null), - Row( - children: [ - Icon(Icons.access_time_rounded), - Text( - /* better error checking */ - " " + - DateFormat("HH:mm").format( - event?.startsAt.toLocal() ?? DateTime.now(), - ) + - getDots() + - " - " + - DateFormat( - "HH:mm", - ).format(event?.endsAt.toLocal() ?? DateTime.now()) + - ", " + - DateFormat( - "MMMMd", - locale, - ).format(event?.startsAt.toLocal() ?? DateTime.now()), - style: TextStyle( - fontSize: 14, - color: Theme.of(context).textTheme.bodyMedium!.color, - ), + decoration: !event!.isNollningEvent ? null : BoxDecoration( + image: DecorationImage( + image: ResizeImage( // Can not just use scale in DecorationImage because it is prone to floating point errors + AssetImage("assets/data/nollning_26/calendar/event_background.png"), + width: constraints.maxWidth.toInt() // imageWidth / scale ), - ], + invertColors: Theme.of(context).brightness == Brightness.dark, // is this the correct way to do this? + centerSlice: scaledCenterSlice, // To hide stretching + ), ), - Row( + child: Column( + crossAxisAlignment: event!.isNollningEvent ? CrossAxisAlignment.center : CrossAxisAlignment.start, children: [ - Icon(Icons.room), - Text( - " " + (event?.location ?? "intigheten"), - style: TextStyle( - fontSize: 14, - color: Theme.of(context).textTheme.bodyMedium!.color, - ), + Padding( + padding: event!.isNollningEvent ? EdgeInsets.symmetric(horizontal: 25) : EdgeInsets.zero, // padding is not actually constant (depends on scale) but not too important + child: Text( + locale == "sv" ? event!.titleSv : event!.titleEn, + style: Theme.of( + context, + ).textTheme.headlineMedium!.copyWith(fontSize: 30), + textAlign: event!.isNollningEvent ? TextAlign.center : TextAlign.start + ) ), - ], - ), - Divider(color: null), - Container( - margin: EdgeInsets.fromLTRB(0, 0, 0, 0), - width: double.infinity, - /* should be parsed html */ - child: Markdown( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - data: - (locale == "sv" - ? event!.descriptionSv - : event!.descriptionEn) - .replaceAll("
", ""), - onTapLink: (text, href, title) { - if (href != null) { - launchUrl(Uri.parse(href)); - } - }, - styleSheet: MarkdownStyleSheet.fromTheme(Theme.of(context)) - .copyWith( - p: Theme.of( - context, - ).textTheme.bodyMedium?.copyWith(height: 1.2), - ), - ), - ), - Divider(color: null), - Padding( - padding: const EdgeInsets.fromLTRB(0, 5, 0, 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [Text(t.eventDressCode + event!.dressCode)], - ), - Visibility( - visible: event!.price <= 0 ? false : true, - child: Text( - t.eventPrice + - (event?.price.toString() ?? "") + - " kr", + Divider(color: null), + Row( + children: [ + Icon(Icons.access_time_rounded), + Text( + /* better error checking */ + " " + + DateFormat("HH:mm").format( + event?.startsAt.toLocal() ?? DateTime.now(), + ) + + getDots() + + " - " + + DateFormat( + "HH:mm", + ).format(event?.endsAt.toLocal() ?? DateTime.now()) + + ", " + + DateFormat( + "MMMMd", + locale, + ).format(event?.startsAt.toLocal() ?? DateTime.now()), + style: TextStyle( + fontSize: 14, + color: Theme.of(context).textTheme.bodyMedium!.color, + ), ), - ), - ], - ), - ), - Divider(color: null), - Padding( - padding: const EdgeInsets.fromLTRB(0, 5, 0, 5), - child: Column( - children: [ - Visibility( - visible: event!.price <= 0 ? false : true, - child: Row( - children: [ - Icon(Icons.attach_money_rounded), - Text(t.eventCostsMoney), - ], + ], + ), + Row( + children: [ + Icon(Icons.room), + Text( + " " + (event?.location ?? "intigheten"), + style: TextStyle( + fontSize: 14, + color: Theme.of(context).textTheme.bodyMedium!.color, + ), ), + ], + ), + Divider(color: null), + Container( + margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + width: double.infinity, + /* should be parsed html */ + child: Markdown( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + data: + (locale == "sv" + ? event!.descriptionSv + : event!.descriptionEn) + .replaceAll("
", ""), + onTapLink: (text, href, title) { + if (href != null) { + launchUrl(Uri.parse(href)); + } + }, + styleSheet: MarkdownStyleSheet.fromTheme(Theme.of(context)) + .copyWith( + p: Theme.of( + context, + ).textTheme.bodyMedium?.copyWith(height: 1.2), + ), ), - Visibility( - visible: event!.food, - child: Row( - children: [ - Icon(Icons.restaurant_rounded), - Text(t.eventFoodServed), - ], - ), + ), + Divider(color: null), + Padding( + padding: const EdgeInsets.fromLTRB(0, 5, 0, 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [Text(t.eventDressCode + event!.dressCode)], + ), + Visibility( + visible: event!.price <= 0 ? false : true, + child: Text( + t.eventPrice + + (event?.price.toString() ?? "") + + " kr", + ), + ), + ], ), - nollningEventRow(event!, context), - alcoholEventRow(event!, context), - Visibility( - visible: event!.canSignup, - child: Row( - children: [ - Icon(Icons.event_rounded), - Text(t.eventHasSignup), - ], - ), + ), + Divider(color: null), + Padding( + padding: const EdgeInsets.fromLTRB(0, 5, 0, 5), + child: Column( + children: [ + Visibility( + visible: event!.price <= 0 ? false : true, + child: Row( + children: [ + Icon(Icons.attach_money_rounded), + Text(t.eventCostsMoney), + ], + ), + ), + Visibility( + visible: event!.food, + child: Row( + children: [ + Icon(Icons.restaurant_rounded), + Text(t.eventFoodServed), + ], + ), + ), + nollningEventRow(event!, context), + alcoholEventRow(event!, context), + Visibility( + visible: event!.canSignup, + child: Row( + children: [ + Icon(Icons.event_rounded), + Text(t.eventHasSignup), + ], + ), + ), + Visibility( + visible: event!.lottery, + child: Row( + children: [ + Icon(Icons.casino_outlined), + Text(" " + t.eventHasLottery), + ], + ), + ), + ], ), - Visibility( - visible: event!.lottery, - child: Row( + ), + Visibility( + visible: event!.canSignup, + child: Divider(color: null), + ), + Visibility( + visible: (!(event!.council == null)), + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon(Icons.casino_outlined), - Text(" " + t.eventHasLottery), + Text(t.eventInCaseOfQuestions), + InkWell( + child: new Text( + t.localeName == "sv" + ? event!.council.nameSv + : event!.council.nameEn, + style: TextStyle(color: Colors.blue[300]), + ), + onTap: () => _goToPostContact(event!.council.nameSv), + ), + Divider(color: null), ], ), ), - ], - ), - ), - Visibility( - visible: event!.canSignup, - child: Divider(color: null), - ), - Visibility( - visible: (!(event!.council == null)), - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(t.eventInCaseOfQuestions), - InkWell( - child: new Text( - t.localeName == "sv" - ? event!.council.nameSv - : event!.council.nameEn, - style: TextStyle(color: Colors.blue[300]), - ), - onTap: () => _goToPostContact(event!.council.nameSv), - ), - Divider(color: null), - ], ), - ), + signupInfoWidget(), + ], ), - signupInfoWidget(), - ], - ), - ), - ), - ), + ); + } + ) + ) + ) ); } diff --git a/pubspec.yaml b/pubspec.yaml index 2929cbf2..558eee21 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -139,6 +139,7 @@ flutter: - assets/data/nollning_26/homescreen/lvl_2/ - assets/data/nollning_26/homescreen/lvl_3/ - assets/data/nollning_26/homescreen/lvl_4/ + - assets/data/nollning_26/calendar/ - assets/data/nollning_26/map/ - assets/data/nollning_26/map/pin_media/