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

Broadcasts screen frontend #22

Merged
merged 24 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e2be02d
Merge branch 'room-vacancy-lost-and-found' of https://github.com/Nail…
SAISURYAtalla Feb 8, 2024
c8488c6
conflicts resolved
SAISURYAtalla Feb 8, 2024
9d7c1cf
broadcast schema added and provider, repository files
SAISURYAtalla Feb 9, 2024
57d25f3
added routes and few changes
SAISURYAtalla Feb 9, 2024
1f99fc0
added dummy data and displayed in the broadcast screen
SAISURYAtalla Feb 9, 2024
fea97f7
ui updated
SAISURYAtalla Feb 11, 2024
e2f49f4
schema updated and displayed
SAISURYAtalla Feb 11, 2024
01c7079
notifications page added with dummy notiifcations
SAISURYAtalla Feb 11, 2024
69191d2
ui change
SAISURYAtalla Feb 11, 2024
7e7b889
schema updated
SAISURYAtalla Feb 11, 2024
3267b22
removed redundant code
SAISURYAtalla Feb 11, 2024
8f55d65
removed notifications screen
SAISURYAtalla Feb 12, 2024
611040c
env configured
SAISURYAtalla Feb 13, 2024
3229c1d
Merge branch 'main' of https://github.com/SAISURYAtalla/Smart-Insti-A…
SAISURYAtalla Feb 13, 2024
22190e0
pubspec.lock updated
SAISURYAtalla Feb 13, 2024
a0c1d69
routes changed
SAISURYAtalla Feb 13, 2024
494a2d0
Merge branch 'main' of https://github.com/SAISURYAtalla/Smart-Insti-A…
SAISURYAtalla Feb 13, 2024
984c31e
home to user_home , routes changes , broadcast feature added
SAISURYAtalla Feb 14, 2024
2d93a8a
removed redundant code
SAISURYAtalla Feb 14, 2024
e2eebc4
removed env file frontend
SAISURYAtalla Feb 14, 2024
9ec71cf
Merge branch 'main' of https://github.com/SAISURYAtalla/Smart-Insti-A…
SAISURYAtalla Feb 14, 2024
775619e
modified routes
SAISURYAtalla Feb 14, 2024
a0d9068
files moved to user screen
SAISURYAtalla Feb 14, 2024
84d983a
removed reduntant code
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
157 changes: 108 additions & 49 deletions frontend/lib/constants/dummy_entries.dart
Original file line number Diff line number Diff line change
Expand Up @@ -285,31 +285,6 @@ class DummyStudents {
];
}

