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

User profile with editable fields #17

Merged
merged 38 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
49e8ec8
fetch from latest pr
SAISURYAtalla Jan 31, 2024
d60913f
user profile with admin screens integration
SAISURYAtalla Jan 31, 2024
7189397
schema update
SAISURYAtalla Feb 1, 2024
052ffe9
Merge branch 'userModels' of https://github.com/ArinNigam/Smart-Insti…
SAISURYAtalla Feb 1, 2024
802c08c
dummy entries updated
SAISURYAtalla Feb 1, 2024
b7ca0c9
remove the redudant files and updates the imports
SAISURYAtalla Feb 1, 2024
b7c2e81
added routes.dart
SAISURYAtalla Feb 1, 2024
31d00c7
added the getstudentbyID function
SAISURYAtalla Feb 1, 2024
996e3b2
added separate widgets for editable entities
SAISURYAtalla Feb 3, 2024
7115555
roles commented
SAISURYAtalla Feb 3, 2024
df45c70
edit functionality
SAISURYAtalla Feb 3, 2024
63f5402
pie chart lib added, edit profile, user profile edited
SAISURYAtalla Feb 4, 2024
f9e8bba
ui change
SAISURYAtalla Feb 4, 2024
230730a
display code working
SAISURYAtalla Feb 4, 2024
8d0efb4
edit profile page added
SAISURYAtalla Feb 4, 2024
54b24e6
removed unused import
SAISURYAtalla Feb 4, 2024
301a228
Merge branch 'main' of https://github.com/SAISURYAtalla/Smart-Insti-A…
SAISURYAtalla Feb 4, 2024
0fc1b3b
added scrolling for skills and achievements in case of many entries
SAISURYAtalla Feb 4, 2024
2ca9b97
Merge branch 'main' into userprofile
SAISURYAtalla Feb 4, 2024
34aa8c0
changes aligned with origin
SAISURYAtalla Feb 4, 2024
cb49de1
final changes-name and roles
SAISURYAtalla Feb 4, 2024
e7319b7
removed reduntant code and files
SAISURYAtalla Feb 10, 2024
cd10c5c
Merge branch 'main' into userprofile
SAISURYAtalla Feb 11, 2024
cc4089a
Merge branch 'OpenLake:main' into userprofile
SAISURYAtalla Feb 11, 2024
b92e524
Merge branch 'OpenLake:main' into userprofile
SAISURYAtalla Feb 11, 2024
67fd037
Merge branch 'userprofile' of https://github.com/SAISURYAtalla/Smart-…
SAISURYAtalla Feb 11, 2024
7472a8c
build_apk updated
SAISURYAtalla Feb 13, 2024
cca6fec
routes modified
SAISURYAtalla Feb 13, 2024
ce9a8bf
.env file added
SAISURYAtalla Feb 13, 2024
9e068ed
Merge branch 'main' of https://github.com/SAISURYAtalla/Smart-Insti-A…
SAISURYAtalla Feb 13, 2024
7fbb726
Merge branch 'main' of https://github.com/SAISURYAtalla/Smart-Insti-A…
SAISURYAtalla Feb 14, 2024
33a50da
backend configured
SAISURYAtalla Feb 14, 2024
99d66b9
routes configured
SAISURYAtalla Feb 14, 2024
b7175de
home.dart to user_home.dart
SAISURYAtalla Feb 14, 2024
bc128c8
user_profile.dart to student_profile.dart
SAISURYAtalla Feb 14, 2024
010dba8
providers and edit profile updated
SAISURYAtalla Feb 14, 2024
522dc0d
removed redundant code
SAISURYAtalla Feb 14, 2024
29d86c7
initial location set to '/'
SAISURYAtalla Feb 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
147 changes: 130 additions & 17 deletions frontend/lib/constants/dummy_entries.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ class DummyStudents {
email: '[email protected]',
rollNumber: '89890',
about: 'I am a computer science student.',
profilePicURI: '',
profilePicURI:
'https://cdn4.sharechat.com/img_907710_35cec5f5_1681916904360_sc.jpg?tenant=sc&referrer=pwa-sharechat-service&f=360_sc.jpg',
branch: 'Computer Science',
graduationYear: 2023,
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
skills: [DummySkills.skills[1], DummySkills.skills[2]],
achievements: Dummyachievements.achievements.sublist(0, 5),
roles: ['Core Member', 'Coordinator'],
),
Student(
id: '2',
Expand All @@ -30,7 +32,38 @@ class DummyStudents {
branch: 'Mechanical Engineering',
roles: ['Student,Class Representative'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '3',
name: 'John Doe',
email: '[email protected]',
rollNumber: 'R001',
about: 'I am a computer science student.',
profilePicURI:
'https://cdn4.sharechat.com/img_907710_35cec5f5_1681916904360_sc.jpg?tenant=sc&referrer=pwa-sharechat-service&f=360_sc.jpg',
branch: 'Computer Science',
graduationYear: 2023,
skills: [DummySkills.skills[1], DummySkills.skills[2]],
achievements: [
Dummyachievements.achievements[1],
Dummyachievements.achievements[2]
],
roles: ['Core Member', 'Coordinator'],
),
Student(
id: '4',
name: 'John Doe',
email: '[email protected]',
rollNumber: 'R001',
about: 'I am a computer science student.',
profilePicURI:
'https://cdn4.sharechat.com/img_907710_35cec5f5_1681916904360_sc.jpg?tenant=sc&referrer=pwa-sharechat-service&f=360_sc.jpg',
branch: 'Computer Science',
graduationYear: 2023,
skills: [DummySkills.skills[1], DummySkills.skills[2]],
roles: ['Core Member', 'Coordinator'],
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '3',
Expand All @@ -42,7 +75,7 @@ class DummyStudents {
branch: 'Electrical Engineering',
roles: ['Student'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '4',
Expand All @@ -54,7 +87,7 @@ class DummyStudents {
branch: 'Civil Engineering',
roles: ['Student,Class Representative'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '5',
Expand All @@ -66,7 +99,7 @@ class DummyStudents {
branch: 'Chemical Engineering',
roles: ['Student'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '6',
Expand All @@ -78,7 +111,7 @@ class DummyStudents {
branch: 'Biotechnology',
roles: ['Student,Class Representative'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '7',
Expand All @@ -90,7 +123,7 @@ class DummyStudents {
branch: 'Aerospace Engineering',
roles: ['Student,Teaching Assistant'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '8',
Expand All @@ -102,7 +135,7 @@ class DummyStudents {
branch: 'Information Technology',
roles: ['Student,Teaching Assistant'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '9',
Expand All @@ -114,7 +147,7 @@ class DummyStudents {
branch: 'Mechatronics',
roles: ['Student'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '10',
Expand All @@ -126,7 +159,7 @@ class DummyStudents {
branch: 'Robotics Engineering',
roles: ['Student'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '11',
Expand All @@ -138,7 +171,7 @@ class DummyStudents {
branch: 'Industrial Engineering',
roles: ['Student,Teaching Assistant'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '12',
Expand All @@ -150,7 +183,7 @@ class DummyStudents {
branch: 'Computer Engineering',
roles: ['Student'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '13',
Expand All @@ -162,7 +195,7 @@ class DummyStudents {
branch: 'Software Engineering',
roles: ['Student'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '14',
Expand All @@ -174,7 +207,7 @@ class DummyStudents {
branch: 'Environmental Engineering',
roles: ['Student'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '15',
Expand All @@ -186,7 +219,7 @@ class DummyStudents {
branch: 'Petrolesum Engineer]ing',
roles: ['Student,Class Representative'],
skills: DummySkills.skills.sublist(0, 5),
achievements: DummyAchievements.achievements.sublist(0, 5),
achievements: Dummyachievements.achievements.sublist(0, 5),
),
Student(
id: '16',
Expand Down Expand Up @@ -251,6 +284,86 @@ class DummyStudents {
];
}

// class DummySkills {
henilp105 marked this conversation as resolved.
Show resolved Hide resolved
// static List<Skill> skills = [
// Skill(id: '1', name: 'Flutter', level: 80),
// Skill(id: '2', name: 'C++', level: 100),
// Skill(id: '3', name: 'javascript', level: 20),
// Skill(id: '4', name: 'Nodejs', level: 30),
// Skill(id: '5', name: 'Reactjs', level: 40),
// Skill(id: '6', name: 'MongoDB', level: 50),
// Skill(id: '7', name: 'Graphic Designing', level: 60),
// Skill(id: '8', name: 'chess', level: 70),
// Skill(id: '9', name: 'cricket', level: 80),
// Skill(id: '10', name: 'VScode', level: 100),
// Skill(id: '11', name: 'Dart', level: 100),
// Skill(id: '12', name: 'Typing', level: 90),
// Skill(id: '13', name: 'Drawing', level: 80),
// Skill(id: '14', name: 'Painting', level: 70),
// Skill(id: '15', name: 'Sketching', level: 60),
// Skill(id: '16', name: 'Programming', level: 50),
// Skill(id: '17', name: 'Python', level: 40),
// Skill(id: '18', name: 'C', level: 30),
// Skill(id: '19', name: 'Speaking', level: 20),
// Skill(id: '20', name: 'Sleeping', level: 10)
// ];
// }

class Dummyachievements {
static List<Achievement> achievements = [
Achievement(
id: '1',
name: 'Hackathon Winner',
date: DateTime(2023, 02, 01),
description: 'First place in XYZ Hackathon'),
Achievement(
id: '2',
name: 'Hackathon Winner',
date: DateTime(2023, 02, 01),
description: 'First place in XYZ Hackathon'),
Achievement(
id: '3',
name: 'Hackathon Winner',
date: DateTime(2023, 02, 01),
description: 'First place in XYZ Hackathon'),
Achievement(
id: '4',
name: 'Hackathon Winner',
date: DateTime(2023, 02, 01),
description: 'First place in XYZ Hackathon'),
Achievement(
id: '5',
name: 'Hackathon Winner',
date: DateTime(2023, 02, 01),
description: 'First place in XYZ Hackathon'),
Achievement(
id: '6',
name: 'Hackathon Winner',
date: DateTime(2023, 02, 01),
description: 'First place in XYZ Hackathon'),
Achievement(
id: '7',
name: 'Hackathon Winner',
date: DateTime(2023, 02, 01),
description: 'First place in XYZ Hackathon'),
Achievement(
id: '8',
name: 'Hackathon Winner',
date: DateTime(2023, 02, 01),
description: 'First place in XYZ Hackathon'),
Achievement(
id: '9',
name: 'Hackathon Winner',
date: DateTime(2023, 02, 01),
description: 'First place in XYZ Hackathon'),
Achievement(
id: '10',
name: 'Hackathon Winner',
date: DateTime(2023, 02, 01),
description: 'First place in XYZ Hackathon')
];
}

class DummyCourses {
static List<Course> courses = [
Course(
Expand Down
53 changes: 53 additions & 0 deletions frontend/lib/provider/about_Edit_widget.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

final aboutProvider = Provider<String?>((ref) {
return ref.watch(aboutControllerProvider);
});

final aboutControllerProvider =
StateNotifierProvider<AboutController, String?>((ref) {
return AboutController();
});

class AboutController extends StateNotifier<String?> {
AboutController() : super("");

void updateAbout(String about) {
state = about;
}
}

class AboutEditWidget extends ConsumerWidget {
const AboutEditWidget({Key? key}) : super(key: key);

@override
Widget build(BuildContext context, WidgetRef ref) {
final about = ref.watch(aboutProvider);

final TextEditingController aboutController =
TextEditingController(text: about);

return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'About',
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
TextField(
controller: aboutController,
onChanged: (newAbout) {
ref.read(aboutControllerProvider.notifier).updateAbout(newAbout);
},
decoration: const InputDecoration(
hintText: 'Write something about yourself...',
),
maxLines: 5,
),
],
);
}
}
Loading
Loading