Skip to content

Commit

Permalink
fix: Add location to event (#218)
Browse files Browse the repository at this point in the history
* fix: Redirect to website if not registered to fest

* update: Added boarder to hacknitr event

* chore: add location to query

* feat: Show location in schedule and event detail page

* chore: Minor change

* fix: Minor fix for webmail login

---------

Co-authored-by: Ashish Padhy <100484401+Shurtu-gal@users.noreply.github.com>
  • Loading branch information
Mixel2004 and Shurtu-gal authored Nov 2, 2023
1 parent 1449ea3 commit ddad084
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 38 deletions.
5 changes: 4 additions & 1 deletion elaichi/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*.aar
*.ap_
*.aab
*.jks
key.properties
pubspec.lock

# Files for the ART/Dalvik VM
*.dex
Expand Down Expand Up @@ -228,4 +231,4 @@ lib/data/constants/app_env.dart

lib/firebase_options.dart

# End of https://www.toptal.com/developers/gitignore/api/dart,flutter,visualstudiocode,android,firebase
# End of https://www.toptal.com/developers/gitignore/api/dart,flutter,visualstudiocode,android,firebase
1 change: 1 addition & 0 deletions elaichi/lib/data/remote/graphql/queries.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class Queries {
status
locationID
location {
id
name
description
lat
Expand Down
2 changes: 1 addition & 1 deletion elaichi/lib/presentation/core/utils/strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class Strings {
static const String festLogo = 'assets/icons/fest_icon.svg';

static const String zimbraCardText =
'Verify your NITR webmail to access \ntime table, mess menu and much more';
'Verify your NITR webmail to access \nZimbra Mail';
static const String kMmCardTitle =
'A Noble Breakthrough: NIT Rourkela produces alcohol-based sanitizers';
static const String kMmCardImageUri =
Expand Down
15 changes: 14 additions & 1 deletion elaichi/lib/presentation/home/feed/widgets/webmail_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,20 @@ class WebMailCard extends StatelessWidget {
},
);
} else {
Navigator.pushNamed(context, AppRouter.registrationForm);
showModalBottomSheet<void>(
isScrollControlled: true,
context: context,
builder: (context) => const WebMailLoginBottomSheet(),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(16),
),
),
).then(
(value) => context
.read<FestBloc>()
.add(const FestEvent.webMailLogIn()),
);
}
},
child: Text(
Expand Down
48 changes: 42 additions & 6 deletions elaichi/lib/presentation/home/fest/explore/event_details_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:elaichi/presentation/home/fest/explore/widgets/registration.dart
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 EventDetailsPage extends StatelessWidget {
EventDetailsPage({
Expand Down Expand Up @@ -135,12 +136,47 @@ class EventDetailsPage extends StatelessWidget {
),
),
const SizedBox(height: 4),
Text(
'${event.startDate.day.toString().padLeft(2, '0')} ${format.format(event.startDate)} | ${event.startDate.hour.toString().padLeft(2, '0')}:${event.startDate.minute.toString().padLeft(2, '0')}',
style: interTextTheme.bodyLarge!.copyWith(
color: Colors.white.withOpacity(0.6),
fontSize: 14,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'${event.startDate.day.toString().padLeft(2, '0')} ${format.format(event.startDate)} | ${event.startDate.hour.toString().padLeft(2, '0')}:${event.startDate.minute.toString().padLeft(2, '0')}',
style: interTextTheme.bodyLarge!.copyWith(
color: Colors.white.withOpacity(0.6),
fontSize: 14,
),
),
InkWell(
onTap: () {
final url =
'https://www.google.com/maps/search/?api=1&query=${event.location!.lat},${event.location!.long}';
launchUrlString(
url,
mode: LaunchMode.externalNonBrowserApplication,
);
},
child: Row(
children: [
Icon(
Icons.location_on,
color: Colors.white.withOpacity(0.6),
size: 14,
),
const SizedBox(width: 2),
Text(
event.location!.name,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.white.withOpacity(0.6),
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),
),
],
),
const SizedBox(height: 24),
if (description.isEmpty)
Expand Down
105 changes: 77 additions & 28 deletions elaichi/lib/presentation/home/fest/explore/widgets/fest_calender.dart
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// ignore_for_file: avoid_dynamic_calls


import 'package:elaichi/domain/models/event/event.dart';
import 'package:elaichi/presentation/core/router/app_router.dart';
import 'package:elaichi/presentation/core/theme/base_theme.dart';
import 'package:elaichi/presentation/core/theme/colors.dart';
import 'package:elaichi/presentation/home/fest/explore/widgets/scrolling_text.dart';
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher_string.dart';

class CalenderTabView extends StatelessWidget {
const CalenderTabView({
super.key,
required TabController tabController,
required this.calender,
}) : _tabController = tabController;
}) : _tabController = tabController;

final TabController _tabController;
final Map<String, List<Event>> calender;
Expand Down Expand Up @@ -91,7 +91,7 @@ class CalenderItem extends StatelessWidget {
child: Container(
margin: const EdgeInsets.only(bottom: 24),
constraints: const BoxConstraints(minHeight: 67, maxHeight: 109),
width: 326,
// width: MediaQuery.of(context).size.width,
color: AppColors.grey13,
padding: const EdgeInsets.all(12),
child: Row(
Expand All @@ -113,16 +113,27 @@ class CalenderItem extends StatelessWidget {
),
),
const SizedBox(height: 8),
SizedBox(
width: 200,
child: ScrollingText(
text: event.name,
style: interTextTheme.bodyLarge!.copyWith(
color: Colors.white,
fontWeight: FontWeight.w600,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: 200,
child: ScrollingText(
text: event.name,
style: interTextTheme.bodyLarge!.copyWith(
color: Colors.white,
fontWeight: FontWeight.w600,
),
condition: 50,
),
),
condition: 50,
),
Text(
'${event.startDate.hour}:${event.startDate.minute.toString().padLeft(2, '0')} - ${event.endDate.hour}:${event.endDate.minute.toString().padLeft(2, '0')}',
style: interTextTheme.labelSmall!.copyWith(
color: AppColors.grey10,
),
),
],
),
// if (event.poster != '') const SizedBox(height: 4),
// if (event.poster != '' && speakerName != null)
Expand All @@ -137,28 +148,66 @@ class CalenderItem extends StatelessWidget {
const SizedBox(height: 4),
if (event.subHeading != '')
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Icon(
Icons.group_work_outlined,
size: 8,
color: AppColors.white1,
),
const SizedBox(width: 4),
Text(
event.subHeading,
style: interTextTheme.labelSmall!
.copyWith(fontSize: 12, color: AppColors.white1),
SizedBox(
width: 200,
child: Row(
children: [
const Icon(
Icons.group_work_outlined,
size: 8,
color: AppColors.white1,
),
const SizedBox(width: 4),
Text(
event.subHeading,
style: interTextTheme.labelSmall!.copyWith(
fontSize: 12,
color: AppColors.white1,
),
),
],
),
),
GestureDetector(
onTap: () {
final url =
'https://www.google.com/maps/search/?api=1&query=${event.location!.lat},${event.location!.long}';
launchUrlString(
url,
mode: LaunchMode.externalNonBrowserApplication,
);
},
child: Row(
children: [
Icon(
Icons.location_on,
color: Colors.white.withOpacity(0.6),
size: 14,
),
const SizedBox(width: 2),
SizedBox(
width: 80,
child: Text(
event.location!.name,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.normal,
color: Colors.white.withOpacity(0.6),
),
// prevent overflow
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
),
)
],
),
],
),
Text(
'${event.startDate.hour}:${event.startDate.minute.toString().padLeft(2, '0')} - ${event.endDate.hour}:${event.endDate.minute.toString().padLeft(2, '0')}',
style: interTextTheme.labelSmall!.copyWith(
color: AppColors.grey10,
),
),
],
),
),
Expand Down
2 changes: 1 addition & 1 deletion elaichi/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Campus Guide for NIT Rourkela

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1
version: 1.0.0+3

environment:
sdk: ">=2.17.0 <3.0.0"
Expand Down

0 comments on commit ddad084

Please sign in to comment.