// class DummySkills {
// 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(
Expand Down Expand Up @@ -547,135 +522,211 @@ class DummyFaculties {
id: '2',
name: 'Prof. Johnson',
email: '[email protected]',
courses: [DummyCourses.courses[1], DummyCourses.courses[6], DummyCourses.courses[11]],
courses: [
DummyCourses.courses[1],
DummyCourses.courses[6],
DummyCourses.courses[11]
],
cabinNumber: 'C-102',
department: 'Mechanical Engineering',
),
Faculty(
id: '3',
name: 'Dr. Brown',
email: '[email protected]',
courses: [DummyCourses.courses[2], DummyCourses.courses[7], DummyCourses.courses[12]],
courses: [
DummyCourses.courses[2],
DummyCourses.courses[7],
DummyCourses.courses[12]
],
cabinNumber: 'C-103',
department: 'Electrical Engineering',
),
Faculty(
id: '4',
name: 'Prof. Davis',
email: '[email protected]',
courses: [DummyCourses.courses[3], DummyCourses.courses[8], DummyCourses.courses[13]],
courses: [
DummyCourses.courses[3],
DummyCourses.courses[8],
DummyCourses.courses[13]
],
cabinNumber: 'C-104',
department: 'Civil Engineering'),
Faculty(
id: '5',
name: 'Dr. Wilson',
email: '[email protected]',
courses: [DummyCourses.courses[4], DummyCourses.courses[9], DummyCourses.courses[14]],
courses: [
DummyCourses.courses[4],
DummyCourses.courses[9],
DummyCourses.courses[14]
],
cabinNumber: 'C-105',
department: 'Chemical Engineering'),
Faculty(
id: '6',
name: 'Prof. Miller',
email: '[email protected]',
courses: [DummyCourses.courses[0], DummyCourses.courses[5], DummyCourses.courses[10]],
courses: [
DummyCourses.courses[0],
DummyCourses.courses[5],
DummyCourses.courses[10]
],
cabinNumber: 'C-106',
department: 'Biotechnology'),
Faculty(
id: '7',
name: 'Dr. Turner',
email: '[email protected]',
courses: [DummyCourses.courses[1], DummyCourses.courses[6], DummyCourses.courses[11]],
courses: [
DummyCourses.courses[1],
DummyCourses.courses[6],
DummyCourses.courses[11]
],
cabinNumber: 'C-107',
department: 'Aerospace Engineering'),
Faculty(
id: '8',
name: 'Prof. Clark',
email: '[email protected]',
courses: [DummyCourses.courses[2], DummyCourses.courses[7], DummyCourses.courses[12]],
courses: [
DummyCourses.courses[2],
DummyCourses.courses[7],
DummyCourses.courses[12]
],
cabinNumber: 'C-108',
department: 'Information Technology'),
Faculty(
id: '9',
name: 'Dr. Harris',
email: '[email protected]',
courses: [DummyCourses.courses[3], DummyCourses.courses[8], DummyCourses.courses[13]],
courses: [
DummyCourses.courses[3],
DummyCourses.courses[8],
DummyCourses.courses[13]
],
cabinNumber: 'C-109',
department: 'Mechatronics'),
Faculty(
id: '10',
name: 'Prof. Turner',
email: '[email protected]',
courses: [DummyCourses.courses[4], DummyCourses.courses[9], DummyCourses.courses[14]],
courses: [
DummyCourses.courses[4],
DummyCourses.courses[9],
DummyCourses.courses[14]
],
cabinNumber: 'C-110',
department: 'Robotics Engineering'),
Faculty(
id: '11',
name: 'Dr. White',
email: '[email protected]',
courses: [DummyCourses.courses[0], DummyCourses.courses[5], DummyCourses.courses[10]],
courses: [
DummyCourses.courses[0],
DummyCourses.courses[5],
DummyCourses.courses[10]
],
cabinNumber: 'D-101',
department: 'Industrial Engineering'),
Faculty(
id: '12',
name: 'Prof. Allen',
email: '[email protected]',
courses: [DummyCourses.courses[1], DummyCourses.courses[6], DummyCourses.courses[11]],
courses: [
DummyCourses.courses[1],
DummyCourses.courses[6],
DummyCourses.courses[11]
],
cabinNumber: 'D-102',
department: 'Computer Engineering'),
Faculty(
id: '13',
name: 'Dr. Young',
email: '[email protected]',
courses: [DummyCourses.courses[2], DummyCourses.courses[7], DummyCourses.courses[12]],
courses: [
DummyCourses.courses[2],
DummyCourses.courses[7],
DummyCourses.courses[12]
],
cabinNumber: 'D-103',
department: 'Software Engineering'),
Faculty(
id: '14',
name: 'Prof. Walker',
email: '[email protected]',
courses: [DummyCourses.courses[3], DummyCourses.courses[8], DummyCourses.courses[13]],
courses: [
DummyCourses.courses[3],
DummyCourses.courses[8],
DummyCourses.courses[13]
],
cabinNumber: 'D-104',
department: 'Environmental Engineering'),
Faculty(
id: '15',
name: 'Dr. Lee',
email: '[email protected]',
courses: [DummyCourses.courses[4], DummyCourses.courses[9], DummyCourses.courses[14]],
courses: [
DummyCourses.courses[4],
DummyCourses.courses[9],
DummyCourses.courses[14]
],
cabinNumber: 'D-105',
department: 'Petrolesum[ Engineer]ing'),
Faculty(
id: '16',
name: 'Prof. Hall',
email: '[email protected]',
courses: [DummyCourses.courses[0], DummyCourses.courses[5], DummyCourses.courses[10]],
courses: [
DummyCourses.courses[0],
DummyCourses.courses[5],
DummyCourses.courses[10]
],
cabinNumber: 'D-106',
department: 'Nuclear Engineering'),
Faculty(
id: '17',
name: 'Dr. Miller',
email: '[email protected]',
courses: [DummyCourses.courses[1], DummyCourses.courses[6], DummyCourses.courses[11]],
courses: [
DummyCourses.courses[1],
DummyCourses.courses[6],
DummyCourses.courses[11]
],
cabinNumber: 'D-107',
department: 'Biomedical Engineering'),
Faculty(
id: '18',
name: 'Prof. Baker',
email: '[email protected]',
courses: [DummyCourses.courses[2], DummyCourses.courses[7], DummyCourses.courses[12]],
courses: [
DummyCourses.courses[2],
DummyCourses.courses[7],
DummyCourses.courses[12]
],
cabinNumber: 'D-108',
department: 'Chemical Engineering'),
Faculty(
id: '19',
name: 'Dr. Turner',
email: '[email protected]',
courses: [DummyCourses.courses[3], DummyCourses.courses[8], DummyCourses.courses[13]],
courses: [
DummyCourses.courses[3],
DummyCourses.courses[8],
DummyCourses.courses[13]
],
cabinNumber: 'D-109',
department: 'Electronics Engineering'),
Faculty(
id: '20',
name: 'Prof. Smith',
email: '[email protected]',
courses: [DummyCourses.courses[4], DummyCourses.courses[9], DummyCourses.courses[14]],
courses: [
DummyCourses.courses[4],
DummyCourses.courses[9],
DummyCourses.courses[14]
],
cabinNumber: 'D-110',
department: 'Computer Science'),
];
Expand Down Expand Up @@ -947,7 +998,11 @@ class DummyRooms {
Room(id: '16', name: 'Outdoor Sports Arena', vacant: true),
Room(id: '17', name: 'Medical Clinic', vacant: false, occupantId: 'S004'),
Room(id: '18', name: 'Music Room', vacant: true),
Room(id: '19', name: 'Student Council Office', vacant: false, occupantId: 'T005'),
Room(
id: '19',
name: 'Student Council Office',
vacant: false,
occupantId: 'T005'),
Room(id: '20', name: 'Virtual Reality Lab', vacant: true),
];
}
Expand Down Expand Up @@ -1124,13 +1179,15 @@ class DummyAchievements {
id: '12',
name: 'Training and Development',
date: DateTime(2022, 4, 22),
description: 'Contributed significantly to employee training and development.',
description:
'Contributed significantly to employee training and development.',
),
Achievement(
id: '13',
name: 'Quality Assurance Recognition',
date: DateTime(2023, 2, 14),
description: 'Acknowledged for ensuring high-quality standards in projects.',
description:
'Acknowledged for ensuring high-quality standards in projects.',
),
Achievement(
id: '14',
Expand Down Expand Up @@ -1166,13 +1223,15 @@ class DummyAchievements {
id: '19',
name: 'Health and Wellness Initiative',
date: DateTime(2023, 9, 10),
description: 'Led initiatives to promote health and wellness in the workplace.',
description:
'Led initiatives to promote health and wellness in the workplace.',
),
Achievement(
id: '20',
name: 'Public Speaking Achievement',
date: DateTime(2022, 1, 30),
description: 'Received acclaim for public speaking skills at a conference.',
description:
'Received acclaim for public speaking skills at a conference.',
),
];
// You can use the dummyEntries list as needed in your application
Expand Down
19 changes: 19 additions & 0 deletions frontend/lib/models/broadcast_schema.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class Broadcast {
final String title;
final String body;
final DateTime date;

Broadcast({
required this.title,
required this.body,
required this.date,
});

factory Broadcast.fromJson(Map<String, dynamic> json) {
return Broadcast(
title: json['title'],
body: json['body'],
date: DateTime.parse(json['date']), // Update parsing to 'date'
);
}
}
1 change: 0 additions & 1 deletion frontend/lib/provider/achievements_edit_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class AchievementsEditWidget extends ConsumerWidget {
},
),
TextFormField(
// Add another text field for description
initialValue: achievements[index].description,
onChanged: (value) {
ref
Expand Down
14 changes: 14 additions & 0 deletions frontend/lib/provider/broadcast_provider.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:smart_insti_app/models/broadcast_schema.dart';

final broadcastProvider = FutureProvider<List<Broadcast>>((ref) async {
await Future.delayed(const Duration(seconds: 2)); // Simulating delay
return List.generate(
10,
(index) => Broadcast(
title: 'Broadcast $index',
body: 'This is the body of broadcast $index.',
date: DateTime.now().subtract(Duration(days: index)),
),
);
});
10 changes: 10 additions & 0 deletions frontend/lib/provider/home_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ class UserProvider extends StateNotifier<HomeState> {
secondaryColor: Colors.orangeAccent.shade200,
icon: Icons.search,
),
MenuTile(
title: 'Broadcast',
onTap: () {
// Navigate to the broadcast page
context.push('/user_home/broadcast');
},
icon: Icons.announcement,
primaryColor: Colors.greenAccent.shade100,
secondaryColor: Colors.greenAccent.shade200,
),
];
String query = state.searchController.text;
state = state.copyWith(
Expand Down
1 change: 0 additions & 1 deletion frontend/lib/provider/student_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class StudentState {
return students.firstWhere((student) => student.id == studentId);
} catch (e) {
return Student(
// Default values or a placeholder student object
id: '1',
name: 'John Doe',
email: '[email protected]',
Expand Down
Loading
Loading