From 1505674033beac7ab77dc5a54cdda87def08d9ea Mon Sep 17 00:00:00 2001 From: Arindam Upadhyay <20bec018@iiitdmj.ac.in> Date: Mon, 27 Mar 2023 13:11:13 +0530 Subject: [PATCH 01/45] script structured --- clone.sh | 13 ------------- scripts/clone.sh | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 clone.sh create mode 100644 scripts/clone.sh diff --git a/clone.sh b/clone.sh deleted file mode 100644 index 3a3780c4..00000000 --- a/clone.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -#branches=("ac-1" "ac-2" "ac-3" "ac-4" "ac-5" "ps-1" "ps-2" "gad-1" "gad-2" "gad-3" "gad-4" "gad-5" "hr" "sa-1" "sa-2" "sa-3" "sa-4" "os-1" "os-2" "os-3" "os-4" "rspc") -branches=("ac") -for branch in "${branches[@]}" -do - echo "Creating $branch" - - git checkout -b "$branch" - git push origin "$branch" - - echo "Pushed new branch $branch to remote" -done \ No newline at end of file diff --git a/scripts/clone.sh b/scripts/clone.sh new file mode 100644 index 00000000..20bf0276 --- /dev/null +++ b/scripts/clone.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +branches=("ac" "ac-1" "ac-2" "ac-3" "ac-4" "ac-5" "ps-1" "ps-2" "gad-1" "gad-2" "gad-3" "gad-4" "gad-5" "hr" "sa-1" "sa-2" "sa-3" "sa-4" "os-1" "os-2" "os-3" "os-4" "rspc") + +for branch in "${branches[@]}" +do + echo "Creating $branch..." + + git checkout -b "$branch" + git push origin "$branch" + + echo "Pushed new branch $branch to remote" +done \ No newline at end of file From aa2e5791c9de58bf6f19f7220e74d8c2306c14d5 Mon Sep 17 00:00:00 2001 From: AgPriyanshu18 Date: Fri, 17 Nov 2023 17:02:40 +0530 Subject: [PATCH 02/45] Server Url updated --- android/build.gradle | 4 ++-- android/gradle/wrapper/gradle-wrapper.properties | 2 +- lib/api.dart | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index b3a325d5..a78be8cb 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,12 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.8.21' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.2' + classpath 'com.android.tools.build:gradle:7.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index cc5527d7..6b665338 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/lib/api.dart b/lib/api.dart index 802bee2d..73d1c6bc 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -1,10 +1,11 @@ //Server and local links String klocalLink = "127.0.0.1:8000"; -String kserverLink = "172.27.16.215:80"; +String kserverLink = "172.27.16.214:8000"; //Login Service -String kAuthUrl = "172.27.16.215:80"; +String kAuthUrl = "172.27.16.214:8000"; String kAuthLogin = "/api/auth/login/"; +// String kAuthLogin = "/accounts/login"; //Profile Service String kProfile = "/api/profile/"; From d329bf366a06f21c4acea0b74852b8a843557da7 Mon Sep 17 00:00:00 2001 From: Praneki <97080887+PraneGIT@users.noreply.github.com> Date: Wed, 17 Apr 2024 21:51:24 +0530 Subject: [PATCH 03/45] Gad 5 to main (#162) * Ui Changes and Added functionality of designation * Updated kserverLink,kAuthUrl and gradle ver (7.4.2) --------- Co-authored-by: TusharGupta03 --- android/build.gradle | 2 +- lib/Components/appBar2.dart | 106 +++++ lib/Components/bottom_navigation_bar.dart | 148 +++++++ lib/Components/side_drawer2.dart | 264 ++++++++++++ lib/DesignationProvider.dart | 12 + lib/api.dart | 1 + lib/main.dart | 12 +- .../DashboardComponents/announcement.dart | 200 +++++++++ .../DashboardComponents/cardItems.dart | 76 ++-- .../DashboardComponents/news.dart | 201 +++++++++ .../DashboardComponents/notify.dart | 152 +++++++ lib/screens/LoginandDashboard/dashboard.dart | 389 +++++++++++------- lib/screens/LoginandDashboard/login_page.dart | 155 ++++--- lib/services/appBar_services.dart | 14 + lib/services/dashboard_service.dart | 51 ++- lib/services/login_service.dart | 16 +- lib/services/storage_service.dart | 14 +- 17 files changed, 1543 insertions(+), 270 deletions(-) create mode 100644 lib/Components/appBar2.dart create mode 100644 lib/Components/bottom_navigation_bar.dart create mode 100644 lib/Components/side_drawer2.dart create mode 100644 lib/DesignationProvider.dart create mode 100644 lib/screens/LoginandDashboard/DashboardComponents/announcement.dart create mode 100644 lib/screens/LoginandDashboard/DashboardComponents/news.dart create mode 100644 lib/screens/LoginandDashboard/DashboardComponents/notify.dart create mode 100644 lib/services/appBar_services.dart diff --git a/android/build.gradle b/android/build.gradle index a78be8cb..881e7e55 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/lib/Components/appBar2.dart b/lib/Components/appBar2.dart new file mode 100644 index 00000000..a1f63393 --- /dev/null +++ b/lib/Components/appBar2.dart @@ -0,0 +1,106 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; + +class CustomAppBar extends StatefulWidget implements PreferredSizeWidget { + final String curr_desig; + final String headerTitle; + + final ValueChanged onDesignationChanged; + + const CustomAppBar({ + Key? key, + required this.curr_desig, + required this.headerTitle, + + required this.onDesignationChanged, + }) : super(key: key); + + @override + _CustomAppBarState createState() => _CustomAppBarState(); + + @override + Size get preferredSize => Size.fromHeight(kToolbarHeight); +} + +class _CustomAppBarState extends State { + late List designations; + late String current; + var service = locator(); + + @override + void initState() { + super.initState(); + designations = (service!.getFromDisk('designations') as List) + .map((dynamic item) => item.toString()) + .toList(); + + current = service!.getFromDisk( + 'Current_designation'); // Ensure designations is not null before accessing index 0 + } + + @override + Widget build(BuildContext context) { + return AppBar( + iconTheme: IconThemeData(color: Colors.white), + backgroundColor: kPrimaryColor, + title: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + child: Padding( + padding: EdgeInsets.only(right: 20.0), // Add some right padding to ensure space for the dropdown + child: Text( + widget.headerTitle, // Example of a long title + overflow: TextOverflow.ellipsis, // Prevents overflow by adding ellipsis + style: TextStyle( + color: Colors.white, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + ), + DropdownButtonHideUnderline( + child: DropdownButton( + padding: const EdgeInsets.all(15), + borderRadius: BorderRadius.circular(5), + value: current, + icon: Icon(Icons.arrow_drop_down, color: Colors.white), + iconSize: 24, + style: TextStyle(color: Colors.white, fontSize: 18), + dropdownColor: + kPrimaryColor, // Set the dropdown background color to orange + onChanged: (String? newValue) { + widget.onDesignationChanged(newValue!); + setState(() { + current = newValue!; + service!.saveToDisk('Current_designation', current); + }); + }, + items: designations.map>((String value) { + return DropdownMenuItem( + value: value, + child: Text( + value, + style: TextStyle( + color: Colors.white), // Set the text color to white + ), + ); + }).toList(), + onTap: () { + // Find the index of the selected value + int index = designations.indexOf(current); + // Scroll the dropdown to the selected value + Scrollable.ensureVisible(context, + alignment: 0.5, duration: Duration(milliseconds: 300)); + }, + ), + ), + ], + ), + actions: [], + ); + } +} \ No newline at end of file diff --git a/lib/Components/bottom_navigation_bar.dart b/lib/Components/bottom_navigation_bar.dart new file mode 100644 index 00000000..f95ad3c3 --- /dev/null +++ b/lib/Components/bottom_navigation_bar.dart @@ -0,0 +1,148 @@ +import 'package:flutter/material.dart'; + +class MyBottomNavigationBar extends StatefulWidget { + @override + _MyBottomNavigationBarState createState() => _MyBottomNavigationBarState(); +} + +class _MyBottomNavigationBarState extends State { + bool _notificationsBool = false; + bool _announcementsBool = false; + bool _newsBool = false; + bool _homeBool = false; + + @override + Widget build(BuildContext context) { + return SizedBox( + height: 100.0, + child: Padding( + padding: EdgeInsets.only(bottom: 40), + child: Card( + color: Colors.deepOrangeAccent, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(17.0), + ), + child: Padding( + padding: const EdgeInsets.only( + left: 13.0, right: 10.0, top: 5.0, bottom: 5.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + _notificationsBool = false; + _announcementsBool = false; + _newsBool = false; + _homeBool = true; + setState(() { + _notificationsBool = false; + _announcementsBool = false; + _newsBool = false; + _homeBool = true; + }); + Navigator.pushReplacementNamed(context, "/dashboard"); + + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Icon( + Icons.home_rounded, + color: Colors.white, + size: _homeBool ? 30.0 : 25.0, + ), + ], + ), + ), + GestureDetector( + onTap: () { + _newsBool = true; + _announcementsBool = false; + _notificationsBool = false; + _homeBool = false; + + setState(() { + _newsBool = true; + _announcementsBool = false; + _notificationsBool = false; + _homeBool = false; + }); + Navigator.pushReplacementNamed(context, "/news"); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Icon( + Icons.newspaper_rounded, + color: Colors.white, + size: _newsBool ? 30.0 : 25.0, + ), + ], + ), + ), + GestureDetector( + onTap: () { + _announcementsBool = false; + _newsBool = false; + _notificationsBool = true; + _homeBool = false; + + setState(() { + _announcementsBool = false; + _newsBool = false; + _notificationsBool = true; + _homeBool = false; + }); + Navigator.pushReplacementNamed(context, "/notification"); + }, + child: Padding( + padding: const EdgeInsets.only(right: 16.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Icon( + Icons.notifications_active_rounded, + color: Colors.white, + size: _notificationsBool ? 30.0 : 25.0, + ), + ], + ), + ), + ), + GestureDetector( + onTap: () { + _announcementsBool = true; + _newsBool = false; + _notificationsBool = false; + _homeBool = false; + + setState(() { + _announcementsBool = true; + _newsBool = false; + _notificationsBool = false; + _homeBool = false; + }); + Navigator.pushReplacementNamed(context, "/announcement"); + }, + child: Padding( + padding: const EdgeInsets.only(right: 16.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Icon( + Icons.campaign_rounded, + color: Colors.white, + size: _announcementsBool ? 30.0 : 25.0, + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/Components/side_drawer2.dart b/lib/Components/side_drawer2.dart new file mode 100644 index 00000000..97c80e8d --- /dev/null +++ b/lib/Components/side_drawer2.dart @@ -0,0 +1,264 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/services/login_service.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; + +class SideDrawer extends StatefulWidget { + final String curr_desig; + + const SideDrawer({ + Key? key, + required this.curr_desig, + }) : super(key: key); + + @override + _SideDrawerState createState() => _SideDrawerState(); +} + +class _SideDrawerState extends State { + bool _loading = false; + int count = 0; + late String name; + late String depttype; + late String type; + @override + void initState() { + super.initState(); + var service = locator(); + print(service.profileData); + name = service.profileData.user!["first_name"] + + " " + + service.profileData.user!["last_name"]; + depttype = service.profileData.profile!['department']!['name']; + + type = service.profileData.profile!['user_type']; + print(depttype); + } + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Container( + margin: const EdgeInsets.only(right: 50.0), + height: MediaQuery.of(context).size.height, + color: Colors.white, + child: ListView( + shrinkWrap: true, + physics: ClampingScrollPhysics(), + children: [ + Column( + children: [ + Card( + elevation: 2.0, + margin: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 30.0), + // shadowColor: Colors.black, + color: Colors.white, + + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 0.0), + width: 270.0, + height: 120.0, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/profile_pic.png'), + fit: BoxFit.contain, + ), + ), + ), + SizedBox( + height: 10.0, + ), + Text( + name, //Display name of User + style: TextStyle( + fontSize: 20.0, + color: Colors.black, + fontWeight: FontWeight.bold), + ), + SizedBox( + height: 10.0, + ), + Text( + depttype + + " " + + widget.curr_desig, // Display Type of User + style: TextStyle( + fontSize: 17.0, + color: Colors.black, + fontWeight: FontWeight.bold), + ), + SizedBox( + height: 10.0, + ), + ], + ), + ), + ], + ), + ModulesCard(cardLine: 'DashBoard', pageMover: '/dashboard'), + + if ((type != "staff" || widget.curr_desig=="acadmin"|| widget.curr_desig== "corelabcaretaker")) + ModulesCard( + cardLine: 'Academics Module', + pageMover: '/academic_home_page', + ), + + if ((type == "student" || widget.curr_desig=="acadmin")) + ModulesCard( + cardLine: 'Programme Curriculum', + pageMover: '/programme_curriculum_home', + ), + + if ((type == "student") || widget.curr_desig== "Dean_s" || widget.curr_desig== "DeanPnD" || widget.curr_desig== "dean_rspc" || widget.curr_desig== "dean_s" ) + ModulesCard( + cardLine: 'Gymkhana Module', + pageMover: '/gymkhana_homepage', + ), + + if ((type == "student" || widget.curr_desig== "mess_manager" || widget.curr_desig== "mess_warden")) + ModulesCard(cardLine: 'Central Mess Module',pageMover: '/central_mess_home'), + + + ModulesCard( + cardLine: 'Health Center Module', + pageMover: '/health_center', + ), + if ((type == "student" )) + ModulesCard(cardLine: 'Leave Module'), + + if ((type == "student" )) + ModulesCard(cardLine: 'Purchase and Store'), + + if ((type == "student" )) + ModulesCard(cardLine: 'Human Resource'), + + if(type == "student"|| widget.curr_desig=="placement chairman" || widget.curr_desig=="placement officer") + ModulesCard(cardLine: 'Placement Module'), + + ModulesCard(cardLine: 'Visitors Hostel Module',pageMover: '/visitor_hostel'), + + if(type != "student") + ModulesCard(cardLine: 'File Tracking Module',pageMover: '/compose_file'), + + ModulesCard( + cardLine: 'Establishment Module', pageMover: '/establishment'), + + ModulesCard( + cardLine: 'Library Module', pageMover: '/library_homepage'), + + if(type == "student" || widget.curr_desig== "spacsconvenor"|| widget.curr_desig== "spacsassistant") + ModulesCard(cardLine: 'Awards & Scholarship Module'), + + ModulesCard(cardLine: 'Complaint Module', pageMover: '/complaint'), + + ModulesCard(cardLine: 'Research Module'), + + ModulesCard(cardLine: 'Counselling Cell'), + + if ((type == "faculty" ||widget.curr_desig== "acadadmin" )) + ModulesCard(cardLine: 'Examination Module',pageMover: '/examination',), + + + + if ((widget.curr_desig== "Executive Engineer (Civil)" ||widget.curr_desig== "EE" || widget.curr_desig== "Admin IWD" || widget.curr_desig== "Electrical_AE" || widget.curr_desig== "mess_manager" || widget.curr_desig== "Electrical_JE" || widget.curr_desig== "Civil_AE" || widget.curr_desig== "Civil_JE" || widget.curr_desig== "Director" || widget.curr_desig== "dean_s" || widget.curr_desig== "Dean_s" || widget.curr_desig== "DeanPnD" )) + ModulesCard(cardLine: 'IWD',pageMover: '/iwd/home_page'), + + + ModulesCard(cardLine: 'Courses Module', pageMover: '/registered_courses', + ), + ModulesCard(cardLine: 'HR Module', pageMover: '/hr_homepage', + ), + + + // ModulesCard( + // cardLine: 'Profile', + // icon: Icons.account_circle, + // pageMover: '/profile'), + + // ModulesCard(cardLine: 'Office Of Dean Students'), + // ModulesCard(cardLine: 'Office Of Dean Academics'), + // ModulesCard(cardLine: 'Director Office'), + // ModulesCard(cardLine: 'Office Of Purchase Officer'), + // ModulesCard(cardLine: 'Office Of Registrar'), + // ModulesCard(cardLine: 'Office Of P&D'), + // ModulesCard(cardLine: 'Office Of HOD (Branch)'), + // ModulesCard(cardLine: 'Finance & Accounts'), + // ModulesCard(cardLine: 'Meet Our Team'), + ModulesCard(cardLine: 'Log Out', icon: Icons.logout), + ], + ), + ), + ); + } + +String _getGymkhanaPage() { + + // Determine the pageMover based on designation + print(widget.curr_desig); + if (widget.curr_desig == 'co-ordinator') { + + return '/gymkhana_coordinator'; + } + else if(widget.curr_desig == 'Counsellor'){ + return '/gymkhana_counsellor'; + } + else if(widget.curr_desig == 'Convenor'){ + return '/gymkhana_convenor'; + } + else if(widget.curr_desig == 'Dean Academic'){ + return '/gymkhana_dean'; + } + + else + return '/gymkhana_homepage'; + } +// ignore: must_be_immutable +} + +class ModulesCard extends StatelessWidget { + final String? cardLine; + final String? pageMover; + IconData? icon; + ModulesCard({this.cardLine, this.icon, this.pageMover}); + @override + Widget build(BuildContext context) { + return GestureDetector( + //behaviour to translucent to get Tap even on blank or empty space within container + behavior: HitTestBehavior.translucent, + child: Card( + color: Colors.white, + margin: const EdgeInsets.all(10.0), + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + cardLine!, + style: TextStyle(fontSize: 16.0, color: Colors.black), + ), + Icon( + icon, + color: Colors.deepOrangeAccent, + ), + ], + ), + ), + ), + onTap: () async { + var _prefs = await StorageService.getInstance(); + String token = _prefs!.userInDB?.token ?? ""; + if (cardLine == 'Log Out') { + LoginService auth = LoginService(); + auth.logout(); + Navigator.pushReplacementNamed(context, "/landing"); + } + if (pageMover != null) + Navigator.pushReplacementNamed(context, pageMover!, arguments: token); + }, + ); + } +} \ No newline at end of file diff --git a/lib/DesignationProvider.dart b/lib/DesignationProvider.dart new file mode 100644 index 00000000..34031248 --- /dev/null +++ b/lib/DesignationProvider.dart @@ -0,0 +1,12 @@ +import 'package:flutter/material.dart'; + +class DesignationProvider extends ChangeNotifier { + late String _designation; + + String get designation => _designation; + + void updateDesignation(String newDesignation) { + _designation = newDesignation; + notifyListeners(); // Notify listeners about the change + } +} \ No newline at end of file diff --git a/lib/api.dart b/lib/api.dart index 73d1c6bc..1f76a52b 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -21,6 +21,7 @@ String kComplaintRemove = "/complaint/api/removecomplain/"; //Dashboard String kDashboard = "/api/dashboard/"; +String kNotification = "/api/notification/"; String kNotificationRead = "/api/notification/read/"; //Gymkhana diff --git a/lib/main.dart b/lib/main.dart index 9ca81ff8..4cd5af87 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -9,7 +9,10 @@ import 'package:fusion/screens/Library/Book_Search.dart'; import 'package:fusion/screens/Library/dues.dart'; import 'package:fusion/screens/Library/issued_items.dart'; import 'package:fusion/screens/Library/lib_home_screen.dart'; +import 'package:fusion/screens/LoginandDashboard/DashboardComponents/news.dart'; import 'package:fusion/screens/LoginandDashboard/dashboard.dart'; +import 'package:fusion/screens/LoginandDashboard/DashboardComponents/notify.dart'; +import 'package:fusion/screens/LoginandDashboard/DashboardComponents/announcement.dart'; import 'package:fusion/screens/LoginandDashboard/login_page.dart'; import 'package:fusion/screens/Academic/academic_home_page.dart'; import 'package:fusion/screens/Academic/Current_Semester/current_semester_home_page.dart'; @@ -60,9 +63,9 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { MediaQueryData windowData = - MediaQueryData.fromWindow(WidgetsBinding.instance.window); + MediaQueryData.fromView(WidgetsBinding.instance.window); windowData = windowData.copyWith( - textScaleFactor: 1, + textScaler: TextScaler.linear(1), ); return MediaQuery( data: windowData, @@ -81,6 +84,9 @@ class MyApp extends StatelessWidget { routes: { '/landing': (context) => LandingPage(), '/login_page': (context) => LoginPage(), + '/notification':(context)=>Notify(), + '/news':(context)=>News(), + '/announcement':(context)=>Announcement(), '/dashboard': (context) => Dashboard(), '/academic_home_page': (context) => AcademicHomePage( ModalRoute.of(context)!.settings.arguments.toString()), @@ -131,4 +137,4 @@ class MyApp extends StatelessWidget { ), ); } -} +} \ No newline at end of file diff --git a/lib/screens/LoginandDashboard/DashboardComponents/announcement.dart b/lib/screens/LoginandDashboard/DashboardComponents/announcement.dart new file mode 100644 index 00000000..c0db276f --- /dev/null +++ b/lib/screens/LoginandDashboard/DashboardComponents/announcement.dart @@ -0,0 +1,200 @@ +import 'dart:async'; +import 'dart:convert'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; +import 'package:flutter/material.dart'; +import 'package:fusion/Components/appBar2.dart'; +import 'package:fusion/Components/side_drawer2.dart'; +import 'package:fusion/models/dashboard.dart'; +import 'package:fusion/screens/LoginandDashboard/DashboardComponents/cardItems.dart'; +import 'package:fusion/services/dashboard_service.dart'; +import 'package:http/http.dart'; +import 'package:fusion/Components/bottom_navigation_bar.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; + +class Announcement extends StatefulWidget { + static String tag = 'home-page'; + @override + _AnnouncementState createState() => _AnnouncementState(); +} + +class _AnnouncementState extends State { + bool _notificationsBool = false; + bool _newsBool = false; + bool _announcementsBool = true; + bool _homeBool = false; + + bool _loading = true; + late String name; + late String studentType; + // Stream Controller for API + late StreamController _dashboardController; + late DashboardService dashboardService; + late DashboardData data; + late StreamController _profileController; + late ProfileService profileService; + late ProfileData data2; + var service = locator(); + late String curr_desig = service.getFromDisk("Current_designation"); + @override + void initState() { + super.initState(); + _dashboardController = StreamController(); + dashboardService = DashboardService(); + _profileController = StreamController(); + profileService = ProfileService(); + getData(); + } + + getData() async { + try { + print("gfsgsgd"); + Response response = await dashboardService.getDashboard(); + print("1"); + Response response2 = await profileService.getProfile(); + print("2"); + print(response); + print(response2); + + setState(() { + data = DashboardData.fromJson(jsonDecode(response.body)); + data2 = ProfileData.fromJson(jsonDecode(response2.body)); + _loading = false; + }); + name = data2.user!['first_name'] + ' ' + data2.user!['last_name']; + studentType = data2.profile!['department']!['name'] + + ' ' + + data2.profile!['user_type']; + } catch (e) { + print(e); + } + } + + loadData() async { + getData().then((res) { + _dashboardController.add(res); + _profileController.add(res); + }); + } + + final GlobalKey scaffoldKey = new GlobalKey(); + showSnack() { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: const Text('New Content Loaded'), + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: CustomAppBar( + curr_desig: curr_desig, + headerTitle: "Announcement", + + onDesignationChanged: (newValue) { + setState(() { + curr_desig = newValue; + }); + }, + ), + bottomNavigationBar: MyBottomNavigationBar(), + drawer: SideDrawer(curr_desig: curr_desig), + body: _loading == true + ? Center(child: CircularProgressIndicator()) + : StreamBuilder( + stream: _dashboardController.stream, + builder: (context, AsyncSnapshot snapshot) { + return Stack(children: [ + Positioned( + left: 0, + child: Column( + children: [ + Card( + elevation: 0, + margin: EdgeInsets.symmetric( + horizontal: 10.0, vertical: 10.0), + color: Colors.transparent, + child: Padding( + padding: const EdgeInsets.only( + top: 10.0, + bottom: 10.0, + left: 13.0, + right: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + _notificationsBool = true; + _announcementsBool = false; + _newsBool = false; + setState(() { + _notificationsBool = true; + _announcementsBool = false; + _newsBool = false; + }); + Navigator.pushReplacementNamed( + context, "/notification"); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + // Only handle navigation when the icon is clicked + _notificationsBool = false; + _announcementsBool = true; + _newsBool = false; + setState(() { + _notificationsBool = false; + _announcementsBool = true; + _newsBool = false; + }); + Navigator.pushReplacementNamed( + context, "/landing"); + }, + child: Icon( + Icons.navigate_before_rounded, + color: Colors.black, + size: 25.0, + ), + ), + SizedBox(width: 20.0), + Text( + 'Announcement', + style: TextStyle( + fontSize: 22.0, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(width: 170.0), + ], + ), + ), + ], + ), + ), + ), + + + ], + ), + ), + ]); + }, + ), + ); + } + + @override + void dispose() { + _dashboardController.close(); + super.dispose(); + } +} \ No newline at end of file diff --git a/lib/screens/LoginandDashboard/DashboardComponents/cardItems.dart b/lib/screens/LoginandDashboard/DashboardComponents/cardItems.dart index fffcde98..63afcdd9 100644 --- a/lib/screens/LoginandDashboard/DashboardComponents/cardItems.dart +++ b/lib/screens/LoginandDashboard/DashboardComponents/cardItems.dart @@ -1,36 +1,34 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; import 'package:fusion/models/notification.dart' as notif; import 'package:fusion/services/dashboard_service.dart'; class NotificationCard extends StatelessWidget { final List? notifications; - const NotificationCard({Key? key, required this.notifications}) - : super(key: key); + const NotificationCard({Key? key, required this.notifications}) : super(key: key); @override Widget build(BuildContext context) { return Card( elevation: 2.0, - margin: EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0), + margin: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0), shadowColor: Colors.black, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: getCards(), + child: SingleChildScrollView( // Added to allow scrolling + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: getCards(), + ), ), ); } - getCards() { - List cards = []; - for (int i = 0; i < notifications!.length; i++) { - cards.add(InfoCard( - notification: notifications![i], - )); - } - return cards; + List getCards() { + // Transforming the notifications into InfoCard widgets + return notifications!.map((notif.Notification notification) { + return InfoCard( + notification: notification, + ); + }).toList(); } } @@ -38,19 +36,20 @@ class NewsCard extends StatelessWidget { @override Widget build(BuildContext context) { return Card( - elevation: 2.0, - margin: EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0), + elevation: 0, + margin: EdgeInsets.symmetric( + horizontal: 10.0, vertical: 10.0), shadowColor: Colors.black, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Card( elevation: 3.0, - margin: EdgeInsets.symmetric(horizontal: 15.0, vertical: 20.0), + margin: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 20.0), shadowColor: Colors.black, - child: Center( + child: const Center( child: Padding( - padding: const EdgeInsets.all(18.0), + padding: EdgeInsets.all(18.0), child: Text('Work in progress'), ), ), @@ -64,9 +63,10 @@ class NewsCard extends StatelessWidget { class InfoCard extends StatefulWidget { final notif.Notification notification; - InfoCard({ + const InfoCard({ + Key? key, required this.notification, - }); + }) : super(key: key); @override _InfoCardState createState() => _InfoCardState(); @@ -77,46 +77,38 @@ class _InfoCardState extends State { Widget build(BuildContext context) { return Card( elevation: 3.0, - margin: EdgeInsets.symmetric(horizontal: 15.0, vertical: 20.0), + margin: const EdgeInsets.symmetric(horizontal: 15.0, vertical: 20.0), shadowColor: Colors.black, child: Column( children: [ - SizedBox( - height: 10.0, - ), + const SizedBox(height: 10.0), Text( widget.notification.data!["module"], textAlign: TextAlign.left, - style: TextStyle( + style: const TextStyle( fontSize: 20.0, color: Colors.deepOrangeAccent, fontWeight: FontWeight.bold, ), ), - SizedBox( - height: 10.0, - ), + const SizedBox(height: 10.0), Padding( padding: const EdgeInsets.all(8.0), child: Text( widget.notification.verb!, - style: TextStyle(fontSize: 15.0, color: Colors.black), + style: const TextStyle(fontSize: 15.0, color: Colors.black), ), ), - SizedBox( - height: 10.0, - ), + const SizedBox(height: 10.0), ElevatedButton( - child: widget.notification.unread! - ? Text('Mark As Read') - : Text('Mark As Unread'), + child: Text(widget.notification.unread! ? 'Mark As Read' : 'Mark As Unread'), onPressed: () { // Respond to button press DashboardService service = DashboardService(); setState(() { try { service.markRead(widget.notification.id!.toString()); - }catch(e){ + } catch (e) { print(e); } }); @@ -124,10 +116,8 @@ class _InfoCardState extends State { style: ButtonStyle( backgroundColor: MaterialStateProperty.resolveWith( (Set states) { - if (states.contains(MaterialState.pressed)) - return Colors.deepOrange; - return Colors - .deepOrangeAccent; // Use the component's default. + if (states.contains(MaterialState.pressed)) return Colors.deepOrange; + return Colors.deepOrangeAccent; // Default Color }, ), ), diff --git a/lib/screens/LoginandDashboard/DashboardComponents/news.dart b/lib/screens/LoginandDashboard/DashboardComponents/news.dart new file mode 100644 index 00000000..268ae36a --- /dev/null +++ b/lib/screens/LoginandDashboard/DashboardComponents/news.dart @@ -0,0 +1,201 @@ +import 'dart:async'; +import 'dart:convert'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; +import 'package:flutter/material.dart'; +import 'package:fusion/Components/appBar2.dart'; +import 'package:fusion/Components/side_drawer2.dart'; +import 'package:fusion/models/dashboard.dart'; +import 'package:fusion/screens/LoginandDashboard/DashboardComponents/cardItems.dart'; +import 'package:fusion/services/dashboard_service.dart'; +import 'package:http/http.dart'; +import 'package:fusion/Components/bottom_navigation_bar.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; + +class News extends StatefulWidget { + static String tag = 'home-page'; + @override + _NewsState createState() => _NewsState(); +} + +class _NewsState extends State { + bool _notificationsBool = false; + bool _newsBool = true; + bool _announcementsBool = false; + bool _homeBool = false; + + bool _loading = true; + late String name; + late String studentType; + // Stream Controller for API + late StreamController _dashboardController; + late DashboardService dashboardService; + late DashboardData data; + late StreamController _profileController; + late ProfileService profileService; + late ProfileData data2; + var service = locator(); + late String curr_desig = service.getFromDisk("Current_designation"); + + @override + void initState() { + super.initState(); + _dashboardController = StreamController(); + dashboardService = DashboardService(); + _profileController = StreamController(); + profileService = ProfileService(); + getData(); + } + + getData() async { + try { + print("gfsgsgd"); + Response response = await dashboardService.getDashboard(); + print("1"); + Response response2 = await profileService.getProfile(); + print("2"); + print(response); + print(response2); + + setState(() { + data = DashboardData.fromJson(jsonDecode(response.body)); + data2 = ProfileData.fromJson(jsonDecode(response2.body)); + _loading = false; + }); + name = data2.user!['first_name'] + ' ' + data2.user!['last_name']; + studentType = data2.profile!['department']!['name'] + + ' ' + + data2.profile!['user_type']; + } catch (e) { + print(e); + } + } + + loadData() async { + getData().then((res) { + _dashboardController.add(res); + _profileController.add(res); + }); + } + + final GlobalKey scaffoldKey = new GlobalKey(); + showSnack() { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: const Text('New Content Loaded'), + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: CustomAppBar( + curr_desig: curr_desig, + headerTitle: "News", + + onDesignationChanged: (newValue) { + setState(() { + curr_desig = newValue; + }); + }, + ), + drawer: SideDrawer(curr_desig: curr_desig), + bottomNavigationBar: MyBottomNavigationBar(), + body: _loading == true + ? Center(child: CircularProgressIndicator()) + : StreamBuilder( + stream: _dashboardController.stream, + builder: (context, AsyncSnapshot snapshot) { + return Stack(children: [ + Positioned( + left: 0, + child: Column( + children: [ + Card( + elevation: 0, + margin: EdgeInsets.symmetric( + horizontal: 10.0, vertical: 10.0), + color: Colors.transparent, + child: Padding( + padding: const EdgeInsets.only( + top: 10.0, + bottom: 10.0, + left: 13.0, + right: 10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + onTap: () { + _notificationsBool = true; + _announcementsBool = false; + _newsBool = false; + setState(() { + _notificationsBool = true; + _announcementsBool = false; + _newsBool = false; + }); + Navigator.pushReplacementNamed( + context, "/notification"); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + // Only handle navigation when the icon is clicked + _notificationsBool = true; + _announcementsBool = false; + _newsBool = false; + setState(() { + _notificationsBool = true; + _announcementsBool = false; + _newsBool = false; + }); + Navigator.pushReplacementNamed( + context, "/landing"); + }, + child: Icon( + Icons.navigate_before_rounded, + color: Colors.black, + size: 25.0, + ), + ), + SizedBox(width: 20.0), + Text( + 'News', + style: TextStyle( + fontSize: 22.0, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(width: 170.0), + ], + ), + ), + ], + ), + ), + ), + + + ], + ), + ), + ]); + }, + ), + ); + } + + @override + void dispose() { + _dashboardController.close(); + super.dispose(); + } +} \ No newline at end of file diff --git a/lib/screens/LoginandDashboard/DashboardComponents/notify.dart b/lib/screens/LoginandDashboard/DashboardComponents/notify.dart new file mode 100644 index 00000000..198820b5 --- /dev/null +++ b/lib/screens/LoginandDashboard/DashboardComponents/notify.dart @@ -0,0 +1,152 @@ +import 'dart:async'; +import 'dart:convert'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; +import 'package:flutter/material.dart'; +import 'package:fusion/Components/appBar2.dart'; +import 'package:fusion/Components/side_drawer2.dart'; +import 'package:fusion/models/dashboard.dart'; +import 'package:fusion/screens/LoginandDashboard/DashboardComponents/cardItems.dart'; +import 'package:fusion/services/dashboard_service.dart'; +import 'package:http/http.dart'; +import 'package:fusion/Components/bottom_navigation_bar.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:fusion/models/notification.dart' as notif; +import 'package:intl/intl.dart'; + +class Notify extends StatefulWidget { + static String tag = 'home-page'; + @override + _NotifyState createState() => _NotifyState(); +} + +class _NotifyState extends State { + List _notifications = []; + bool _loading = true; + late String name; + late String studentType; + + // Stream Controller for API + late StreamController _dashboardController; + late DashboardService dashboardService; + late DashboardData data; + late StreamController _profileController; + late ProfileService profileService; + late ProfileData data2; + var service = locator(); + late String curr_desig = service.getFromDisk("Current_designation"); + @override + void initState() { + super.initState(); + _dashboardController = StreamController(); + dashboardService = DashboardService(); + _profileController = StreamController(); + profileService = ProfileService(); + getData(); + } + + getData() async { + try { + print("gfsgsgd"); + Response response = await dashboardService.getNotification(); + print("1"); + Response response2 = await profileService.getProfile(); + print("2"); + print(response); + print(response2); + + setState(() { + data = DashboardData.fromJson(jsonDecode(response.body)); + _notifications = notif.Notification.fromListJson(jsonDecode(response.body)['notifications']); + data2 = ProfileData.fromJson(jsonDecode(response2.body)); + _loading = false; + }); + name = data2.user!['first_name'] + ' ' + data2.user!['last_name']; + studentType = data2.profile!['department']!['name'] + + ' ' + + data2.profile!['user_type']; + } catch (e) { + print(e); + } + } + + loadData() async { + getData().then((res) { + _dashboardController.add(res); + _profileController.add(res); + }); + } + + final GlobalKey scaffoldKey = new GlobalKey(); + showSnack() { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: const Text('New Content Loaded'), + ), + ); + } + + @override +Widget build(BuildContext context) { + return Scaffold( + appBar: CustomAppBar( + curr_desig: curr_desig, + headerTitle: "Notifications", + + onDesignationChanged: (newValue) { + setState(() { + curr_desig = newValue; + }); + }, + ), // This is default app bar used in all modules + drawer: SideDrawer(curr_desig: curr_desig), + bottomNavigationBar: + MyBottomNavigationBar(), // This is sideDrawer used in all modules + body: _loading + ? Center(child: CircularProgressIndicator()) + : ListView.builder( + itemCount: _notifications.length, + padding: EdgeInsets.all(8.0), // Add padding around the list for better spacing + itemBuilder: (context, index) { + final notification = _notifications[index]; + final formattedDate = notification.timestamp != null + ? DateFormat('yyyy-MM-dd – kk:mm').format(notification.timestamp!) + : "No Date"; + + return Card( + elevation: 4.0, // Adjust the shadow's elevation + margin: EdgeInsets.symmetric(vertical: 4.0, horizontal: 0), // Spacing between cards + child: ListTile( + leading: Icon(notification.unread ?? false ? Icons.notifications_active : Icons.notifications_off), + title: Text(notification.verb ?? "No Title"), + subtitle: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + notification.description ?? "No Description", + overflow: TextOverflow.ellipsis, + ), + ), + Text(formattedDate, textAlign: TextAlign.right), + ], + ), + onTap: () { + // Handle tap + }, + ), + ); + }, + ), + + + ); + } + + @override + void dispose() { + _dashboardController.close(); + super.dispose(); + } +} \ No newline at end of file diff --git a/lib/screens/LoginandDashboard/dashboard.dart b/lib/screens/LoginandDashboard/dashboard.dart index 80c2719f..24f372d5 100644 --- a/lib/screens/LoginandDashboard/dashboard.dart +++ b/lib/screens/LoginandDashboard/dashboard.dart @@ -2,15 +2,17 @@ import 'dart:async'; import 'dart:convert'; import 'package:fusion/models/profile.dart'; import 'package:fusion/services/profile_service.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:fusion/Components/appBar.dart'; -import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/Components/appBar2.dart'; +import 'package:fusion/Components/side_drawer2.dart'; import 'package:fusion/models/dashboard.dart'; import 'package:fusion/screens/LoginandDashboard/DashboardComponents/cardItems.dart'; import 'package:fusion/services/dashboard_service.dart'; import 'package:http/http.dart'; +import 'package:fusion/services/appBar_services.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:fusion/Components/bottom_navigation_bar.dart'; class Dashboard extends StatefulWidget { static String tag = 'home-page'; @@ -20,9 +22,11 @@ class Dashboard extends StatefulWidget { } class _DashboardState extends State { - bool _notificationsBool = true; + bool _notificationsBool = false; bool _newsBool = false; bool _announcementsBool = false; + bool _homeBool = true; + bool _loading = true; late String name; late String studentType; @@ -33,6 +37,12 @@ class _DashboardState extends State { late StreamController _profileController; late ProfileService profileService; late ProfileData data2; + late List designationsArray; + var service = locator(); + late String curr_desig = service.getFromDisk("Current_designation"); + bool isStudent = false; + + final appBarServices _appBarServices = appBarServices(); @override void initState() { super.initState(); @@ -45,17 +55,28 @@ class _DashboardState extends State { getData() async { try { + print("gfsgsgd"); Response response = await dashboardService.getDashboard(); + print("1"); Response response2 = await profileService.getProfile(); + print("2"); + print(response); + print(response2); + setState(() { data = DashboardData.fromJson(jsonDecode(response.body)); data2 = ProfileData.fromJson(jsonDecode(response2.body)); _loading = false; }); + print(data2.user!); + print( + '-----------------------------------=---------------------------------------'); name = data2.user!['first_name'] + ' ' + data2.user!['last_name']; - studentType = data2.profile!['department']!['name'] + - ' ' + - data2.profile!['user_type']; + studentType = data2.profile!['department']!['name']; + + if (data2.profile!['user_type'] == 'student') { + isStudent = true; + } } catch (e) { print(e); } @@ -68,6 +89,15 @@ class _DashboardState extends State { }); } + fetchDesignations() async { + try { + designationsArray = await _appBarServices.getDesignations(); + } catch (e) { + print("Error fetching designations: $e"); + return null; + } + } + final GlobalKey scaffoldKey = new GlobalKey(); showSnack() { ScaffoldMessenger.of(context).showSnackBar( @@ -80,174 +110,221 @@ class _DashboardState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: DefaultAppBar() - .buildAppBar(), // This is default app bar used in all modules - drawer: SideDrawer(), // This is sideDrawer used in all modules - body: _loading == true - ? Center(child: CircularProgressIndicator()) - : StreamBuilder( - stream: _dashboardController.stream, - builder: (context, AsyncSnapshot snapshot) { - return ListView( - shrinkWrap: true, - physics: ClampingScrollPhysics(), - children: [ - Card( - elevation: 2.0, - margin: EdgeInsets.symmetric( - horizontal: 50.0, vertical: 20.0), - shadowColor: Colors.black, - child: Column( + appBar: CustomAppBar( + curr_desig: curr_desig, + headerTitle: "Dashboard", + onDesignationChanged: (newValue) { + setState(() { + curr_desig = newValue; + }); + }, + ), // This is default app bar used in all modules + drawer: SideDrawer(curr_desig: curr_desig), + bottomNavigationBar: + MyBottomNavigationBar(), // This is sideDrawer used in all modules + body: Column( + children: [ + Expanded( + child: _loading == true + ? Center(child: CircularProgressIndicator()) + : StreamBuilder( + stream: _dashboardController.stream, + builder: (context, AsyncSnapshot snapshot) { + return ListView( + shrinkWrap: true, + physics: ClampingScrollPhysics(), children: [ - Container( - margin: EdgeInsets.only(top: 20.0), - width: 170.0, - height: 170.0, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage('assets/profile_pic.png'), - fit: BoxFit.cover, - ), - ), - ), - SizedBox( - height: 10.0, - ), - Text( - name, //Display name of User - style: - TextStyle(fontSize: 20.0, color: Colors.black), - ), - SizedBox( - height: 10.0, - ), - Text( - studentType, // Display Type of User - style: - TextStyle(fontSize: 15.0, color: Colors.black), - ), - SizedBox( - height: 10.0, - ), - ], - ), - ), - Card( - color: Colors.black, - child: Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - GestureDetector( - onTap: () { - _notificationsBool = true; - _announcementsBool = false; - _newsBool = false; - setState(() { - _notificationsBool = true; - _announcementsBool = false; - _newsBool = false; - }); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Text( - 'Notifications', - style: TextStyle( - fontSize: 16.0, - color: Colors.white, + Card( + elevation: 2.0, + margin: EdgeInsets.symmetric( + horizontal: 20.0, vertical: 30.0), + // shadowColor: Colors.black, + color: Colors.white, + + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 20.0), + width: 170.0, + height: 190.0, + decoration: BoxDecoration( + image: DecorationImage( + image: + AssetImage('assets/profile_pic.png'), + fit: BoxFit.cover, ), ), - Icon( - Icons.notifications_active_rounded, - color: _notificationsBool - ? Colors.deepOrangeAccent - : Colors.white, - ), - ], - ), + ), + SizedBox( + height: 10.0, + ), + Text( + name, //Display name of User + style: TextStyle( + fontSize: 20.0, + color: Colors.black, + fontWeight: FontWeight.bold), + ), + SizedBox( + height: 10.0, + ), + Text( + studentType + + " " + + curr_desig, // Display Type of User + style: TextStyle( + fontSize: 17.0, + color: Colors.black, + fontWeight: FontWeight.bold), + ), + SizedBox( + height: 10.0, + ), + ], ), - GestureDetector( - onTap: () { - _newsBool = true; - _announcementsBool = false; - _notificationsBool = false; - setState(() { - _newsBool = true; - _announcementsBool = false; - _notificationsBool = false; - }); - }, + ), + + Card( + margin: EdgeInsets.symmetric( + horizontal: 20.0, vertical: 10.0), + color: Colors.deepOrangeAccent, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + 50.0), // Set the border radius here + ), + child: Padding( + padding: const EdgeInsets.only( + top: 10.0, + bottom: 10.0, + left: 13.0, + right: 10.0), child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment + .spaceEvenly, // Align the children along the main axis with space between them + crossAxisAlignment: CrossAxisAlignment + .center, // Align the children along the cross axis (vertically by default) + // mainAxisSize: MainAxisSize.max, children: [ - Text( - 'News', - style: TextStyle( - fontSize: 16.0, - color: Colors.white, + GestureDetector( + onTap: () { + _notificationsBool = true; + _announcementsBool = false; + _newsBool = false; + setState(() { + _notificationsBool = true; + _announcementsBool = false; + _newsBool = false; + }); + Navigator.pushReplacementNamed( + context, "/profile"); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + Icon( + Icons.account_circle, + color: Colors.white, + size: 30.0, + ), + SizedBox(width: 40.0), + Text( + 'Professsional Profile', + style: TextStyle( + fontSize: 20.0, + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(width: 40.0), + Icon( + Icons.arrow_forward_ios_rounded, + color: Colors.white, + ), + ], ), ), - Icon( - Icons.email, - color: _newsBool - ? Colors.deepOrangeAccent - : Colors.white, - ), ], ), ), - GestureDetector( - onTap: () { - _announcementsBool = true; - _newsBool = false; - _notificationsBool = false; - setState(() { - _announcementsBool = true; - _newsBool = false; - _notificationsBool = false; - }); - }, + ), + + if (!isStudent) + Card( + margin: EdgeInsets.symmetric( + horizontal: 20.0, vertical: 10.0), + color: Colors.deepOrangeAccent, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + 50.0), // Set the border radius here + ), child: Padding( - padding: const EdgeInsets.only(right: 16.0), + padding: const EdgeInsets.only( + top: 10.0, + bottom: 10.0, + left: 13.0, + right: 10.0), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceEvenly, children: [ - Text( - 'Announcements', - style: TextStyle( - fontSize: 16.0, - color: Colors.white, + GestureDetector( + onTap: () { + _notificationsBool = true; + _announcementsBool = false; + _newsBool = false; + setState(() { + _notificationsBool = true; + _announcementsBool = false; + _newsBool = false; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment + .spaceEvenly, // Align the children along the main axis with space between them + crossAxisAlignment: CrossAxisAlignment + .center, // Align the children along the cross axis (vertically by default) + mainAxisSize: MainAxisSize.max, + children: [ + Icon( + Icons.notifications_active_rounded, + color: Colors.white, + ), + SizedBox(width: 40.0), + Text( + 'Admistrative Profile', + style: TextStyle( + fontSize: 20.0, + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(width: 40.0), + Icon( + Icons.arrow_forward_ios_rounded, + color: Colors.white, + ), + ], ), ), - Icon( - Icons.announcement, - color: _announcementsBool - ? Colors.deepOrangeAccent - : Colors.white, - ), ], ), ), ), - ], - ), - ), - ), - _notificationsBool - ? NotificationCard( - notifications: data.notifications, - ) - : NewsCard(), - ], - ); - }, - ), + + // _notificationsBool + // ? NotificationCard( + // notifications: data.notifications, + // ) + // : NewsCard(), + ], + ); + }, + ), + ), + // Place the BottomNavigationBar here + ], + ), ); } @@ -256,4 +333,4 @@ class _DashboardState extends State { _dashboardController.close(); super.dispose(); } -} +} \ No newline at end of file diff --git a/lib/screens/LoginandDashboard/login_page.dart b/lib/screens/LoginandDashboard/login_page.dart index ca09fee2..aff38280 100644 --- a/lib/screens/LoginandDashboard/login_page.dart +++ b/lib/screens/LoginandDashboard/login_page.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:fusion/constants.dart'; @@ -10,7 +9,9 @@ class LoginPage extends StatefulWidget { _LoginPageState createState() => _LoginPageState(); } -bool checkBoxValue = false; +bool _focused = false; +bool _focused2 = false; +double bottom =10; class _LoginPageState extends State { final GlobalKey _formKey = GlobalKey(); @@ -23,21 +24,45 @@ class _LoginPageState extends State { final Widget logoWidget = CircleAvatar( backgroundColor: Colors.transparent, - radius: 54.0, - child: Image.asset('assets/logo.jpg'), + radius: (_focused || _focused2) ? 110.0 : 150.0, + child:Container( + + child: Image.asset('assets/logo.jpg'), + ), ); - final Widget emailFormField = TextFormField( + final Widget emailFormField = Focus( + onFocusChange: (focus) { + setState(() { + _focused = focus; + if (focus==true){ + bottom=400; + } + + }); + }, + child:TextFormField( keyboardType: TextInputType.emailAddress, autofocus: false, decoration: InputDecoration( label: Text('Username', style: TextStyle( - fontSize: 12.0, + fontSize: 18.0, ),), contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), - border: OutlineInputBorder( - // borderRadius: BorderRadius.circular(32.0), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(width: 0, color: Color(0xFFf4f4f4)), + borderRadius: BorderRadius.circular(20.0), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(width: 0, color: Color(0xFFf4f4f4)), + borderRadius: BorderRadius.circular(20.0), ), + // enabledBorder: InputBorder.none, + fillColor: Color(0xFFf4f4f4), // Green color + filled: true, + floatingLabelBehavior: FloatingLabelBehavior.never, ), + cursorColor: Colors.black, + onChanged: (input) { username = input; }, @@ -48,23 +73,45 @@ class _LoginPageState extends State { else if (value?.contains('@') == true) { return 'Please enter username only'; } + return null; }, autofillHints: [AutofillHints.username], - ); + )); + + final Widget passwordFormField = Focus( + onFocusChange: (focus) { + setState(() { + _focused2 = focus; + if (focus==true){ + bottom=400; + } - final Widget passwordFormField = TextFormField( + }); + }, + child: TextFormField( autofocus: false, obscureText: true, decoration: InputDecoration( label: Text('Password', style: TextStyle( - fontSize: 12.0, + fontSize: 18.0, ),), contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), - border: OutlineInputBorder( - // borderRadius: BorderRadius.circular(32.0), + + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(width: 0, color: Color(0xFFf4f4f4)), + borderRadius: BorderRadius.circular(20.0), ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(width: 0, color: Color(0xFFf4f4f4)), + borderRadius: BorderRadius.circular(20.0), + ), + // enabledBorder: InputBorder.none, + fillColor: Color(0xFFf4f4f4), // Green color + filled: true, + floatingLabelBehavior: FloatingLabelBehavior.never, ), + cursorColor: Colors.black, onChanged: (input) { pass = input; }, @@ -74,12 +121,13 @@ class _LoginPageState extends State { } else if (value.length < 6) { return 'Password must be at least 6 characters'; } + return null; }, autofillHints: [AutofillHints.password], - ); + )); final loginButton = Padding( - padding: EdgeInsets.symmetric(vertical: 16.0), + padding: EdgeInsets.only(top: 16.0), child: ElevatedButton( style: ButtonStyle( backgroundColor: MaterialStateProperty.all(kPrimaryColor), @@ -102,7 +150,8 @@ class _LoginPageState extends State { style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, - fontSize: 14.0, + fontSize: 22.0, + ), ), ), @@ -124,13 +173,16 @@ class _LoginPageState extends State { key: _formKey, child: ListView( shrinkWrap: true, - padding: EdgeInsets.only(left: 24.0, right: 24.0), + padding: EdgeInsets.only(top:8.0,left: 24.0, right: 24.0), children: [ - logoWidget, + Padding( + padding: const EdgeInsets.only(top: 0.0), // Change the top padding here + child: logoWidget, + ), Padding( padding: const EdgeInsets.only(bottom: 30.0), child: Text( - 'Fusion Login', + 'Fusion', style: TextStyle( color: kPrimaryColor, fontWeight: FontWeight.bold, @@ -141,14 +193,21 @@ class _LoginPageState extends State { ), Padding( padding: EdgeInsets.only(bottom: 15), - child: emailFormField, + child: emailFormField, ), Padding( padding: EdgeInsets.only(bottom: 15), child: passwordFormField, ), - loginButton, - forgotLabel, + Padding( + padding: EdgeInsets.only(bottom: 0.0), + child: loginButton, + ), + Padding( + padding: EdgeInsets.only(top:0.0,bottom: bottom), + child: forgotLabel, + ), + ], ), ), @@ -157,29 +216,29 @@ class _LoginPageState extends State { ); } - // void _showDialog() { - // // flutter defined function - // showDialog( - // context: context, - // builder: (BuildContext context) { - // // return object of type Dialog - // return AlertDialog( - // title: Text("Invalid Username/Password"), - // content: Text("Please enter correct Username or Password"), - // actions: [ - // // usually buttons at the bottom of the dialog - // new TextButton( - // child: new Text( - // "Close", - // style: TextStyle(color: Colors.deepOrangeAccent), - // ), - // onPressed: () { - // Navigator.of(context).pop(); - // }, - // ), - // ], - // ); - // }, - // ); - // } -} +// void _showDialog() { +// // flutter defined function +// showDialog( +// context: context, +// builder: (BuildContext context) { +// // return object of type Dialog +// return AlertDialog( +// title: Text("Invalid Username/Password"), +// content: Text("Please enter correct Username or Password"), +// actions: [ +// // usually buttons at the bottom of the dialog +// new TextButton( +// child: new Text( +// "Close", +// style: TextStyle(color: Colors.deepOrangeAccent), +// ), +// onPressed: () { +// Navigator.of(context).pop(); +// }, +// ), +// ], +// ); +// }, +// ); +// } +} \ No newline at end of file diff --git a/lib/services/appBar_services.dart b/lib/services/appBar_services.dart new file mode 100644 index 00000000..bc7ba3c0 --- /dev/null +++ b/lib/services/appBar_services.dart @@ -0,0 +1,14 @@ +import 'package:fusion/services/storage_service.dart'; + +class appBarServices { + getDesignations() async { + try { + var storageService = await StorageService.getInstance(); + List? designations = storageService!.getFromDisk('designations'); + + return designations; + } catch (e) { + rethrow; + } + } +} \ No newline at end of file diff --git a/lib/services/dashboard_service.dart b/lib/services/dashboard_service.dart index 8e4520a9..ef348125 100644 --- a/lib/services/dashboard_service.dart +++ b/lib/services/dashboard_service.dart @@ -7,12 +7,12 @@ import 'package:http/http.dart' as http; class DashboardService { getDashboard() async { try { - var storage_service = locator(); - if (storage_service.userInDB?.token == null) + var storageService = locator(); + if (storageService.userInDB?.token == null) throw Exception('Token Error'); Map headers = { - 'Authorization': 'Token ' + (storage_service.userInDB?.token ?? "") + 'Authorization': 'Token ' + (storageService.userInDB?.token ?? "") }; var client = http.Client(); http.Response response = await client.get( @@ -24,6 +24,43 @@ class DashboardService { ); if (response.statusCode == 200) { print("success"); + print(response); + return response; + } + throw Exception('Can\'t load'); + } catch (e) { + rethrow; + } + } + + + getNotification() async { + try { + print("gett"); + var storageService = locator(); + if (storageService.userInDB?.token == null) + throw Exception('Token Error'); + + + Map headers = { + 'Authorization': 'Token ' + (storageService.userInDB?.token ?? "") + }; + print("gett2"); + + var client = http.Client(); + http.Response response = await client.get( + Uri.http( + getLink(), + kNotification, // constant dashboard path + ), + headers: headers, + ); + + print("gett3"); + + if (response.statusCode == 200) { + print("success"); + print(response); return response; } throw Exception('Can\'t load'); @@ -34,12 +71,12 @@ class DashboardService { markRead(String id) async { try { - StorageService? storage_service = await StorageService.getInstance(); + StorageService? storageService = await StorageService.getInstance(); - if (storage_service?.userInDB?.token == null) + if (storageService?.userInDB?.token == null) throw Exception('Token Error'); - String token = storage_service?.userInDB?.token ?? ""; + String token = storageService?.userInDB?.token ?? ""; Map headers = {'Authorization': 'Token ' + token}; Map body = {"id": id}; var client = http.Client(); @@ -60,4 +97,4 @@ class DashboardService { rethrow; } } -} +} \ No newline at end of file diff --git a/lib/services/login_service.dart b/lib/services/login_service.dart index 17d79b42..97277ffc 100644 --- a/lib/services/login_service.dart +++ b/lib/services/login_service.dart @@ -1,6 +1,5 @@ import 'dart:convert'; -import 'package:fusion/constants.dart'; import 'package:fusion/api.dart'; import 'package:fusion/models/user.dart'; import 'package:fusion/services/storage_service.dart'; @@ -25,8 +24,15 @@ class LoginService { var prefs = await StorageService.getInstance(); print("response.body: ${response.body}"); - var storage_service = await StorageService.getInstance(); - storage_service!.saveUserInDB(User((jsonDecode(response.body))["token"])); + var storageService = await StorageService.getInstance(); + storageService!.saveUserInDB(User((jsonDecode(response.body))["token"])); + storageService.saveToDisk>( + 'designations', + (jsonDecode(response.body)["designations"] as List) + .map((dynamic item) => item.toString()) + .toList(), + ); + storageService.saveStringToDisk("Current_designation",jsonDecode(response.body)["designations"][0]); return true; } catch (e) { rethrow; @@ -35,8 +41,8 @@ class LoginService { void logout() async { try { - var storage_service = await StorageService.getInstance(); - storage_service!.deleteKey("user"); + var storageService = await StorageService.getInstance(); + storageService!.deleteKey("user"); } catch (e) { rethrow; } diff --git a/lib/services/storage_service.dart b/lib/services/storage_service.dart index 94d39ea4..9d118326 100644 --- a/lib/services/storage_service.dart +++ b/lib/services/storage_service.dart @@ -13,19 +13,19 @@ class StorageService with ChangeNotifier { static const String ProfileKey = "ProfileKey"; User? get userInDB { - var userJson = _getFromDisk(UserKey); + var userJson = getFromDisk(UserKey); return userJson == null ? null : User.fromJson(jsonDecode(userJson)); } ProfileData get profileData { - var profileJson = _getFromDisk(ProfileKey); + var profileJson = getFromDisk(ProfileKey); // print(jsonDecode(profileJson)); return ProfileData.fromJson(jsonDecode(profileJson)); } AcademicData get academicData { - var profileJson = _getFromDisk(ProfileKey); + var profileJson = getFromDisk(ProfileKey); // print(jsonDecode(profileJson)); return AcademicData.fromJson(jsonDecode(profileJson)); } @@ -49,9 +49,9 @@ class StorageService with ChangeNotifier { return _instance; } - dynamic _getFromDisk(String key) { + dynamic getFromDisk(String key) { var value = _sharedPreferences?.get(key); - // print('(TRACE) LocalStorageService:_getFromDisk. key: $key value: $value'); + // print('(TRACE) LocalStorageService:getFromDisk. key: $key value: $value'); return value; } @@ -62,7 +62,7 @@ class StorageService with ChangeNotifier { void deleteKey(String key) { print( - '(TRACE) StorageService: deleteKey. key: $key value: ${_getFromDisk(key)}'); + '(TRACE) StorageService: deleteKey. key: $key value: ${getFromDisk(key)}'); _sharedPreferences!.remove(key); } @@ -84,4 +84,4 @@ class StorageService with ChangeNotifier { _sharedPreferences!.setStringList(key, content); } } -} +} \ No newline at end of file From 3d44184c26f0b95cc0a3765ec2bf371f8cc7d6ce Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:04:03 +0530 Subject: [PATCH 04/45] Create tpo_home.dart --- lib/screens/Placement/tpo/tpo_home.dart | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/screens/Placement/tpo/tpo_home.dart diff --git a/lib/screens/Placement/tpo/tpo_home.dart b/lib/screens/Placement/tpo/tpo_home.dart new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/screens/Placement/tpo/tpo_home.dart @@ -0,0 +1 @@ + From 072aa7318cec5076b62482366950cbb3ccf1bfbe Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:05:52 +0530 Subject: [PATCH 05/45] Add files via upload --- lib/screens/Placement/tpo/add_company.dart | 313 ++++++++++++++++++ lib/screens/Placement/tpo/alumni_data.dart | 174 ++++++++++ .../Placement/tpo/filter_students.dart | 194 +++++++++++ .../Placement/tpo/placement_charts.dart | 59 ++++ .../Placement/tpo/placement_record.dart | 270 +++++++++++++++ .../Placement/tpo/placement_schedule.dart | 239 +++++++++++++ .../Placement/tpo/placement_statistics.dart | 99 ++++++ lib/screens/Placement/tpo/tpo_sidebar.dart | 109 ++++++ 8 files changed, 1457 insertions(+) create mode 100644 lib/screens/Placement/tpo/add_company.dart create mode 100644 lib/screens/Placement/tpo/alumni_data.dart create mode 100644 lib/screens/Placement/tpo/filter_students.dart create mode 100644 lib/screens/Placement/tpo/placement_charts.dart create mode 100644 lib/screens/Placement/tpo/placement_record.dart create mode 100644 lib/screens/Placement/tpo/placement_schedule.dart create mode 100644 lib/screens/Placement/tpo/placement_statistics.dart create mode 100644 lib/screens/Placement/tpo/tpo_sidebar.dart diff --git a/lib/screens/Placement/tpo/add_company.dart b/lib/screens/Placement/tpo/add_company.dart new file mode 100644 index 00000000..997c2be7 --- /dev/null +++ b/lib/screens/Placement/tpo/add_company.dart @@ -0,0 +1,313 @@ +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class AddCompany extends StatefulWidget { + @override + _AddCompanyState createState() => _AddCompanyState(); +} + +class _AddCompanyState extends State { + final _formKey = GlobalKey(); + String _companyName = ""; + String _placementType = ""; + List _rolesOffered = []; + int _ctc = 0; + String _jobDescription = ""; + DateTime _dateOfVisit = DateTime.now(); + DateTime _deadlineToApply = DateTime.now(); + final List> _companyList = []; + + void _previewCompanyDetails() { + if (_formKey.currentState!.validate()) { + _formKey.currentState!.save(); + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text('Company Details'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text('Company Name: $_companyName'), + Text('Placement Type: $_placementType'), + Text('Roles Offered: ${_rolesOffered.join(", ")}'), + Text('CTC: $_ctc'), + Text('Job Description: $_jobDescription'), + Text('Date of Visit: ${DateFormat('yyyy-MM-dd').format(_dateOfVisit)}'), + Text('Deadline to Apply: ${DateFormat('yyyy-MM-dd').format(_deadlineToApply)}'), + ], + ), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: Text('Cancel'), + ), + TextButton( + onPressed: () { + _companyList.add({ + 'companyName': _companyName, + 'placementType': _placementType, + 'rolesOffered': _rolesOffered, + 'ctc': _ctc, + 'jobDescription': _jobDescription, + 'dateOfVisit': _dateOfVisit, + 'deadlineToApply': _deadlineToApply, + }); + _formKey.currentState!.reset(); + Navigator.pop(context); + }, + child: Text('Save'), + ), + ], + ); + }, + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Company Details'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: Sidebar(), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + Form( + key: _formKey, + child: Column( + children: [ + TextFormField( + decoration: InputDecoration(labelText: 'Company Name'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter a company name'; + } + return null; + }, + onSaved: (value) => _companyName = value!, + ), + TextFormField( + decoration: InputDecoration(labelText: 'Placement Type'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter whether its intern or full time job'; + } + return null; + }, + onSaved: (value)=> _placementType = value!, + ), + TextFormField( + decoration: InputDecoration(labelText: 'Roles Offered'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter roles offered'; + } + return null; + }, + onSaved: (value) => _rolesOffered = value!.split(','), + ), + TextFormField( + decoration: InputDecoration(labelText: 'CTC'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter CTC'; + } + if (int.tryParse(value) == null) { + return 'CTC must be a valid integer'; + } + return null; + }, + onSaved: (value) => _ctc = int.parse(value!), + ), + TextFormField( + decoration: InputDecoration(labelText: 'Job Description'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter job description'; + } + return null; + }, + onSaved: (value) => _jobDescription = value!, + ), + Row( + children: [ + Expanded( + child: Column( + children: [ + Text('Date of Visit'), + SizedBox(height: 8), + Container( + width: double.infinity, + child: ElevatedButton( + onPressed: () async { + final DateTime? picked = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(2000), + lastDate: DateTime(2025), + ); + if (picked != null && picked != _dateOfVisit) { + setState(() { + _dateOfVisit = picked; + }); + } + }, + child: Text( + _dateOfVisit == null + ? 'Pick a date' + : DateFormat('yyyy-MM-dd').format( + _dateOfVisit), + ), + ), + ), + ], + ), + ), + SizedBox(width: 16), + Expanded( + child: Column( + children: [ + Text('Deadline to Apply'), + SizedBox(height: 8), + Container( + width: double.infinity, + child: ElevatedButton( + onPressed: () async { + final DateTime? picked = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(2000), + lastDate: DateTime(2025), + ); + if (picked != null && + picked != _deadlineToApply) { + setState(() { + _deadlineToApply = picked!; + }); + } + }, + child: Text( + _deadlineToApply == null + ? 'Pick a date and time' + : DateFormat('yyyy-MM-dd') + .format(_deadlineToApply), + ), + ), + ), + ], + ), + ), + ], + ), + ], + ), + ), + SizedBox(height: 16), + Expanded( + child: ListView.builder( + itemCount: _companyList.length, + itemBuilder: (context, index) { + final company = _companyList[index]; + return Dismissible( + key: Key(company['companyName']), + onDismissed: (direction) { + setState(() { + _companyList.removeAt(index); + }); + }, + child: ListTile( + title: Text(company['companyName']), + subtitle: Text(company['placementType']), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CompanyDetailsPage( + company: company, + ), + ), + ); + }, + ), + ); + }, + ), + ), + SizedBox(height: 16), + ElevatedButton( + onPressed: _previewCompanyDetails, + child: Text('Preview'), + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: () { + if (_formKey.currentState!.validate()) { + _formKey.currentState!.save(); + _companyList.add({ + 'companyName': _companyName, + 'placementType': _placementType, + 'rolesOffered': _rolesOffered, + 'ctc': _ctc, + 'jobDescription': _jobDescription, + 'dateOfVisit': _dateOfVisit, + 'deadlineToApply': _deadlineToApply, + }); + _formKey.currentState!.reset(); + } + }, + child: Icon(Icons.add), + ), + ); + } +} +class CompanyDetailsPage extends StatelessWidget { + final Map company; + + CompanyDetailsPage({Key? key, required this.company}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(company['companyName']), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Placement Type: ${company['placementType']}'), + SizedBox(height: 8), + Text('Roles Offered: ${company['rolesOffered'].join(', ')}'), + SizedBox(height: 8), + Text('CTC: ${company['ctc']}'), + SizedBox(height: 8), + Text('Job Description: ${company['jobDescription']}'), + SizedBox(height: 8), + Text('Date of Visit: ${DateFormat('yyyy-MM-dd').format(company['dateOfVisit'])}'), + SizedBox(height: 8), + Text('Deadline to Apply: ${DateFormat('yyyy-MM-dd HH:mm').format(company['deadlineToApply'])}'), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: () { + Navigator.pop(context); + }, + child: Icon(Icons.edit), + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/alumni_data.dart b/lib/screens/Placement/tpo/alumni_data.dart new file mode 100644 index 00000000..1f94c8d4 --- /dev/null +++ b/lib/screens/Placement/tpo/alumni_data.dart @@ -0,0 +1,174 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class AlumniData extends StatefulWidget { + @override + State createState() => AlumniDataState(); +} + +class Student { + final String name; + final int year; + + Student({required this.name, required this.year}); +} + +class AlumniDataState extends State { + //String _value = 'Alumni Data'; + // var _currentSelectedValue; + + String tab1 = 'Placement'; + + String tab2 = 'PBI'; + + String tab3 = 'Higher Studies'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title:const Text('Alumni Data'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: Sidebar(), + body: DefaultTabController( + length: 3, + child: Scaffold( + body: SafeArea( + child: TabBarView( + children: [ + SingleChildScrollView(child: PlacementTab()), + PlacementTab1(), + PlacementTab1(), + ], + ), + ), + appBar: AppBar( + bottom: TabBar( + labelColor: Colors.black, + isScrollable: true, + labelStyle: TextStyle(fontSize: 20.0), + tabs: [Tab(text: tab1), Tab(text: tab2), Tab(text: tab3)]), + ), + ), + ), + ); + } +} + +class PlacementTab extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row( + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(10, 30, 0, 0), + child: Text( + 'Search a Student!', + style: TextStyle(fontSize: 20), + ), + ), + ], + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: TextField( + textAlign: TextAlign.center, + decoration: InputDecoration( + labelStyle: TextStyle(color: Colors.grey), + border: OutlineInputBorder(), + labelText: 'Student Name', + ), + ), + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: TextField( + textAlign: TextAlign.center, + decoration: InputDecoration( + labelStyle: TextStyle(color: Colors.grey), + border: OutlineInputBorder(), + labelText: 'Year', + ), + ), + ), + ElevatedButton.icon( + style: ButtonStyle( + foregroundColor: MaterialStatePropertyAll(Colors.white), + backgroundColor: MaterialStatePropertyAll(Colors.blue), + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5.0), + side: BorderSide(color: Colors.blue)))), + onPressed: () { + print('Search Pressed'); + }, + icon: Icon(Icons.arrow_right), + label: Text('Search'), + ) + ], + ); + } +} + +class PlacementTab1 extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row( + children: [ + Padding( + padding:const EdgeInsets.fromLTRB(10, 30, 0, 0), + child: Text( + 'Search a Student!', + style: TextStyle(fontSize: 20), + ), + ), + ], + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: TextField( + textAlign: TextAlign.center, + decoration: InputDecoration( + labelStyle: TextStyle(color: Colors.grey), + border: OutlineInputBorder(), + labelText: 'Student Name', + ), + ), + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: TextField( + textAlign: TextAlign.center, + decoration: InputDecoration( + labelStyle: TextStyle(color: Colors.grey), + border: OutlineInputBorder(), + labelText: 'Year', + ), + ), + ), + ElevatedButton.icon( + style: ButtonStyle( + foregroundColor: MaterialStatePropertyAll(Colors.white), + backgroundColor: MaterialStatePropertyAll(Colors.blue), + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5.0), + side: BorderSide(color: Colors.blue)))), + onPressed: () { + Navigator.pushNamed(context, '/add_placement_record'); + print('Search Pressed'); + }, + icon: Icon(Icons.arrow_right), + label: Text('Search'), + ) + ], + ); + } +} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/filter_students.dart b/lib/screens/Placement/tpo/filter_students.dart new file mode 100644 index 00000000..b230770c --- /dev/null +++ b/lib/screens/Placement/tpo/filter_students.dart @@ -0,0 +1,194 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class Student { + final String name; + final String rollNumber; + final double cpi; + final String gender; + final String branch; + final String batch; + + Student({ + required this.name, + required this.rollNumber, + required this.cpi, + required this.gender, + required this.branch, + required this.batch, + }); +} + +class FilterStudents extends StatefulWidget { + final List students = [ + Student(name:'Jayanth Prajapati', rollNumber:'20bcs137', batch:'2020', branch:'CSE', gender:'Male', cpi:8.5), + Student(name:'Jahnavi Kaushal', rollNumber:'22bec234', batch:'2022', branch:'ECE', gender:'Female', cpi:9.0), + Student(name:'Deekshith Ranjan', rollNumber:'21bcs104', batch:'2021', branch:'CSE', gender:'Male', cpi:7.5), + Student(name:'Ankita Dvivedhi', rollNumber:'23bme034', batch:'2023', branch:'ME', gender:'Female', cpi:8.0), + Student(name:'Anand', rollNumber:'21bcs001', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), + Student(name:'Roopa', rollNumber:'21bcs002', batch:'2021', branch:'CSE', gender:'Female', cpi:8.5), + Student(name:'Arjun', rollNumber:'21bcs003', batch:'2021', branch:'CSE', gender:'Male', cpi:8.5), + Student(name:'Abhi', rollNumber:'23bcs002', batch:'2023', branch:'CSE', gender:'Male', cpi:8.2), + Student(name:'Ram', rollNumber:'21bcs141', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), + Student(name:'Vishnu Mishra', rollNumber:'21bcs165', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), + Student(name:'Sita', rollNumber:'22bcs216', batch:'2022', branch:'CSE', gender:'Female', cpi:7.5), + Student(name:'Vishnu Rajput', rollNumber:'22bcs165', batch:'2022', branch:'CSE', gender:'Male', cpi:8.1), + Student(name:'Bruhath', rollNumber:'21bcs149', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), + Student(name:'Ananya Patel', rollNumber:'21bcs150', batch:'2021', branch:'CSE', gender:'Female', cpi:9.2), + Student(name:'Arnav Gupta', rollNumber:'21bcs151', batch:'2021', branch:'CSE', gender:'Male', cpi:8.7), + Student(name:'Khushi Kumari', rollNumber:'22bcs152', batch:'2022', branch:'CSE', gender:'Female', cpi:8.5), + Student(name:'Sahil Singh', rollNumber:'22bcs153', batch:'2022', branch:'CSE', gender:'Male', cpi:7.9), + Student(name:'Neha Shah', rollNumber:'23bcs154', batch:'2023', branch:'CSE', gender:'Female', cpi:9.0), + Student(name:'Aryan Reddy', rollNumber:'23bcs155', batch:'2023', branch:'CSE', gender:'Male', cpi:8.3), + Student(name:'Deepika Singh', rollNumber:'21bec156', batch:'2021', branch:'ECE', gender:'Female', cpi:8.1), + Student(name:'Aruna Sharma', rollNumber:'21bec157', batch:'2021', branch:'ECE', gender:'Female', cpi:7.5), + Student(name:'Rohan Patel', rollNumber:'22bec158', batch:'2022', branch:'ECE', gender:'Male', cpi:8.8), + Student(name:'Ananya Das', rollNumber:'22bec159', batch:'2022', branch:'ECE', gender:'Female', cpi:8.2), + Student(name:'Neha Rao', rollNumber:'23bec160', batch:'2023', branch:'ECE', gender:'Female', cpi:8.7), + Student(name:'Arnav Patel', rollNumber:'23bec161', batch:'2023', branch:'ECE', gender:'Male', cpi:8.6), + Student(name:'Khushi Gupta', rollNumber:'21bme162', batch:'2021', branch:'ME', gender:'Female', cpi:8.0), + Student(name:'Aryan Kumar', rollNumber:'21bme163', batch:'2021', branch:'ME', gender:'Male', cpi:7.8), + Student(name:'Sahil Rao', rollNumber:'22bme164', batch:'2022', branch:'ME', gender:'Male', cpi:8.4), + Student(name:'Ananya Mishra', rollNumber:'22bme165', batch:'2022', branch:'ME', gender:'Female', cpi:7.9), + Student(name:'Arnav Iyer', rollNumber:'23bme166', batch:'2023', branch:'ME', gender:'Male', cpi:8.2), + Student(name:'Khushi Singh', rollNumber:'23bme167', batch:'2023', branch:'ME', gender:'Female', cpi:8.3), + Student(name:'Aditya Rao', rollNumber:'21bsm168', batch:'2021', branch:'SM', gender:'Male', cpi:8.2), + Student(name:'Arun Mehra', rollNumber:'21bsm169', batch:'2021', branch:'SM', gender:'Male', cpi:7.6), + Student(name:'Rajesh Chauhan', rollNumber:'22bsm170', batch:'2022', branch:'SM', gender:'Male', cpi:8.9), + Student(name:'Karthik Menon', rollNumber:'22bsm171', batch:'2022', branch:'SM', gender:'Male', cpi:8.1), + Student(name:'Priya Sharma', rollNumber:'23bsm172', batch:'2023', branch:'SM', gender:'Female', cpi:8.5), + Student(name:'Meera Reddy', rollNumber:'23bsm173', batch:'2023', branch:'SM', gender:'Female', cpi:8.4), + Student(name:'Ananya Tiwari', rollNumber:'20bcs174', batch:'2020', branch:'CSE', gender:'Female', cpi:8.6), + Student(name:'Arnav Reddy', rollNumber:'20bcs175', batch:'2020', branch:'CSE', gender:'Male', cpi:8.2), + Student(name:'Khushi Mehta', rollNumber:'20bec176', batch:'2020', branch:'ECE', gender:'Female', cpi:8.4), + Student(name:'Sahil Tiwari', rollNumber:'20bec177', batch:'2020', branch:'ECE', gender:'Male', cpi:8.0), + Student(name:'Neha Reddy', rollNumber:'20bme178', batch:'2020', branch:'ME', gender:'Female', cpi:8.3), + Student(name:'Aryan Mehta', rollNumber:'20bme179', batch:'2020', branch:'ME', gender:'Male', cpi:7.9), + Student(name:'Deepika Tiwari', rollNumber:'20bsm180', batch:'2020', branch:'SM', gender:'Female', cpi:8.1), + Student(name:'Arun Reddy', rollNumber:'20bsm181', batch:'2020', branch:'SM', gender:'Male', cpi:8.5) + ]; + + @override + _FilterStudentsState createState() => _FilterStudentsState(); +} + +class _FilterStudentsState extends State { + double minCpi = 7.0; + String selectedGender = "All"; + String selectedBranch = "All"; + String selectedBatch = "All"; + List filteredStudents = []; + + @override + void initState() { + super.initState(); + filteredStudents = widget.students; // Initially show all students + } + + void applyFilters() { + setState(() { + filteredStudents = widget.students.where((student) => + student.cpi >= minCpi && + (selectedGender == "All" || student.gender == selectedGender) && + (selectedBranch == "All" || student.branch == selectedBranch) && + (selectedBatch == "All" || student.batch == selectedBatch) + ).toList(); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text("Filter Students"), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: Sidebar(), + body: SingleChildScrollView( + padding: EdgeInsets.all(20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Minimum CPI : '), + ), + Slider( + value: minCpi, + min: 7.0, + max: 10.0, + divisions: 6, + label: "Minimum CPI: ${minCpi.toStringAsFixed(1)}", + onChanged: (value) => setState(() => minCpi = value), + ), + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Select Gender : '), + ), + DropdownButton( + value: selectedGender, + items: [ + DropdownMenuItem(value: "All", child: Text("All")), + DropdownMenuItem(value: "Male", child: Text("Male")), + DropdownMenuItem(value: "Female", child: Text("Female")), + DropdownMenuItem(value: "Other", child: Text("Other")), + ], + onChanged: (value) => setState(() => selectedGender = value!), + ), + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Select Branch : '), + ), + DropdownButton( + value: selectedBranch, + items: [ + DropdownMenuItem(value: "All", child: Text("All")), + DropdownMenuItem(value: "CSE", child: Text("CSE")), + DropdownMenuItem(value: "ECE", child: Text("ECE")), + DropdownMenuItem(value: "ME", child: Text("ME")), + DropdownMenuItem(value: "SM", child: Text("SM")), + ], + onChanged: (value) => setState(() => selectedBranch = value!), + ), + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Select Batch : '), + ), + DropdownButton( + value: selectedBatch, + items: [ + DropdownMenuItem(value: "All", child: Text("All")), + DropdownMenuItem(value: "2020", child: Text("2020")), + DropdownMenuItem(value: "2021", child: Text("2021")), + DropdownMenuItem(value: "2022", child: Text("2022")), + DropdownMenuItem(value: "2023", child: Text("2023")), + ], + onChanged: (value) => setState(() => selectedBatch = value!), + ), + SizedBox(height: 16.0), + ElevatedButton( + onPressed: applyFilters, + child: Text("Apply Filters"), + ), + SizedBox(height: 20.0), + filteredStudents.isEmpty + ? Text("No students found matching your criteria.") + : ListView.builder( + shrinkWrap: true, + itemCount: filteredStudents.length, + itemBuilder: (context, index) { + final student = filteredStudents[index]; + return ListTile( + title: Text(student.name), + subtitle: Text(student.rollNumber), + ); + }, + ), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/placement_charts.dart b/lib/screens/Placement/tpo/placement_charts.dart new file mode 100644 index 00000000..2b5070d4 --- /dev/null +++ b/lib/screens/Placement/tpo/placement_charts.dart @@ -0,0 +1,59 @@ +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +class PlacementData { + final String branch; + final int placements; + final charts.Color barColor; + PlacementData( + {required this.branch, required this.placements, required this.barColor}); +} + +class PlacementCharts extends StatelessWidget { + final List data; + + PlacementCharts({required this.data}); + @override + Widget build(BuildContext context) { + List> series = [ + charts.Series( + id: "developers", + data: data, + domainFn: (PlacementData series, _) => series.branch, + measureFn: (PlacementData series, _) => series.placements, + colorFn: (PlacementData series, _) => series.barColor, + labelAccessorFn: (PlacementData series, _) => series.branch, + ) + ]; + + return Container( + height: 600, + padding: EdgeInsets.all(25), + child: Card( + child: Padding( + padding: const EdgeInsets.all(9.0), + child: Column( + children: [ + AppBar( + title: Text('Placements for the batch : '), + surfaceTintColor: Colors.yellowAccent, + ), + Expanded( + child: charts.PieChart(series, + animate: true, + defaultRenderer: charts.ArcRendererConfig( + arcRendererDecorators: [ + charts.ArcLabelDecorator( + labelPosition: charts.ArcLabelPosition.inside) + ])), + ), + Expanded( + child: charts.BarChart(series, animate: true), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/Placement/tpo/placement_record.dart b/lib/screens/Placement/tpo/placement_record.dart new file mode 100644 index 00000000..af849b6e --- /dev/null +++ b/lib/screens/Placement/tpo/placement_record.dart @@ -0,0 +1,270 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class PlacementRecord extends StatefulWidget { + @override + _AddStudentState createState() => _AddStudentState(); +} + +class _AddStudentState extends State { + final _formKey = GlobalKey(); + String _rollNumber = ""; + String _studentName = ""; + String _placementType = ""; + double _cpi = 0; + int _ctc = 0; + int _year = 0; + String _organizationName = ""; + final List> _studentList = []; + + void _previewStudentDetails() { + if (_formKey.currentState!.validate()) { + _formKey.currentState!.save(); + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text('Student Details'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text('Roll Number: $_rollNumber'), + Text('Student Name: $_studentName'), + Text('Placement Type: $_placementType'), + Text('CPI: $_cpi'), + Text('CTC: $_ctc'), + Text('Year: $_year'), + Text('Organization Name: $_organizationName'), + ], + ), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: Text('Cancel'), + ), + TextButton( + onPressed: () { + _studentList.add({ + 'rollNumber': _rollNumber, + 'studentName': _studentName, + 'placementType': _placementType, + 'CPI': _cpi, + 'CTC': _ctc, + 'year': _year, + 'organizationName': _organizationName, + }); + _formKey.currentState!.reset(); + Navigator.pop(context); + }, + child: Text('Save'), + ), + ], + ); + }, + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Student Details'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: Sidebar(), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + Form( + key: _formKey, + child: Column( + children: [ + TextFormField( + decoration: InputDecoration(labelText: 'Roll Number'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter the roll number of the student'; + } + return null; + }, + onSaved: (value) => _rollNumber = value!, + ), + TextFormField( + decoration: InputDecoration(labelText: 'Student Name'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter the student name'; + } + return null; + }, + onSaved: (value) => _studentName = value!, + ), + TextFormField( + decoration: InputDecoration(labelText: 'Placement Type'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter whether its a job or higher studies or PBI'; + } + return null; + }, + onSaved: (value) => _placementType = value!, + ), + TextFormField( + decoration: InputDecoration(labelText: 'CPI'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter CPI'; + } + if (double.tryParse(value) == null) { + return 'CTC must be a valid integer'; + } + return null; + }, + onSaved: (value) => _cpi = double.parse(value!), + ), + TextFormField( + decoration: InputDecoration(labelText: 'CTC'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter CTC'; + } + if (int.tryParse(value) == null) { + return 'CTC must be a valid integer'; + } + return null; + }, + onSaved: (value) => _ctc = int.parse(value!), + ), + TextFormField( + decoration: InputDecoration(labelText: 'Year'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter year'; + } + if (int.tryParse(value) == null) { + return 'CTC must be a valid integer'; + } + return null; + }, + onSaved: (value) => _year = int.parse(value!), + ), + TextFormField( + decoration: InputDecoration(labelText: 'Organization Name'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter organization name'; + } + return null; + }, + onSaved: (value) => _organizationName = value!, + ), + ], + ), + ), + SizedBox(height: 16), + Expanded( + child: ListView.builder( + itemCount: _studentList.length, + itemBuilder: (context, index) { + final student = _studentList[index]; + return Dismissible( + key: Key(student['rollNumber']), + onDismissed: (direction) { + setState(() { + _studentList.removeAt(index); + }); + }, + child: ListTile( + title: Text(student['studentName']), + subtitle: Text(student['rollNumber']), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => StudentDetailsPage( + student: student, + ), + ), + ); + }, + ), + ); + }, + ), + ), + SizedBox(height: 16), + ElevatedButton( + onPressed: _previewStudentDetails, + child: Text('Preview'), + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: () { + if (_formKey.currentState!.validate()) { + _formKey.currentState!.save(); + _studentList.add({ + 'rollNumber': _rollNumber, + 'studentName': _studentName, + 'placementType': _placementType, + 'CPI': _cpi, + 'CTC': _ctc, + 'year': _year, + 'organizationName': _organizationName, + }); + _formKey.currentState!.reset(); + } + }, + child: Icon(Icons.add), + ), + ); + } +} + +class StudentDetailsPage extends StatelessWidget { + final Map student; + + StudentDetailsPage({Key? key, required this.student}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(student['rollNumber']), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Placement Type: ${student['placementType']}'), + SizedBox(height: 8), + Text('Student Name: ${student['studentName']}'), + SizedBox(height: 8), + Text('CTC: ${student['ctc']}'), + SizedBox(height: 8), + Text('CPI: ${student['cpi']}'), + SizedBox(height: 8), + Text('Year: ${student['year']}'), + SizedBox(height: 8), + Text('Organization Name: ${student['organizationName']}'), + SizedBox(height: 8), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: () { + Navigator.pop(context); + }, + child: Icon(Icons.edit), + ), + ); + } +} diff --git a/lib/screens/Placement/tpo/placement_schedule.dart b/lib/screens/Placement/tpo/placement_schedule.dart new file mode 100644 index 00000000..7904eee1 --- /dev/null +++ b/lib/screens/Placement/tpo/placement_schedule.dart @@ -0,0 +1,239 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class PlacementSchedule extends StatefulWidget { + @override + _PlacementScheduleState createState() => _PlacementScheduleState(); +} +class Note { + final int id; + final String title; + final String content; + + Note({required this.id, required this.title, required this.content}); +} +class NotesProvider { + List _notes = [ + Note( + id: 1, + title: '25/04/2024-01/05/2024', + content: 'Mock interviews as part of PDC classes.\nVenue:Placement Cell, DSA.\nTime:9am - 1pm(Mor),2pm-6pm(Even).\n\nCSE 2021 - 25/04/2024 & 26/04/2024.\nECE 2021 - 27/04/2024.\nME 2021 - 28/04/2024.\nSM 2021 - 29/04/2024.\nDES 2021 - 30/04/2024.\nMTech 2021 - 01/05/2024.\nPhD 2021 - 01/05/2024.', + ), + + Note( + id: 2, + title: '27/04/2024', + content: 'Workshop by PostMan.\nVenue : L103, Audi.\nTime:10am.', + ), + ]; + int _nextId = 1; + + List get notes => _notes; + + int get nextId => _nextId; + + void addNote(String title, String content) { + final note = Note(id: _nextId, title: title, content: content); + _notes.add(note); + _nextId++; + } + + void updateNote(Note note, String title, String content) { + final updatedNote = Note( + id: note.id, + title: title, + content: content, + ); + final index = _notes.indexWhere((n) => n.id == note.id); + if (index != -1) { + _notes[index] = updatedNote; + } + } + + void deleteNote(Note note) { + _notes.remove(note); + } +} + +class _PlacementScheduleState extends State { + final _notesProvider = NotesProvider(); + final _titleController = TextEditingController(); + final _contentController = TextEditingController(); + Note? _editingNote; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Placement Schedule'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer:Sidebar(), + body: ListView.builder( + itemCount: _notesProvider.notes.length, + itemBuilder: (context, index) { + final note = _notesProvider.notes[index]; + return ListTile( + leading: Icon(Icons.schedule_sharp), + title: Text(note.title), + subtitle: Text(note.content), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + icon: Icon(Icons.edit), + onPressed: () { + setState(() { + _editingNote = note; + _titleController.text = note.title; + _contentController.text = note.content; + }); + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text(_editingNote == null ? 'Add Note' : 'Edit Note'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + TextField( + controller: _titleController, + decoration: InputDecoration(hintText: 'Date'), + ), + TextField( + controller: _contentController, + decoration: InputDecoration(hintText: 'Details of the event, time and venue if required'), + maxLines: null, + ), + ], + ), + actions: [ + TextButton( + child: Text('Cancel'), + onPressed: () { + Navigator.pop(context); + }, + ), + TextButton( + child: Text(_editingNote == null ? 'Add' : 'Save'), + onPressed: () { + final title = _titleController.text; + final content = _contentController.text; + if (title.isNotEmpty && content.isNotEmpty) { + if (_editingNote == null) { + _notesProvider.addNote(title, content); + } else { + _notesProvider.updateNote(_editingNote!, title, content); + } + Navigator.pop(context); + setState(() {}); + } + }, + ), + ], + ); + }, + ); + }, + ), + + IconButton( + icon: Icon(Icons.delete), + onPressed: () { + _notesProvider.deleteNote(note); + setState(() {}); + }, + ), + ], + ), + ); + }, + ), + floatingActionButton: FloatingActionButton( + child: Icon(Icons.add), + onPressed: () { + setState(() { + _editingNote = null; + _titleController.clear(); + _contentController.clear(); + }); + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text('Add Schedule'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + TextField( + controller: _titleController, + decoration: InputDecoration(hintText: 'Date'), + ), + TextField( + controller: _contentController, + decoration: InputDecoration(hintText: 'Details of the event, time and venue if required'), + maxLines: null, + ), + ], + ), + actions: [ + TextButton( + child: Text('Cancel'), + onPressed: () { + Navigator.pop(context); + }, + ), + TextButton( + + child: Text('Add'), + + onPressed: () { + + final title = _titleController.text; + + final content = _contentController.text; + + if (title.isNotEmpty && content.isNotEmpty) { + + final note = Note( + + id: _notesProvider.nextId, + + title: title, + + content: content, + + ); + + _notesProvider.addNote(title, content); + + Navigator.pop(context); + + setState(() {}); + + } + + }, + + ), + + ], + + ); + + }, + + ); + + }, + + ), + + ); + + } + +} + diff --git a/lib/screens/Placement/tpo/placement_statistics.dart b/lib/screens/Placement/tpo/placement_statistics.dart new file mode 100644 index 00000000..25dc32e3 --- /dev/null +++ b/lib/screens/Placement/tpo/placement_statistics.dart @@ -0,0 +1,99 @@ +import 'dart:math'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:fusion/screens/Placement/tpo/placement_charts.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class PlacementStatistics extends StatefulWidget { + @override + State createState() => _PlacementStatisticsState(); +} + +class _PlacementStatisticsState extends State { + int _graphValue = 2011; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Placement Statistics'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: Sidebar(), + body: Column( + children: [ + Row( + children: [ + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Select Year '), + ), + DropdownButton( + value: _graphValue, + items: >[ + for (int year = 2010; year <= 2023; year++) + DropdownMenuItem( + value: year, + child: Text('$year'), + ), + ], + onChanged: (int? value) => + setState(() => _graphValue = value!), + ), + ], + ), + Expanded(child: _buildGraph()), + ], + ), + ); + } + + Widget _buildGraph() { + switch (_graphValue) { + case 2011: + return EmptyGraphs(); + default: + return StatsCharts(year: _graphValue); + } + } +} + +class EmptyGraphs extends StatelessWidget { + @override + Widget build(BuildContext context) { + return SizedBox.shrink(); + } +} + +class StatsCharts extends StatelessWidget { + final int year; + + StatsCharts({Key? key, required this.year}) : super(key: key); + + final Random rnd = new Random(); + late List data = [ + PlacementData( + branch: 'CSE', + placements:rnd.nextInt(250), + barColor: charts.ColorUtil.fromDartColor(Colors.deepPurpleAccent)), + PlacementData( + branch: 'ECE', + placements: rnd.nextInt(120), + barColor: charts.ColorUtil.fromDartColor(Colors.orangeAccent)), + PlacementData( + branch: 'ME', + placements: rnd.nextInt(90), + barColor: charts.ColorUtil.fromDartColor(Colors.tealAccent)), + PlacementData( + branch: 'SM', + placements: rnd.nextInt(90), + barColor: charts.ColorUtil.fromDartColor(Colors.indigoAccent)), + ]; + + @override + Widget build(BuildContext context) { + return PlacementCharts(data: data); + } +} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/tpo_sidebar.dart b/lib/screens/Placement/tpo/tpo_sidebar.dart new file mode 100644 index 00000000..5c6f7fc6 --- /dev/null +++ b/lib/screens/Placement/tpo/tpo_sidebar.dart @@ -0,0 +1,109 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/screens/Placement/tpo/filter_students.dart'; +import 'package:fusion/screens/Placement/tpo/placement_record.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_home.dart'; +import 'package:fusion/screens/Placement/tpo/alumni_data.dart'; +import 'package:fusion/screens/Placement/tpo/placement_schedule.dart'; +import 'package:fusion/screens/Placement/tpo/placement_statistics.dart'; +import 'package:fusion/screens/Placement/tpo/add_company.dart'; + +class Sidebar extends StatelessWidget { + const Sidebar({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + child: SizedBox( + width: 300, + child: Drawer( + child: ListView( + children: [ + const DrawerHeader( + decoration: BoxDecoration( + color: Color.fromARGB(255, 245, 103, 47), + ), + child: Text( + 'Menu', + style: TextStyle( + color: Colors.white, + fontSize: 35, + ), + ), + ), + ListTile( + title: const Text( + 'Home', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context) + .push(MaterialPageRoute(builder: (context) => TpoHome())); + }, + ), + + ListTile( + title: const Text( + 'Filter Students', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push( + MaterialPageRoute(builder: (context) => FilterStudents())); + }, + ), + ListTile( + title: const Text( + 'Placement Schedule', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => PlacementSchedule())); + }, + ), + ListTile( + title: const Text( + 'Placement Statistics', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => PlacementStatistics())); + }, + ), + ListTile( + title: const Text( + 'Add Placement Data', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => PlacementRecord())); + }, + ), + ListTile( + title: const Text( + 'Add Company', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => AddCompany())); + }, + ), + ListTile( + title: const Text( + 'Alumni Data', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push( + MaterialPageRoute(builder: (context) => AlumniData())); + }, + ), + ], + ), + ), + )); + } +} From 1bd442cec2b618048cc5fa7c844c347a94a482a6 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:07:04 +0530 Subject: [PATCH 06/45] Create demo.txt --- lib/screens/Placement/demo.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/screens/Placement/demo.txt diff --git a/lib/screens/Placement/demo.txt b/lib/screens/Placement/demo.txt new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/screens/Placement/demo.txt @@ -0,0 +1 @@ + From b7e3c1bcd15c1b68d951e000d396fc212dffc2e9 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:15:42 +0530 Subject: [PATCH 07/45] Create placement_cell_home.dart --- lib/screens/Placement/student/placement_cell_home.dart | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/screens/Placement/student/placement_cell_home.dart diff --git a/lib/screens/Placement/student/placement_cell_home.dart b/lib/screens/Placement/student/placement_cell_home.dart new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/screens/Placement/student/placement_cell_home.dart @@ -0,0 +1 @@ + From ccd660c24cd3f1b86b6466f955ab82ff76b5a106 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:18:40 +0530 Subject: [PATCH 08/45] view_statistics\statistics.dart --- "lib/screens/Placement/student/view_statistics\\statistics.dart" | 1 + 1 file changed, 1 insertion(+) create mode 100644 "lib/screens/Placement/student/view_statistics\\statistics.dart" diff --git "a/lib/screens/Placement/student/view_statistics\\statistics.dart" "b/lib/screens/Placement/student/view_statistics\\statistics.dart" new file mode 100644 index 00000000..8b137891 --- /dev/null +++ "b/lib/screens/Placement/student/view_statistics\\statistics.dart" @@ -0,0 +1 @@ + From 4c686173ce5e1f9f6cb204a76dfdfa9334e77ec9 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:21:24 +0530 Subject: [PATCH 09/45] Delete student directory --- lib/screens/Placement/student/placement_cell_home.dart | 1 - "lib/screens/Placement/student/view_statistics\\statistics.dart" | 1 - 2 files changed, 2 deletions(-) delete mode 100644 lib/screens/Placement/student/placement_cell_home.dart delete mode 100644 "lib/screens/Placement/student/view_statistics\\statistics.dart" diff --git a/lib/screens/Placement/student/placement_cell_home.dart b/lib/screens/Placement/student/placement_cell_home.dart deleted file mode 100644 index 8b137891..00000000 --- a/lib/screens/Placement/student/placement_cell_home.dart +++ /dev/null @@ -1 +0,0 @@ - diff --git "a/lib/screens/Placement/student/view_statistics\\statistics.dart" "b/lib/screens/Placement/student/view_statistics\\statistics.dart" deleted file mode 100644 index 8b137891..00000000 --- "a/lib/screens/Placement/student/view_statistics\\statistics.dart" +++ /dev/null @@ -1 +0,0 @@ - From 25e8d5a9470ca2f5eafb54d2f12f307e5c1d0419 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:21:52 +0530 Subject: [PATCH 10/45] Create placement_cell_home.dart --- lib/screens/Placement/student/placement_cell_home.dart | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/screens/Placement/student/placement_cell_home.dart diff --git a/lib/screens/Placement/student/placement_cell_home.dart b/lib/screens/Placement/student/placement_cell_home.dart new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/screens/Placement/student/placement_cell_home.dart @@ -0,0 +1 @@ + From 2f6e17690f8b8b1f84861a0fc231ebca9ae92a04 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:22:40 +0530 Subject: [PATCH 11/45] Create statistics.dart --- lib/screens/Placement/student/view_statistics/statistics.dart | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/screens/Placement/student/view_statistics/statistics.dart diff --git a/lib/screens/Placement/student/view_statistics/statistics.dart b/lib/screens/Placement/student/view_statistics/statistics.dart new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/screens/Placement/student/view_statistics/statistics.dart @@ -0,0 +1 @@ + From 455a80efd6ac31b36b9c7c96dfaae69762a88219 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:23:39 +0530 Subject: [PATCH 12/45] Create schedule.dart --- lib/screens/Placement/student/view_schedules/schedule.dart | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/screens/Placement/student/view_schedules/schedule.dart diff --git a/lib/screens/Placement/student/view_schedules/schedule.dart b/lib/screens/Placement/student/view_schedules/schedule.dart new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/screens/Placement/student/view_schedules/schedule.dart @@ -0,0 +1 @@ + From 3bb9ec05190cc8d05f3c7136090eb9923d047427 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:28:12 +0530 Subject: [PATCH 13/45] Create jobs.dart --- lib/screens/Placement/student/view_jobs/jobs.dart | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/screens/Placement/student/view_jobs/jobs.dart diff --git a/lib/screens/Placement/student/view_jobs/jobs.dart b/lib/screens/Placement/student/view_jobs/jobs.dart new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/screens/Placement/student/view_jobs/jobs.dart @@ -0,0 +1 @@ + From 6ed971801bbcebc0d80369819ae4fd0e516da25d Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:29:07 +0530 Subject: [PATCH 14/45] Create resume_landing.dart --- lib/screens/Placement/student/create_resume/resume_landing.dart | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/screens/Placement/student/create_resume/resume_landing.dart diff --git a/lib/screens/Placement/student/create_resume/resume_landing.dart b/lib/screens/Placement/student/create_resume/resume_landing.dart new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/screens/Placement/student/create_resume/resume_landing.dart @@ -0,0 +1 @@ + From 98f2c3866783fb944462f652378db6e9ed0d3d1b Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:29:38 +0530 Subject: [PATCH 15/45] Add files via upload --- .../create_resume/resumeMakerPage.dart | 174 ++++++++++++++++++ .../student/create_resume/resume_model.dart | 63 +++++++ .../student/create_resume/template1Page.dart | 11 ++ 3 files changed, 248 insertions(+) create mode 100644 lib/screens/Placement/student/create_resume/resumeMakerPage.dart create mode 100644 lib/screens/Placement/student/create_resume/resume_model.dart create mode 100644 lib/screens/Placement/student/create_resume/template1Page.dart diff --git a/lib/screens/Placement/student/create_resume/resumeMakerPage.dart b/lib/screens/Placement/student/create_resume/resumeMakerPage.dart new file mode 100644 index 00000000..a59f5a3b --- /dev/null +++ b/lib/screens/Placement/student/create_resume/resumeMakerPage.dart @@ -0,0 +1,174 @@ +import 'dart:io'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'package:path_provider/path_provider.dart'; +import 'package:pdf/pdf.dart'; +import 'package:pdf/widgets.dart' as pw; +import 'resume_model.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/constants.dart'; +import 'package:syncfusion_flutter_pdf/pdf.dart'; +import 'resumeMakerPage.dart'; +import 'package:fusion/screens/Placement/student/create_resume/template1Page.dart'; + +class ResumeMakerPage extends StatefulWidget { + @override + _ResumeMakerPageState createState() => _ResumeMakerPageState(); +} + +class _ResumeMakerPageState extends State { + final TextEditingController _nameController = TextEditingController(); + final TextEditingController _cpiController = TextEditingController(); + final TextEditingController _emailController = TextEditingController(); + final TextEditingController _phoneController = TextEditingController(); + final TextEditingController _linkedinController = TextEditingController(); + final TextEditingController _githubController = TextEditingController(); + + final TextEditingController _workExperienceController = TextEditingController(); + final TextEditingController _skillsController = TextEditingController(); + final TextEditingController _projectTitleController = TextEditingController(); + final TextEditingController _projectDescriptionController = TextEditingController(); + final TextEditingController _projectLinkController = TextEditingController(); + final TextEditingController _codingPlatformNameController = TextEditingController(); + final TextEditingController _codingPlatformLinkController = TextEditingController(); + + List codingPlatformProfiles = []; + List educationBackground = []; + List projects = []; + List skills = []; + List workExperiences = []; + + Future _createPDF(Resume resume) async { + final fontData = await rootBundle.load('assets/helvetica.ttf'); + final helveticaFont = pw.Font.ttf(fontData.buffer.asByteData()); + + final pdf = pw.Document(); + + pdf.addPage( + pw.Page( + build: (pw.Context context) { + return pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.start, + children: [ + pw.Text('Name: ${resume.name}', style: pw.TextStyle(font: helveticaFont)), + pw.Text('CPI: ${resume.cpi}', style: pw.TextStyle(font: helveticaFont)), + pw.Text('Email: ${resume.email}', style: pw.TextStyle(font: helveticaFont)), + pw.Text('Phone: ${resume.phoneNumber}', style: pw.TextStyle(font: helveticaFont)), + pw.Text('LinkedIn ID: ${resume.linkedinId}', style: pw.TextStyle(font: helveticaFont)), + pw.Text('GitHub ID: ${resume.githubId}', style: pw.TextStyle(font: helveticaFont)), + // Add other resume fields here + ], + ); + }, + ), + ); + + final bytes = await pdf.save(); + await saveAndLaunchFile(bytes, 'resume.pdf'); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Add Information'), + backgroundColor: Colors.deepOrangeAccent, + ), + body: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text('Personal Information', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), + TextFormField( + controller: _nameController, + decoration: InputDecoration(labelText: 'Name'), + ), + TextFormField( + controller: _cpiController, + decoration: InputDecoration(labelText: 'CPI'), + keyboardType: TextInputType.number, + ), + TextFormField( + controller: _emailController, + decoration: InputDecoration(labelText: 'Email'), + keyboardType: TextInputType.emailAddress, + ), + TextFormField( + controller: _phoneController, + decoration: InputDecoration(labelText: 'Phone'), + keyboardType: TextInputType.phone, + ), + TextFormField( + controller: _linkedinController, + decoration: InputDecoration(labelText: 'LinkedIn ID'), + ), + TextFormField( + controller: _githubController, + decoration: InputDecoration(labelText: 'GitHub ID'), + ), + SizedBox(height: 20), + Text('Work Experience', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), + TextFormField( + controller: _workExperienceController, + decoration: InputDecoration(labelText: 'Work Experience'), + ), + SizedBox(height: 20), + Text('Skills', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), + TextFormField( + controller: _skillsController, + decoration: InputDecoration(labelText: 'Skills'), + ), + SizedBox(height: 20), + Text('Projects', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), + TextFormField( + controller: _projectTitleController, + decoration: InputDecoration(labelText: 'Project Title'), + ), + TextFormField( + controller: _projectDescriptionController, + decoration: InputDecoration(labelText: 'Project Description'), + ), + TextFormField( + controller: _projectLinkController, + decoration: InputDecoration(labelText: 'Project Link'), + ), + SizedBox(height: 20), + Text('Coding Platform Profiles', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), + TextFormField( + controller: _codingPlatformNameController, + decoration: InputDecoration(labelText: 'Platform Name'), + ), + TextFormField( + controller: _codingPlatformLinkController, + decoration: InputDecoration(labelText: 'Profile Link'), + ), + SizedBox(height: 20), + ElevatedButton( + onPressed: () async { + Resume resume = Resume( + name: _nameController.text, + cpi: double.tryParse(_cpiController.text) ?? 0.0, + email: _emailController.text, + phoneNumber: _phoneController.text, + linkedinId: _linkedinController.text, + githubId: _githubController.text, + codingPlatformProfiles: codingPlatformProfiles, + educationBackground: educationBackground, + projects: projects, + skills: skills, + workExperiences: workExperiences, + ); + + await _createPDF(resume); + }, + child: Text('Submit'), + ), + ], + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/Placement/student/create_resume/resume_model.dart b/lib/screens/Placement/student/create_resume/resume_model.dart new file mode 100644 index 00000000..d46f8951 --- /dev/null +++ b/lib/screens/Placement/student/create_resume/resume_model.dart @@ -0,0 +1,63 @@ +class Resume { + String? title; + String? name; + double? cpi; + String? email; + String? phoneNumber; + String? linkedinId; + String? githubId; + List codingPlatformProfiles; + List educationBackground; + List projects; + List skills; + List workExperiences; + + Resume({ + this.title, + this.name, + this.cpi, + this.email, + this.phoneNumber, + this.linkedinId, + this.githubId, + this.codingPlatformProfiles = const [], + this.educationBackground = const [], + this.projects = const [], + this.skills = const [], + this.workExperiences = const [], + }); +} + +class CodingPlatformProfile { + String? platformName; + String? profileLink; + + CodingPlatformProfile({this.platformName, this.profileLink}); +} + +class Education { + DateTime? startDate; + DateTime? endDate; + String? institution; + String? degree; + + Education({this.startDate, this.endDate, this.institution, this.degree}); +} + +class Project { + String? title; + String? description; + String? link; + + Project({this.title, this.description, this.link}); +} + +class WorkExperience { + DateTime? startDate; + DateTime? endDate; + String? companyName; + String? position; + + WorkExperience( + {this.startDate, this.endDate, this.companyName, this.position}); +} diff --git a/lib/screens/Placement/student/create_resume/template1Page.dart b/lib/screens/Placement/student/create_resume/template1Page.dart new file mode 100644 index 00000000..3fa5638f --- /dev/null +++ b/lib/screens/Placement/student/create_resume/template1Page.dart @@ -0,0 +1,11 @@ +import 'package:flutter/material.dart'; +import 'package:open_file/open_file.dart'; +import 'package:path_provider/path_provider.dart'; +import 'dart:io'; + +Future saveAndLaunchFile(List bytes, String fileName) async { + final path = (await getExternalStorageDirectory())?.path; + final file = File('$path/$fileName'); + await file.writeAsBytes(bytes, flush: true); + OpenFile.open('$path/$fileName'); +} \ No newline at end of file From d99879d8ed529906478d149e805444c81f6fb87e Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:30:38 +0530 Subject: [PATCH 16/45] Update placement_cell_home.dart --- .../student/placement_cell_home.dart | 212 ++++++++++++++++++ 1 file changed, 212 insertions(+) diff --git a/lib/screens/Placement/student/placement_cell_home.dart b/lib/screens/Placement/student/placement_cell_home.dart index 8b137891..b24532ae 100644 --- a/lib/screens/Placement/student/placement_cell_home.dart +++ b/lib/screens/Placement/student/placement_cell_home.dart @@ -1 +1,213 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/models/placement.dart'; +import 'package:fusion/services/placement_service.dart'; +import 'package:fusion/constants.dart'; +import 'dart:async'; +import 'dart:convert'; +import 'package:http/http.dart'; +import 'package:url_launcher/url_launcher.dart'; +class PlacementHomePage extends StatefulWidget { + final String? token; + static String tag = 'placement-page'; + PlacementHomePage(this.token); + + @override + _PlacementHomePageState createState() => _PlacementHomePageState(); +} + +class _PlacementHomePageState extends State { + bool _loading1 = true; + late StreamController _placementController; + late PlacementService placementService; + late List list; + + // String _value = 'Placement Schedule'; + // var _currentSelectedValue; + // var _placementTypes = [ + // "PlacementType1", + // "PlacementType2", + // ]; + + @override + void initState() { + super.initState(); + _placementController = StreamController(); + placementService = PlacementService(); + getPlacementDataStream(); + } + + getPlacementDataStream() async { + try { + Response response = + await placementService.getPlacementRecord(widget.token!); + setState(() { + // print(response.body); + var data = json.decode(response.body); + var rest = data["placementrecord"] as List; + print(rest); + list = rest + .map((json) => PlacementRecord.fromJson(json)) + .toList(); + print(list[0].name); + // print("list size : ${list.length}"); + _loading1 = false; + }); + } catch (e) { + print(e); + } + } + + loadData() async { + getPlacementDataStream().then((res) { + _placementController.add(res); + }); + } + + BoxDecoration myBoxDecoration() { + return BoxDecoration( + border: new Border.all( + color: Colors.deepOrangeAccent, + width: 2.0, + style: BorderStyle.solid, + ), + borderRadius: new BorderRadius.all(new Radius.circular(15.0))); + } + + Text myText(String text) { + return Text( + text, + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ); + } + + Padding myContainer(String text) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + decoration: myBoxDecoration(), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: myText(text), + ), + ), + ); + } + + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(backgroundColor: kPrimaryColor, title: Text('Fusion')), + drawer: SideDrawer(), + body: Center( + child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [ + Container( + child: Card( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(100), + // Image radius + child: Image.asset('assets/profile_pic.png', + fit: BoxFit.cover)), + ) + ], + ), + ), + ), + SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(width: 20), + Column( + children: [ + Row(children: [ + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed( + context, '/profile'); + }, + icon: const Icon(Icons.remove_red_eye), + label: const Text("View Profile")), + + ]), + SizedBox(height: 20), + Row( + children: [ + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed( + context, '/placement_cell_home/placement_notification'); + }, + icon: const Icon(Icons.notifications), + label: const Text("View Notifications")), + + // Text("View Notification"), + // IconButton( + // icon: Icon(Icons.notifications), + // onPressed: () { + // Navigator.pushNamed(context, 'notifications-page'); + // }, + // tooltip: 'View Notifications', + // ), + ], + ) + ], + ), + ], + ), + SizedBox(height: 20), + SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed( + context, 'placement_cell_home/view_jobs/jobs'); + }, + icon: const Icon(Icons.card_travel_rounded), + label: const Text("Job Invitation")), + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed(context, + 'placement_cell_home/view_statistics/statistics'); + }, + icon: const Icon(Icons.checklist_rtl_rounded), + label: const Text("View Statistics")), + ], + ), + SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed( + context, 'placement_cell_home/create_resume/resume_landing'); + }, + icon: const Icon(Icons.assignment_rounded), + label: const Text("Create Resume")), + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed( + context, 'placement_cell_home/view_schedules/schedule'); + }, + icon: const Icon(Icons.calendar_month_rounded), + label: const Text("View Schedule")), + + ], + ), + + ]), + ), + ); + } +} From 0e8f81e358a403e6234ff9059460c89295d1bb65 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:31:33 +0530 Subject: [PATCH 17/45] Update tpo_home.dart --- lib/screens/Placement/tpo/tpo_home.dart | 165 ++++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/lib/screens/Placement/tpo/tpo_home.dart b/lib/screens/Placement/tpo/tpo_home.dart index 8b137891..805cd82c 100644 --- a/lib/screens/Placement/tpo/tpo_home.dart +++ b/lib/screens/Placement/tpo/tpo_home.dart @@ -1 +1,166 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/Components/appBar2.dart'; +import 'package:fusion/Components/side_drawer2.dart'; +import 'package:fusion/screens/Placement/tpo/add_company.dart'; +import 'package:fusion/screens/Placement/tpo/alumni_data.dart'; +import 'package:fusion/screens/Placement/tpo/filter_students.dart'; +import 'package:fusion/screens/Placement/tpo/placement_statistics.dart'; +import 'package:fusion/screens/Placement/tpo/placement_schedule.dart'; +import 'package:fusion/screens/Placement/tpo/placement_record.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:fusion/Components/bottom_navigation_bar.dart'; +class TpoHome extends StatefulWidget { + @override + State createState() => TpoHomeState(); +} + +class TpoHomeState extends State { + + var service = locator(); + late String curr_desig = service.getFromDisk("Current_designation"); + + @override + Widget build(BuildContext context) { + final data = ''; + + return Scaffold( + appBar: CustomAppBar( + curr_desig: curr_desig, + headerTitle: "Central Mess", + onDesignationChanged: (newValue) { + setState(() { + curr_desig = newValue; + }); + + }, + ), // This is default app bar used in all modules + drawer: SideDrawer(curr_desig: curr_desig), + bottomNavigationBar: + MyBottomNavigationBar(), + body: Container( + padding: const EdgeInsets.all(20.0), + child: Container( + child: GridView.count( + crossAxisCount: 3, + childAspectRatio: 1.0, + mainAxisSpacing: 5.0, + crossAxisSpacing: 5.0, + shrinkWrap: true, + children: List.generate(6, (index) { + return GestureDetector( + onTap: () { + if (index == 0) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => AddCompany()), + ); + } else if (index == 1) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => FilterStudents()), + ); + } else if (index == 3) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PlacementSchedule()), + ); + } else if (index == 4) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PlacementStatistics()), + ); + } else if (index == 5) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => AlumniData()), + ); + } else if (index == 6) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => AddCompany()), + ); + }else if (index == 2) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => PlacementRecord()), + ); + } + }, + child: Expanded( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + color: kPrimaryColor, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (index == 0) + Icon( + Icons.add_business, + color: Colors.white, + size: 30, + ) + else if (index == 1) + Icon( + Icons.people, + color: Colors.white, + size: 30, + ) + + else if (index == 3) + Icon( + Icons.schedule, + color: Colors.white, + size: 30, + ) + else if (index == 4) + Icon( + Icons.pie_chart, + color: Colors.white, + size: 30, + ) + else if (index == 5) + Icon( + Icons.person, + color: Colors.white, + size: 30, + ) + else if(index==2) + Icon( + Icons.dataset_sharp, + color:Colors.white, + size:30, + ), + Text( + index == 0 + ? 'Add Company' + : index == 1 + ? 'Filter Students' + : index == 3 + ? 'Placement Schedule' + : index == 4 + ? 'Placement Statistics' + : index==5 + ?'Alumni Data' + :'Placement Records', + style: TextStyle(color: Colors.white, fontSize: 15), + ) + ], + ), + ), + ), + ); + }), + ), + ), + ), + ); + } +} From c338a5db40e2eea5c1c1a3bc08aeb88a8f6c03c7 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:37:43 +0530 Subject: [PATCH 18/45] Update statistics.dart --- .../student/view_statistics/statistics.dart | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/lib/screens/Placement/student/view_statistics/statistics.dart b/lib/screens/Placement/student/view_statistics/statistics.dart index 8b137891..6ed47787 100644 --- a/lib/screens/Placement/student/view_statistics/statistics.dart +++ b/lib/screens/Placement/student/view_statistics/statistics.dart @@ -1 +1,80 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/constants.dart'; +class StatisticsPage extends StatefulWidget { + const StatisticsPage({Key? key}) : super(key: key); + + @override + State createState() => _StatisticsPageState(); +} + + +class _StatisticsPageState extends State { + String selectedBranch = 'CSE'; // Default selected branch + + // Dummy list of years + List years = [2022, 2023, 2024]; // Example years + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Statistics'), + backgroundColor: Colors.deepOrangeAccent, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(20), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + DropdownButton( + value: selectedBranch, + onChanged: (String? newValue) { + setState(() { + selectedBranch = newValue!; + }); + }, + items: ['CSE', 'ECE', 'SM', 'Design', 'ME'] + .map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + SizedBox(width: 20), + DropdownButton( + value: years.first, + onChanged: (int? newValue) { + setState(() { + // Handle year change + }); + }, + items: years.map>((int value) { + return DropdownMenuItem( + value: value, + child: Text(value.toString()), + ); + }).toList(), + ), + SizedBox(width: 20), + ElevatedButton( + onPressed: () { + // Handle search button press + }, + child: Text('Search'), + ), + ], + ), + ), + // Add statistics widgets here + ], + ), + ); + } +} From 0f43ac7f73db7acd4fd1e00a94e79e5399e03d61 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:38:23 +0530 Subject: [PATCH 19/45] Update schedule.dart --- .../student/view_schedules/schedule.dart | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/lib/screens/Placement/student/view_schedules/schedule.dart b/lib/screens/Placement/student/view_schedules/schedule.dart index 8b137891..86ff76a1 100644 --- a/lib/screens/Placement/student/view_schedules/schedule.dart +++ b/lib/screens/Placement/student/view_schedules/schedule.dart @@ -1 +1,120 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/constants.dart'; + +class SchedulesPage extends StatefulWidget { + const SchedulesPage({Key? key}) : super(key: key); + + @override + State createState() => _SchedulesPageState(); +} + +class _SchedulesPageState extends State { + BoxDecoration myBoxDecoration() { + return BoxDecoration( + border: new Border.all( + color: Colors.deepOrangeAccent, + width: 2.0, + style: BorderStyle.solid, + ), + borderRadius: new BorderRadius.all(new Radius.circular(15.0))); + } + + Text myText(String text) { + return Text( + text, + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ); + } + + Container myContainer(String text) { + return Container( + decoration: myBoxDecoration(), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: myText(text), + ), + ); + } + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Schedules'), + ), + body: ScheduleList(), + ); + } +} + +class ScheduleList extends StatelessWidget { + // Dummy list of job schedules + final List> jobSchedules = [ + { + "jobTitle": "Apple", + "jobDescription": "Job Description 1", + "date": "2024-04-15", + "time": "10:00 AM" + }, + { + "jobTitle": "Nvidia", + "jobDescription": "Job Description 2", + "date": "2024-04-16", + "time": "11:00 AM" + }, + // Add more job schedules here if needed + ]; + + @override + Widget build(BuildContext context) { + return Center( + child: ListView.builder( + itemCount: jobSchedules.length, + itemBuilder: (BuildContext context, int index) { + return Container( + margin: EdgeInsets.all(8.0), + padding: EdgeInsets.all(16.0), + decoration: BoxDecoration( + border: Border.all(color: Colors.deepOrangeAccent), + borderRadius: BorderRadius.circular(15.0), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + jobSchedules[index]['jobTitle'], + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + SizedBox(height: 8.0), + Text( + 'Description: ${jobSchedules[index]['jobDescription']}', + style: TextStyle(fontSize: 16.0, color: Colors.grey), + ), + SizedBox(height: 4.0), + Text( + 'Date: ${jobSchedules[index]['date']}', + style: TextStyle(fontSize: 16.0, color: Colors.grey), + ), + SizedBox(height: 4.0), + Text( + 'Time: ${jobSchedules[index]['time']}', + style: TextStyle(fontSize: 16.0, color: Colors.grey), + ), + ], + ), + ); + }, + ), + ); + } +} From f88e97bb0a519dac49d806d21d94d435ecd0cdc7 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:38:58 +0530 Subject: [PATCH 20/45] Update jobs.dart --- .../Placement/student/view_jobs/jobs.dart | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/lib/screens/Placement/student/view_jobs/jobs.dart b/lib/screens/Placement/student/view_jobs/jobs.dart index 8b137891..08a2d7e0 100644 --- a/lib/screens/Placement/student/view_jobs/jobs.dart +++ b/lib/screens/Placement/student/view_jobs/jobs.dart @@ -1 +1,99 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/constants.dart'; + +class JobsPage extends StatefulWidget { + const JobsPage({Key? key}) : super(key: key); + + @override + State createState() => _JobsPageState(); +} + +class _JobsPageState extends State { + // Dummy list of job invitations + List> jobInvitations = [ + {"name": "Google", "description": "SDE Intern"}, + {"name": "Microsoft", "description": "Job Description 2"}, + // Add more job invitations here if needed + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('View Jobs'), + backgroundColor: Colors.deepOrangeAccent, + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'Company Name', + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 20.0), + // Display job invitations using ListView.builder + ListView.builder( + shrinkWrap: true, + itemCount: jobInvitations.length, + itemBuilder: (BuildContext context, int index) { + return Container( + padding: EdgeInsets.all(16.0), + margin: EdgeInsets.symmetric(vertical: 8.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.deepOrangeAccent, + width: 2.0, + style: BorderStyle.solid, + ), + borderRadius: BorderRadius.circular(15.0), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + jobInvitations[index]['name']!, + style: TextStyle(fontSize: 18), + ), + Text( + jobInvitations[index]['description']!, + style: TextStyle(fontSize: 16, color: Colors.grey), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ElevatedButton( + onPressed: () { + // Handle "Accept" button press + }, + child: Text('Accept'), + ), + SizedBox(width: 8.0), + ElevatedButton( + onPressed: () { + // Handle "Decline" button press + }, + child: Text('Decline'), + ), + ], + ), + ], + ), + ); + }, + ), + ], + ), + ), + ), + ); + } +} From 1323301f75b87938a12669d67dae3149e04a19c9 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:39:43 +0530 Subject: [PATCH 21/45] Update resume_landing.dart --- .../student/create_resume/resume_landing.dart | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/lib/screens/Placement/student/create_resume/resume_landing.dart b/lib/screens/Placement/student/create_resume/resume_landing.dart index 8b137891..665469b8 100644 --- a/lib/screens/Placement/student/create_resume/resume_landing.dart +++ b/lib/screens/Placement/student/create_resume/resume_landing.dart @@ -1 +1,61 @@ +import 'package:flutter/material.dart'; +import 'resume_model.dart'; +import 'package:fusion/screens/Placement/student/create_resume/resumeMakerPage.dart'; + +class ResumeLandingPage extends StatefulWidget { + @override + _ResumeLandingPageState createState() => _ResumeLandingPageState(); +} + +class _ResumeLandingPageState extends State { + List savedResumes = []; // Initial empty list of saved resumes + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Saved Resumes'), + backgroundColor: Colors.deepOrangeAccent, + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "Saved resumes:", + style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + ), + SizedBox(height: 20), + Expanded( + child: ListView.builder( + itemCount: savedResumes.length, + itemBuilder: (context, index) { + return ListTile( + title: Text(savedResumes[index].title!), + // Implement onTap to view the resume details + onTap: () { + // Handle tapping on a resume + // For example, navigate to a page to view resume details + }, + ); + }, + ), + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _createNewResume, + child: Icon(Icons.add), + backgroundColor: Colors.deepOrangeAccent, + ), + ); + } + + void _createNewResume() { + + Navigator.push(context, MaterialPageRoute(builder: (context) => ResumeMakerPage()));// Navigate to a page to create a new resume + + } +} From b239357724774768651a22a5dc5b611c59324589 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:40:52 +0530 Subject: [PATCH 22/45] Delete lib/screens/Placement/demo.txt --- lib/screens/Placement/demo.txt | 1 - .../create_resume/resumeMakerPage.dart | 174 ---------- .../student/create_resume/resume_landing.dart | 61 ---- .../student/create_resume/resume_model.dart | 63 ---- .../student/create_resume/template1Page.dart | 11 - .../student/placement_cell_home.dart | 213 ------------ .../Placement/student/view_jobs/jobs.dart | 99 ------ .../student/view_schedules/schedule.dart | 120 ------- .../student/view_statistics/statistics.dart | 80 ----- lib/screens/Placement/tpo/add_company.dart | 313 ------------------ lib/screens/Placement/tpo/alumni_data.dart | 174 ---------- .../Placement/tpo/filter_students.dart | 194 ----------- .../Placement/tpo/placement_charts.dart | 59 ---- .../Placement/tpo/placement_record.dart | 270 --------------- .../Placement/tpo/placement_schedule.dart | 239 ------------- .../Placement/tpo/placement_statistics.dart | 99 ------ lib/screens/Placement/tpo/tpo_home.dart | 166 ---------- lib/screens/Placement/tpo/tpo_sidebar.dart | 109 ------ 18 files changed, 2445 deletions(-) delete mode 100644 lib/screens/Placement/demo.txt delete mode 100644 lib/screens/Placement/student/create_resume/resumeMakerPage.dart delete mode 100644 lib/screens/Placement/student/create_resume/resume_landing.dart delete mode 100644 lib/screens/Placement/student/create_resume/resume_model.dart delete mode 100644 lib/screens/Placement/student/create_resume/template1Page.dart delete mode 100644 lib/screens/Placement/student/placement_cell_home.dart delete mode 100644 lib/screens/Placement/student/view_jobs/jobs.dart delete mode 100644 lib/screens/Placement/student/view_schedules/schedule.dart delete mode 100644 lib/screens/Placement/student/view_statistics/statistics.dart delete mode 100644 lib/screens/Placement/tpo/add_company.dart delete mode 100644 lib/screens/Placement/tpo/alumni_data.dart delete mode 100644 lib/screens/Placement/tpo/filter_students.dart delete mode 100644 lib/screens/Placement/tpo/placement_charts.dart delete mode 100644 lib/screens/Placement/tpo/placement_record.dart delete mode 100644 lib/screens/Placement/tpo/placement_schedule.dart delete mode 100644 lib/screens/Placement/tpo/placement_statistics.dart delete mode 100644 lib/screens/Placement/tpo/tpo_home.dart delete mode 100644 lib/screens/Placement/tpo/tpo_sidebar.dart diff --git a/lib/screens/Placement/demo.txt b/lib/screens/Placement/demo.txt deleted file mode 100644 index 8b137891..00000000 --- a/lib/screens/Placement/demo.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lib/screens/Placement/student/create_resume/resumeMakerPage.dart b/lib/screens/Placement/student/create_resume/resumeMakerPage.dart deleted file mode 100644 index a59f5a3b..00000000 --- a/lib/screens/Placement/student/create_resume/resumeMakerPage.dart +++ /dev/null @@ -1,174 +0,0 @@ -import 'dart:io'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart' show rootBundle; -import 'package:path_provider/path_provider.dart'; -import 'package:pdf/pdf.dart'; -import 'package:pdf/widgets.dart' as pw; -import 'resume_model.dart'; -import 'package:fusion/Components/side_drawer.dart'; -import 'package:fusion/constants.dart'; -import 'package:syncfusion_flutter_pdf/pdf.dart'; -import 'resumeMakerPage.dart'; -import 'package:fusion/screens/Placement/student/create_resume/template1Page.dart'; - -class ResumeMakerPage extends StatefulWidget { - @override - _ResumeMakerPageState createState() => _ResumeMakerPageState(); -} - -class _ResumeMakerPageState extends State { - final TextEditingController _nameController = TextEditingController(); - final TextEditingController _cpiController = TextEditingController(); - final TextEditingController _emailController = TextEditingController(); - final TextEditingController _phoneController = TextEditingController(); - final TextEditingController _linkedinController = TextEditingController(); - final TextEditingController _githubController = TextEditingController(); - - final TextEditingController _workExperienceController = TextEditingController(); - final TextEditingController _skillsController = TextEditingController(); - final TextEditingController _projectTitleController = TextEditingController(); - final TextEditingController _projectDescriptionController = TextEditingController(); - final TextEditingController _projectLinkController = TextEditingController(); - final TextEditingController _codingPlatformNameController = TextEditingController(); - final TextEditingController _codingPlatformLinkController = TextEditingController(); - - List codingPlatformProfiles = []; - List educationBackground = []; - List projects = []; - List skills = []; - List workExperiences = []; - - Future _createPDF(Resume resume) async { - final fontData = await rootBundle.load('assets/helvetica.ttf'); - final helveticaFont = pw.Font.ttf(fontData.buffer.asByteData()); - - final pdf = pw.Document(); - - pdf.addPage( - pw.Page( - build: (pw.Context context) { - return pw.Column( - crossAxisAlignment: pw.CrossAxisAlignment.start, - children: [ - pw.Text('Name: ${resume.name}', style: pw.TextStyle(font: helveticaFont)), - pw.Text('CPI: ${resume.cpi}', style: pw.TextStyle(font: helveticaFont)), - pw.Text('Email: ${resume.email}', style: pw.TextStyle(font: helveticaFont)), - pw.Text('Phone: ${resume.phoneNumber}', style: pw.TextStyle(font: helveticaFont)), - pw.Text('LinkedIn ID: ${resume.linkedinId}', style: pw.TextStyle(font: helveticaFont)), - pw.Text('GitHub ID: ${resume.githubId}', style: pw.TextStyle(font: helveticaFont)), - // Add other resume fields here - ], - ); - }, - ), - ); - - final bytes = await pdf.save(); - await saveAndLaunchFile(bytes, 'resume.pdf'); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Add Information'), - backgroundColor: Colors.deepOrangeAccent, - ), - body: SingleChildScrollView( - child: Padding( - padding: EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Text('Personal Information', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), - TextFormField( - controller: _nameController, - decoration: InputDecoration(labelText: 'Name'), - ), - TextFormField( - controller: _cpiController, - decoration: InputDecoration(labelText: 'CPI'), - keyboardType: TextInputType.number, - ), - TextFormField( - controller: _emailController, - decoration: InputDecoration(labelText: 'Email'), - keyboardType: TextInputType.emailAddress, - ), - TextFormField( - controller: _phoneController, - decoration: InputDecoration(labelText: 'Phone'), - keyboardType: TextInputType.phone, - ), - TextFormField( - controller: _linkedinController, - decoration: InputDecoration(labelText: 'LinkedIn ID'), - ), - TextFormField( - controller: _githubController, - decoration: InputDecoration(labelText: 'GitHub ID'), - ), - SizedBox(height: 20), - Text('Work Experience', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), - TextFormField( - controller: _workExperienceController, - decoration: InputDecoration(labelText: 'Work Experience'), - ), - SizedBox(height: 20), - Text('Skills', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), - TextFormField( - controller: _skillsController, - decoration: InputDecoration(labelText: 'Skills'), - ), - SizedBox(height: 20), - Text('Projects', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), - TextFormField( - controller: _projectTitleController, - decoration: InputDecoration(labelText: 'Project Title'), - ), - TextFormField( - controller: _projectDescriptionController, - decoration: InputDecoration(labelText: 'Project Description'), - ), - TextFormField( - controller: _projectLinkController, - decoration: InputDecoration(labelText: 'Project Link'), - ), - SizedBox(height: 20), - Text('Coding Platform Profiles', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), - TextFormField( - controller: _codingPlatformNameController, - decoration: InputDecoration(labelText: 'Platform Name'), - ), - TextFormField( - controller: _codingPlatformLinkController, - decoration: InputDecoration(labelText: 'Profile Link'), - ), - SizedBox(height: 20), - ElevatedButton( - onPressed: () async { - Resume resume = Resume( - name: _nameController.text, - cpi: double.tryParse(_cpiController.text) ?? 0.0, - email: _emailController.text, - phoneNumber: _phoneController.text, - linkedinId: _linkedinController.text, - githubId: _githubController.text, - codingPlatformProfiles: codingPlatformProfiles, - educationBackground: educationBackground, - projects: projects, - skills: skills, - workExperiences: workExperiences, - ); - - await _createPDF(resume); - }, - child: Text('Submit'), - ), - ], - ), - ), - ), - ); - } -} \ No newline at end of file diff --git a/lib/screens/Placement/student/create_resume/resume_landing.dart b/lib/screens/Placement/student/create_resume/resume_landing.dart deleted file mode 100644 index 665469b8..00000000 --- a/lib/screens/Placement/student/create_resume/resume_landing.dart +++ /dev/null @@ -1,61 +0,0 @@ -import 'package:flutter/material.dart'; -import 'resume_model.dart'; -import 'package:fusion/screens/Placement/student/create_resume/resumeMakerPage.dart'; - -class ResumeLandingPage extends StatefulWidget { - @override - _ResumeLandingPageState createState() => _ResumeLandingPageState(); -} - -class _ResumeLandingPageState extends State { - List savedResumes = []; // Initial empty list of saved resumes - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Saved Resumes'), - backgroundColor: Colors.deepOrangeAccent, - ), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - "Saved resumes:", - style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), - ), - SizedBox(height: 20), - Expanded( - child: ListView.builder( - itemCount: savedResumes.length, - itemBuilder: (context, index) { - return ListTile( - title: Text(savedResumes[index].title!), - // Implement onTap to view the resume details - onTap: () { - // Handle tapping on a resume - // For example, navigate to a page to view resume details - }, - ); - }, - ), - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: _createNewResume, - child: Icon(Icons.add), - backgroundColor: Colors.deepOrangeAccent, - ), - ); - } - - void _createNewResume() { - - Navigator.push(context, MaterialPageRoute(builder: (context) => ResumeMakerPage()));// Navigate to a page to create a new resume - - } -} - diff --git a/lib/screens/Placement/student/create_resume/resume_model.dart b/lib/screens/Placement/student/create_resume/resume_model.dart deleted file mode 100644 index d46f8951..00000000 --- a/lib/screens/Placement/student/create_resume/resume_model.dart +++ /dev/null @@ -1,63 +0,0 @@ -class Resume { - String? title; - String? name; - double? cpi; - String? email; - String? phoneNumber; - String? linkedinId; - String? githubId; - List codingPlatformProfiles; - List educationBackground; - List projects; - List skills; - List workExperiences; - - Resume({ - this.title, - this.name, - this.cpi, - this.email, - this.phoneNumber, - this.linkedinId, - this.githubId, - this.codingPlatformProfiles = const [], - this.educationBackground = const [], - this.projects = const [], - this.skills = const [], - this.workExperiences = const [], - }); -} - -class CodingPlatformProfile { - String? platformName; - String? profileLink; - - CodingPlatformProfile({this.platformName, this.profileLink}); -} - -class Education { - DateTime? startDate; - DateTime? endDate; - String? institution; - String? degree; - - Education({this.startDate, this.endDate, this.institution, this.degree}); -} - -class Project { - String? title; - String? description; - String? link; - - Project({this.title, this.description, this.link}); -} - -class WorkExperience { - DateTime? startDate; - DateTime? endDate; - String? companyName; - String? position; - - WorkExperience( - {this.startDate, this.endDate, this.companyName, this.position}); -} diff --git a/lib/screens/Placement/student/create_resume/template1Page.dart b/lib/screens/Placement/student/create_resume/template1Page.dart deleted file mode 100644 index 3fa5638f..00000000 --- a/lib/screens/Placement/student/create_resume/template1Page.dart +++ /dev/null @@ -1,11 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:open_file/open_file.dart'; -import 'package:path_provider/path_provider.dart'; -import 'dart:io'; - -Future saveAndLaunchFile(List bytes, String fileName) async { - final path = (await getExternalStorageDirectory())?.path; - final file = File('$path/$fileName'); - await file.writeAsBytes(bytes, flush: true); - OpenFile.open('$path/$fileName'); -} \ No newline at end of file diff --git a/lib/screens/Placement/student/placement_cell_home.dart b/lib/screens/Placement/student/placement_cell_home.dart deleted file mode 100644 index b24532ae..00000000 --- a/lib/screens/Placement/student/placement_cell_home.dart +++ /dev/null @@ -1,213 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:fusion/Components/side_drawer.dart'; -import 'package:fusion/models/placement.dart'; -import 'package:fusion/services/placement_service.dart'; -import 'package:fusion/constants.dart'; -import 'dart:async'; -import 'dart:convert'; -import 'package:http/http.dart'; -import 'package:url_launcher/url_launcher.dart'; - -class PlacementHomePage extends StatefulWidget { - final String? token; - static String tag = 'placement-page'; - PlacementHomePage(this.token); - - @override - _PlacementHomePageState createState() => _PlacementHomePageState(); -} - -class _PlacementHomePageState extends State { - bool _loading1 = true; - late StreamController _placementController; - late PlacementService placementService; - late List list; - - // String _value = 'Placement Schedule'; - // var _currentSelectedValue; - // var _placementTypes = [ - // "PlacementType1", - // "PlacementType2", - // ]; - - @override - void initState() { - super.initState(); - _placementController = StreamController(); - placementService = PlacementService(); - getPlacementDataStream(); - } - - getPlacementDataStream() async { - try { - Response response = - await placementService.getPlacementRecord(widget.token!); - setState(() { - // print(response.body); - var data = json.decode(response.body); - var rest = data["placementrecord"] as List; - print(rest); - list = rest - .map((json) => PlacementRecord.fromJson(json)) - .toList(); - print(list[0].name); - // print("list size : ${list.length}"); - _loading1 = false; - }); - } catch (e) { - print(e); - } - } - - loadData() async { - getPlacementDataStream().then((res) { - _placementController.add(res); - }); - } - - BoxDecoration myBoxDecoration() { - return BoxDecoration( - border: new Border.all( - color: Colors.deepOrangeAccent, - width: 2.0, - style: BorderStyle.solid, - ), - borderRadius: new BorderRadius.all(new Radius.circular(15.0))); - } - - Text myText(String text) { - return Text( - text, - style: TextStyle( - fontSize: 20.0, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ); - } - - Padding myContainer(String text) { - return Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - decoration: myBoxDecoration(), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: myText(text), - ), - ), - ); - } - - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(backgroundColor: kPrimaryColor, title: Text('Fusion')), - drawer: SideDrawer(), - body: Center( - child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [ - Container( - child: Card( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ClipOval( - child: SizedBox.fromSize( - size: Size.fromRadius(100), - // Image radius - child: Image.asset('assets/profile_pic.png', - fit: BoxFit.cover)), - ) - ], - ), - ), - ), - SizedBox(height: 20), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox(width: 20), - Column( - children: [ - Row(children: [ - ElevatedButton.icon( - onPressed: () { - Navigator.pushNamed( - context, '/profile'); - }, - icon: const Icon(Icons.remove_red_eye), - label: const Text("View Profile")), - - ]), - SizedBox(height: 20), - Row( - children: [ - ElevatedButton.icon( - onPressed: () { - Navigator.pushNamed( - context, '/placement_cell_home/placement_notification'); - }, - icon: const Icon(Icons.notifications), - label: const Text("View Notifications")), - - // Text("View Notification"), - // IconButton( - // icon: Icon(Icons.notifications), - // onPressed: () { - // Navigator.pushNamed(context, 'notifications-page'); - // }, - // tooltip: 'View Notifications', - // ), - ], - ) - ], - ), - ], - ), - SizedBox(height: 20), - SizedBox(height: 20), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - ElevatedButton.icon( - onPressed: () { - Navigator.pushNamed( - context, 'placement_cell_home/view_jobs/jobs'); - }, - icon: const Icon(Icons.card_travel_rounded), - label: const Text("Job Invitation")), - ElevatedButton.icon( - onPressed: () { - Navigator.pushNamed(context, - 'placement_cell_home/view_statistics/statistics'); - }, - icon: const Icon(Icons.checklist_rtl_rounded), - label: const Text("View Statistics")), - ], - ), - SizedBox(height: 20), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - ElevatedButton.icon( - onPressed: () { - Navigator.pushNamed( - context, 'placement_cell_home/create_resume/resume_landing'); - }, - icon: const Icon(Icons.assignment_rounded), - label: const Text("Create Resume")), - ElevatedButton.icon( - onPressed: () { - Navigator.pushNamed( - context, 'placement_cell_home/view_schedules/schedule'); - }, - icon: const Icon(Icons.calendar_month_rounded), - label: const Text("View Schedule")), - - ], - ), - - ]), - ), - ); - } -} diff --git a/lib/screens/Placement/student/view_jobs/jobs.dart b/lib/screens/Placement/student/view_jobs/jobs.dart deleted file mode 100644 index 08a2d7e0..00000000 --- a/lib/screens/Placement/student/view_jobs/jobs.dart +++ /dev/null @@ -1,99 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart' show rootBundle; -import 'package:fusion/Components/side_drawer.dart'; -import 'package:fusion/constants.dart'; - -class JobsPage extends StatefulWidget { - const JobsPage({Key? key}) : super(key: key); - - @override - State createState() => _JobsPageState(); -} - -class _JobsPageState extends State { - // Dummy list of job invitations - List> jobInvitations = [ - {"name": "Google", "description": "SDE Intern"}, - {"name": "Microsoft", "description": "Job Description 2"}, - // Add more job invitations here if needed - ]; - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('View Jobs'), - backgroundColor: Colors.deepOrangeAccent, - ), - body: Padding( - padding: const EdgeInsets.all(16.0), - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text( - 'Company Name', - style: TextStyle( - fontSize: 24, - fontWeight: FontWeight.bold, - ), - ), - SizedBox(height: 20.0), - // Display job invitations using ListView.builder - ListView.builder( - shrinkWrap: true, - itemCount: jobInvitations.length, - itemBuilder: (BuildContext context, int index) { - return Container( - padding: EdgeInsets.all(16.0), - margin: EdgeInsets.symmetric(vertical: 8.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.deepOrangeAccent, - width: 2.0, - style: BorderStyle.solid, - ), - borderRadius: BorderRadius.circular(15.0), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - jobInvitations[index]['name']!, - style: TextStyle(fontSize: 18), - ), - Text( - jobInvitations[index]['description']!, - style: TextStyle(fontSize: 16, color: Colors.grey), - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ElevatedButton( - onPressed: () { - // Handle "Accept" button press - }, - child: Text('Accept'), - ), - SizedBox(width: 8.0), - ElevatedButton( - onPressed: () { - // Handle "Decline" button press - }, - child: Text('Decline'), - ), - ], - ), - ], - ), - ); - }, - ), - ], - ), - ), - ), - ); - } -} - diff --git a/lib/screens/Placement/student/view_schedules/schedule.dart b/lib/screens/Placement/student/view_schedules/schedule.dart deleted file mode 100644 index 86ff76a1..00000000 --- a/lib/screens/Placement/student/view_schedules/schedule.dart +++ /dev/null @@ -1,120 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart' show rootBundle; -import 'package:fusion/Components/side_drawer.dart'; -import 'package:fusion/constants.dart'; - - -class SchedulesPage extends StatefulWidget { - const SchedulesPage({Key? key}) : super(key: key); - - @override - State createState() => _SchedulesPageState(); -} - -class _SchedulesPageState extends State { - BoxDecoration myBoxDecoration() { - return BoxDecoration( - border: new Border.all( - color: Colors.deepOrangeAccent, - width: 2.0, - style: BorderStyle.solid, - ), - borderRadius: new BorderRadius.all(new Radius.circular(15.0))); - } - - Text myText(String text) { - return Text( - text, - style: TextStyle( - fontSize: 20.0, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ); - } - - Container myContainer(String text) { - return Container( - decoration: myBoxDecoration(), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: myText(text), - ), - ); - } - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Schedules'), - ), - body: ScheduleList(), - ); - } -} - -class ScheduleList extends StatelessWidget { - // Dummy list of job schedules - final List> jobSchedules = [ - { - "jobTitle": "Apple", - "jobDescription": "Job Description 1", - "date": "2024-04-15", - "time": "10:00 AM" - }, - { - "jobTitle": "Nvidia", - "jobDescription": "Job Description 2", - "date": "2024-04-16", - "time": "11:00 AM" - }, - // Add more job schedules here if needed - ]; - - @override - Widget build(BuildContext context) { - return Center( - child: ListView.builder( - itemCount: jobSchedules.length, - itemBuilder: (BuildContext context, int index) { - return Container( - margin: EdgeInsets.all(8.0), - padding: EdgeInsets.all(16.0), - decoration: BoxDecoration( - border: Border.all(color: Colors.deepOrangeAccent), - borderRadius: BorderRadius.circular(15.0), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - jobSchedules[index]['jobTitle'], - style: TextStyle( - fontSize: 20.0, - fontWeight: FontWeight.bold, - color: Colors.black, - ), - ), - SizedBox(height: 8.0), - Text( - 'Description: ${jobSchedules[index]['jobDescription']}', - style: TextStyle(fontSize: 16.0, color: Colors.grey), - ), - SizedBox(height: 4.0), - Text( - 'Date: ${jobSchedules[index]['date']}', - style: TextStyle(fontSize: 16.0, color: Colors.grey), - ), - SizedBox(height: 4.0), - Text( - 'Time: ${jobSchedules[index]['time']}', - style: TextStyle(fontSize: 16.0, color: Colors.grey), - ), - ], - ), - ); - }, - ), - ); - } -} diff --git a/lib/screens/Placement/student/view_statistics/statistics.dart b/lib/screens/Placement/student/view_statistics/statistics.dart deleted file mode 100644 index 6ed47787..00000000 --- a/lib/screens/Placement/student/view_statistics/statistics.dart +++ /dev/null @@ -1,80 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart' show rootBundle; -import 'package:fusion/Components/side_drawer.dart'; -import 'package:fusion/constants.dart'; - -class StatisticsPage extends StatefulWidget { - const StatisticsPage({Key? key}) : super(key: key); - - @override - State createState() => _StatisticsPageState(); -} - - -class _StatisticsPageState extends State { - String selectedBranch = 'CSE'; // Default selected branch - - // Dummy list of years - List years = [2022, 2023, 2024]; // Example years - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Statistics'), - backgroundColor: Colors.deepOrangeAccent, - ), - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(20), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - DropdownButton( - value: selectedBranch, - onChanged: (String? newValue) { - setState(() { - selectedBranch = newValue!; - }); - }, - items: ['CSE', 'ECE', 'SM', 'Design', 'ME'] - .map>((String value) { - return DropdownMenuItem( - value: value, - child: Text(value), - ); - }).toList(), - ), - SizedBox(width: 20), - DropdownButton( - value: years.first, - onChanged: (int? newValue) { - setState(() { - // Handle year change - }); - }, - items: years.map>((int value) { - return DropdownMenuItem( - value: value, - child: Text(value.toString()), - ); - }).toList(), - ), - SizedBox(width: 20), - ElevatedButton( - onPressed: () { - // Handle search button press - }, - child: Text('Search'), - ), - ], - ), - ), - // Add statistics widgets here - ], - ), - ); - } -} diff --git a/lib/screens/Placement/tpo/add_company.dart b/lib/screens/Placement/tpo/add_company.dart deleted file mode 100644 index 997c2be7..00000000 --- a/lib/screens/Placement/tpo/add_company.dart +++ /dev/null @@ -1,313 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; -import 'package:fusion/constants.dart'; -import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; - -class AddCompany extends StatefulWidget { - @override - _AddCompanyState createState() => _AddCompanyState(); -} - -class _AddCompanyState extends State { - final _formKey = GlobalKey(); - String _companyName = ""; - String _placementType = ""; - List _rolesOffered = []; - int _ctc = 0; - String _jobDescription = ""; - DateTime _dateOfVisit = DateTime.now(); - DateTime _deadlineToApply = DateTime.now(); - final List> _companyList = []; - - void _previewCompanyDetails() { - if (_formKey.currentState!.validate()) { - _formKey.currentState!.save(); - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text('Company Details'), - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text('Company Name: $_companyName'), - Text('Placement Type: $_placementType'), - Text('Roles Offered: ${_rolesOffered.join(", ")}'), - Text('CTC: $_ctc'), - Text('Job Description: $_jobDescription'), - Text('Date of Visit: ${DateFormat('yyyy-MM-dd').format(_dateOfVisit)}'), - Text('Deadline to Apply: ${DateFormat('yyyy-MM-dd').format(_deadlineToApply)}'), - ], - ), - actions: [ - TextButton( - onPressed: () { - Navigator.pop(context); - }, - child: Text('Cancel'), - ), - TextButton( - onPressed: () { - _companyList.add({ - 'companyName': _companyName, - 'placementType': _placementType, - 'rolesOffered': _rolesOffered, - 'ctc': _ctc, - 'jobDescription': _jobDescription, - 'dateOfVisit': _dateOfVisit, - 'deadlineToApply': _deadlineToApply, - }); - _formKey.currentState!.reset(); - Navigator.pop(context); - }, - child: Text('Save'), - ), - ], - ); - }, - ); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Company Details'), - backgroundColor: kPrimaryColor, - foregroundColor: Colors.white, - ), - drawer: Sidebar(), - body: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - children: [ - Form( - key: _formKey, - child: Column( - children: [ - TextFormField( - decoration: InputDecoration(labelText: 'Company Name'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter a company name'; - } - return null; - }, - onSaved: (value) => _companyName = value!, - ), - TextFormField( - decoration: InputDecoration(labelText: 'Placement Type'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter whether its intern or full time job'; - } - return null; - }, - onSaved: (value)=> _placementType = value!, - ), - TextFormField( - decoration: InputDecoration(labelText: 'Roles Offered'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter roles offered'; - } - return null; - }, - onSaved: (value) => _rolesOffered = value!.split(','), - ), - TextFormField( - decoration: InputDecoration(labelText: 'CTC'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter CTC'; - } - if (int.tryParse(value) == null) { - return 'CTC must be a valid integer'; - } - return null; - }, - onSaved: (value) => _ctc = int.parse(value!), - ), - TextFormField( - decoration: InputDecoration(labelText: 'Job Description'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter job description'; - } - return null; - }, - onSaved: (value) => _jobDescription = value!, - ), - Row( - children: [ - Expanded( - child: Column( - children: [ - Text('Date of Visit'), - SizedBox(height: 8), - Container( - width: double.infinity, - child: ElevatedButton( - onPressed: () async { - final DateTime? picked = await showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(2000), - lastDate: DateTime(2025), - ); - if (picked != null && picked != _dateOfVisit) { - setState(() { - _dateOfVisit = picked; - }); - } - }, - child: Text( - _dateOfVisit == null - ? 'Pick a date' - : DateFormat('yyyy-MM-dd').format( - _dateOfVisit), - ), - ), - ), - ], - ), - ), - SizedBox(width: 16), - Expanded( - child: Column( - children: [ - Text('Deadline to Apply'), - SizedBox(height: 8), - Container( - width: double.infinity, - child: ElevatedButton( - onPressed: () async { - final DateTime? picked = await showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(2000), - lastDate: DateTime(2025), - ); - if (picked != null && - picked != _deadlineToApply) { - setState(() { - _deadlineToApply = picked!; - }); - } - }, - child: Text( - _deadlineToApply == null - ? 'Pick a date and time' - : DateFormat('yyyy-MM-dd') - .format(_deadlineToApply), - ), - ), - ), - ], - ), - ), - ], - ), - ], - ), - ), - SizedBox(height: 16), - Expanded( - child: ListView.builder( - itemCount: _companyList.length, - itemBuilder: (context, index) { - final company = _companyList[index]; - return Dismissible( - key: Key(company['companyName']), - onDismissed: (direction) { - setState(() { - _companyList.removeAt(index); - }); - }, - child: ListTile( - title: Text(company['companyName']), - subtitle: Text(company['placementType']), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CompanyDetailsPage( - company: company, - ), - ), - ); - }, - ), - ); - }, - ), - ), - SizedBox(height: 16), - ElevatedButton( - onPressed: _previewCompanyDetails, - child: Text('Preview'), - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: () { - if (_formKey.currentState!.validate()) { - _formKey.currentState!.save(); - _companyList.add({ - 'companyName': _companyName, - 'placementType': _placementType, - 'rolesOffered': _rolesOffered, - 'ctc': _ctc, - 'jobDescription': _jobDescription, - 'dateOfVisit': _dateOfVisit, - 'deadlineToApply': _deadlineToApply, - }); - _formKey.currentState!.reset(); - } - }, - child: Icon(Icons.add), - ), - ); - } -} -class CompanyDetailsPage extends StatelessWidget { - final Map company; - - CompanyDetailsPage({Key? key, required this.company}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(company['companyName']), - ), - body: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('Placement Type: ${company['placementType']}'), - SizedBox(height: 8), - Text('Roles Offered: ${company['rolesOffered'].join(', ')}'), - SizedBox(height: 8), - Text('CTC: ${company['ctc']}'), - SizedBox(height: 8), - Text('Job Description: ${company['jobDescription']}'), - SizedBox(height: 8), - Text('Date of Visit: ${DateFormat('yyyy-MM-dd').format(company['dateOfVisit'])}'), - SizedBox(height: 8), - Text('Deadline to Apply: ${DateFormat('yyyy-MM-dd HH:mm').format(company['deadlineToApply'])}'), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: () { - Navigator.pop(context); - }, - child: Icon(Icons.edit), - ), - ); - } -} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/alumni_data.dart b/lib/screens/Placement/tpo/alumni_data.dart deleted file mode 100644 index 1f94c8d4..00000000 --- a/lib/screens/Placement/tpo/alumni_data.dart +++ /dev/null @@ -1,174 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:fusion/constants.dart'; -import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; - -class AlumniData extends StatefulWidget { - @override - State createState() => AlumniDataState(); -} - -class Student { - final String name; - final int year; - - Student({required this.name, required this.year}); -} - -class AlumniDataState extends State { - //String _value = 'Alumni Data'; - // var _currentSelectedValue; - - String tab1 = 'Placement'; - - String tab2 = 'PBI'; - - String tab3 = 'Higher Studies'; - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title:const Text('Alumni Data'), - backgroundColor: kPrimaryColor, - foregroundColor: Colors.white, - ), - drawer: Sidebar(), - body: DefaultTabController( - length: 3, - child: Scaffold( - body: SafeArea( - child: TabBarView( - children: [ - SingleChildScrollView(child: PlacementTab()), - PlacementTab1(), - PlacementTab1(), - ], - ), - ), - appBar: AppBar( - bottom: TabBar( - labelColor: Colors.black, - isScrollable: true, - labelStyle: TextStyle(fontSize: 20.0), - tabs: [Tab(text: tab1), Tab(text: tab2), Tab(text: tab3)]), - ), - ), - ), - ); - } -} - -class PlacementTab extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Column( - children: [ - Row( - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(10, 30, 0, 0), - child: Text( - 'Search a Student!', - style: TextStyle(fontSize: 20), - ), - ), - ], - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: TextField( - textAlign: TextAlign.center, - decoration: InputDecoration( - labelStyle: TextStyle(color: Colors.grey), - border: OutlineInputBorder(), - labelText: 'Student Name', - ), - ), - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: TextField( - textAlign: TextAlign.center, - decoration: InputDecoration( - labelStyle: TextStyle(color: Colors.grey), - border: OutlineInputBorder(), - labelText: 'Year', - ), - ), - ), - ElevatedButton.icon( - style: ButtonStyle( - foregroundColor: MaterialStatePropertyAll(Colors.white), - backgroundColor: MaterialStatePropertyAll(Colors.blue), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5.0), - side: BorderSide(color: Colors.blue)))), - onPressed: () { - print('Search Pressed'); - }, - icon: Icon(Icons.arrow_right), - label: Text('Search'), - ) - ], - ); - } -} - -class PlacementTab1 extends StatelessWidget { - @override - Widget build(BuildContext context) { - return Column( - children: [ - Row( - children: [ - Padding( - padding:const EdgeInsets.fromLTRB(10, 30, 0, 0), - child: Text( - 'Search a Student!', - style: TextStyle(fontSize: 20), - ), - ), - ], - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: TextField( - textAlign: TextAlign.center, - decoration: InputDecoration( - labelStyle: TextStyle(color: Colors.grey), - border: OutlineInputBorder(), - labelText: 'Student Name', - ), - ), - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: TextField( - textAlign: TextAlign.center, - decoration: InputDecoration( - labelStyle: TextStyle(color: Colors.grey), - border: OutlineInputBorder(), - labelText: 'Year', - ), - ), - ), - ElevatedButton.icon( - style: ButtonStyle( - foregroundColor: MaterialStatePropertyAll(Colors.white), - backgroundColor: MaterialStatePropertyAll(Colors.blue), - shape: MaterialStateProperty.all( - RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5.0), - side: BorderSide(color: Colors.blue)))), - onPressed: () { - Navigator.pushNamed(context, '/add_placement_record'); - print('Search Pressed'); - }, - icon: Icon(Icons.arrow_right), - label: Text('Search'), - ) - ], - ); - } -} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/filter_students.dart b/lib/screens/Placement/tpo/filter_students.dart deleted file mode 100644 index b230770c..00000000 --- a/lib/screens/Placement/tpo/filter_students.dart +++ /dev/null @@ -1,194 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:fusion/constants.dart'; -import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; - -class Student { - final String name; - final String rollNumber; - final double cpi; - final String gender; - final String branch; - final String batch; - - Student({ - required this.name, - required this.rollNumber, - required this.cpi, - required this.gender, - required this.branch, - required this.batch, - }); -} - -class FilterStudents extends StatefulWidget { - final List students = [ - Student(name:'Jayanth Prajapati', rollNumber:'20bcs137', batch:'2020', branch:'CSE', gender:'Male', cpi:8.5), - Student(name:'Jahnavi Kaushal', rollNumber:'22bec234', batch:'2022', branch:'ECE', gender:'Female', cpi:9.0), - Student(name:'Deekshith Ranjan', rollNumber:'21bcs104', batch:'2021', branch:'CSE', gender:'Male', cpi:7.5), - Student(name:'Ankita Dvivedhi', rollNumber:'23bme034', batch:'2023', branch:'ME', gender:'Female', cpi:8.0), - Student(name:'Anand', rollNumber:'21bcs001', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), - Student(name:'Roopa', rollNumber:'21bcs002', batch:'2021', branch:'CSE', gender:'Female', cpi:8.5), - Student(name:'Arjun', rollNumber:'21bcs003', batch:'2021', branch:'CSE', gender:'Male', cpi:8.5), - Student(name:'Abhi', rollNumber:'23bcs002', batch:'2023', branch:'CSE', gender:'Male', cpi:8.2), - Student(name:'Ram', rollNumber:'21bcs141', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), - Student(name:'Vishnu Mishra', rollNumber:'21bcs165', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), - Student(name:'Sita', rollNumber:'22bcs216', batch:'2022', branch:'CSE', gender:'Female', cpi:7.5), - Student(name:'Vishnu Rajput', rollNumber:'22bcs165', batch:'2022', branch:'CSE', gender:'Male', cpi:8.1), - Student(name:'Bruhath', rollNumber:'21bcs149', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), - Student(name:'Ananya Patel', rollNumber:'21bcs150', batch:'2021', branch:'CSE', gender:'Female', cpi:9.2), - Student(name:'Arnav Gupta', rollNumber:'21bcs151', batch:'2021', branch:'CSE', gender:'Male', cpi:8.7), - Student(name:'Khushi Kumari', rollNumber:'22bcs152', batch:'2022', branch:'CSE', gender:'Female', cpi:8.5), - Student(name:'Sahil Singh', rollNumber:'22bcs153', batch:'2022', branch:'CSE', gender:'Male', cpi:7.9), - Student(name:'Neha Shah', rollNumber:'23bcs154', batch:'2023', branch:'CSE', gender:'Female', cpi:9.0), - Student(name:'Aryan Reddy', rollNumber:'23bcs155', batch:'2023', branch:'CSE', gender:'Male', cpi:8.3), - Student(name:'Deepika Singh', rollNumber:'21bec156', batch:'2021', branch:'ECE', gender:'Female', cpi:8.1), - Student(name:'Aruna Sharma', rollNumber:'21bec157', batch:'2021', branch:'ECE', gender:'Female', cpi:7.5), - Student(name:'Rohan Patel', rollNumber:'22bec158', batch:'2022', branch:'ECE', gender:'Male', cpi:8.8), - Student(name:'Ananya Das', rollNumber:'22bec159', batch:'2022', branch:'ECE', gender:'Female', cpi:8.2), - Student(name:'Neha Rao', rollNumber:'23bec160', batch:'2023', branch:'ECE', gender:'Female', cpi:8.7), - Student(name:'Arnav Patel', rollNumber:'23bec161', batch:'2023', branch:'ECE', gender:'Male', cpi:8.6), - Student(name:'Khushi Gupta', rollNumber:'21bme162', batch:'2021', branch:'ME', gender:'Female', cpi:8.0), - Student(name:'Aryan Kumar', rollNumber:'21bme163', batch:'2021', branch:'ME', gender:'Male', cpi:7.8), - Student(name:'Sahil Rao', rollNumber:'22bme164', batch:'2022', branch:'ME', gender:'Male', cpi:8.4), - Student(name:'Ananya Mishra', rollNumber:'22bme165', batch:'2022', branch:'ME', gender:'Female', cpi:7.9), - Student(name:'Arnav Iyer', rollNumber:'23bme166', batch:'2023', branch:'ME', gender:'Male', cpi:8.2), - Student(name:'Khushi Singh', rollNumber:'23bme167', batch:'2023', branch:'ME', gender:'Female', cpi:8.3), - Student(name:'Aditya Rao', rollNumber:'21bsm168', batch:'2021', branch:'SM', gender:'Male', cpi:8.2), - Student(name:'Arun Mehra', rollNumber:'21bsm169', batch:'2021', branch:'SM', gender:'Male', cpi:7.6), - Student(name:'Rajesh Chauhan', rollNumber:'22bsm170', batch:'2022', branch:'SM', gender:'Male', cpi:8.9), - Student(name:'Karthik Menon', rollNumber:'22bsm171', batch:'2022', branch:'SM', gender:'Male', cpi:8.1), - Student(name:'Priya Sharma', rollNumber:'23bsm172', batch:'2023', branch:'SM', gender:'Female', cpi:8.5), - Student(name:'Meera Reddy', rollNumber:'23bsm173', batch:'2023', branch:'SM', gender:'Female', cpi:8.4), - Student(name:'Ananya Tiwari', rollNumber:'20bcs174', batch:'2020', branch:'CSE', gender:'Female', cpi:8.6), - Student(name:'Arnav Reddy', rollNumber:'20bcs175', batch:'2020', branch:'CSE', gender:'Male', cpi:8.2), - Student(name:'Khushi Mehta', rollNumber:'20bec176', batch:'2020', branch:'ECE', gender:'Female', cpi:8.4), - Student(name:'Sahil Tiwari', rollNumber:'20bec177', batch:'2020', branch:'ECE', gender:'Male', cpi:8.0), - Student(name:'Neha Reddy', rollNumber:'20bme178', batch:'2020', branch:'ME', gender:'Female', cpi:8.3), - Student(name:'Aryan Mehta', rollNumber:'20bme179', batch:'2020', branch:'ME', gender:'Male', cpi:7.9), - Student(name:'Deepika Tiwari', rollNumber:'20bsm180', batch:'2020', branch:'SM', gender:'Female', cpi:8.1), - Student(name:'Arun Reddy', rollNumber:'20bsm181', batch:'2020', branch:'SM', gender:'Male', cpi:8.5) - ]; - - @override - _FilterStudentsState createState() => _FilterStudentsState(); -} - -class _FilterStudentsState extends State { - double minCpi = 7.0; - String selectedGender = "All"; - String selectedBranch = "All"; - String selectedBatch = "All"; - List filteredStudents = []; - - @override - void initState() { - super.initState(); - filteredStudents = widget.students; // Initially show all students - } - - void applyFilters() { - setState(() { - filteredStudents = widget.students.where((student) => - student.cpi >= minCpi && - (selectedGender == "All" || student.gender == selectedGender) && - (selectedBranch == "All" || student.branch == selectedBranch) && - (selectedBatch == "All" || student.batch == selectedBatch) - ).toList(); - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text("Filter Students"), - backgroundColor: kPrimaryColor, - foregroundColor: Colors.white, - ), - drawer: Sidebar(), - body: SingleChildScrollView( - padding: EdgeInsets.all(20.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Padding( - padding: const EdgeInsets.all(20.0), - child: Text('Minimum CPI : '), - ), - Slider( - value: minCpi, - min: 7.0, - max: 10.0, - divisions: 6, - label: "Minimum CPI: ${minCpi.toStringAsFixed(1)}", - onChanged: (value) => setState(() => minCpi = value), - ), - Padding( - padding: const EdgeInsets.all(20.0), - child: Text('Select Gender : '), - ), - DropdownButton( - value: selectedGender, - items: [ - DropdownMenuItem(value: "All", child: Text("All")), - DropdownMenuItem(value: "Male", child: Text("Male")), - DropdownMenuItem(value: "Female", child: Text("Female")), - DropdownMenuItem(value: "Other", child: Text("Other")), - ], - onChanged: (value) => setState(() => selectedGender = value!), - ), - Padding( - padding: const EdgeInsets.all(20.0), - child: Text('Select Branch : '), - ), - DropdownButton( - value: selectedBranch, - items: [ - DropdownMenuItem(value: "All", child: Text("All")), - DropdownMenuItem(value: "CSE", child: Text("CSE")), - DropdownMenuItem(value: "ECE", child: Text("ECE")), - DropdownMenuItem(value: "ME", child: Text("ME")), - DropdownMenuItem(value: "SM", child: Text("SM")), - ], - onChanged: (value) => setState(() => selectedBranch = value!), - ), - Padding( - padding: const EdgeInsets.all(20.0), - child: Text('Select Batch : '), - ), - DropdownButton( - value: selectedBatch, - items: [ - DropdownMenuItem(value: "All", child: Text("All")), - DropdownMenuItem(value: "2020", child: Text("2020")), - DropdownMenuItem(value: "2021", child: Text("2021")), - DropdownMenuItem(value: "2022", child: Text("2022")), - DropdownMenuItem(value: "2023", child: Text("2023")), - ], - onChanged: (value) => setState(() => selectedBatch = value!), - ), - SizedBox(height: 16.0), - ElevatedButton( - onPressed: applyFilters, - child: Text("Apply Filters"), - ), - SizedBox(height: 20.0), - filteredStudents.isEmpty - ? Text("No students found matching your criteria.") - : ListView.builder( - shrinkWrap: true, - itemCount: filteredStudents.length, - itemBuilder: (context, index) { - final student = filteredStudents[index]; - return ListTile( - title: Text(student.name), - subtitle: Text(student.rollNumber), - ); - }, - ), - ], - ), - ), - ); - } -} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/placement_charts.dart b/lib/screens/Placement/tpo/placement_charts.dart deleted file mode 100644 index 2b5070d4..00000000 --- a/lib/screens/Placement/tpo/placement_charts.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:charts_flutter/flutter.dart' as charts; - -class PlacementData { - final String branch; - final int placements; - final charts.Color barColor; - PlacementData( - {required this.branch, required this.placements, required this.barColor}); -} - -class PlacementCharts extends StatelessWidget { - final List data; - - PlacementCharts({required this.data}); - @override - Widget build(BuildContext context) { - List> series = [ - charts.Series( - id: "developers", - data: data, - domainFn: (PlacementData series, _) => series.branch, - measureFn: (PlacementData series, _) => series.placements, - colorFn: (PlacementData series, _) => series.barColor, - labelAccessorFn: (PlacementData series, _) => series.branch, - ) - ]; - - return Container( - height: 600, - padding: EdgeInsets.all(25), - child: Card( - child: Padding( - padding: const EdgeInsets.all(9.0), - child: Column( - children: [ - AppBar( - title: Text('Placements for the batch : '), - surfaceTintColor: Colors.yellowAccent, - ), - Expanded( - child: charts.PieChart(series, - animate: true, - defaultRenderer: charts.ArcRendererConfig( - arcRendererDecorators: [ - charts.ArcLabelDecorator( - labelPosition: charts.ArcLabelPosition.inside) - ])), - ), - Expanded( - child: charts.BarChart(series, animate: true), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/screens/Placement/tpo/placement_record.dart b/lib/screens/Placement/tpo/placement_record.dart deleted file mode 100644 index af849b6e..00000000 --- a/lib/screens/Placement/tpo/placement_record.dart +++ /dev/null @@ -1,270 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:fusion/constants.dart'; -import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; - -class PlacementRecord extends StatefulWidget { - @override - _AddStudentState createState() => _AddStudentState(); -} - -class _AddStudentState extends State { - final _formKey = GlobalKey(); - String _rollNumber = ""; - String _studentName = ""; - String _placementType = ""; - double _cpi = 0; - int _ctc = 0; - int _year = 0; - String _organizationName = ""; - final List> _studentList = []; - - void _previewStudentDetails() { - if (_formKey.currentState!.validate()) { - _formKey.currentState!.save(); - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text('Student Details'), - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text('Roll Number: $_rollNumber'), - Text('Student Name: $_studentName'), - Text('Placement Type: $_placementType'), - Text('CPI: $_cpi'), - Text('CTC: $_ctc'), - Text('Year: $_year'), - Text('Organization Name: $_organizationName'), - ], - ), - actions: [ - TextButton( - onPressed: () { - Navigator.pop(context); - }, - child: Text('Cancel'), - ), - TextButton( - onPressed: () { - _studentList.add({ - 'rollNumber': _rollNumber, - 'studentName': _studentName, - 'placementType': _placementType, - 'CPI': _cpi, - 'CTC': _ctc, - 'year': _year, - 'organizationName': _organizationName, - }); - _formKey.currentState!.reset(); - Navigator.pop(context); - }, - child: Text('Save'), - ), - ], - ); - }, - ); - } - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Student Details'), - backgroundColor: kPrimaryColor, - foregroundColor: Colors.white, - ), - drawer: Sidebar(), - body: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - children: [ - Form( - key: _formKey, - child: Column( - children: [ - TextFormField( - decoration: InputDecoration(labelText: 'Roll Number'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter the roll number of the student'; - } - return null; - }, - onSaved: (value) => _rollNumber = value!, - ), - TextFormField( - decoration: InputDecoration(labelText: 'Student Name'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter the student name'; - } - return null; - }, - onSaved: (value) => _studentName = value!, - ), - TextFormField( - decoration: InputDecoration(labelText: 'Placement Type'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter whether its a job or higher studies or PBI'; - } - return null; - }, - onSaved: (value) => _placementType = value!, - ), - TextFormField( - decoration: InputDecoration(labelText: 'CPI'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter CPI'; - } - if (double.tryParse(value) == null) { - return 'CTC must be a valid integer'; - } - return null; - }, - onSaved: (value) => _cpi = double.parse(value!), - ), - TextFormField( - decoration: InputDecoration(labelText: 'CTC'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter CTC'; - } - if (int.tryParse(value) == null) { - return 'CTC must be a valid integer'; - } - return null; - }, - onSaved: (value) => _ctc = int.parse(value!), - ), - TextFormField( - decoration: InputDecoration(labelText: 'Year'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter year'; - } - if (int.tryParse(value) == null) { - return 'CTC must be a valid integer'; - } - return null; - }, - onSaved: (value) => _year = int.parse(value!), - ), - TextFormField( - decoration: InputDecoration(labelText: 'Organization Name'), - validator: (value) { - if (value == null || value.isEmpty) { - return 'Please enter organization name'; - } - return null; - }, - onSaved: (value) => _organizationName = value!, - ), - ], - ), - ), - SizedBox(height: 16), - Expanded( - child: ListView.builder( - itemCount: _studentList.length, - itemBuilder: (context, index) { - final student = _studentList[index]; - return Dismissible( - key: Key(student['rollNumber']), - onDismissed: (direction) { - setState(() { - _studentList.removeAt(index); - }); - }, - child: ListTile( - title: Text(student['studentName']), - subtitle: Text(student['rollNumber']), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => StudentDetailsPage( - student: student, - ), - ), - ); - }, - ), - ); - }, - ), - ), - SizedBox(height: 16), - ElevatedButton( - onPressed: _previewStudentDetails, - child: Text('Preview'), - ), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: () { - if (_formKey.currentState!.validate()) { - _formKey.currentState!.save(); - _studentList.add({ - 'rollNumber': _rollNumber, - 'studentName': _studentName, - 'placementType': _placementType, - 'CPI': _cpi, - 'CTC': _ctc, - 'year': _year, - 'organizationName': _organizationName, - }); - _formKey.currentState!.reset(); - } - }, - child: Icon(Icons.add), - ), - ); - } -} - -class StudentDetailsPage extends StatelessWidget { - final Map student; - - StudentDetailsPage({Key? key, required this.student}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(student['rollNumber']), - ), - body: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('Placement Type: ${student['placementType']}'), - SizedBox(height: 8), - Text('Student Name: ${student['studentName']}'), - SizedBox(height: 8), - Text('CTC: ${student['ctc']}'), - SizedBox(height: 8), - Text('CPI: ${student['cpi']}'), - SizedBox(height: 8), - Text('Year: ${student['year']}'), - SizedBox(height: 8), - Text('Organization Name: ${student['organizationName']}'), - SizedBox(height: 8), - ], - ), - ), - floatingActionButton: FloatingActionButton( - onPressed: () { - Navigator.pop(context); - }, - child: Icon(Icons.edit), - ), - ); - } -} diff --git a/lib/screens/Placement/tpo/placement_schedule.dart b/lib/screens/Placement/tpo/placement_schedule.dart deleted file mode 100644 index 7904eee1..00000000 --- a/lib/screens/Placement/tpo/placement_schedule.dart +++ /dev/null @@ -1,239 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:fusion/constants.dart'; -import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; - -class PlacementSchedule extends StatefulWidget { - @override - _PlacementScheduleState createState() => _PlacementScheduleState(); -} -class Note { - final int id; - final String title; - final String content; - - Note({required this.id, required this.title, required this.content}); -} -class NotesProvider { - List _notes = [ - Note( - id: 1, - title: '25/04/2024-01/05/2024', - content: 'Mock interviews as part of PDC classes.\nVenue:Placement Cell, DSA.\nTime:9am - 1pm(Mor),2pm-6pm(Even).\n\nCSE 2021 - 25/04/2024 & 26/04/2024.\nECE 2021 - 27/04/2024.\nME 2021 - 28/04/2024.\nSM 2021 - 29/04/2024.\nDES 2021 - 30/04/2024.\nMTech 2021 - 01/05/2024.\nPhD 2021 - 01/05/2024.', - ), - - Note( - id: 2, - title: '27/04/2024', - content: 'Workshop by PostMan.\nVenue : L103, Audi.\nTime:10am.', - ), - ]; - int _nextId = 1; - - List get notes => _notes; - - int get nextId => _nextId; - - void addNote(String title, String content) { - final note = Note(id: _nextId, title: title, content: content); - _notes.add(note); - _nextId++; - } - - void updateNote(Note note, String title, String content) { - final updatedNote = Note( - id: note.id, - title: title, - content: content, - ); - final index = _notes.indexWhere((n) => n.id == note.id); - if (index != -1) { - _notes[index] = updatedNote; - } - } - - void deleteNote(Note note) { - _notes.remove(note); - } -} - -class _PlacementScheduleState extends State { - final _notesProvider = NotesProvider(); - final _titleController = TextEditingController(); - final _contentController = TextEditingController(); - Note? _editingNote; - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text('Placement Schedule'), - backgroundColor: kPrimaryColor, - foregroundColor: Colors.white, - ), - drawer:Sidebar(), - body: ListView.builder( - itemCount: _notesProvider.notes.length, - itemBuilder: (context, index) { - final note = _notesProvider.notes[index]; - return ListTile( - leading: Icon(Icons.schedule_sharp), - title: Text(note.title), - subtitle: Text(note.content), - trailing: Row( - mainAxisSize: MainAxisSize.min, - children: [ - IconButton( - icon: Icon(Icons.edit), - onPressed: () { - setState(() { - _editingNote = note; - _titleController.text = note.title; - _contentController.text = note.content; - }); - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text(_editingNote == null ? 'Add Note' : 'Edit Note'), - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - TextField( - controller: _titleController, - decoration: InputDecoration(hintText: 'Date'), - ), - TextField( - controller: _contentController, - decoration: InputDecoration(hintText: 'Details of the event, time and venue if required'), - maxLines: null, - ), - ], - ), - actions: [ - TextButton( - child: Text('Cancel'), - onPressed: () { - Navigator.pop(context); - }, - ), - TextButton( - child: Text(_editingNote == null ? 'Add' : 'Save'), - onPressed: () { - final title = _titleController.text; - final content = _contentController.text; - if (title.isNotEmpty && content.isNotEmpty) { - if (_editingNote == null) { - _notesProvider.addNote(title, content); - } else { - _notesProvider.updateNote(_editingNote!, title, content); - } - Navigator.pop(context); - setState(() {}); - } - }, - ), - ], - ); - }, - ); - }, - ), - - IconButton( - icon: Icon(Icons.delete), - onPressed: () { - _notesProvider.deleteNote(note); - setState(() {}); - }, - ), - ], - ), - ); - }, - ), - floatingActionButton: FloatingActionButton( - child: Icon(Icons.add), - onPressed: () { - setState(() { - _editingNote = null; - _titleController.clear(); - _contentController.clear(); - }); - showDialog( - context: context, - builder: (context) { - return AlertDialog( - title: Text('Add Schedule'), - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - TextField( - controller: _titleController, - decoration: InputDecoration(hintText: 'Date'), - ), - TextField( - controller: _contentController, - decoration: InputDecoration(hintText: 'Details of the event, time and venue if required'), - maxLines: null, - ), - ], - ), - actions: [ - TextButton( - child: Text('Cancel'), - onPressed: () { - Navigator.pop(context); - }, - ), - TextButton( - - child: Text('Add'), - - onPressed: () { - - final title = _titleController.text; - - final content = _contentController.text; - - if (title.isNotEmpty && content.isNotEmpty) { - - final note = Note( - - id: _notesProvider.nextId, - - title: title, - - content: content, - - ); - - _notesProvider.addNote(title, content); - - Navigator.pop(context); - - setState(() {}); - - } - - }, - - ), - - ], - - ); - - }, - - ); - - }, - - ), - - ); - - } - -} - diff --git a/lib/screens/Placement/tpo/placement_statistics.dart b/lib/screens/Placement/tpo/placement_statistics.dart deleted file mode 100644 index 25dc32e3..00000000 --- a/lib/screens/Placement/tpo/placement_statistics.dart +++ /dev/null @@ -1,99 +0,0 @@ -import 'dart:math'; -import 'package:flutter/material.dart'; -import 'package:charts_flutter/flutter.dart' as charts; -import 'package:fusion/screens/Placement/tpo/placement_charts.dart'; -import 'package:fusion/constants.dart'; -import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; - -class PlacementStatistics extends StatefulWidget { - @override - State createState() => _PlacementStatisticsState(); -} - -class _PlacementStatisticsState extends State { - int _graphValue = 2011; - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Placement Statistics'), - backgroundColor: kPrimaryColor, - foregroundColor: Colors.white, - ), - drawer: Sidebar(), - body: Column( - children: [ - Row( - children: [ - Padding( - padding: const EdgeInsets.all(20.0), - child: Text('Select Year '), - ), - DropdownButton( - value: _graphValue, - items: >[ - for (int year = 2010; year <= 2023; year++) - DropdownMenuItem( - value: year, - child: Text('$year'), - ), - ], - onChanged: (int? value) => - setState(() => _graphValue = value!), - ), - ], - ), - Expanded(child: _buildGraph()), - ], - ), - ); - } - - Widget _buildGraph() { - switch (_graphValue) { - case 2011: - return EmptyGraphs(); - default: - return StatsCharts(year: _graphValue); - } - } -} - -class EmptyGraphs extends StatelessWidget { - @override - Widget build(BuildContext context) { - return SizedBox.shrink(); - } -} - -class StatsCharts extends StatelessWidget { - final int year; - - StatsCharts({Key? key, required this.year}) : super(key: key); - - final Random rnd = new Random(); - late List data = [ - PlacementData( - branch: 'CSE', - placements:rnd.nextInt(250), - barColor: charts.ColorUtil.fromDartColor(Colors.deepPurpleAccent)), - PlacementData( - branch: 'ECE', - placements: rnd.nextInt(120), - barColor: charts.ColorUtil.fromDartColor(Colors.orangeAccent)), - PlacementData( - branch: 'ME', - placements: rnd.nextInt(90), - barColor: charts.ColorUtil.fromDartColor(Colors.tealAccent)), - PlacementData( - branch: 'SM', - placements: rnd.nextInt(90), - barColor: charts.ColorUtil.fromDartColor(Colors.indigoAccent)), - ]; - - @override - Widget build(BuildContext context) { - return PlacementCharts(data: data); - } -} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/tpo_home.dart b/lib/screens/Placement/tpo/tpo_home.dart deleted file mode 100644 index 805cd82c..00000000 --- a/lib/screens/Placement/tpo/tpo_home.dart +++ /dev/null @@ -1,166 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:fusion/constants.dart'; -import 'package:fusion/Components/appBar2.dart'; -import 'package:fusion/Components/side_drawer2.dart'; -import 'package:fusion/screens/Placement/tpo/add_company.dart'; -import 'package:fusion/screens/Placement/tpo/alumni_data.dart'; -import 'package:fusion/screens/Placement/tpo/filter_students.dart'; -import 'package:fusion/screens/Placement/tpo/placement_statistics.dart'; -import 'package:fusion/screens/Placement/tpo/placement_schedule.dart'; -import 'package:fusion/screens/Placement/tpo/placement_record.dart'; -import 'package:fusion/services/service_locator.dart'; -import 'package:fusion/services/storage_service.dart'; -import 'package:fusion/Components/bottom_navigation_bar.dart'; - -class TpoHome extends StatefulWidget { - @override - State createState() => TpoHomeState(); -} - -class TpoHomeState extends State { - - var service = locator(); - late String curr_desig = service.getFromDisk("Current_designation"); - - @override - Widget build(BuildContext context) { - final data = ''; - - return Scaffold( - appBar: CustomAppBar( - curr_desig: curr_desig, - headerTitle: "Central Mess", - onDesignationChanged: (newValue) { - setState(() { - curr_desig = newValue; - }); - - }, - ), // This is default app bar used in all modules - drawer: SideDrawer(curr_desig: curr_desig), - bottomNavigationBar: - MyBottomNavigationBar(), - body: Container( - padding: const EdgeInsets.all(20.0), - child: Container( - child: GridView.count( - crossAxisCount: 3, - childAspectRatio: 1.0, - mainAxisSpacing: 5.0, - crossAxisSpacing: 5.0, - shrinkWrap: true, - children: List.generate(6, (index) { - return GestureDetector( - onTap: () { - if (index == 0) { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => AddCompany()), - ); - } else if (index == 1) { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => FilterStudents()), - ); - } else if (index == 3) { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PlacementSchedule()), - ); - } else if (index == 4) { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PlacementStatistics()), - ); - } else if (index == 5) { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => AlumniData()), - ); - } else if (index == 6) { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => AddCompany()), - ); - }else if (index == 2) { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => PlacementRecord()), - ); - } - }, - child: Expanded( - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(5), - color: kPrimaryColor, - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (index == 0) - Icon( - Icons.add_business, - color: Colors.white, - size: 30, - ) - else if (index == 1) - Icon( - Icons.people, - color: Colors.white, - size: 30, - ) - - else if (index == 3) - Icon( - Icons.schedule, - color: Colors.white, - size: 30, - ) - else if (index == 4) - Icon( - Icons.pie_chart, - color: Colors.white, - size: 30, - ) - else if (index == 5) - Icon( - Icons.person, - color: Colors.white, - size: 30, - ) - else if(index==2) - Icon( - Icons.dataset_sharp, - color:Colors.white, - size:30, - ), - Text( - index == 0 - ? 'Add Company' - : index == 1 - ? 'Filter Students' - : index == 3 - ? 'Placement Schedule' - : index == 4 - ? 'Placement Statistics' - : index==5 - ?'Alumni Data' - :'Placement Records', - style: TextStyle(color: Colors.white, fontSize: 15), - ) - ], - ), - ), - ), - ); - }), - ), - ), - ), - ); - } -} diff --git a/lib/screens/Placement/tpo/tpo_sidebar.dart b/lib/screens/Placement/tpo/tpo_sidebar.dart deleted file mode 100644 index 5c6f7fc6..00000000 --- a/lib/screens/Placement/tpo/tpo_sidebar.dart +++ /dev/null @@ -1,109 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:fusion/screens/Placement/tpo/filter_students.dart'; -import 'package:fusion/screens/Placement/tpo/placement_record.dart'; -import 'package:fusion/screens/Placement/tpo/tpo_home.dart'; -import 'package:fusion/screens/Placement/tpo/alumni_data.dart'; -import 'package:fusion/screens/Placement/tpo/placement_schedule.dart'; -import 'package:fusion/screens/Placement/tpo/placement_statistics.dart'; -import 'package:fusion/screens/Placement/tpo/add_company.dart'; - -class Sidebar extends StatelessWidget { - const Sidebar({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return Container( - child: SizedBox( - width: 300, - child: Drawer( - child: ListView( - children: [ - const DrawerHeader( - decoration: BoxDecoration( - color: Color.fromARGB(255, 245, 103, 47), - ), - child: Text( - 'Menu', - style: TextStyle( - color: Colors.white, - fontSize: 35, - ), - ), - ), - ListTile( - title: const Text( - 'Home', - style: TextStyle(color: Colors.black, fontSize: 20), - ), - onTap: () { - Navigator.of(context) - .push(MaterialPageRoute(builder: (context) => TpoHome())); - }, - ), - - ListTile( - title: const Text( - 'Filter Students', - style: TextStyle(color: Colors.black, fontSize: 20), - ), - onTap: () { - Navigator.of(context).push( - MaterialPageRoute(builder: (context) => FilterStudents())); - }, - ), - ListTile( - title: const Text( - 'Placement Schedule', - style: TextStyle(color: Colors.black, fontSize: 20), - ), - onTap: () { - Navigator.of(context).push(MaterialPageRoute( - builder: (context) => PlacementSchedule())); - }, - ), - ListTile( - title: const Text( - 'Placement Statistics', - style: TextStyle(color: Colors.black, fontSize: 20), - ), - onTap: () { - Navigator.of(context).push(MaterialPageRoute( - builder: (context) => PlacementStatistics())); - }, - ), - ListTile( - title: const Text( - 'Add Placement Data', - style: TextStyle(color: Colors.black, fontSize: 20), - ), - onTap: () { - Navigator.of(context).push(MaterialPageRoute( - builder: (context) => PlacementRecord())); - }, - ), - ListTile( - title: const Text( - 'Add Company', - style: TextStyle(color: Colors.black, fontSize: 20), - ), - onTap: () { - Navigator.of(context).push(MaterialPageRoute( - builder: (context) => AddCompany())); - }, - ), - ListTile( - title: const Text( - 'Alumni Data', - style: TextStyle(color: Colors.black, fontSize: 20), - ), - onTap: () { - Navigator.of(context).push( - MaterialPageRoute(builder: (context) => AlumniData())); - }, - ), - ], - ), - ), - )); - } -} From 7e02b94f00d1c0dcbc7bd625997aa1b329017df6 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:43:24 +0530 Subject: [PATCH 23/45] Create Student --- lib/screens/Placement/Student | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/screens/Placement/Student diff --git a/lib/screens/Placement/Student b/lib/screens/Placement/Student new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/screens/Placement/Student @@ -0,0 +1 @@ + From e51bacf1286b1d3d16afb558c9fcc11019fc904b Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:44:14 +0530 Subject: [PATCH 24/45] Delete lib/screens/Placement directory --- lib/screens/Placement/Student | 1 - 1 file changed, 1 deletion(-) delete mode 100644 lib/screens/Placement/Student diff --git a/lib/screens/Placement/Student b/lib/screens/Placement/Student deleted file mode 100644 index 8b137891..00000000 --- a/lib/screens/Placement/Student +++ /dev/null @@ -1 +0,0 @@ - From 5dd7c12a2368d0d287020efa0e0443034698f58a Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:44:53 +0530 Subject: [PATCH 25/45] Create placement_cell_home.dart --- lib/screens/Placement/student/placement_cell_home.dart | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/screens/Placement/student/placement_cell_home.dart diff --git a/lib/screens/Placement/student/placement_cell_home.dart b/lib/screens/Placement/student/placement_cell_home.dart new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/screens/Placement/student/placement_cell_home.dart @@ -0,0 +1 @@ + From a26b4f49e134a19471912907f85ef885ef04c202 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:45:21 +0530 Subject: [PATCH 26/45] Update placement_cell_home.dart --- .../student/placement_cell_home.dart | 213 ++++++++++++++++++ 1 file changed, 213 insertions(+) diff --git a/lib/screens/Placement/student/placement_cell_home.dart b/lib/screens/Placement/student/placement_cell_home.dart index 8b137891..fe294e91 100644 --- a/lib/screens/Placement/student/placement_cell_home.dart +++ b/lib/screens/Placement/student/placement_cell_home.dart @@ -1 +1,214 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/models/placement.dart'; +import 'package:fusion/services/placement_service.dart'; +import 'package:fusion/constants.dart'; +import 'dart:async'; +import 'dart:convert'; +import 'package:http/http.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class PlacementHomePage extends StatefulWidget { + final String? token; + static String tag = 'placement-page'; + PlacementHomePage(this.token); + + @override + _PlacementHomePageState createState() => _PlacementHomePageState(); +} + +class _PlacementHomePageState extends State { + bool _loading1 = true; + late StreamController _placementController; + late PlacementService placementService; + late List list; + + // String _value = 'Placement Schedule'; + // var _currentSelectedValue; + // var _placementTypes = [ + // "PlacementType1", + // "PlacementType2", + // ]; + + @override + void initState() { + super.initState(); + _placementController = StreamController(); + placementService = PlacementService(); + getPlacementDataStream(); + } + + getPlacementDataStream() async { + try { + Response response = + await placementService.getPlacementRecord(widget.token!); + setState(() { + // print(response.body); + var data = json.decode(response.body); + var rest = data["placementrecord"] as List; + print(rest); + list = rest + .map((json) => PlacementRecord.fromJson(json)) + .toList(); + print(list[0].name); + // print("list size : ${list.length}"); + _loading1 = false; + }); + } catch (e) { + print(e); + } + } + + loadData() async { + getPlacementDataStream().then((res) { + _placementController.add(res); + }); + } + + BoxDecoration myBoxDecoration() { + return BoxDecoration( + border: new Border.all( + color: Colors.deepOrangeAccent, + width: 2.0, + style: BorderStyle.solid, + ), + borderRadius: new BorderRadius.all(new Radius.circular(15.0))); + } + + Text myText(String text) { + return Text( + text, + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ); + } + + Padding myContainer(String text) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + decoration: myBoxDecoration(), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: myText(text), + ), + ), + ); + } + + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(backgroundColor: kPrimaryColor, title: Text('Fusion')), + drawer: SideDrawer(), + body: Center( + child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [ + Container( + child: Card( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(100), + // Image radius + child: Image.asset('assets/profile_pic.png', + fit: BoxFit.cover)), + ) + ], + ), + ), + ), + SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(width: 20), + Column( + children: [ + Row(children: [ + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed( + context, '/profile'); + }, + icon: const Icon(Icons.remove_red_eye), + label: const Text("View Profile")), + + ]), + SizedBox(height: 20), + Row( + children: [ + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed( + context, '/placement_cell_home/placement_notification'); + }, + icon: const Icon(Icons.notifications), + label: const Text("View Notifications")), + + // Text("View Notification"), + // IconButton( + // icon: Icon(Icons.notifications), + // onPressed: () { + // Navigator.pushNamed(context, 'notifications-page'); + // }, + // tooltip: 'View Notifications', + // ), + ], + ) + ], + ), + ], + ), + SizedBox(height: 20), + SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed( + context, 'placement_cell_home/view_jobs/jobs'); + }, + icon: const Icon(Icons.card_travel_rounded), + label: const Text("Job Invitation")), + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed(context, + 'placement_cell_home/view_statistics/statistics'); + }, + icon: const Icon(Icons.checklist_rtl_rounded), + label: const Text("View Statistics")), + ], + ), + SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed( + context, 'placement_cell_home/create_resume/resume_landing'); + }, + icon: const Icon(Icons.assignment_rounded), + label: const Text("Create Resume")), + ElevatedButton.icon( + onPressed: () { + Navigator.pushNamed( + context, 'placement_cell_home/view_schedules/schedule'); + }, + icon: const Icon(Icons.calendar_month_rounded), + label: const Text("View Schedule")), + + ], + ), + + ]), + ), + ); + } +} From 6fcd7fecfa602b8ab6e2e477f44a15dfd2ba5cfc Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:45:57 +0530 Subject: [PATCH 27/45] Create tpo_home.dart --- lib/screens/Placement/tpo/tpo_home.dart | 1 + 1 file changed, 1 insertion(+) create mode 100644 lib/screens/Placement/tpo/tpo_home.dart diff --git a/lib/screens/Placement/tpo/tpo_home.dart b/lib/screens/Placement/tpo/tpo_home.dart new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/lib/screens/Placement/tpo/tpo_home.dart @@ -0,0 +1 @@ + From cd00c046514d3d85fe03a33005676f801e157f30 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:46:22 +0530 Subject: [PATCH 28/45] Update tpo_home.dart --- lib/screens/Placement/tpo/tpo_home.dart | 165 ++++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/lib/screens/Placement/tpo/tpo_home.dart b/lib/screens/Placement/tpo/tpo_home.dart index 8b137891..805cd82c 100644 --- a/lib/screens/Placement/tpo/tpo_home.dart +++ b/lib/screens/Placement/tpo/tpo_home.dart @@ -1 +1,166 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/Components/appBar2.dart'; +import 'package:fusion/Components/side_drawer2.dart'; +import 'package:fusion/screens/Placement/tpo/add_company.dart'; +import 'package:fusion/screens/Placement/tpo/alumni_data.dart'; +import 'package:fusion/screens/Placement/tpo/filter_students.dart'; +import 'package:fusion/screens/Placement/tpo/placement_statistics.dart'; +import 'package:fusion/screens/Placement/tpo/placement_schedule.dart'; +import 'package:fusion/screens/Placement/tpo/placement_record.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:fusion/Components/bottom_navigation_bar.dart'; +class TpoHome extends StatefulWidget { + @override + State createState() => TpoHomeState(); +} + +class TpoHomeState extends State { + + var service = locator(); + late String curr_desig = service.getFromDisk("Current_designation"); + + @override + Widget build(BuildContext context) { + final data = ''; + + return Scaffold( + appBar: CustomAppBar( + curr_desig: curr_desig, + headerTitle: "Central Mess", + onDesignationChanged: (newValue) { + setState(() { + curr_desig = newValue; + }); + + }, + ), // This is default app bar used in all modules + drawer: SideDrawer(curr_desig: curr_desig), + bottomNavigationBar: + MyBottomNavigationBar(), + body: Container( + padding: const EdgeInsets.all(20.0), + child: Container( + child: GridView.count( + crossAxisCount: 3, + childAspectRatio: 1.0, + mainAxisSpacing: 5.0, + crossAxisSpacing: 5.0, + shrinkWrap: true, + children: List.generate(6, (index) { + return GestureDetector( + onTap: () { + if (index == 0) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => AddCompany()), + ); + } else if (index == 1) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => FilterStudents()), + ); + } else if (index == 3) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PlacementSchedule()), + ); + } else if (index == 4) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PlacementStatistics()), + ); + } else if (index == 5) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => AlumniData()), + ); + } else if (index == 6) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => AddCompany()), + ); + }else if (index == 2) { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => PlacementRecord()), + ); + } + }, + child: Expanded( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(5), + color: kPrimaryColor, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (index == 0) + Icon( + Icons.add_business, + color: Colors.white, + size: 30, + ) + else if (index == 1) + Icon( + Icons.people, + color: Colors.white, + size: 30, + ) + + else if (index == 3) + Icon( + Icons.schedule, + color: Colors.white, + size: 30, + ) + else if (index == 4) + Icon( + Icons.pie_chart, + color: Colors.white, + size: 30, + ) + else if (index == 5) + Icon( + Icons.person, + color: Colors.white, + size: 30, + ) + else if(index==2) + Icon( + Icons.dataset_sharp, + color:Colors.white, + size:30, + ), + Text( + index == 0 + ? 'Add Company' + : index == 1 + ? 'Filter Students' + : index == 3 + ? 'Placement Schedule' + : index == 4 + ? 'Placement Statistics' + : index==5 + ?'Alumni Data' + :'Placement Records', + style: TextStyle(color: Colors.white, fontSize: 15), + ) + ], + ), + ), + ), + ); + }), + ), + ), + ), + ); + } +} From e784874c990e0f3b1f2e1ed7bd64d6bf54b3a618 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:47:09 +0530 Subject: [PATCH 29/45] Create faculty_stats.dart --- .../Placement/faculty/faculty_stats.dart | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 lib/screens/Placement/faculty/faculty_stats.dart diff --git a/lib/screens/Placement/faculty/faculty_stats.dart b/lib/screens/Placement/faculty/faculty_stats.dart new file mode 100644 index 00000000..63ec0b2e --- /dev/null +++ b/lib/screens/Placement/faculty/faculty_stats.dart @@ -0,0 +1,102 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/Components/appBar.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'dart:math'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:fusion/screens/Placement/tpo/placement_charts.dart'; + +class Statistics extends StatefulWidget { + @override + State createState() => _PlacementStatisticsState(); +} + +class _PlacementStatisticsState extends State { + int _graphValue = 2011; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Placement Statistics'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: SideDrawer(), + body: Column( + children: [ + Row( + children: [ + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Select Year '), + ), + DropdownButton( + value: _graphValue, + items: >[ + for (int year = 2010; year <= 2023; year++) + DropdownMenuItem( + value: year, + child: Text('$year'), + ), + ], + onChanged: (int? value) => + setState(() => _graphValue = value!), + ), + ], + ), + Expanded(child: _buildGraph()), + ], + ), + ); + } + + Widget _buildGraph() { + switch (_graphValue) { + case 2011: + return EmptyGraphs(); + default: + return StatsCharts(year: _graphValue); + } + } +} + +class EmptyGraphs extends StatelessWidget { + @override + Widget build(BuildContext context) { + return SizedBox.shrink(); + } +} + +class StatsCharts extends StatelessWidget { + final int year; + + StatsCharts({Key? key, required this.year}) : super(key: key); + + final Random rnd = new Random(); + late List data = [ + PlacementData( + branch: 'CSE', + placements:rnd.nextInt(250), + barColor: charts.ColorUtil.fromDartColor(Colors.deepPurpleAccent)), + PlacementData( + branch: 'ECE', + placements: rnd.nextInt(120), + barColor: charts.ColorUtil.fromDartColor(Colors.orangeAccent)), + PlacementData( + branch: 'ME', + placements: rnd.nextInt(90), + barColor: charts.ColorUtil.fromDartColor(Colors.tealAccent)), + PlacementData( + branch: 'SM', + placements: rnd.nextInt(90), + barColor: charts.ColorUtil.fromDartColor(Colors.indigoAccent)), + ]; + + @override + Widget build(BuildContext context) { + return PlacementCharts(data: data); + } +} From 531d62859d2e6a97fd1c15811ed05c324eed7b0c Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:48:17 +0530 Subject: [PATCH 30/45] Create chairman_statistics.dart --- .../chairman/chairman_statistics.dart | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 lib/screens/Placement/chairman/chairman_statistics.dart diff --git a/lib/screens/Placement/chairman/chairman_statistics.dart b/lib/screens/Placement/chairman/chairman_statistics.dart new file mode 100644 index 00000000..63ec0b2e --- /dev/null +++ b/lib/screens/Placement/chairman/chairman_statistics.dart @@ -0,0 +1,102 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/Components/appBar.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'dart:math'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:fusion/screens/Placement/tpo/placement_charts.dart'; + +class Statistics extends StatefulWidget { + @override + State createState() => _PlacementStatisticsState(); +} + +class _PlacementStatisticsState extends State { + int _graphValue = 2011; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Placement Statistics'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: SideDrawer(), + body: Column( + children: [ + Row( + children: [ + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Select Year '), + ), + DropdownButton( + value: _graphValue, + items: >[ + for (int year = 2010; year <= 2023; year++) + DropdownMenuItem( + value: year, + child: Text('$year'), + ), + ], + onChanged: (int? value) => + setState(() => _graphValue = value!), + ), + ], + ), + Expanded(child: _buildGraph()), + ], + ), + ); + } + + Widget _buildGraph() { + switch (_graphValue) { + case 2011: + return EmptyGraphs(); + default: + return StatsCharts(year: _graphValue); + } + } +} + +class EmptyGraphs extends StatelessWidget { + @override + Widget build(BuildContext context) { + return SizedBox.shrink(); + } +} + +class StatsCharts extends StatelessWidget { + final int year; + + StatsCharts({Key? key, required this.year}) : super(key: key); + + final Random rnd = new Random(); + late List data = [ + PlacementData( + branch: 'CSE', + placements:rnd.nextInt(250), + barColor: charts.ColorUtil.fromDartColor(Colors.deepPurpleAccent)), + PlacementData( + branch: 'ECE', + placements: rnd.nextInt(120), + barColor: charts.ColorUtil.fromDartColor(Colors.orangeAccent)), + PlacementData( + branch: 'ME', + placements: rnd.nextInt(90), + barColor: charts.ColorUtil.fromDartColor(Colors.tealAccent)), + PlacementData( + branch: 'SM', + placements: rnd.nextInt(90), + barColor: charts.ColorUtil.fromDartColor(Colors.indigoAccent)), + ]; + + @override + Widget build(BuildContext context) { + return PlacementCharts(data: data); + } +} From 48d5a5aa25826079fc23bec72ecbff5d496f918f Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:49:24 +0530 Subject: [PATCH 31/45] Create statistics.dart --- .../student/view_statistics/statistics.dart | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 lib/screens/Placement/student/view_statistics/statistics.dart diff --git a/lib/screens/Placement/student/view_statistics/statistics.dart b/lib/screens/Placement/student/view_statistics/statistics.dart new file mode 100644 index 00000000..6ed47787 --- /dev/null +++ b/lib/screens/Placement/student/view_statistics/statistics.dart @@ -0,0 +1,80 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/constants.dart'; + +class StatisticsPage extends StatefulWidget { + const StatisticsPage({Key? key}) : super(key: key); + + @override + State createState() => _StatisticsPageState(); +} + + +class _StatisticsPageState extends State { + String selectedBranch = 'CSE'; // Default selected branch + + // Dummy list of years + List years = [2022, 2023, 2024]; // Example years + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Statistics'), + backgroundColor: Colors.deepOrangeAccent, + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(20), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + DropdownButton( + value: selectedBranch, + onChanged: (String? newValue) { + setState(() { + selectedBranch = newValue!; + }); + }, + items: ['CSE', 'ECE', 'SM', 'Design', 'ME'] + .map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + SizedBox(width: 20), + DropdownButton( + value: years.first, + onChanged: (int? newValue) { + setState(() { + // Handle year change + }); + }, + items: years.map>((int value) { + return DropdownMenuItem( + value: value, + child: Text(value.toString()), + ); + }).toList(), + ), + SizedBox(width: 20), + ElevatedButton( + onPressed: () { + // Handle search button press + }, + child: Text('Search'), + ), + ], + ), + ), + // Add statistics widgets here + ], + ), + ); + } +} From 303a33b65e0045634acceaa9d569a49e290d6d50 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:50:10 +0530 Subject: [PATCH 32/45] Create jobs.dart --- .../Placement/student/view_jobs/jobs.dart | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 lib/screens/Placement/student/view_jobs/jobs.dart diff --git a/lib/screens/Placement/student/view_jobs/jobs.dart b/lib/screens/Placement/student/view_jobs/jobs.dart new file mode 100644 index 00000000..6980f385 --- /dev/null +++ b/lib/screens/Placement/student/view_jobs/jobs.dart @@ -0,0 +1,98 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/constants.dart'; + +class JobsPage extends StatefulWidget { + const JobsPage({Key? key}) : super(key: key); + + @override + State createState() => _JobsPageState(); +} + +class _JobsPageState extends State { + // Dummy list of job invitations + List> jobInvitations = [ + {"name": "Google", "description": "SDE Intern"}, + {"name": "Microsoft", "description": "Job Description 2"}, + // Add more job invitations here if needed + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('View Jobs'), + backgroundColor: Colors.deepOrangeAccent, + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'Company Name', + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 20.0), + // Display job invitations using ListView.builder + ListView.builder( + shrinkWrap: true, + itemCount: jobInvitations.length, + itemBuilder: (BuildContext context, int index) { + return Container( + padding: EdgeInsets.all(16.0), + margin: EdgeInsets.symmetric(vertical: 8.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.deepOrangeAccent, + width: 2.0, + style: BorderStyle.solid, + ), + borderRadius: BorderRadius.circular(15.0), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + jobInvitations[index]['name']!, + style: TextStyle(fontSize: 18), + ), + Text( + jobInvitations[index]['description']!, + style: TextStyle(fontSize: 16, color: Colors.grey), + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ElevatedButton( + onPressed: () { + // Handle "Accept" button press + }, + child: Text('Accept'), + ), + SizedBox(width: 8.0), + ElevatedButton( + onPressed: () { + // Handle "Decline" button press + }, + child: Text('Decline'), + ), + ], + ), + ], + ), + ); + }, + ), + ], + ), + ), + ), + ); + } +} From 9e9479a0c8b9aec0f45c5f8499d1d0e8843c0c0b Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:51:10 +0530 Subject: [PATCH 33/45] Create schedule.dart --- .../student/view_schedules/schedule.dart | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 lib/screens/Placement/student/view_schedules/schedule.dart diff --git a/lib/screens/Placement/student/view_schedules/schedule.dart b/lib/screens/Placement/student/view_schedules/schedule.dart new file mode 100644 index 00000000..86ff76a1 --- /dev/null +++ b/lib/screens/Placement/student/view_schedules/schedule.dart @@ -0,0 +1,120 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/constants.dart'; + + +class SchedulesPage extends StatefulWidget { + const SchedulesPage({Key? key}) : super(key: key); + + @override + State createState() => _SchedulesPageState(); +} + +class _SchedulesPageState extends State { + BoxDecoration myBoxDecoration() { + return BoxDecoration( + border: new Border.all( + color: Colors.deepOrangeAccent, + width: 2.0, + style: BorderStyle.solid, + ), + borderRadius: new BorderRadius.all(new Radius.circular(15.0))); + } + + Text myText(String text) { + return Text( + text, + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ); + } + + Container myContainer(String text) { + return Container( + decoration: myBoxDecoration(), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: myText(text), + ), + ); + } + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Schedules'), + ), + body: ScheduleList(), + ); + } +} + +class ScheduleList extends StatelessWidget { + // Dummy list of job schedules + final List> jobSchedules = [ + { + "jobTitle": "Apple", + "jobDescription": "Job Description 1", + "date": "2024-04-15", + "time": "10:00 AM" + }, + { + "jobTitle": "Nvidia", + "jobDescription": "Job Description 2", + "date": "2024-04-16", + "time": "11:00 AM" + }, + // Add more job schedules here if needed + ]; + + @override + Widget build(BuildContext context) { + return Center( + child: ListView.builder( + itemCount: jobSchedules.length, + itemBuilder: (BuildContext context, int index) { + return Container( + margin: EdgeInsets.all(8.0), + padding: EdgeInsets.all(16.0), + decoration: BoxDecoration( + border: Border.all(color: Colors.deepOrangeAccent), + borderRadius: BorderRadius.circular(15.0), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + jobSchedules[index]['jobTitle'], + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + ), + SizedBox(height: 8.0), + Text( + 'Description: ${jobSchedules[index]['jobDescription']}', + style: TextStyle(fontSize: 16.0, color: Colors.grey), + ), + SizedBox(height: 4.0), + Text( + 'Date: ${jobSchedules[index]['date']}', + style: TextStyle(fontSize: 16.0, color: Colors.grey), + ), + SizedBox(height: 4.0), + Text( + 'Time: ${jobSchedules[index]['time']}', + style: TextStyle(fontSize: 16.0, color: Colors.grey), + ), + ], + ), + ); + }, + ), + ); + } +} From 7d5befaf7480bbeecafeafdd3d539c884bb0cba9 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:52:00 +0530 Subject: [PATCH 34/45] Create resume_landing.dart --- .../student/create_resume/resume_landing.dart | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 lib/screens/Placement/student/create_resume/resume_landing.dart diff --git a/lib/screens/Placement/student/create_resume/resume_landing.dart b/lib/screens/Placement/student/create_resume/resume_landing.dart new file mode 100644 index 00000000..7271dabf --- /dev/null +++ b/lib/screens/Placement/student/create_resume/resume_landing.dart @@ -0,0 +1,60 @@ +import 'package:flutter/material.dart'; +import 'resume_model.dart'; +import 'package:fusion/screens/Placement/student/create_resume/resumeMakerPage.dart'; + +class ResumeLandingPage extends StatefulWidget { + @override + _ResumeLandingPageState createState() => _ResumeLandingPageState(); +} + +class _ResumeLandingPageState extends State { + List savedResumes = []; // Initial empty list of saved resumes + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Saved Resumes'), + backgroundColor: Colors.deepOrangeAccent, + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "Saved resumes:", + style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + ), + SizedBox(height: 20), + Expanded( + child: ListView.builder( + itemCount: savedResumes.length, + itemBuilder: (context, index) { + return ListTile( + title: Text(savedResumes[index].title!), + // Implement onTap to view the resume details + onTap: () { + // Handle tapping on a resume + // For example, navigate to a page to view resume details + }, + ); + }, + ), + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _createNewResume, + child: Icon(Icons.add), + backgroundColor: Colors.deepOrangeAccent, + ), + ); + } + + void _createNewResume() { + + Navigator.push(context, MaterialPageRoute(builder: (context) => ResumeMakerPage()));// Navigate to a page to create a new resume + + } +} From 496dea7287a1a4b6d9f6f7dd0009aad4fc5c5f3b Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:52:37 +0530 Subject: [PATCH 35/45] Add files via upload --- .../create_resume/resumeMakerPage.dart | 174 ++++++++++++++++++ .../student/create_resume/resume_model.dart | 63 +++++++ .../student/create_resume/template1Page.dart | 11 ++ 3 files changed, 248 insertions(+) create mode 100644 lib/screens/Placement/student/create_resume/resumeMakerPage.dart create mode 100644 lib/screens/Placement/student/create_resume/resume_model.dart create mode 100644 lib/screens/Placement/student/create_resume/template1Page.dart diff --git a/lib/screens/Placement/student/create_resume/resumeMakerPage.dart b/lib/screens/Placement/student/create_resume/resumeMakerPage.dart new file mode 100644 index 00000000..a59f5a3b --- /dev/null +++ b/lib/screens/Placement/student/create_resume/resumeMakerPage.dart @@ -0,0 +1,174 @@ +import 'dart:io'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show rootBundle; +import 'package:path_provider/path_provider.dart'; +import 'package:pdf/pdf.dart'; +import 'package:pdf/widgets.dart' as pw; +import 'resume_model.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/constants.dart'; +import 'package:syncfusion_flutter_pdf/pdf.dart'; +import 'resumeMakerPage.dart'; +import 'package:fusion/screens/Placement/student/create_resume/template1Page.dart'; + +class ResumeMakerPage extends StatefulWidget { + @override + _ResumeMakerPageState createState() => _ResumeMakerPageState(); +} + +class _ResumeMakerPageState extends State { + final TextEditingController _nameController = TextEditingController(); + final TextEditingController _cpiController = TextEditingController(); + final TextEditingController _emailController = TextEditingController(); + final TextEditingController _phoneController = TextEditingController(); + final TextEditingController _linkedinController = TextEditingController(); + final TextEditingController _githubController = TextEditingController(); + + final TextEditingController _workExperienceController = TextEditingController(); + final TextEditingController _skillsController = TextEditingController(); + final TextEditingController _projectTitleController = TextEditingController(); + final TextEditingController _projectDescriptionController = TextEditingController(); + final TextEditingController _projectLinkController = TextEditingController(); + final TextEditingController _codingPlatformNameController = TextEditingController(); + final TextEditingController _codingPlatformLinkController = TextEditingController(); + + List codingPlatformProfiles = []; + List educationBackground = []; + List projects = []; + List skills = []; + List workExperiences = []; + + Future _createPDF(Resume resume) async { + final fontData = await rootBundle.load('assets/helvetica.ttf'); + final helveticaFont = pw.Font.ttf(fontData.buffer.asByteData()); + + final pdf = pw.Document(); + + pdf.addPage( + pw.Page( + build: (pw.Context context) { + return pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.start, + children: [ + pw.Text('Name: ${resume.name}', style: pw.TextStyle(font: helveticaFont)), + pw.Text('CPI: ${resume.cpi}', style: pw.TextStyle(font: helveticaFont)), + pw.Text('Email: ${resume.email}', style: pw.TextStyle(font: helveticaFont)), + pw.Text('Phone: ${resume.phoneNumber}', style: pw.TextStyle(font: helveticaFont)), + pw.Text('LinkedIn ID: ${resume.linkedinId}', style: pw.TextStyle(font: helveticaFont)), + pw.Text('GitHub ID: ${resume.githubId}', style: pw.TextStyle(font: helveticaFont)), + // Add other resume fields here + ], + ); + }, + ), + ); + + final bytes = await pdf.save(); + await saveAndLaunchFile(bytes, 'resume.pdf'); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Add Information'), + backgroundColor: Colors.deepOrangeAccent, + ), + body: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text('Personal Information', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), + TextFormField( + controller: _nameController, + decoration: InputDecoration(labelText: 'Name'), + ), + TextFormField( + controller: _cpiController, + decoration: InputDecoration(labelText: 'CPI'), + keyboardType: TextInputType.number, + ), + TextFormField( + controller: _emailController, + decoration: InputDecoration(labelText: 'Email'), + keyboardType: TextInputType.emailAddress, + ), + TextFormField( + controller: _phoneController, + decoration: InputDecoration(labelText: 'Phone'), + keyboardType: TextInputType.phone, + ), + TextFormField( + controller: _linkedinController, + decoration: InputDecoration(labelText: 'LinkedIn ID'), + ), + TextFormField( + controller: _githubController, + decoration: InputDecoration(labelText: 'GitHub ID'), + ), + SizedBox(height: 20), + Text('Work Experience', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), + TextFormField( + controller: _workExperienceController, + decoration: InputDecoration(labelText: 'Work Experience'), + ), + SizedBox(height: 20), + Text('Skills', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), + TextFormField( + controller: _skillsController, + decoration: InputDecoration(labelText: 'Skills'), + ), + SizedBox(height: 20), + Text('Projects', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), + TextFormField( + controller: _projectTitleController, + decoration: InputDecoration(labelText: 'Project Title'), + ), + TextFormField( + controller: _projectDescriptionController, + decoration: InputDecoration(labelText: 'Project Description'), + ), + TextFormField( + controller: _projectLinkController, + decoration: InputDecoration(labelText: 'Project Link'), + ), + SizedBox(height: 20), + Text('Coding Platform Profiles', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), + TextFormField( + controller: _codingPlatformNameController, + decoration: InputDecoration(labelText: 'Platform Name'), + ), + TextFormField( + controller: _codingPlatformLinkController, + decoration: InputDecoration(labelText: 'Profile Link'), + ), + SizedBox(height: 20), + ElevatedButton( + onPressed: () async { + Resume resume = Resume( + name: _nameController.text, + cpi: double.tryParse(_cpiController.text) ?? 0.0, + email: _emailController.text, + phoneNumber: _phoneController.text, + linkedinId: _linkedinController.text, + githubId: _githubController.text, + codingPlatformProfiles: codingPlatformProfiles, + educationBackground: educationBackground, + projects: projects, + skills: skills, + workExperiences: workExperiences, + ); + + await _createPDF(resume); + }, + child: Text('Submit'), + ), + ], + ), + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/Placement/student/create_resume/resume_model.dart b/lib/screens/Placement/student/create_resume/resume_model.dart new file mode 100644 index 00000000..d46f8951 --- /dev/null +++ b/lib/screens/Placement/student/create_resume/resume_model.dart @@ -0,0 +1,63 @@ +class Resume { + String? title; + String? name; + double? cpi; + String? email; + String? phoneNumber; + String? linkedinId; + String? githubId; + List codingPlatformProfiles; + List educationBackground; + List projects; + List skills; + List workExperiences; + + Resume({ + this.title, + this.name, + this.cpi, + this.email, + this.phoneNumber, + this.linkedinId, + this.githubId, + this.codingPlatformProfiles = const [], + this.educationBackground = const [], + this.projects = const [], + this.skills = const [], + this.workExperiences = const [], + }); +} + +class CodingPlatformProfile { + String? platformName; + String? profileLink; + + CodingPlatformProfile({this.platformName, this.profileLink}); +} + +class Education { + DateTime? startDate; + DateTime? endDate; + String? institution; + String? degree; + + Education({this.startDate, this.endDate, this.institution, this.degree}); +} + +class Project { + String? title; + String? description; + String? link; + + Project({this.title, this.description, this.link}); +} + +class WorkExperience { + DateTime? startDate; + DateTime? endDate; + String? companyName; + String? position; + + WorkExperience( + {this.startDate, this.endDate, this.companyName, this.position}); +} diff --git a/lib/screens/Placement/student/create_resume/template1Page.dart b/lib/screens/Placement/student/create_resume/template1Page.dart new file mode 100644 index 00000000..3fa5638f --- /dev/null +++ b/lib/screens/Placement/student/create_resume/template1Page.dart @@ -0,0 +1,11 @@ +import 'package:flutter/material.dart'; +import 'package:open_file/open_file.dart'; +import 'package:path_provider/path_provider.dart'; +import 'dart:io'; + +Future saveAndLaunchFile(List bytes, String fileName) async { + final path = (await getExternalStorageDirectory())?.path; + final file = File('$path/$fileName'); + await file.writeAsBytes(bytes, flush: true); + OpenFile.open('$path/$fileName'); +} \ No newline at end of file From bc92385f73f7af4cfaf105514e637ee09934f8b2 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:53:58 +0530 Subject: [PATCH 36/45] Add files via upload --- lib/screens/Placement/chairman/schedule.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/screens/Placement/chairman/schedule.dart diff --git a/lib/screens/Placement/chairman/schedule.dart b/lib/screens/Placement/chairman/schedule.dart new file mode 100644 index 00000000..e69de29b From 4218c7d3596dcbac69856252c0e1bf04104f32e5 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:55:37 +0530 Subject: [PATCH 37/45] Add files via upload --- lib/screens/Placement/tpo/add_company.dart | 313 ++++++++++++++++++ lib/screens/Placement/tpo/alumni_data.dart | 174 ++++++++++ .../Placement/tpo/filter_students.dart | 194 +++++++++++ .../Placement/tpo/placement_charts.dart | 59 ++++ .../Placement/tpo/placement_record.dart | 270 +++++++++++++++ .../Placement/tpo/placement_schedule.dart | 239 +++++++++++++ .../Placement/tpo/placement_statistics.dart | 99 ++++++ lib/screens/Placement/tpo/tpo_sidebar.dart | 109 ++++++ 8 files changed, 1457 insertions(+) create mode 100644 lib/screens/Placement/tpo/add_company.dart create mode 100644 lib/screens/Placement/tpo/alumni_data.dart create mode 100644 lib/screens/Placement/tpo/filter_students.dart create mode 100644 lib/screens/Placement/tpo/placement_charts.dart create mode 100644 lib/screens/Placement/tpo/placement_record.dart create mode 100644 lib/screens/Placement/tpo/placement_schedule.dart create mode 100644 lib/screens/Placement/tpo/placement_statistics.dart create mode 100644 lib/screens/Placement/tpo/tpo_sidebar.dart diff --git a/lib/screens/Placement/tpo/add_company.dart b/lib/screens/Placement/tpo/add_company.dart new file mode 100644 index 00000000..997c2be7 --- /dev/null +++ b/lib/screens/Placement/tpo/add_company.dart @@ -0,0 +1,313 @@ +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class AddCompany extends StatefulWidget { + @override + _AddCompanyState createState() => _AddCompanyState(); +} + +class _AddCompanyState extends State { + final _formKey = GlobalKey(); + String _companyName = ""; + String _placementType = ""; + List _rolesOffered = []; + int _ctc = 0; + String _jobDescription = ""; + DateTime _dateOfVisit = DateTime.now(); + DateTime _deadlineToApply = DateTime.now(); + final List> _companyList = []; + + void _previewCompanyDetails() { + if (_formKey.currentState!.validate()) { + _formKey.currentState!.save(); + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text('Company Details'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text('Company Name: $_companyName'), + Text('Placement Type: $_placementType'), + Text('Roles Offered: ${_rolesOffered.join(", ")}'), + Text('CTC: $_ctc'), + Text('Job Description: $_jobDescription'), + Text('Date of Visit: ${DateFormat('yyyy-MM-dd').format(_dateOfVisit)}'), + Text('Deadline to Apply: ${DateFormat('yyyy-MM-dd').format(_deadlineToApply)}'), + ], + ), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: Text('Cancel'), + ), + TextButton( + onPressed: () { + _companyList.add({ + 'companyName': _companyName, + 'placementType': _placementType, + 'rolesOffered': _rolesOffered, + 'ctc': _ctc, + 'jobDescription': _jobDescription, + 'dateOfVisit': _dateOfVisit, + 'deadlineToApply': _deadlineToApply, + }); + _formKey.currentState!.reset(); + Navigator.pop(context); + }, + child: Text('Save'), + ), + ], + ); + }, + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Company Details'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: Sidebar(), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + Form( + key: _formKey, + child: Column( + children: [ + TextFormField( + decoration: InputDecoration(labelText: 'Company Name'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter a company name'; + } + return null; + }, + onSaved: (value) => _companyName = value!, + ), + TextFormField( + decoration: InputDecoration(labelText: 'Placement Type'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter whether its intern or full time job'; + } + return null; + }, + onSaved: (value)=> _placementType = value!, + ), + TextFormField( + decoration: InputDecoration(labelText: 'Roles Offered'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter roles offered'; + } + return null; + }, + onSaved: (value) => _rolesOffered = value!.split(','), + ), + TextFormField( + decoration: InputDecoration(labelText: 'CTC'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter CTC'; + } + if (int.tryParse(value) == null) { + return 'CTC must be a valid integer'; + } + return null; + }, + onSaved: (value) => _ctc = int.parse(value!), + ), + TextFormField( + decoration: InputDecoration(labelText: 'Job Description'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter job description'; + } + return null; + }, + onSaved: (value) => _jobDescription = value!, + ), + Row( + children: [ + Expanded( + child: Column( + children: [ + Text('Date of Visit'), + SizedBox(height: 8), + Container( + width: double.infinity, + child: ElevatedButton( + onPressed: () async { + final DateTime? picked = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(2000), + lastDate: DateTime(2025), + ); + if (picked != null && picked != _dateOfVisit) { + setState(() { + _dateOfVisit = picked; + }); + } + }, + child: Text( + _dateOfVisit == null + ? 'Pick a date' + : DateFormat('yyyy-MM-dd').format( + _dateOfVisit), + ), + ), + ), + ], + ), + ), + SizedBox(width: 16), + Expanded( + child: Column( + children: [ + Text('Deadline to Apply'), + SizedBox(height: 8), + Container( + width: double.infinity, + child: ElevatedButton( + onPressed: () async { + final DateTime? picked = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(2000), + lastDate: DateTime(2025), + ); + if (picked != null && + picked != _deadlineToApply) { + setState(() { + _deadlineToApply = picked!; + }); + } + }, + child: Text( + _deadlineToApply == null + ? 'Pick a date and time' + : DateFormat('yyyy-MM-dd') + .format(_deadlineToApply), + ), + ), + ), + ], + ), + ), + ], + ), + ], + ), + ), + SizedBox(height: 16), + Expanded( + child: ListView.builder( + itemCount: _companyList.length, + itemBuilder: (context, index) { + final company = _companyList[index]; + return Dismissible( + key: Key(company['companyName']), + onDismissed: (direction) { + setState(() { + _companyList.removeAt(index); + }); + }, + child: ListTile( + title: Text(company['companyName']), + subtitle: Text(company['placementType']), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CompanyDetailsPage( + company: company, + ), + ), + ); + }, + ), + ); + }, + ), + ), + SizedBox(height: 16), + ElevatedButton( + onPressed: _previewCompanyDetails, + child: Text('Preview'), + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: () { + if (_formKey.currentState!.validate()) { + _formKey.currentState!.save(); + _companyList.add({ + 'companyName': _companyName, + 'placementType': _placementType, + 'rolesOffered': _rolesOffered, + 'ctc': _ctc, + 'jobDescription': _jobDescription, + 'dateOfVisit': _dateOfVisit, + 'deadlineToApply': _deadlineToApply, + }); + _formKey.currentState!.reset(); + } + }, + child: Icon(Icons.add), + ), + ); + } +} +class CompanyDetailsPage extends StatelessWidget { + final Map company; + + CompanyDetailsPage({Key? key, required this.company}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(company['companyName']), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Placement Type: ${company['placementType']}'), + SizedBox(height: 8), + Text('Roles Offered: ${company['rolesOffered'].join(', ')}'), + SizedBox(height: 8), + Text('CTC: ${company['ctc']}'), + SizedBox(height: 8), + Text('Job Description: ${company['jobDescription']}'), + SizedBox(height: 8), + Text('Date of Visit: ${DateFormat('yyyy-MM-dd').format(company['dateOfVisit'])}'), + SizedBox(height: 8), + Text('Deadline to Apply: ${DateFormat('yyyy-MM-dd HH:mm').format(company['deadlineToApply'])}'), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: () { + Navigator.pop(context); + }, + child: Icon(Icons.edit), + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/alumni_data.dart b/lib/screens/Placement/tpo/alumni_data.dart new file mode 100644 index 00000000..1f94c8d4 --- /dev/null +++ b/lib/screens/Placement/tpo/alumni_data.dart @@ -0,0 +1,174 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class AlumniData extends StatefulWidget { + @override + State createState() => AlumniDataState(); +} + +class Student { + final String name; + final int year; + + Student({required this.name, required this.year}); +} + +class AlumniDataState extends State { + //String _value = 'Alumni Data'; + // var _currentSelectedValue; + + String tab1 = 'Placement'; + + String tab2 = 'PBI'; + + String tab3 = 'Higher Studies'; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title:const Text('Alumni Data'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: Sidebar(), + body: DefaultTabController( + length: 3, + child: Scaffold( + body: SafeArea( + child: TabBarView( + children: [ + SingleChildScrollView(child: PlacementTab()), + PlacementTab1(), + PlacementTab1(), + ], + ), + ), + appBar: AppBar( + bottom: TabBar( + labelColor: Colors.black, + isScrollable: true, + labelStyle: TextStyle(fontSize: 20.0), + tabs: [Tab(text: tab1), Tab(text: tab2), Tab(text: tab3)]), + ), + ), + ), + ); + } +} + +class PlacementTab extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row( + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(10, 30, 0, 0), + child: Text( + 'Search a Student!', + style: TextStyle(fontSize: 20), + ), + ), + ], + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: TextField( + textAlign: TextAlign.center, + decoration: InputDecoration( + labelStyle: TextStyle(color: Colors.grey), + border: OutlineInputBorder(), + labelText: 'Student Name', + ), + ), + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: TextField( + textAlign: TextAlign.center, + decoration: InputDecoration( + labelStyle: TextStyle(color: Colors.grey), + border: OutlineInputBorder(), + labelText: 'Year', + ), + ), + ), + ElevatedButton.icon( + style: ButtonStyle( + foregroundColor: MaterialStatePropertyAll(Colors.white), + backgroundColor: MaterialStatePropertyAll(Colors.blue), + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5.0), + side: BorderSide(color: Colors.blue)))), + onPressed: () { + print('Search Pressed'); + }, + icon: Icon(Icons.arrow_right), + label: Text('Search'), + ) + ], + ); + } +} + +class PlacementTab1 extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row( + children: [ + Padding( + padding:const EdgeInsets.fromLTRB(10, 30, 0, 0), + child: Text( + 'Search a Student!', + style: TextStyle(fontSize: 20), + ), + ), + ], + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: TextField( + textAlign: TextAlign.center, + decoration: InputDecoration( + labelStyle: TextStyle(color: Colors.grey), + border: OutlineInputBorder(), + labelText: 'Student Name', + ), + ), + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: TextField( + textAlign: TextAlign.center, + decoration: InputDecoration( + labelStyle: TextStyle(color: Colors.grey), + border: OutlineInputBorder(), + labelText: 'Year', + ), + ), + ), + ElevatedButton.icon( + style: ButtonStyle( + foregroundColor: MaterialStatePropertyAll(Colors.white), + backgroundColor: MaterialStatePropertyAll(Colors.blue), + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5.0), + side: BorderSide(color: Colors.blue)))), + onPressed: () { + Navigator.pushNamed(context, '/add_placement_record'); + print('Search Pressed'); + }, + icon: Icon(Icons.arrow_right), + label: Text('Search'), + ) + ], + ); + } +} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/filter_students.dart b/lib/screens/Placement/tpo/filter_students.dart new file mode 100644 index 00000000..b230770c --- /dev/null +++ b/lib/screens/Placement/tpo/filter_students.dart @@ -0,0 +1,194 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class Student { + final String name; + final String rollNumber; + final double cpi; + final String gender; + final String branch; + final String batch; + + Student({ + required this.name, + required this.rollNumber, + required this.cpi, + required this.gender, + required this.branch, + required this.batch, + }); +} + +class FilterStudents extends StatefulWidget { + final List students = [ + Student(name:'Jayanth Prajapati', rollNumber:'20bcs137', batch:'2020', branch:'CSE', gender:'Male', cpi:8.5), + Student(name:'Jahnavi Kaushal', rollNumber:'22bec234', batch:'2022', branch:'ECE', gender:'Female', cpi:9.0), + Student(name:'Deekshith Ranjan', rollNumber:'21bcs104', batch:'2021', branch:'CSE', gender:'Male', cpi:7.5), + Student(name:'Ankita Dvivedhi', rollNumber:'23bme034', batch:'2023', branch:'ME', gender:'Female', cpi:8.0), + Student(name:'Anand', rollNumber:'21bcs001', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), + Student(name:'Roopa', rollNumber:'21bcs002', batch:'2021', branch:'CSE', gender:'Female', cpi:8.5), + Student(name:'Arjun', rollNumber:'21bcs003', batch:'2021', branch:'CSE', gender:'Male', cpi:8.5), + Student(name:'Abhi', rollNumber:'23bcs002', batch:'2023', branch:'CSE', gender:'Male', cpi:8.2), + Student(name:'Ram', rollNumber:'21bcs141', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), + Student(name:'Vishnu Mishra', rollNumber:'21bcs165', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), + Student(name:'Sita', rollNumber:'22bcs216', batch:'2022', branch:'CSE', gender:'Female', cpi:7.5), + Student(name:'Vishnu Rajput', rollNumber:'22bcs165', batch:'2022', branch:'CSE', gender:'Male', cpi:8.1), + Student(name:'Bruhath', rollNumber:'21bcs149', batch:'2021', branch:'CSE', gender:'Male', cpi:8.1), + Student(name:'Ananya Patel', rollNumber:'21bcs150', batch:'2021', branch:'CSE', gender:'Female', cpi:9.2), + Student(name:'Arnav Gupta', rollNumber:'21bcs151', batch:'2021', branch:'CSE', gender:'Male', cpi:8.7), + Student(name:'Khushi Kumari', rollNumber:'22bcs152', batch:'2022', branch:'CSE', gender:'Female', cpi:8.5), + Student(name:'Sahil Singh', rollNumber:'22bcs153', batch:'2022', branch:'CSE', gender:'Male', cpi:7.9), + Student(name:'Neha Shah', rollNumber:'23bcs154', batch:'2023', branch:'CSE', gender:'Female', cpi:9.0), + Student(name:'Aryan Reddy', rollNumber:'23bcs155', batch:'2023', branch:'CSE', gender:'Male', cpi:8.3), + Student(name:'Deepika Singh', rollNumber:'21bec156', batch:'2021', branch:'ECE', gender:'Female', cpi:8.1), + Student(name:'Aruna Sharma', rollNumber:'21bec157', batch:'2021', branch:'ECE', gender:'Female', cpi:7.5), + Student(name:'Rohan Patel', rollNumber:'22bec158', batch:'2022', branch:'ECE', gender:'Male', cpi:8.8), + Student(name:'Ananya Das', rollNumber:'22bec159', batch:'2022', branch:'ECE', gender:'Female', cpi:8.2), + Student(name:'Neha Rao', rollNumber:'23bec160', batch:'2023', branch:'ECE', gender:'Female', cpi:8.7), + Student(name:'Arnav Patel', rollNumber:'23bec161', batch:'2023', branch:'ECE', gender:'Male', cpi:8.6), + Student(name:'Khushi Gupta', rollNumber:'21bme162', batch:'2021', branch:'ME', gender:'Female', cpi:8.0), + Student(name:'Aryan Kumar', rollNumber:'21bme163', batch:'2021', branch:'ME', gender:'Male', cpi:7.8), + Student(name:'Sahil Rao', rollNumber:'22bme164', batch:'2022', branch:'ME', gender:'Male', cpi:8.4), + Student(name:'Ananya Mishra', rollNumber:'22bme165', batch:'2022', branch:'ME', gender:'Female', cpi:7.9), + Student(name:'Arnav Iyer', rollNumber:'23bme166', batch:'2023', branch:'ME', gender:'Male', cpi:8.2), + Student(name:'Khushi Singh', rollNumber:'23bme167', batch:'2023', branch:'ME', gender:'Female', cpi:8.3), + Student(name:'Aditya Rao', rollNumber:'21bsm168', batch:'2021', branch:'SM', gender:'Male', cpi:8.2), + Student(name:'Arun Mehra', rollNumber:'21bsm169', batch:'2021', branch:'SM', gender:'Male', cpi:7.6), + Student(name:'Rajesh Chauhan', rollNumber:'22bsm170', batch:'2022', branch:'SM', gender:'Male', cpi:8.9), + Student(name:'Karthik Menon', rollNumber:'22bsm171', batch:'2022', branch:'SM', gender:'Male', cpi:8.1), + Student(name:'Priya Sharma', rollNumber:'23bsm172', batch:'2023', branch:'SM', gender:'Female', cpi:8.5), + Student(name:'Meera Reddy', rollNumber:'23bsm173', batch:'2023', branch:'SM', gender:'Female', cpi:8.4), + Student(name:'Ananya Tiwari', rollNumber:'20bcs174', batch:'2020', branch:'CSE', gender:'Female', cpi:8.6), + Student(name:'Arnav Reddy', rollNumber:'20bcs175', batch:'2020', branch:'CSE', gender:'Male', cpi:8.2), + Student(name:'Khushi Mehta', rollNumber:'20bec176', batch:'2020', branch:'ECE', gender:'Female', cpi:8.4), + Student(name:'Sahil Tiwari', rollNumber:'20bec177', batch:'2020', branch:'ECE', gender:'Male', cpi:8.0), + Student(name:'Neha Reddy', rollNumber:'20bme178', batch:'2020', branch:'ME', gender:'Female', cpi:8.3), + Student(name:'Aryan Mehta', rollNumber:'20bme179', batch:'2020', branch:'ME', gender:'Male', cpi:7.9), + Student(name:'Deepika Tiwari', rollNumber:'20bsm180', batch:'2020', branch:'SM', gender:'Female', cpi:8.1), + Student(name:'Arun Reddy', rollNumber:'20bsm181', batch:'2020', branch:'SM', gender:'Male', cpi:8.5) + ]; + + @override + _FilterStudentsState createState() => _FilterStudentsState(); +} + +class _FilterStudentsState extends State { + double minCpi = 7.0; + String selectedGender = "All"; + String selectedBranch = "All"; + String selectedBatch = "All"; + List filteredStudents = []; + + @override + void initState() { + super.initState(); + filteredStudents = widget.students; // Initially show all students + } + + void applyFilters() { + setState(() { + filteredStudents = widget.students.where((student) => + student.cpi >= minCpi && + (selectedGender == "All" || student.gender == selectedGender) && + (selectedBranch == "All" || student.branch == selectedBranch) && + (selectedBatch == "All" || student.batch == selectedBatch) + ).toList(); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text("Filter Students"), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: Sidebar(), + body: SingleChildScrollView( + padding: EdgeInsets.all(20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Minimum CPI : '), + ), + Slider( + value: minCpi, + min: 7.0, + max: 10.0, + divisions: 6, + label: "Minimum CPI: ${minCpi.toStringAsFixed(1)}", + onChanged: (value) => setState(() => minCpi = value), + ), + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Select Gender : '), + ), + DropdownButton( + value: selectedGender, + items: [ + DropdownMenuItem(value: "All", child: Text("All")), + DropdownMenuItem(value: "Male", child: Text("Male")), + DropdownMenuItem(value: "Female", child: Text("Female")), + DropdownMenuItem(value: "Other", child: Text("Other")), + ], + onChanged: (value) => setState(() => selectedGender = value!), + ), + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Select Branch : '), + ), + DropdownButton( + value: selectedBranch, + items: [ + DropdownMenuItem(value: "All", child: Text("All")), + DropdownMenuItem(value: "CSE", child: Text("CSE")), + DropdownMenuItem(value: "ECE", child: Text("ECE")), + DropdownMenuItem(value: "ME", child: Text("ME")), + DropdownMenuItem(value: "SM", child: Text("SM")), + ], + onChanged: (value) => setState(() => selectedBranch = value!), + ), + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Select Batch : '), + ), + DropdownButton( + value: selectedBatch, + items: [ + DropdownMenuItem(value: "All", child: Text("All")), + DropdownMenuItem(value: "2020", child: Text("2020")), + DropdownMenuItem(value: "2021", child: Text("2021")), + DropdownMenuItem(value: "2022", child: Text("2022")), + DropdownMenuItem(value: "2023", child: Text("2023")), + ], + onChanged: (value) => setState(() => selectedBatch = value!), + ), + SizedBox(height: 16.0), + ElevatedButton( + onPressed: applyFilters, + child: Text("Apply Filters"), + ), + SizedBox(height: 20.0), + filteredStudents.isEmpty + ? Text("No students found matching your criteria.") + : ListView.builder( + shrinkWrap: true, + itemCount: filteredStudents.length, + itemBuilder: (context, index) { + final student = filteredStudents[index]; + return ListTile( + title: Text(student.name), + subtitle: Text(student.rollNumber), + ); + }, + ), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/placement_charts.dart b/lib/screens/Placement/tpo/placement_charts.dart new file mode 100644 index 00000000..2b5070d4 --- /dev/null +++ b/lib/screens/Placement/tpo/placement_charts.dart @@ -0,0 +1,59 @@ +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +class PlacementData { + final String branch; + final int placements; + final charts.Color barColor; + PlacementData( + {required this.branch, required this.placements, required this.barColor}); +} + +class PlacementCharts extends StatelessWidget { + final List data; + + PlacementCharts({required this.data}); + @override + Widget build(BuildContext context) { + List> series = [ + charts.Series( + id: "developers", + data: data, + domainFn: (PlacementData series, _) => series.branch, + measureFn: (PlacementData series, _) => series.placements, + colorFn: (PlacementData series, _) => series.barColor, + labelAccessorFn: (PlacementData series, _) => series.branch, + ) + ]; + + return Container( + height: 600, + padding: EdgeInsets.all(25), + child: Card( + child: Padding( + padding: const EdgeInsets.all(9.0), + child: Column( + children: [ + AppBar( + title: Text('Placements for the batch : '), + surfaceTintColor: Colors.yellowAccent, + ), + Expanded( + child: charts.PieChart(series, + animate: true, + defaultRenderer: charts.ArcRendererConfig( + arcRendererDecorators: [ + charts.ArcLabelDecorator( + labelPosition: charts.ArcLabelPosition.inside) + ])), + ), + Expanded( + child: charts.BarChart(series, animate: true), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/Placement/tpo/placement_record.dart b/lib/screens/Placement/tpo/placement_record.dart new file mode 100644 index 00000000..af849b6e --- /dev/null +++ b/lib/screens/Placement/tpo/placement_record.dart @@ -0,0 +1,270 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class PlacementRecord extends StatefulWidget { + @override + _AddStudentState createState() => _AddStudentState(); +} + +class _AddStudentState extends State { + final _formKey = GlobalKey(); + String _rollNumber = ""; + String _studentName = ""; + String _placementType = ""; + double _cpi = 0; + int _ctc = 0; + int _year = 0; + String _organizationName = ""; + final List> _studentList = []; + + void _previewStudentDetails() { + if (_formKey.currentState!.validate()) { + _formKey.currentState!.save(); + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text('Student Details'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text('Roll Number: $_rollNumber'), + Text('Student Name: $_studentName'), + Text('Placement Type: $_placementType'), + Text('CPI: $_cpi'), + Text('CTC: $_ctc'), + Text('Year: $_year'), + Text('Organization Name: $_organizationName'), + ], + ), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: Text('Cancel'), + ), + TextButton( + onPressed: () { + _studentList.add({ + 'rollNumber': _rollNumber, + 'studentName': _studentName, + 'placementType': _placementType, + 'CPI': _cpi, + 'CTC': _ctc, + 'year': _year, + 'organizationName': _organizationName, + }); + _formKey.currentState!.reset(); + Navigator.pop(context); + }, + child: Text('Save'), + ), + ], + ); + }, + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Student Details'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: Sidebar(), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + children: [ + Form( + key: _formKey, + child: Column( + children: [ + TextFormField( + decoration: InputDecoration(labelText: 'Roll Number'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter the roll number of the student'; + } + return null; + }, + onSaved: (value) => _rollNumber = value!, + ), + TextFormField( + decoration: InputDecoration(labelText: 'Student Name'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter the student name'; + } + return null; + }, + onSaved: (value) => _studentName = value!, + ), + TextFormField( + decoration: InputDecoration(labelText: 'Placement Type'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter whether its a job or higher studies or PBI'; + } + return null; + }, + onSaved: (value) => _placementType = value!, + ), + TextFormField( + decoration: InputDecoration(labelText: 'CPI'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter CPI'; + } + if (double.tryParse(value) == null) { + return 'CTC must be a valid integer'; + } + return null; + }, + onSaved: (value) => _cpi = double.parse(value!), + ), + TextFormField( + decoration: InputDecoration(labelText: 'CTC'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter CTC'; + } + if (int.tryParse(value) == null) { + return 'CTC must be a valid integer'; + } + return null; + }, + onSaved: (value) => _ctc = int.parse(value!), + ), + TextFormField( + decoration: InputDecoration(labelText: 'Year'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter year'; + } + if (int.tryParse(value) == null) { + return 'CTC must be a valid integer'; + } + return null; + }, + onSaved: (value) => _year = int.parse(value!), + ), + TextFormField( + decoration: InputDecoration(labelText: 'Organization Name'), + validator: (value) { + if (value == null || value.isEmpty) { + return 'Please enter organization name'; + } + return null; + }, + onSaved: (value) => _organizationName = value!, + ), + ], + ), + ), + SizedBox(height: 16), + Expanded( + child: ListView.builder( + itemCount: _studentList.length, + itemBuilder: (context, index) { + final student = _studentList[index]; + return Dismissible( + key: Key(student['rollNumber']), + onDismissed: (direction) { + setState(() { + _studentList.removeAt(index); + }); + }, + child: ListTile( + title: Text(student['studentName']), + subtitle: Text(student['rollNumber']), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => StudentDetailsPage( + student: student, + ), + ), + ); + }, + ), + ); + }, + ), + ), + SizedBox(height: 16), + ElevatedButton( + onPressed: _previewStudentDetails, + child: Text('Preview'), + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: () { + if (_formKey.currentState!.validate()) { + _formKey.currentState!.save(); + _studentList.add({ + 'rollNumber': _rollNumber, + 'studentName': _studentName, + 'placementType': _placementType, + 'CPI': _cpi, + 'CTC': _ctc, + 'year': _year, + 'organizationName': _organizationName, + }); + _formKey.currentState!.reset(); + } + }, + child: Icon(Icons.add), + ), + ); + } +} + +class StudentDetailsPage extends StatelessWidget { + final Map student; + + StudentDetailsPage({Key? key, required this.student}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(student['rollNumber']), + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Placement Type: ${student['placementType']}'), + SizedBox(height: 8), + Text('Student Name: ${student['studentName']}'), + SizedBox(height: 8), + Text('CTC: ${student['ctc']}'), + SizedBox(height: 8), + Text('CPI: ${student['cpi']}'), + SizedBox(height: 8), + Text('Year: ${student['year']}'), + SizedBox(height: 8), + Text('Organization Name: ${student['organizationName']}'), + SizedBox(height: 8), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: () { + Navigator.pop(context); + }, + child: Icon(Icons.edit), + ), + ); + } +} diff --git a/lib/screens/Placement/tpo/placement_schedule.dart b/lib/screens/Placement/tpo/placement_schedule.dart new file mode 100644 index 00000000..7904eee1 --- /dev/null +++ b/lib/screens/Placement/tpo/placement_schedule.dart @@ -0,0 +1,239 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class PlacementSchedule extends StatefulWidget { + @override + _PlacementScheduleState createState() => _PlacementScheduleState(); +} +class Note { + final int id; + final String title; + final String content; + + Note({required this.id, required this.title, required this.content}); +} +class NotesProvider { + List _notes = [ + Note( + id: 1, + title: '25/04/2024-01/05/2024', + content: 'Mock interviews as part of PDC classes.\nVenue:Placement Cell, DSA.\nTime:9am - 1pm(Mor),2pm-6pm(Even).\n\nCSE 2021 - 25/04/2024 & 26/04/2024.\nECE 2021 - 27/04/2024.\nME 2021 - 28/04/2024.\nSM 2021 - 29/04/2024.\nDES 2021 - 30/04/2024.\nMTech 2021 - 01/05/2024.\nPhD 2021 - 01/05/2024.', + ), + + Note( + id: 2, + title: '27/04/2024', + content: 'Workshop by PostMan.\nVenue : L103, Audi.\nTime:10am.', + ), + ]; + int _nextId = 1; + + List get notes => _notes; + + int get nextId => _nextId; + + void addNote(String title, String content) { + final note = Note(id: _nextId, title: title, content: content); + _notes.add(note); + _nextId++; + } + + void updateNote(Note note, String title, String content) { + final updatedNote = Note( + id: note.id, + title: title, + content: content, + ); + final index = _notes.indexWhere((n) => n.id == note.id); + if (index != -1) { + _notes[index] = updatedNote; + } + } + + void deleteNote(Note note) { + _notes.remove(note); + } +} + +class _PlacementScheduleState extends State { + final _notesProvider = NotesProvider(); + final _titleController = TextEditingController(); + final _contentController = TextEditingController(); + Note? _editingNote; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Placement Schedule'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer:Sidebar(), + body: ListView.builder( + itemCount: _notesProvider.notes.length, + itemBuilder: (context, index) { + final note = _notesProvider.notes[index]; + return ListTile( + leading: Icon(Icons.schedule_sharp), + title: Text(note.title), + subtitle: Text(note.content), + trailing: Row( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + icon: Icon(Icons.edit), + onPressed: () { + setState(() { + _editingNote = note; + _titleController.text = note.title; + _contentController.text = note.content; + }); + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text(_editingNote == null ? 'Add Note' : 'Edit Note'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + TextField( + controller: _titleController, + decoration: InputDecoration(hintText: 'Date'), + ), + TextField( + controller: _contentController, + decoration: InputDecoration(hintText: 'Details of the event, time and venue if required'), + maxLines: null, + ), + ], + ), + actions: [ + TextButton( + child: Text('Cancel'), + onPressed: () { + Navigator.pop(context); + }, + ), + TextButton( + child: Text(_editingNote == null ? 'Add' : 'Save'), + onPressed: () { + final title = _titleController.text; + final content = _contentController.text; + if (title.isNotEmpty && content.isNotEmpty) { + if (_editingNote == null) { + _notesProvider.addNote(title, content); + } else { + _notesProvider.updateNote(_editingNote!, title, content); + } + Navigator.pop(context); + setState(() {}); + } + }, + ), + ], + ); + }, + ); + }, + ), + + IconButton( + icon: Icon(Icons.delete), + onPressed: () { + _notesProvider.deleteNote(note); + setState(() {}); + }, + ), + ], + ), + ); + }, + ), + floatingActionButton: FloatingActionButton( + child: Icon(Icons.add), + onPressed: () { + setState(() { + _editingNote = null; + _titleController.clear(); + _contentController.clear(); + }); + showDialog( + context: context, + builder: (context) { + return AlertDialog( + title: Text('Add Schedule'), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + TextField( + controller: _titleController, + decoration: InputDecoration(hintText: 'Date'), + ), + TextField( + controller: _contentController, + decoration: InputDecoration(hintText: 'Details of the event, time and venue if required'), + maxLines: null, + ), + ], + ), + actions: [ + TextButton( + child: Text('Cancel'), + onPressed: () { + Navigator.pop(context); + }, + ), + TextButton( + + child: Text('Add'), + + onPressed: () { + + final title = _titleController.text; + + final content = _contentController.text; + + if (title.isNotEmpty && content.isNotEmpty) { + + final note = Note( + + id: _notesProvider.nextId, + + title: title, + + content: content, + + ); + + _notesProvider.addNote(title, content); + + Navigator.pop(context); + + setState(() {}); + + } + + }, + + ), + + ], + + ); + + }, + + ); + + }, + + ), + + ); + + } + +} + diff --git a/lib/screens/Placement/tpo/placement_statistics.dart b/lib/screens/Placement/tpo/placement_statistics.dart new file mode 100644 index 00000000..25dc32e3 --- /dev/null +++ b/lib/screens/Placement/tpo/placement_statistics.dart @@ -0,0 +1,99 @@ +import 'dart:math'; +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:fusion/screens/Placement/tpo/placement_charts.dart'; +import 'package:fusion/constants.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_sidebar.dart'; + +class PlacementStatistics extends StatefulWidget { + @override + State createState() => _PlacementStatisticsState(); +} + +class _PlacementStatisticsState extends State { + int _graphValue = 2011; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Placement Statistics'), + backgroundColor: kPrimaryColor, + foregroundColor: Colors.white, + ), + drawer: Sidebar(), + body: Column( + children: [ + Row( + children: [ + Padding( + padding: const EdgeInsets.all(20.0), + child: Text('Select Year '), + ), + DropdownButton( + value: _graphValue, + items: >[ + for (int year = 2010; year <= 2023; year++) + DropdownMenuItem( + value: year, + child: Text('$year'), + ), + ], + onChanged: (int? value) => + setState(() => _graphValue = value!), + ), + ], + ), + Expanded(child: _buildGraph()), + ], + ), + ); + } + + Widget _buildGraph() { + switch (_graphValue) { + case 2011: + return EmptyGraphs(); + default: + return StatsCharts(year: _graphValue); + } + } +} + +class EmptyGraphs extends StatelessWidget { + @override + Widget build(BuildContext context) { + return SizedBox.shrink(); + } +} + +class StatsCharts extends StatelessWidget { + final int year; + + StatsCharts({Key? key, required this.year}) : super(key: key); + + final Random rnd = new Random(); + late List data = [ + PlacementData( + branch: 'CSE', + placements:rnd.nextInt(250), + barColor: charts.ColorUtil.fromDartColor(Colors.deepPurpleAccent)), + PlacementData( + branch: 'ECE', + placements: rnd.nextInt(120), + barColor: charts.ColorUtil.fromDartColor(Colors.orangeAccent)), + PlacementData( + branch: 'ME', + placements: rnd.nextInt(90), + barColor: charts.ColorUtil.fromDartColor(Colors.tealAccent)), + PlacementData( + branch: 'SM', + placements: rnd.nextInt(90), + barColor: charts.ColorUtil.fromDartColor(Colors.indigoAccent)), + ]; + + @override + Widget build(BuildContext context) { + return PlacementCharts(data: data); + } +} \ No newline at end of file diff --git a/lib/screens/Placement/tpo/tpo_sidebar.dart b/lib/screens/Placement/tpo/tpo_sidebar.dart new file mode 100644 index 00000000..5c6f7fc6 --- /dev/null +++ b/lib/screens/Placement/tpo/tpo_sidebar.dart @@ -0,0 +1,109 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/screens/Placement/tpo/filter_students.dart'; +import 'package:fusion/screens/Placement/tpo/placement_record.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_home.dart'; +import 'package:fusion/screens/Placement/tpo/alumni_data.dart'; +import 'package:fusion/screens/Placement/tpo/placement_schedule.dart'; +import 'package:fusion/screens/Placement/tpo/placement_statistics.dart'; +import 'package:fusion/screens/Placement/tpo/add_company.dart'; + +class Sidebar extends StatelessWidget { + const Sidebar({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + child: SizedBox( + width: 300, + child: Drawer( + child: ListView( + children: [ + const DrawerHeader( + decoration: BoxDecoration( + color: Color.fromARGB(255, 245, 103, 47), + ), + child: Text( + 'Menu', + style: TextStyle( + color: Colors.white, + fontSize: 35, + ), + ), + ), + ListTile( + title: const Text( + 'Home', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context) + .push(MaterialPageRoute(builder: (context) => TpoHome())); + }, + ), + + ListTile( + title: const Text( + 'Filter Students', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push( + MaterialPageRoute(builder: (context) => FilterStudents())); + }, + ), + ListTile( + title: const Text( + 'Placement Schedule', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => PlacementSchedule())); + }, + ), + ListTile( + title: const Text( + 'Placement Statistics', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => PlacementStatistics())); + }, + ), + ListTile( + title: const Text( + 'Add Placement Data', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => PlacementRecord())); + }, + ), + ListTile( + title: const Text( + 'Add Company', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push(MaterialPageRoute( + builder: (context) => AddCompany())); + }, + ), + ListTile( + title: const Text( + 'Alumni Data', + style: TextStyle(color: Colors.black, fontSize: 20), + ), + onTap: () { + Navigator.of(context).push( + MaterialPageRoute(builder: (context) => AlumniData())); + }, + ), + ], + ), + ), + )); + } +} From 9f03b9f48e938e1b3d37be4089b6921354d923bf Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:57:18 +0530 Subject: [PATCH 38/45] Update api.dart --- lib/api.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/api.dart b/lib/api.dart index 1f76a52b..5b02072e 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -31,6 +31,9 @@ const kGymkhanaMemberRecords = '/api/gymkhana/members_record'; //HealthCentre String kHealthCentreStudent = "/healthcenter/api/student"; +//PlacementCell +String kPlacementRecord="/placement/api/placementrecord"; + //------------Screens------------ //screens/Academic/Current_Semester From 57297ca4823cf8c93f7369bcb1f357a6e83c0578 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:58:30 +0530 Subject: [PATCH 39/45] Update main.dart --- lib/main.dart | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 4cd5af87..765e9dd6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -45,6 +45,19 @@ import 'package:fusion/screens/Healthcenter/viewschedule.dart'; import 'package:fusion/screens/Healthcenter/history.dart'; import 'package:fusion/screens/Healthcenter/HealthCenter.dart'; import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/screens/Placement/faculty/faculty_stats.dart'; +import 'package:fusion/screens/Placement/tpo/add_company.dart'; +import 'package:fusion/screens/Placement/tpo/alumni_data.dart'; +import 'package:fusion/screens/Placement/tpo/filter_students.dart'; +import 'package:fusion/screens/Placement/tpo/placement_record.dart'; +import 'package:fusion/screens/Placement/tpo/placement_schedule.dart'; +import 'package:fusion/screens/Placement/tpo/placement_statistics.dart'; +import 'package:fusion/screens/Placement/tpo/tpo_home.dart'; +import 'package:fusion/screens/Placement/student/placement_cell_home.dart'; +import 'package:fusion/screens/Placement/student/create_resume/resume_landing.dart'; +import 'package:fusion/screens/Placement/student/view_jobs/jobs.dart'; +import 'package:fusion/screens/Placement/student/view_schedules/schedule.dart'; +import 'package:fusion/screens/Placement/student/view_statistics/statistics.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); @@ -133,8 +146,22 @@ class MyApp extends StatelessWidget { '/health_center/feedback': (context) => FeedBack(), '/health_center/viewschedule': (context) => ViewSchedule(), '/health_center/history': (context) => History(), + '/tpo/tpo_home': (context) => TpoHome(), + '/tpo_home/alumni_data':(context)=>AlumniData(), + '/tpo_home/filter_students':(context)=>FilterStudents(), + '/tpo_home/placement_schedule':(context)=>PlacementSchedule(), + '/tpo_home/placement_statistics':(context)=>PlacementStatistics(), + '/tpo_home/add_company':(context)=>AddCompany(), + '/tpo_home/placement_record':(context)=>PlacementRecord(), + '/student/placement_cell_home':(context)=>PlacementHomePage(ModalRoute.of(context)!.settings.arguments.toString()), + '/placement_cell_home/view_schedules/schedule':(context)=>SchedulesPage(), + '/placement_cell_home/create_resume/resume_landing':(context)=>ResumeLandingPage(), + '/placement_cell_home/view_jobs/jobs':(context)=>JobsPage(), + '/placement_cell_home/view_statistics/statistics':(context)=>StatisticsPage(), + '/faculty/faculty_stats':(context)=>Statistics(), + '/chairman/chairman_statistics':(context)=>Statistics(), }, ), ); } -} \ No newline at end of file +} From 1dabed80d7aab3e8000012b656cf4e849ae199db Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:59:02 +0530 Subject: [PATCH 40/45] Add files via upload --- lib/models/placement.dart | 439 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 439 insertions(+) create mode 100644 lib/models/placement.dart diff --git a/lib/models/placement.dart b/lib/models/placement.dart new file mode 100644 index 00000000..8d8b9a06 --- /dev/null +++ b/lib/models/placement.dart @@ -0,0 +1,439 @@ +class Projects { + List? projects; + Projects({this.projects}); + factory Projects.fromJson(Map json) { + return Projects( + projects: json["projects"], + ); + } + + Map toJson() { + return { + "projects": this.projects, + }; + } +} + +class Experiences { + List? experiences; + Experiences({this.experiences}); + factory Experiences.fromJson(Map json) { + return Experiences( + experiences: json["experiences"], + ); + } + + Map toJson() { + return { + "experiences": this.experiences, + }; + } +} + +class Skills { + List? skills; + Skills({this.skills}); + factory Skills.fromJson(Map json) { + return Skills( + skills: json["skills"], + ); + } + Map toJson() { + return { + "skills": this.skills, + }; + } +} + +class Has_Skills { + List? has_skills; + Has_Skills({this.has_skills}); + factory Has_Skills.fromJson(Map json) { + return Has_Skills( + has_skills: json["has_skills"], + ); + } + Map toJson() { + return { + "has_skills": this.has_skills, + }; + } +} + +class EducationDetails { + List? education_details; + EducationDetails({this.education_details}); + factory EducationDetails.fromJson(Map json) { + return EducationDetails( + education_details: json["education_details"], + ); + } + Map toJson() { + return { + "education_details": this.education_details, + }; + } +} + +class Courses { + List? courses; + Courses({this.courses}); + factory Courses.fromJson(Map json) { + return Courses( + courses: json["experiences"], + ); + } + Map toJson() { + return { + "experiences": this.courses, + }; + } +} + +class Conference { + List? conferences; + Conference({this.conferences}); + factory Conference.fromJson(Map json) { + return Conference( + conferences: json["experiences"], + ); + } + Map toJson() { + return { + "experiences": this.conferences, + }; + } +} + +class Publications { + List? publications; + Publications({this.publications}); + factory Publications.fromJson(Map json) { + return Publications( + publications: json["experiences"], + ); + } + Map toJson() { + return { + "experiences": this.publications, + }; + } +} + +class References { + List? references; + References({this.references}); + factory References.fromJson(Map json) { + return References( + references: json["references"], + ); + } + Map toJson() { + return { + "references": this.references, + }; + } +} + +class CoAuthor { + List? co_authors; + CoAuthor({this.co_authors}); + factory CoAuthor.fromJson(Map json) { + return CoAuthor( + co_authors: json["coauthor"], + ); + } + Map toJson() { + return { + "coauthor": this.co_authors, + }; + } +} + +class Patent { + List? patents; + Patent({this.patents}); + factory Patent.fromJson(Map json) { + return Patent( + patents: json["patent"], + ); + } + Map toJson() { + return { + "patent": this.patents, + }; + } +} + +class CoInventor { + List? co_inventors; + CoInventor({this.co_inventors}); + factory CoInventor.fromJson(Map json) { + return CoInventor( + co_inventors: json["coinventor"], + ); + } + Map toJson() { + return { + "coinventor": this.co_inventors, + }; + } +} + +class Interest { + List? interests; + Interest({this.interests}); + factory Interest.fromJson(Map json) { + return Interest( + interests: json["interest"], + ); + } + Map toJson() { + return { + "interest": this.interests, + }; + } +} + +class Achievement { + List? achievements; + Achievement({this.achievements}); + factory Achievement.fromJson(Map json) { + return Achievement( + achievements: json["achievement"], + ); + } + Map toJson() { + return { + "achievement": this.achievements, + }; + } +} + +class extraCurricular { + List? extra_curriculars; + extraCurricular({this.extra_curriculars}); + factory extraCurricular.fromJson(Map json) { + return extraCurricular( + extra_curriculars: json["extracurricular"], + ); + } + Map toJson() { + return { + "extracurricular": this.extra_curriculars, + }; + } +} + +class MessageOfficer { + List? message_officers; + MessageOfficer({this.message_officers}); + factory MessageOfficer.fromJson(Map json) { + return MessageOfficer( + message_officers: json["messageofficer"], + ); + } + Map toJson() { + return { + "messageofficer": this.message_officers, + }; + } +} + +class NotifyStudent { + List? notify_students; + NotifyStudent({this.notify_students}); + factory NotifyStudent.fromJson(Map json) { + return NotifyStudent( + notify_students: json["notifystudent"], + ); + } + Map toJson() { + return { + "notifystudent": this.notify_students, + }; + } +} + +class Role { + List? roles; + Role({this.roles}); + factory Role.fromJson(Map json) { + return Role( + roles: json["role"], + ); + } + Map toJson() { + return { + "role": this.roles, + }; + } +} + +class CompanyDetails { + List? company_details; + CompanyDetails({this.company_details}); + factory CompanyDetails.fromJson(Map json) { + return CompanyDetails( + company_details: json["company_details"], + ); + } + Map toJson() { + return { + "company_details": this.company_details, + }; + } +} + +class PlacementStatus { + List? placement_status; + PlacementStatus({this.placement_status}); + factory PlacementStatus.fromJson(Map json) { + return PlacementStatus( + placement_status: json["placement_status"], + ); + } + Map toJson() { + return { + "placement_status": this.placement_status, + }; + } +} + +class PlacementRecord { + var id; + var placement_type; + var name; + var branch; + var ctc; + var year; + var test_score; + var test_type; + var unique_id_id; + PlacementRecord({ + this.id, + this.placement_type, + this.name, + this.branch, + this.ctc, + this.year, + this.test_score, + this.test_type, + this.unique_id_id, + }); + factory PlacementRecord.fromJson(Map json) { + return PlacementRecord( + id: json["id"], + placement_type: json["placement_type"], + name: json["name"], + branch: json["branch"], + ctc: json["ctc"], + year: json["year"], + test_score: json["test_score"], + test_type: json["test_type"], + unique_id_id: json["unique_id_id"], + ); + } + Map toJson() { + return { + "id": this.id, + "placement_type": this.placement_type, + "name": this.name, + "branch": this.branch, + "ctc": this.ctc, + "year": this.year, + "test_score": this.test_score, + "test_type": this.test_type, + "unique_id_id": this.unique_id_id, + }; + } +} + +class StudentRecord { + List? student_records; + StudentRecord({this.student_records}); + factory StudentRecord.fromJson(Map json) { + return StudentRecord( + student_records: json["studentrecord"], + ); + } + Map toJson() { + return { + "studentrecord": this.student_records, + }; + } +} + +class ChairmanVisit { + List? chairman_visits; + ChairmanVisit({this.chairman_visits}); + factory ChairmanVisit.fromJson(Map json) { + return ChairmanVisit( + chairman_visits: json["chairmanvisit"], + ); + } + Map toJson() { + return { + "chairmanvisit": this.chairman_visits, + }; + } +} + +class PlacementSchedule { + int? id; + String? placement_type; + String? name; + String? branch; + double? ctc; + int? year; + int? test_score; + String? test_type; + PlacementSchedule({ + this.id, + this.placement_type, + this.name, + this.branch, + this.ctc, + this.year, + this.test_score, + this.test_type, + }); + factory PlacementSchedule.fromJson(Map json) { + return PlacementSchedule( + id: json["id"], + placement_type: json["placement_type"], + name: json["name"], + branch: json["branch"], + ctc: json["ctc"], + year: json["year"], + test_score: json["test_score"], + test_type: json["test_type"]); + } + Map toJson() { + return { + "id": this.id, + "placement_type": this.placement_type, + "name": this.name, + "branch": this.branch, + "ctc": this.ctc, + "year": this.year, + "test_score": this.test_score, + "test_type": this.test_type, + }; + } +} + +class StudentPlacement { + List? student_placements; + StudentPlacement({this.student_placements}); + factory StudentPlacement.fromJson(Map json) { + return StudentPlacement( + student_placements: json["studentplacement"], + ); + } + Map toJson() { + return { + "studentplacement": this.student_placements, + }; + } +} From 192e8672fe2e59af7d6d006b80ec6bda86b2dd31 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:00:38 +0530 Subject: [PATCH 41/45] Add files via upload --- lib/services/placement_service.dart | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lib/services/placement_service.dart diff --git a/lib/services/placement_service.dart b/lib/services/placement_service.dart new file mode 100644 index 00000000..318e2094 --- /dev/null +++ b/lib/services/placement_service.dart @@ -0,0 +1,28 @@ +import 'dart:core'; +import 'package:fusion/api.dart'; +import 'package:fusion/constants.dart'; +import 'package:http/http.dart' as http; + +class PlacementService { + Future getPlacementRecord(String token) async { + try { + Map headers = {'Authorization': 'Token ' + token}; + print("fetching Academic Details"); + var client = http.Client(); + http.Response response = await client.get( + Uri.http( + getLink(), + kPlacementRecord, //Constant api path + ), + headers: headers, + ); + if (response.statusCode != 200) { + throw Exception('Can\'t get Placement records'); + } + print("successfully fetched Placement Records"); + return response; + } catch (e) { + rethrow; + } + } +} From 014154a60409dd211e9e84467e63b72e50fd7977 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:02:20 +0530 Subject: [PATCH 42/45] Update side_drawer.dart --- lib/Components/side_drawer.dart | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/Components/side_drawer.dart b/lib/Components/side_drawer.dart index be08db0e..fbc3a56f 100644 --- a/lib/Components/side_drawer.dart +++ b/lib/Components/side_drawer.dart @@ -24,7 +24,7 @@ class _SideDrawerState extends State { " " + service.profileData.profile!['user_type']; } - + late String user; @override Widget build(BuildContext context) { return SafeArea( @@ -140,7 +140,25 @@ class _SideDrawerState extends State { pageMover: '/health_center', ), ModulesPadding(line: 'Leave Module'), - ModulesPadding(line: 'Placement Module'), + user.toLowerCase().contains("student")? + ModulesPadding( + line: 'Placement Module', + pageMover: '/student/placement_cell_home', + isActive: true + ):user.toLowerCase().contains("faculty")? + ModulesPadding( + line: 'Placement Module', + pageMover: '/faculty/faculty_stats', + isActive: true + ):user.toLowerCase().contains("chairman")? + ModulesPadding( + line: 'Placement Module', + pageMover: '/chairman/chairman_statistics', + isActive: true + ) :ModulesPadding( + line: 'Placement Module', + pageMover: '/tpo/tpo_home', + isActive: true), ModulesPadding(line: 'Visitors Hostel Module'), ModulesPadding(line: 'File Tracking Module'), ], From 7654aa2edc7bd50550d4fe4c1beae674fde4e01b Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:04:20 +0530 Subject: [PATCH 43/45] Update side_drawer2.dart --- lib/Components/side_drawer2.dart | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/Components/side_drawer2.dart b/lib/Components/side_drawer2.dart index 97c80e8d..f0d8067b 100644 --- a/lib/Components/side_drawer2.dart +++ b/lib/Components/side_drawer2.dart @@ -135,8 +135,17 @@ class _SideDrawerState extends State { if ((type == "student" )) ModulesCard(cardLine: 'Human Resource'), - if(type == "student"|| widget.curr_desig=="placement chairman" || widget.curr_desig=="placement officer") - ModulesCard(cardLine: 'Placement Module'), + if(type == "student") + ModulesCard(cardLine: 'Placement Module',pageMover: '/placement_cell_home',), + + if(type=="placement officer") + ModulesCard(cardLine: 'Placement Module',pageMover: '/tpo_home',), + + if(type=="placement chairman") + ModulesCard(cardLine: 'Placement Module',pageMover: '/chairman_statistics',), + + if(type!="student"||widget.curr_desig!="placement officer"||widget.curr_desig!="placement chairman") + ModulesCard(cardLine: 'Placement Module',pageMover: '/faculty_stats',), ModulesCard(cardLine: 'Visitors Hostel Module',pageMover: '/visitor_hostel'), @@ -261,4 +270,4 @@ class ModulesCard extends StatelessWidget { }, ); } -} \ No newline at end of file +} From 787c752311907138b3b4869f67e2ec3eae6137b5 Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:05:03 +0530 Subject: [PATCH 44/45] Update pubspec.yaml --- pubspec.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/pubspec.yaml b/pubspec.yaml index 49030f0b..a77bd124 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,6 +24,7 @@ dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.0 + charts_flutter: ^0.12.0 csv: ^5.0.1 google_fonts: shared_preferences: ^2.0.3 From 70a70f76b912945be26361aa79079082b31c0d7d Mon Sep 17 00:00:00 2001 From: Haritha <97081941+Haritha-Murukutla@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:21:31 +0530 Subject: [PATCH 45/45] Update tpo_home.dart --- lib/screens/Placement/tpo/tpo_home.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/Placement/tpo/tpo_home.dart b/lib/screens/Placement/tpo/tpo_home.dart index 805cd82c..5e044eb8 100644 --- a/lib/screens/Placement/tpo/tpo_home.dart +++ b/lib/screens/Placement/tpo/tpo_home.dart @@ -29,7 +29,7 @@ class TpoHomeState extends State { return Scaffold( appBar: CustomAppBar( curr_desig: curr_desig, - headerTitle: "Central Mess", + headerTitle: "DashBoard", onDesignationChanged: (newValue) { setState(() { curr_desig = newValue;