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

Dhruv #39

Open
wants to merge 58 commits into
base: shruti2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
82b3d9b
Update main.dart
SwiftCode123 Feb 22, 2024
e2d2131
Add files via upload
SwiftCode123 Feb 25, 2024
9ec98d8
Update main.dart
SwiftCode123 Feb 25, 2024
4b80b7e
Update login.dart
SwiftCode123 Feb 25, 2024
7009643
Update pubspec.yaml
SwiftCode123 Feb 25, 2024
96ca032
Update mainevents.dart
SwiftCode123 Feb 26, 2024
08acac7
Update pubspec.yaml
SwiftCode123 Feb 26, 2024
b9b7ffc
Update pubspec.yaml
SwiftCode123 Feb 28, 2024
ebf64bd
Update pubspec.lock
SwiftCode123 Feb 28, 2024
9901b0f
Update signup.dart
SwiftCode123 Feb 29, 2024
fa6b2f5
Add files via upload
SwiftCode123 Mar 2, 2024
ab7dd2a
Update friendsPage.dart
SwiftCode123 Mar 3, 2024
c357eb0
Delete expert_events_flutter_project/lib/model directory
SwiftCode123 Mar 3, 2024
a076b55
Update login.dart
SwiftCode123 Mar 3, 2024
6b04f37
Update mainevents.dart
SwiftCode123 Mar 3, 2024
6fa75fc
Add files via upload
SwiftCode123 Mar 3, 2024
0db7431
Add files via upload
SwiftCode123 Mar 3, 2024
25ce4ed
Update pubspec.yaml
SwiftCode123 Mar 3, 2024
db4fc01
Update main.dart
SwiftCode123 Mar 3, 2024
785fd60
Add files via upload
SwiftCode123 Mar 9, 2024
a8f4c88
Add files via upload
SwiftCode123 Mar 9, 2024
205b8b5
Update friendsPage.dart
SwiftCode123 Mar 9, 2024
e3a38c9
Update mainevents.dart
SwiftCode123 Mar 9, 2024
ea3cef8
Update mytextfield.dart
SwiftCode123 Mar 9, 2024
5571327
Update main.dart
SwiftCode123 Mar 9, 2024
5fcb675
Update profile.dart
SwiftCode123 Mar 13, 2024
a46b8ee
Update requestPage.dart
SwiftCode123 Mar 13, 2024
3bf6612
Update mainevents.dart
SwiftCode123 Mar 14, 2024
23831ec
Update mainevents.dart
SwiftCode123 Mar 27, 2024
6312bef
Add files via upload
SwiftCode123 Mar 27, 2024
f7aa4c2
Add files via upload
SwiftCode123 Mar 27, 2024
5acd891
Add files via upload
SwiftCode123 Mar 27, 2024
27dba6a
Update signup.dart
SwiftCode123 Mar 27, 2024
9e2402b
Update friendsPage.dart
SwiftCode123 Apr 3, 2024
b93f8ba
Update mainevents.dart
SwiftCode123 Apr 3, 2024
59cf2f4
Add files via upload
SwiftCode123 Apr 3, 2024
1929966
Update mainevents.dart
SwiftCode123 Apr 3, 2024
be76407
Update mainevents.dart
SwiftCode123 Apr 3, 2024
16184b5
Update build.gradle
SwiftCode123 Apr 4, 2024
095c1b0
Update pubspec.yaml
SwiftCode123 Apr 4, 2024
e1e1be1
Update signup.dart
SwiftCode123 Apr 4, 2024
18377af
Update notificationsPage.dart
SwiftCode123 Apr 4, 2024
6aaba4a
Add files via upload
SwiftCode123 Apr 8, 2024
699581b
Add files via upload
SwiftCode123 Apr 8, 2024
7410f2e
Update pubspec.yaml
SwiftCode123 Apr 8, 2024
e945df9
Update navbar.dart
SwiftCode123 Apr 8, 2024
23725d2
Add files via upload
SwiftCode123 Apr 8, 2024
06ebefe
Update notificationsPage.dart
SwiftCode123 Apr 8, 2024
c212998
Update friendsPage.dart
SwiftCode123 Apr 8, 2024
d8f17a6
Update mainevents.dart
SwiftCode123 Apr 8, 2024
e5469da
Update detailedevents.dart
SwiftCode123 Apr 8, 2024
7f9d5c4
Update requestPage.dart
SwiftCode123 Apr 11, 2024
cf4e514
Update friendsPage.dart
SwiftCode123 Apr 11, 2024
76f2f92
Add files via upload
SwiftCode123 Apr 11, 2024
45aa3a9
Update login.dart
SwiftCode123 Apr 14, 2024
4b00999
Update requestPage.dart
SwiftCode123 Apr 14, 2024
8ddb69e
Update notificationsPage.dart
SwiftCode123 Apr 14, 2024
316069b
Update friendEvents.dart
SwiftCode123 Apr 14, 2024
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
7 changes: 4 additions & 3 deletions expert_events_flutter_project/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (flutterVersionName == null) {
}

