diff --git a/elaichi/lib/data/remote/graphql/queries.dart b/elaichi/lib/data/remote/graphql/queries.dart index 815e3009..70a44406 100644 --- a/elaichi/lib/data/remote/graphql/queries.dart +++ b/elaichi/lib/data/remote/graphql/queries.dart @@ -76,6 +76,12 @@ class Queries { type status locationID + location { + name + description + lat + long + } pocID orgID } diff --git a/elaichi/lib/presentation/home/fest/explore/cubit/registration_cubit.dart b/elaichi/lib/presentation/home/fest/explore/cubit/registration_cubit.dart index 6fd9e933..10413c33 100644 --- a/elaichi/lib/presentation/home/fest/explore/cubit/registration_cubit.dart +++ b/elaichi/lib/presentation/home/fest/explore/cubit/registration_cubit.dart @@ -18,7 +18,10 @@ class RegistrationCubit extends Cubit { List eventRegistrations = []; - Future createEventRegistration({required Event event}) async { + Future createEventRegistration({ + required Event event, + required String page, + }) async { emit(RegistrationState.loading(eventID: event.id)); final user = _userRepository.user; @@ -29,7 +32,8 @@ class RegistrationCubit extends Cubit { userID: user.id, ); eventRegistration.fold( - (exception) => emit(RegistrationState.error(error: exception.message!)), + (exception) => + emit(RegistrationState.error(error: '${exception.message!} $page')), (eventRegistration) async { eventRegistration ??= EventRegistration( id: 'abc', @@ -46,7 +50,7 @@ class RegistrationCubit extends Cubit { }, ); } else { - emit(const RegistrationState.error(error: 'User Not Registered')); + emit(RegistrationState.error(error: 'User Not Registered $page')); } } diff --git a/elaichi/lib/presentation/home/fest/explore/event_details_page.dart b/elaichi/lib/presentation/home/fest/explore/event_details_page.dart index 918cfc95..5734053b 100644 --- a/elaichi/lib/presentation/home/fest/explore/event_details_page.dart +++ b/elaichi/lib/presentation/home/fest/explore/event_details_page.dart @@ -33,14 +33,15 @@ class EventDetailsPage extends StatelessWidget { child: Scaffold( bottomNavigationBar: RegisterBottomBar( child: BlocConsumer( + bloc: context.read(), listener: (context, state) { state.whenOrNull( success: () {}, error: (error) { - if (error == 'User Not Registered') { - Navigator.pushNamed( - context, - AppRouter.registration, + if (error == 'User Not Registered Event_Details') { + toastUtil.showToast( + mode: ToastMode.Error, + title: 'Please Register for Fest First', ); } else { toastUtil.showToast( @@ -69,6 +70,7 @@ class EventDetailsPage extends StatelessWidget { .read() .createEventRegistration( event: event, + page: 'Event_Details', ); }, text: 'Register', @@ -80,6 +82,7 @@ class EventDetailsPage extends StatelessWidget { .read() .createEventRegistration( event: event, + page: 'Event_Details', ); }, text: 'Register', @@ -95,6 +98,7 @@ class EventDetailsPage extends StatelessWidget { .read() .createEventRegistration( event: event, + page: 'Event_Details', ); }, text: 'Register', diff --git a/elaichi/lib/presentation/home/fest/explore/widgets/high_priority_event_card.dart b/elaichi/lib/presentation/home/fest/explore/widgets/high_priority_event_card.dart index 3765f2ce..5cff5e56 100644 --- a/elaichi/lib/presentation/home/fest/explore/widgets/high_priority_event_card.dart +++ b/elaichi/lib/presentation/home/fest/explore/widgets/high_priority_event_card.dart @@ -13,6 +13,7 @@ import 'package:elaichi/presentation/home/fest/explore/widgets/scrolling_text.da import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:intl/intl.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class HighPriorityEventCard extends StatelessWidget { HighPriorityEventCard({ @@ -134,15 +135,11 @@ class HighPriorityEventCard extends StatelessWidget { listener: (context, state) { state.whenOrNull( error: (error) { - if (error == 'User Not Registered') { - Navigator.pushNamed( - context, - AppRouter.registration, - ); - } else { - toastUtil.showToast( - mode: ToastMode.Error, - title: error, + if (error == + 'User Not Registered High_Priority_Event') { + launchUrlString( + 'https://inno.nitrkl.in/', + mode: LaunchMode.externalApplication, ); } }, @@ -164,6 +161,7 @@ class HighPriorityEventCard extends StatelessWidget { .read() .createEventRegistration( event: event, + page: 'High_Priority_Event', ); }, text: 'Register', @@ -176,6 +174,7 @@ class HighPriorityEventCard extends StatelessWidget { .read() .createEventRegistration( event: event, + page: 'High_Priority_Event', ); }, text: 'Register', @@ -192,6 +191,7 @@ class HighPriorityEventCard extends StatelessWidget { .read() .createEventRegistration( event: event, + page: 'High_Priority_Event', ); }, text: 'Register', diff --git a/elaichi/lib/presentation/home/fest/explore/widgets/speaker_event_card.dart b/elaichi/lib/presentation/home/fest/explore/widgets/speaker_event_card.dart index 138a995e..bf28ff9c 100644 --- a/elaichi/lib/presentation/home/fest/explore/widgets/speaker_event_card.dart +++ b/elaichi/lib/presentation/home/fest/explore/widgets/speaker_event_card.dart @@ -11,6 +11,7 @@ import 'package:elaichi/presentation/home/fest/explore/widgets/scrolling_text.da import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:intl/intl.dart'; +import 'package:url_launcher/url_launcher_string.dart'; class SpeakerEventCard extends StatelessWidget { SpeakerEventCard({ @@ -127,18 +128,14 @@ class SpeakerEventCard extends StatelessWidget { children: [ const SizedBox(width: 2), BlocConsumer( + bloc: context.read(), listener: (context, state) { state.whenOrNull( error: (error) { - if (error == 'User Not Registered') { - Navigator.pushNamed( - context, - AppRouter.registration, - ); - } else { - toastUtil.showToast( - mode: ToastMode.Error, - title: error, + if (error == 'User Not Registered Speaker') { + launchUrlString( + 'https://inno.nitrkl.in/', + mode: LaunchMode.externalApplication, ); } }, @@ -159,6 +156,7 @@ class SpeakerEventCard extends StatelessWidget { .read() .createEventRegistration( event: event, + page: 'Speaker', ); }, text: 'Register', @@ -171,6 +169,7 @@ class SpeakerEventCard extends StatelessWidget { .read() .createEventRegistration( event: event, + page: 'Speaker', ); }, text: 'Register', @@ -187,6 +186,7 @@ class SpeakerEventCard extends StatelessWidget { .read() .createEventRegistration( event: event, + page: 'Speaker', ); }, text: 'Register', diff --git a/elaichi/lib/presentation/home/fest/widgets/featured_events.dart b/elaichi/lib/presentation/home/fest/widgets/featured_events.dart index 52038d33..e0e1dfc5 100644 --- a/elaichi/lib/presentation/home/fest/widgets/featured_events.dart +++ b/elaichi/lib/presentation/home/fest/widgets/featured_events.dart @@ -32,86 +32,99 @@ class FeaturedEventCard extends StatelessWidget { @override Widget build(BuildContext context) { return SizedBox( - height: 280, + height: 250, child: PhysicalModel( elevation: 3, color: Colors.black, - shadowColor: Colors.grey, - child: Column( - children: [ - Image.asset( - Strings.hackNITR, - height: 100, - fit: BoxFit.fill, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.black, + border: Border.all( + color: AppColors.grey16.withOpacity(0.6), + width: 2, ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox(height: 12), - const SizedBox(height: 8), - SizedBox( - height: 32, - child: Text( - 'Explore further into your innovation journey with HackNITR 5.0 and manifest your skills.', - style: interTextTheme.bodyMedium!.copyWith( - fontWeight: FontWeight.w500, - color: AppColors.grey, - fontSize: 12, - height: 1.33, - ), - ), - ), - const SizedBox(height: 16), - const Divider( - thickness: 1, - height: 1, - color: AppColors.grey16, - ), - const SizedBox(height: 12), - SizedBox( - height: 50, - width: 326, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const DurationDates( - text: 'Coming Soon.', + ), + padding: const EdgeInsets.all(15), + child: Column( + children: [ + Image.asset( + Strings.hackNITR, + height: 75, + fit: BoxFit.fill, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 12), + const SizedBox(height: 8), + SizedBox( + height: 32, + child: Text( + 'Explore further into your innovation journey with HackNITR 5.0 and manifest your skills.', + style: interTextTheme.bodyMedium!.copyWith( + fontWeight: FontWeight.w500, color: AppColors.grey, - fontSize: 14, + fontSize: 12, + height: 1.33, ), - SizedBox( - height: 50, - width: 110, - child: TextButton( - onPressed: () { - launchUrlString('https://hacknitr.com/'); - }, - style: TextButton.styleFrom( - backgroundColor: AppColors.lightBlue, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(25), + ), + ), + const SizedBox(height: 16), + const Divider( + thickness: 1, + height: 1, + color: AppColors.grey16, + ), + const SizedBox(height: 12), + SizedBox( + height: 50, + width: 326, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const DurationDates( + text: 'Coming Soon.', + color: AppColors.grey, + fontSize: 14, + ), + SizedBox( + height: 50, + width: 110, + child: TextButton( + onPressed: () { + launchUrlString( + 'https://hacknitr.com/', + mode: LaunchMode.externalApplication, + ); + }, + style: TextButton.styleFrom( + backgroundColor: AppColors.lightBlue, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25), + ), ), - ), - child: Text( - 'Visit Website', - style: interTextTheme.bodyMedium!.copyWith( - fontWeight: FontWeight.w500, - height: 1.28, - color: Colors.white, - letterSpacing: -0.41, + child: Text( + 'Visit Website', + style: interTextTheme.bodyMedium!.copyWith( + fontWeight: FontWeight.w500, + height: 1.28, + color: Colors.white, + letterSpacing: -0.41, + ), ), ), ), - ), - ], + ], + ), ), - ), - ], + ], + ), ), - ), - ], + ], + ), ), ), );