Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore page redesign #37

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ android {
applicationId "com.efficacyuserv2.app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
minSdkVersion 21
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class EfficacyUser extends StatelessWidget {
routes: {
//issue here
Homepage.routeName: (context) => const Homepage(),
ExplorePage.routeName: (context) => const ExplorePage(),
LoginPage.routeName: (context) => const LoginPage(),
SplashScreen.routeName: (context) => const SplashScreen(),
ProfilePage.routeName: (context) => const ProfilePage(),
Expand Down
77 changes: 77 additions & 0 deletions lib/pages/explore/explore_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import 'package:efficacy_user/config/config.dart';
import 'package:efficacy_user/pages/homepage/widgets/events_showcase_page/events_showcase_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class ExplorePage extends StatefulWidget {
const ExplorePage({super.key});

static const String routeName = "/explorePage";

@override
State<ExplorePage> createState() => _ExplorePageState();
}

class _ExplorePageState extends State<ExplorePage> {
@override
Widget build(context) {
final width = MediaQuery.of(context).size.width;
final height = MediaQuery.of(context).size.height;
return DefaultTabController(
length: 3,
child: Scaffold(
appBar: AppBar(
title: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10.0,
// vertical: 15.0,
),
child: Text(
"Explore",
style: TextStyle(
fontSize: width * 0.07,
fontWeight: FontWeight.bold,
color: Color.fromARGB(255, 79, 78, 78),
),
),
),
actions: [
const Icon(CupertinoIcons.bell),
Padding(
padding: EdgeInsets.only(right: 28.0),
child: Icon(
Icons.code,
size: width * 0.1,
),
),
].separate(30),
bottom: const TabBar(
indicatorWeight: 1,
indicatorColor: accent,
tabs: [
Tab(text: "Upcoming"),
Tab(text: "Ongoing"),
Tab(text: "Completed"),
],
),
),
body: TabBarView(
children: [
EventsShowcasePage(
showSubscribedOnly: false,
currentEventFilterTypeIndex: ValueNotifier(0),
),
EventsShowcasePage(
showSubscribedOnly: false,
currentEventFilterTypeIndex: ValueNotifier(1),
),
EventsShowcasePage(
showSubscribedOnly: false,
currentEventFilterTypeIndex: ValueNotifier(2),
),
],
),
),
);
}
}
92 changes: 92 additions & 0 deletions lib/pages/explore/widgets/event_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// import 'package:efficacy_user/config/config.dart';
// import 'package:flutter/material.dart';

// class EventCard extends StatefulWidget {
// const EventCard({super.key});

// @override
// State<EventCard> createState() => _EventCardState();
// }

// class _EventCardState extends State<EventCard> {
// @override
// Widget build(context){
// return Card(
// child: Column(
// children: [
// const Gap(10),
// ClipRRect(
// borderRadius: BorderRadius.circular(20),
// child: event.posterURL.isEmpty
// ? Image.asset(
// Assets.mediaImgPath,
// fit: BoxFit.cover,
// )
// : CustomNetworkImage(
// url: event.posterURL,
// errorWidget: (BuildContext context, _, __) {
// return Image.asset(
// Assets.mediaImgPath,
// fit: BoxFit.cover,
// );
// },
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(
// top: 8.0,
// left: 28.0,
// ),
// child: Align(
// alignment: Alignment.centerLeft,
// child: Text(
// event.title,
// style: const TextStyle(
// color: Color.fromARGB(253, 82, 81, 81),
// fontSize: 25,
// fontWeight: FontWeight.w600,
// ),
// ),
// ),
// ),
// Padding(
// padding: const EdgeInsets.only(
// left: 28.0,
// bottom: 25.0,
// ),
// child: Column(
// children: [
// StreamBuilder(
// stream: ClubController.get(id: event.clubID),
// builder: (BuildContext context, AsyncSnapshot snapshot) {
// List<ClubModel> club = [];
// if (snapshot.hasData) {
// club = snapshot.data ?? [];
// }
// if (club.isNotEmpty) {
// String clubName =
// "${club.first.name[0].toUpperCase()}${club.first.name.substring(1)}";
// return EventDataField(
// text: clubName,
// icon: Icons.group,
// );
// }
// return const SizedBox.shrink();
// }),
// EventDataField(
// text:
// "${_dateFormatter.format(event.startDate)} - ${_dateFormatter.format(event.endDate)}",
// icon: CupertinoIcons.calendar,
// ),
// EventDataField(
// text: Formatter.timeOnly(event.startDate),
// icon: CupertinoIcons.clock,
// ),
// ].separate(15),
// ),
// )
// ].separate(5),
// ),
// );
// }
// }
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ class _EventsShowcasePageState extends State<EventsShowcasePage> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 25.0),
child: Text(
"${currentEventStatus?.name} Events",
style: TextStyle(
fontSize: MediaQuery.of(context).size.width * 0.06,
color: const Color.fromARGB(253, 82, 81, 81),
fontWeight: FontWeight.w500,
),
),
),
// Padding(
// padding: const EdgeInsets.only(left: 25.0),
// child: Text(
// "${currentEventStatus?.name} Events",
// style: TextStyle(
// fontSize: MediaQuery.of(context).size.width * 0.06,
// color: const Color.fromARGB(253, 82, 81, 81),
// fontWeight: FontWeight.w500,
// ),
// ),
// ),
Expanded(
child: RefreshIndicator(
onRefresh: _refreshEvents,
Expand Down
1 change: 1 addition & 0 deletions lib/pages/pages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export 'signup/signup_page.dart';
export 'login/login_page.dart';
export 'developers_page/developers_page.dart';
export 'forgot_password/forgot_password.dart';
export 'explore/explore_page.dart';