android {
namespace "com.example.expert_events_flutter_project"
namespace "com.example.myapp"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

Expand All @@ -42,10 +42,11 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.expert_events_flutter_project"
applicationId "com.example.myapp"
// 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
// minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
152 changes: 152 additions & 0 deletions expert_events_flutter_project/lib/detailedevents.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
import 'package:flutter/material.dart';

class EventDetailPage extends StatefulWidget {
final String eventName;
final String eventDescription;
final String eventDate;
final String location;
final String image;

// Constructor to receive data from the previous page
const EventDetailPage({
Key? key,
required this.eventName,
required this.eventDescription,
required this.eventDate,
required this.location,
required this.image,
}) : super(key: key);

@override
_EventDetailPageState createState() => _EventDetailPageState();
}

class _EventDetailPageState extends State<EventDetailPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: Color.fromARGB(255, 248, 152, 122),
leading: IconButton(
onPressed: () {
Navigator.pop(context);
},
icon: Icon(
Icons.arrow_back,
size: 20,
color: Colors.black,
),
),
centerTitle: true,
title: Text(
widget.eventName, //name of the event
style: TextStyle(
color: Colors.black,
fontSize: 25,
),
),




),
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

//DISPLAYS THE POSTER
Container(
height: 400,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(widget.image),
fit: BoxFit.fill,
),
),
),


//DISPLAYS THE USERS WHO ARE GOING
Padding(
padding: EdgeInsets.symmetric(
horizontal: 10
),
child: Row(
children: [
for (int index = 0; index < 5; index++)
Padding(
padding: EdgeInsets.only(left: index == 0 ? 8.0 : 4.0, right: 4.0),
child: CircleAvatar(
radius: 15.0,
backgroundImage: AssetImage('assets/profile_image$index.png'),
),
),
Spacer(),
MaterialButton(
minWidth: 25,
height: 30,
onPressed: () {
},
color: Colors.blue,
shape: RoundedRectangleBorder(
side: BorderSide(
color: Colors.blue
),
borderRadius: BorderRadius.circular(50)
),
child: Text(
"I'm Interested",
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 15,
color: Colors.white,
),
),
),
],
),
),


// Display the event image


SizedBox(
height: 10,
width: double.infinity,
),

// Display other details about the event (description, date/time, location)
Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [

Text(widget.eventDescription),
SizedBox(height: 16),

Text(widget.eventDate,
style: TextStyle(
fontWeight: FontWeight.bold,
),
),

SizedBox(height: 16),

Text(widget.location,
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import 'package:firebase_auth/firebase_auth.dart';
//import 'package:google_sign_in/google_sign_in.dart';
//import '../../global/common/toast.dart';
//import 'package:fluttertoast/fluttertoast.dart';
import 'package:cloud_firestore/cloud_firestore.dart';

class FirebaseAuthService{

FirebaseAuth _auth = FirebaseAuth.instance;

//User sign up
Future<User?> signUpWithEmailAndPassword(String email, String password) async {

try{
UserCredential credential = await _auth.createUserWithEmailAndPassword(email: email, password: password);
return credential.user;

} on FirebaseAuthException catch (e) {
print(e.code);

// Shows the issue with the entered password on the users screen as a small message, this isn't working tho
// if (e.code == 'email-already-in-use'){
// showToast(message: 'The email address is already in use.');
// } else {
// showToast(message: 'An error occured: ${e.code}');
// }

}
return null;
}

//User sign in
Future<User?> signInWithEmailAndPassword(String email, String password) async {

try{
UserCredential credential = await _auth.signInWithEmailAndPassword(email: email, password: password);
return credential.user;

} on FirebaseAuthException catch (e) {
print (e.code);

//Again, shows issue with password on users screen, but the frontend code isn't working
// if (e.code == 'user-not-found' || e.code == 'wrong-password') {
// showToast(message: 'Invalid email or password.');
// } else {
// showToast(message: 'An error occurred: ${e.code}');
// }
}
return null;
}

//Method that gives the list of all existing users (including their info in the database)
Future<List<Map<String, dynamic>>> getUsers() async {
// Access the Firestore collection containing users
CollectionReference<Map<String, dynamic>>
userCollection = FirebaseFirestore.instance.collection('Users');

// Retrieve all documents (users) from the collection
QuerySnapshot<Map<String, dynamic>>
querySnapshot = await userCollection.get();

// Extract user data from QuerySnapshot and convert to List
List<Map<String, dynamic>> users = [];
querySnapshot.docs.forEach((doc) {
users.add(doc.data());
});

print(users);
return users;
}
//Here is the code to call this above function, this gives the users list
//List<Map<String, dynamic>>? users = await _auth.getUsers() ?? null;
String getUserID() {
String userID = '';
User? user = _auth.currentUser;
if (user != null) {
userID = user.uid; //retrives userID of logged in user
}
return userID;
}
}

62 changes: 62 additions & 0 deletions expert_events_flutter_project/lib/friendEvents.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import 'package:flutter/material.dart';

class Friend {
final String name;
final String imagePath;

Friend(this.name, this.imagePath);
}

class FriendEventPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
List<Friend> friendsList = [
Friend(
"Charu added ACM Interest Session Meeting",
'assets/charu_acmimage.jpeg',
),
];

return Scaffold(
appBar: null, // Set app bar to null to remove the space
body: ListView.builder(
itemCount: friendsList.length,
itemBuilder: (context, index) {
return _buildAvatar(friendsList[index]);
},
),
);
}

Widget _buildAvatar(Friend friend) {
return Padding(
padding: EdgeInsets.all(16),
child: Row(
children: [
// Replace CircleAvatar with Container
Container(
width: 52, // Set the width and height as needed
height: 52,
decoration: BoxDecoration(
shape: BoxShape.circle,
image: DecorationImage(
image: AssetImage(friend.imagePath),
fit: BoxFit.cover,
),
),
),
SizedBox(width: 16), // Add spacing between avatar and name
Expanded(
child: Text(
friend.name,
style: TextStyle(
fontSize: 18,
color: Colors.black,
),
),
),
],
),
);
}
}
Loading