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 20 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
164 changes: 164 additions & 0 deletions expert_events_flutter_project/lib/friendsPage.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:myapp/requestPage.dart';

class FriendsPage extends StatefulWidget {
FriendsPage({super.key});

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

class _FriendsPageState extends State<FriendsPage> {
final TextEditingController _textController =
TextEditingController(text: 'Search here');

List<String> allFriends = [
"Dhruv Tripathi",
"Shruti Gupta",
"Charu Yuvaraja",
"Sifat Islam",
"Seeyan Shabbar Gaus Newaz",
"Nadeeba Atiqui",
"Millie Bobby Brown",
"Charles Darwin",
"Abraham Lincoln",
];

List<String> displayedFriends = [];

@override
void initState() {
super.initState();
displayedFriends.addAll(allFriends);
}

void _searchFriends(String searchText) {
setState(() {
if (searchText.isEmpty) {
displayedFriends.clear();
displayedFriends.addAll(allFriends);
} else {
displayedFriends.clear();
displayedFriends.addAll(allFriends
.where((friend) =>
friend.toLowerCase().contains(searchText.toLowerCase()))
.toList());
}
});
}

Widget _buildAvatar(String fullName) {
// Return the widget containing the avatar and name
return Row(
//avatar and name on the left
children: [
Padding(
padding: EdgeInsets.all(16),
child: CircleAvatar(
radius: 26,
backgroundColor: Colors.blue,
child: Text(fullName.isNotEmpty ? fullName[0] : ''),
),
),
Text(
fullName,
style: TextStyle(
fontSize: 18,
color: Colors.black,
),
),
],
);
}

int? groupValue = 0;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.grey,
title: Text('Your Friends'),
centerTitle: true,
),
body: SingleChildScrollView(
child: Column(
children: [
/* Cupertino Sliding Segmented Control */
Container(
alignment: Alignment.center,
padding: EdgeInsets.all(10),
child: CupertinoSlidingSegmentedControl<int>(
padding: EdgeInsets.all(4),
groupValue: groupValue,
children: {
0: buildSegment('Your Friends'),
1: buildSegment("Requests"),
},
onValueChanged: (groupValue) {
setState(() => this.groupValue = groupValue);
if (groupValue == 1) {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => RequestPage()),
);
}
},
),
),
/* ---------------------------------- */
GestureDetector(
onTap: () {
// When tapped, give focus to the text field
FocusScope.of(context).requestFocus(FocusNode());
},
child: Column(
children: [
Container(
color: CupertinoColors.systemOrange,
padding: const EdgeInsets.all(10.0),
child: Center(
child: CupertinoTextField(
controller: _textController,
onChanged: _searchFriends,
placeholder: 'Search here',
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.0),
),
prefix: Padding(
padding: EdgeInsets.all(8.0),
child: Icon(Icons.search),
),
),
),
),
ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: displayedFriends.length,
itemBuilder: (context, index) {
return _buildAvatar(displayedFriends[index]);
},
),
],
),
),
],
),
),
);
}

Widget buildSegment(String text) {
return Padding(
padding: const EdgeInsets.all(12),
child: Text(
text,
style: TextStyle(fontSize: 15,
),
),
);
}
}
150 changes: 150 additions & 0 deletions expert_events_flutter_project/lib/login.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:myapp/mainevents.dart';
import 'package:myapp/signup.dart';
import 'mytextfield.dart';

class LoginPage extends StatefulWidget {
@override
_LoginPageState createState() => _LoginPageState();
}

class _LoginPageState extends State<LoginPage> {
int groupValue = 0;

final TextEditingController usernameController = TextEditingController();
final TextEditingController passwordController = TextEditingController();

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color.fromARGB(255, 247, 244, 244),
body: SafeArea(
child: SingleChildScrollView(
child: Center(
child: Column(
children: [
const SizedBox(height: 50),
Image.asset(
'assets/experteventslogo.jpg',
width: 100,
),
const SizedBox(height: 35),
Text(
"Welcome to Expert Events!",
style: TextStyle(
color: Colors.grey[700],
fontSize: 25,
fontWeight: FontWeight.w500,
),
),
const SizedBox(height: 25),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: MyTextField(
controller: usernameController,
hintText: 'Username',
obscureText: false,
),
),
const SizedBox(height: 10),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: MyTextField(
controller: passwordController,
hintText: 'Password',
obscureText: true,
),
),
const SizedBox(height: 15),
CupertinoSlidingSegmentedControl<int>(
padding: const EdgeInsets.all(15),
groupValue: groupValue,
children: {
0: buildSegment('Student'),
1: buildSegment('Organization'),
},
onValueChanged: (value) {
setState(() {
groupValue = value!;
});
},
),
const SizedBox(height: 15),
Container(
margin: const EdgeInsets.symmetric(horizontal: 25),
child: ElevatedButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => const MainEvents()),
);
},
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(25),
backgroundColor: Colors.black,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
minimumSize: const Size(double.infinity, 50),
),
child: const Text(
"Login",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
),
),
const SizedBox(height: 15),
Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
"Not a member?",
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.w500,
fontSize: 16,
),
),
const SizedBox(width: 5),
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SignUp()),
);
},
child: const Text(
"Sign up",
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.w500,
fontSize: 16,
decoration: TextDecoration.underline,
),
),
),
],
),
),
],
),
),
),
),
);
}

Widget buildSegment(String text) => Container(
padding: const EdgeInsets.all(15),
child: Text(
text,
style: const TextStyle(fontSize: 20),
),
);
}
Loading