diff --git a/.metadata b/.metadata
new file mode 100644
index 00000000..a778330b
--- /dev/null
+++ b/.metadata
@@ -0,0 +1,45 @@
+# This file tracks properties of this Flutter project.
+# Used by Flutter tool to assess capabilities and perform upgrades etc.
+#
+# This file should be version controlled and should not be manually edited.
+
+version:
+ revision: "d211f42860350d914a5ad8102f9ec32764dc6d06"
+ channel: "stable"
+
+project_type: app
+
+# Tracks metadata for the flutter migrate command
+migration:
+ platforms:
+ - platform: root
+ create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ - platform: android
+ create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ - platform: ios
+ create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ - platform: linux
+ create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ - platform: macos
+ create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ - platform: web
+ create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ - platform: windows
+ create_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+ base_revision: d211f42860350d914a5ad8102f9ec32764dc6d06
+
+ # User provided section
+
+ # List of Local paths (relative to this file) that should be
+ # ignored by the migrate tool.
+ #
+ # Files that are not part of the templates will be ignored by default.
+ unmanaged_files:
+ - 'lib/main.dart'
+ - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/analysis_options.yaml b/analysis_options.yaml
new file mode 100644
index 00000000..0d290213
--- /dev/null
+++ b/analysis_options.yaml
@@ -0,0 +1,28 @@
+# This file configures the analyzer, which statically analyzes Dart code to
+# check for errors, warnings, and lints.
+#
+# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
+# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
+# invoked from the command line by running `flutter analyze`.
+
+# The following line activates a set of recommended lints for Flutter apps,
+# packages, and plugins designed to encourage good coding practices.
+include: package:flutter_lints/flutter.yaml
+
+linter:
+ # The lint rules applied to this project can be customized in the
+ # section below to disable rules from the `package:flutter_lints/flutter.yaml`
+ # included above or to enable additional rules. A list of all available lints
+ # and their documentation is published at https://dart.dev/lints.
+ #
+ # Instead of disabling a lint rule for the entire project in the
+ # section below, it can also be suppressed for a single line of code
+ # or a specific dart file by using the `// ignore: name_of_lint` and
+ # `// ignore_for_file: name_of_lint` syntax on the line or in the file
+ # producing the lint.
+ rules:
+ # avoid_print: false # Uncomment to disable the `avoid_print` rule
+ # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
+
+# Additional information about this file can be found at
+# https://dart.dev/guides/language/analysis-options
diff --git a/android/app/src/main/kotlin/com/fusionIIIT/fusion_mobile/MainActivity.kt b/android/app/src/main/kotlin/com/fusionIIIT/fusion_mobile/MainActivity.kt
new file mode 100644
index 00000000..56f3909e
--- /dev/null
+++ b/android/app/src/main/kotlin/com/fusionIIIT/fusion_mobile/MainActivity.kt
@@ -0,0 +1,6 @@
+package com.fusionIIIT.fusion_mobile
+
+import io.flutter.embedding.android.FlutterActivity
+
+class MainActivity: FlutterActivity() {
+}
diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml
new file mode 100644
index 00000000..f74085f3
--- /dev/null
+++ b/android/app/src/main/res/drawable-v21/launch_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml
new file mode 100644
index 00000000..06952be7
--- /dev/null
+++ b/android/app/src/main/res/values-night/styles.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
diff --git a/android/build.gradle b/android/build.gradle
index b3a325d5..881e7e55 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"
}
}
@@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}
-task clean(type: Delete) {
+tasks.register("clean", Delete) {
delete rootProject.buildDir
}
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/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/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift
new file mode 100644
index 00000000..86a7c3b1
--- /dev/null
+++ b/ios/RunnerTests/RunnerTests.swift
@@ -0,0 +1,12 @@
+import Flutter
+import UIKit
+import XCTest
+
+class RunnerTests: XCTestCase {
+
+ func testExample() {
+ // If you add code to the Runner application, consider adding tests here.
+ // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
+ }
+
+}
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..1efe8c3f
--- /dev/null
+++ b/lib/Components/side_drawer2.dart
@@ -0,0 +1,270 @@
+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'),
+
+
+ if ((widget.curr_desig != "Compounder"))
+ ModulesCard(
+ cardLine: 'Health Center Module',
+ pageMover: '/health_center',
+ ),
+ if ((widget.curr_desig == "Compounder"))
+ ModulesCard(
+ cardLine: 'Health Center Module',
+ pageMover: '/compounder/home',
+ ),
+ 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 802bee2d..b89176fa 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/";
@@ -20,6 +21,7 @@ String kComplaintRemove = "/complaint/api/removecomplain/";
//Dashboard
String kDashboard = "/api/dashboard/";
+String kNotification = "/api/notification/";
String kNotificationRead = "/api/notification/read/";
//Gymkhana
@@ -28,7 +30,7 @@ const kGymkhanaMemberRecords = '/api/gymkhana/members_record';
//HealthCentre
String kHealthCentreStudent = "/healthcenter/api/student";
-
+String kHealthCentreCompounder = "/healthcenter/api/compounder";
//------------Screens------------
//screens/Academic/Current_Semester
diff --git a/lib/main.dart b/lib/main.dart
index 9ca81ff8..97e950d2 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';
@@ -36,11 +39,20 @@ import 'package:fusion/screens/Programme_Curriculum/Programme/programme_home_pag
import 'package:fusion/screens/Programme_Curriculum/Programme_Info/programme_info.dart';
import 'package:fusion/screens/Programme_Curriculum/programme_curriculum_home.dart';
import 'package:fusion/screens/landing_page.dart';
+import 'package:fusion/screens/Healthcenter/reimbursement.dart';
+import 'package:fusion/screens/Healthcenter/view_announcement.dart';
import 'package:fusion/screens/Healthcenter/healthcentermodule.dart';
import 'package:fusion/screens/Healthcenter/feedback.dart';
-import 'package:fusion/screens/Healthcenter/viewschedule.dart';
+import 'package:fusion/screens/Healthcenter/viewdoctorschedule.dart';
import 'package:fusion/screens/Healthcenter/history.dart';
-import 'package:fusion/screens/Healthcenter/HealthCenter.dart';
+import 'package:fusion/screens/Compounder/adddoctor.dart';
+import 'package:fusion/screens/Compounder/announcements.dart';
+import 'package:fusion/screens/Compounder/doctorSchedule.dart';
+import 'package:fusion/screens/Compounder/homepage.dart';
+import 'package:fusion/screens/Compounder/inventory.dart';
+import 'package:fusion/screens/Compounder/medicalReimbursement.dart';
+import 'package:fusion/screens/Compounder/pathologistSchedule.dart';
+import 'package:fusion/screens/Compounder/patientLog.dart';
import 'package:fusion/services/service_locator.dart';
void main() {
@@ -60,9 +72,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 +93,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()),
@@ -123,12 +138,25 @@ class MyApp extends StatelessWidget {
'/profile': (context) => Profile(),
'/health_center': (context) => HealthCenterMod(
ModalRoute.of(context)!.settings.arguments.toString()),
- '/health_center/healthcenter': (context) => HealthCenter(),
+ // '/health_center/healthcenter': (context) => HealthCenter(),
'/health_center/feedback': (context) => FeedBack(),
- '/health_center/viewschedule': (context) => ViewSchedule(),
- '/health_center/history': (context) => History(),
+ '/health_center/viewdoctorschedule': (context) => ViewdoctorSchedule(),
+ '/health_center/history': (context) => HealthRecordsPage(),
+ '/health_center/announcement': (context) => ViewAnnouncementPage(),
+ '/health_center/reimbursement': (context) => ReimbursementFormPage(),
+ // '/health_center/medicalprofile': (context) => MedicalProfilePage(),
+
+ '/compounder/home': (context) => CompounderHome(),
+ '/compounder/doctor_schedule': (context) => DoctorAvailabilityPage(),
+ '/compounder/pathologist_schedule': (context) =>
+ PathologistAvailabilityPage(),
+ '/compounder/announcements': (context) => AnnouncementPage(),
+ '/compounder/inventory': (context) => HealthCenterInventoryPage(),
+ '/compounder/reimbursement': (context) => ReimbursementPage(),
+ '/compounder/patient_log': (context) => HomePage(),
+ '/compounder/adddoctor': (context) => DoctorListScreen(),
},
),
);
}
-}
+}
\ No newline at end of file
diff --git a/lib/screens/Compounder/adddoctor.dart b/lib/screens/Compounder/adddoctor.dart
new file mode 100644
index 00000000..d73d8e58
--- /dev/null
+++ b/lib/screens/Compounder/adddoctor.dart
@@ -0,0 +1,207 @@
+import 'dart:convert';
+import 'package:flutter/material.dart';
+import 'package:http/http.dart' as http;
+import 'package:shared_preferences/shared_preferences.dart';
+import '../../api.dart';
+
+void main() {
+ runApp(MyApp());
+}
+
+class Doctor {
+ String name;
+ String contactNumber;
+ String specialization;
+ bool isActive;
+
+ Doctor({
+ required this.name,
+ required this.contactNumber,
+ required this.specialization,
+ required this.isActive,
+ });
+}
+
+class MyApp extends StatelessWidget {
+ @override
+ Widget build(BuildContext context) {
+ return MaterialApp(
+ title: 'Doctor Management',
+ theme: ThemeData(
+ primarySwatch: Colors.blue,
+ ),
+ home: DoctorListScreen(),
+ );
+ }
+}
+
+class DoctorListScreen extends StatefulWidget {
+ @override
+ _DoctorListScreenState createState() => _DoctorListScreenState();
+}
+
+class _DoctorListScreenState extends State {
+ List doctors = [];
+ late String token;
+ bool _selectedValue = true;
+
+ @override
+ void initState() {
+ super.initState();
+ getToken();
+ }
+
+ Future getToken() async {
+ SharedPreferences prefs = await SharedPreferences.getInstance();
+ String userData = prefs.getString('user') ?? '';
+ if (userData.isNotEmpty) {
+ Map userMap = json.decode(userData);
+ setState(() {
+ token = userMap['token'] ?? '';
+ });
+ }
+ }
+
+ Future _addDoctor(String name, String contactNumber, String specialization, bool isActive) async {
+ final url = "http://"+ kserverLink + "/healthcenter/api/compounder/request"; // Replace with your actual backend URL
+ final response = await http.post(
+ Uri.parse(url),
+ body: jsonEncode({
+ "doctoradd":true,
+ 'doctor_name': name,
+ 'doctor_phone': contactNumber,
+ 'specialization': specialization,
+ 'active': isActive.toString(),
+ }),
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Authorization': 'Token $token',
+ },
+ );
+
+ if (response.statusCode == 201) {
+ // If the server returns a success response, add the doctor locally
+ setState(() {
+ doctors.add(
+ Doctor(
+ name: name,
+ contactNumber: contactNumber,
+ specialization: specialization,
+ isActive: isActive,
+ ),
+ );
+ });
+ } else {
+ // If the server returns an error response, print the error message
+ print('Failed to add doctor: ${response.reasonPhrase}');
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ title: Text('Doctors'),
+ ),
+ body: ListView.builder(
+ itemCount: doctors.length,
+ itemBuilder: (context, index) {
+ return ListTile(
+ title: Text(doctors[index].name),
+ subtitle: Text(doctors[index].specialization),
+ trailing: doctors[index].isActive
+ ? Icon(Icons.check_circle, color: Colors.green)
+ : Icon(Icons.cancel, color: Colors.red),
+ );
+ },
+ ),
+ floatingActionButton: FloatingActionButton(
+ onPressed: () {
+ _showAddDoctorDialog(context);
+ },
+ child: Icon(Icons.add),
+ ),
+ );
+ }
+
+ Future _showAddDoctorDialog(BuildContext context) async {
+ TextEditingController nameController = TextEditingController();
+ TextEditingController contactController = TextEditingController();
+ TextEditingController specializationController = TextEditingController();
+
+ return showDialog(
+ context: context,
+ builder: (BuildContext context) {
+ return StatefulBuilder(
+ builder: (BuildContext context, StateSetter setState) {
+ return AlertDialog(
+ title: Text('Add Doctor'),
+ content: SingleChildScrollView(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ TextField(
+ controller: nameController,
+ decoration: InputDecoration(
+ labelText: 'Name',
+ hintText: 'Enter name',
+ ),
+ ),
+ TextField(
+ controller: contactController,
+ decoration: InputDecoration(
+ labelText: 'Contact Number',
+ hintText: 'Enter contact number',
+ ),
+ ),
+ TextField(
+ controller: specializationController,
+ decoration: InputDecoration(
+ labelText: 'Specialization',
+ hintText: 'Enter specialization',
+ ),
+ ),
+ SizedBox(height: 20),
+ Row(
+ children: [
+ Text('Active Status:'),
+ SizedBox(width: 10),
+ DropdownButton(
+ value: _selectedValue,
+ onChanged: (bool? newValue) {
+ setState(() {
+ _selectedValue = newValue!;
+ });
+ },
+ items: [true, false].map>((bool value) {
+ return DropdownMenuItem(
+ value: value,
+ child: Text(value.toString()),
+ );
+ }).toList(),
+ ),
+ ],
+ ),
+ SizedBox(height: 20),
+ ElevatedButton(
+ onPressed: () {
+ _addDoctor(
+ nameController.text,
+ contactController.text,
+ specializationController.text,
+ _selectedValue,
+ );
+ Navigator.of(context).pop();
+ },
+ child: Text('Add'),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ );
+ },
+ );
+ }
+}
diff --git a/lib/screens/Compounder/announcements.dart b/lib/screens/Compounder/announcements.dart
new file mode 100644
index 00000000..2660da6c
--- /dev/null
+++ b/lib/screens/Compounder/announcements.dart
@@ -0,0 +1,159 @@
+import 'package:flutter/material.dart';
+
+void main() {
+ runApp(MyApp());
+}
+
+class CompounderAnnouncement {
+ final String title;
+ final String description;
+ final DateTime dateTime;
+
+ CompounderAnnouncement({
+ required this.title,
+ required this.description,
+ required this.dateTime,
+ });
+}
+
+class MyApp extends StatelessWidget {
+ @override
+ Widget build(BuildContext context) {
+ return MaterialApp(
+ title: 'Announcements',
+ theme: ThemeData(
+ primarySwatch: Colors.blue,
+ ),
+ home: AnnouncementPage(),
+ );
+ }
+}
+
+class AnnouncementPage extends StatefulWidget {
+ @override
+ _AnnouncementPageState createState() => _AnnouncementPageState();
+}
+
+class _AnnouncementPageState extends State {
+ List announcements = [];
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ title: Text('Announcements'),
+ ),
+ body: ListView.builder(
+ itemCount: announcements.length,
+ itemBuilder: (BuildContext context, int index) {
+ return ListTile(
+ title: Text(announcements[index].title),
+ subtitle: Text(
+ '${announcements[index].dateTime.day}/${announcements[index].dateTime.month}/${announcements[index].dateTime.year} ${announcements[index].dateTime.hour}:${announcements[index].dateTime.minute}'),
+ onTap: () {
+ // Handle onTap event
+ // For example, navigate to a detailed page
+ },
+ );
+ },
+ ),
+ floatingActionButton: FloatingActionButton(
+ onPressed: () async {
+ // Call a method to show a dialog for entering new announcement details
+ final newAnnouncement = await _showAddAnnouncementDialog(context);
+ if (newAnnouncement != null) {
+ setState(() {
+ announcements.add(newAnnouncement);
+ });
+ }
+ },
+ child: Icon(Icons.add),
+ ),
+ );
+ }
+
+ Future _showAddAnnouncementDialog(BuildContext context) {
+ TextEditingController titleController = TextEditingController();
+ TextEditingController descriptionController = TextEditingController();
+ DateTime selectedDate = DateTime.now();
+ TimeOfDay selectedTime = TimeOfDay.now();
+
+ return showDialog(
+ context: context,
+ builder: (BuildContext context) {
+ return AlertDialog(
+ title: Text('Add Announcement'),
+ content: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ TextField(
+ controller: titleController,
+ decoration: InputDecoration(labelText: 'Title'),
+ ),
+ TextField(
+ controller: descriptionController,
+ decoration: InputDecoration(labelText: 'Description'),
+ ),
+ SizedBox(height: 10),
+ TextButton(
+ onPressed: () async {
+ final pickedDate = await showDatePicker(
+ context: context,
+ initialDate: selectedDate,
+ firstDate: DateTime.now(),
+ lastDate: DateTime(2100),
+ );
+ if (pickedDate != null) {
+ setState(() {
+ selectedDate = pickedDate;
+ });
+ }
+ },
+ child: Text('Select Date'),
+ ),
+ TextButton(
+ onPressed: () async {
+ final pickedTime = await showTimePicker(
+ context: context,
+ initialTime: selectedTime,
+ );
+ if (pickedTime != null) {
+ setState(() {
+ selectedTime = pickedTime;
+ });
+ }
+ },
+ child: Text('Select Time'),
+ ),
+ ],
+ ),
+ actions: [
+ TextButton(
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ child: Text('Cancel'),
+ ),
+ TextButton(
+ onPressed: () {
+ Navigator.of(context).pop(CompounderAnnouncement(
+ title: titleController.text,
+ description: descriptionController.text,
+ dateTime: DateTime(
+ selectedDate.year,
+ selectedDate.month,
+ selectedDate.day,
+ selectedTime.hour,
+ selectedTime.minute,
+ ),
+ ));
+ },
+ child: Text('Add'),
+ ),
+ ],
+ );
+ },
+ );
+ }
+}
diff --git a/lib/screens/Compounder/doctorSchedule.dart b/lib/screens/Compounder/doctorSchedule.dart
new file mode 100644
index 00000000..0e7052be
--- /dev/null
+++ b/lib/screens/Compounder/doctorSchedule.dart
@@ -0,0 +1,275 @@
+import 'package:flutter/material.dart';
+import 'package:intl/intl.dart';
+import 'package:http/http.dart' as http;
+import 'dart:convert';
+import 'package:shared_preferences/shared_preferences.dart';
+import '../../api.dart';
+
+void main() {
+ runApp(MyApp());
+}
+
+class Doctor {
+ int id;
+ TimeOfDay startTime;
+ TimeOfDay endTime;
+ List daysAvailable;
+
+ Doctor(this.id, this.startTime, this.endTime, this.daysAvailable);
+}
+
+class MyApp extends StatelessWidget {
+ @override
+ Widget build(BuildContext context) {
+ return MaterialApp(
+ title: 'Doctor Availability',
+ theme: ThemeData(
+ primarySwatch: Colors.blue,
+ ),
+ home: DoctorAvailabilityPage(),
+ );
+ }
+}
+
+class DoctorAvailabilityPage extends StatefulWidget {
+ @override
+ _DoctorAvailabilityPageState createState() =>
+ _DoctorAvailabilityPageState();
+}
+
+class _DoctorAvailabilityPageState extends State {
+ List doctors = [];
+ List selectedDays = [];
+
+ int? dropdownValue;
+ String? dropdownDayValue;
+
+ List daysOfWeek = [
+ 'Monday',
+ 'Tuesday',
+ 'Wednesday',
+ 'Thursday',
+ 'Friday',
+ 'Saturday',
+ 'Sunday',
+ ];
+
+ @override
+ void initState() {
+ super.initState();
+ dropdownValue = doctors.isNotEmpty ? doctors[0].id : null;
+ dropdownDayValue = daysOfWeek.isNotEmpty ? daysOfWeek[0] : null;
+
+ doctors.add(Doctor(1, TimeOfDay(hour: 9, minute: 0),
+ TimeOfDay(hour: 17, minute: 0), ['Monday', 'Wednesday', 'Friday']));
+ doctors.add(Doctor(
+ 2,
+ TimeOfDay(hour: 8, minute: 30),
+ TimeOfDay(hour: 16, minute: 30),
+ ['Tuesday', 'Thursday']));
+
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ title: Text('Doctor Availability'),
+ ),
+ body: ListView.builder(
+ itemCount: doctors.length,
+ itemBuilder: (context, index) {
+ return ListTile(
+ title: Text('Doctor ID: ${doctors[index].id}'),
+ subtitle: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ 'Days Available: ${doctors[index].daysAvailable.join(', ')}'),
+ Text(
+ 'Availability: ${formatTime(doctors[index].startTime)} - ${formatTime(doctors[index].endTime)}'),
+ ],
+ ),
+ );
+ },
+ ),
+ floatingActionButton: FloatingActionButton(
+ onPressed: () {
+ _showAddDoctorDialog(context);
+ },
+ child: Icon(Icons.add),
+ ),
+ );
+ }
+
+ String formatTime(TimeOfDay timeOfDay) {
+ final now = DateTime.now();
+ final dateTime = DateTime(
+ now.year,
+ now.month,
+ now.day,
+ timeOfDay.hour,
+ timeOfDay.minute,
+ );
+ final formattedTime = DateFormat('HH:mm:ss').format(dateTime);
+ return formattedTime;
+ }
+
+ void _showAddDoctorDialog(BuildContext context) {
+ showDialog(
+ context: context,
+ builder: (BuildContext context) {
+ TimeOfDay startTime = TimeOfDay.now();
+ TimeOfDay endTime = TimeOfDay.now();
+ return StatefulBuilder(
+ builder: (context, setState) {
+ return AlertDialog(
+ title: Text('Add Doctor'),
+ content: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ DropdownButtonFormField(
+ value: dropdownValue,
+ onChanged: (int? newValue) {
+ setState(() {
+ dropdownValue = newValue;
+ });
+ },
+ items: doctors.map>((Doctor doctor) {
+ return DropdownMenuItem(
+ value: doctor.id,
+ child: Text('Doctor ID: ${doctor.id}'),
+ );
+ }).toList(),
+ hint: Text('Select Doctor'),
+ ),
+ SizedBox(height: 10),
+ DropdownButtonFormField(
+ value: dropdownDayValue,
+ onChanged: (String? newValue) {
+ setState(() {
+ dropdownDayValue = newValue;
+ });
+ },
+ items: daysOfWeek
+ .map>((String day) {
+ return DropdownMenuItem(
+ value: day,
+ child: Text(day),
+ );
+ }).toList(),
+ hint: Text('Select Day'),
+ ),
+ SizedBox(height: 10),
+ ListTile(
+ title: Text("Start Time"),
+ trailing: TextButton(
+ onPressed: () async {
+ final selectedTime = await showTimePicker(
+ context: context,
+ initialTime: TimeOfDay.now(),
+ );
+ if (selectedTime != null) {
+ setState(() {
+ startTime = selectedTime;
+ });
+ }
+ },
+ child: Text(formatTime(startTime)),
+ ),
+ ),
+ ListTile(
+ title: Text("End Time"),
+ trailing: TextButton(
+ onPressed: () async {
+ final selectedTime = await showTimePicker(
+ context: context,
+ initialTime: TimeOfDay.now(),
+ );
+ if (selectedTime != null) {
+ setState(() {
+ endTime = selectedTime;
+ });
+ }
+ },
+ child: Text(formatTime(endTime)),
+ ),
+ ),
+ ],
+ ),
+ actions: [
+ TextButton(
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ child: Text('Cancel'),
+ ),
+ ElevatedButton(
+ onPressed: () {
+ _addDoctor(startTime, endTime);
+ Navigator.of(context).pop();
+ },
+ child: Text('Add'),
+ ),
+ ],
+ );
+ },
+ );
+ },
+ );
+ }
+
+ void _addDoctor(TimeOfDay startTime, TimeOfDay endTime) async {
+ int id = dropdownValue!;
+ List daysAvailable = [dropdownDayValue!];
+ Doctor newDoctor = Doctor(id, startTime, endTime, daysAvailable);
+ setState(() {
+ doctors.add(newDoctor);
+ });
+
+ final String url = "http://"+ kserverLink + "/healthcenter/api/compounder/request";
+ final Map requestData = {
+ 'doctorscheduleadd': true,
+ 'doctor_id': id,
+ 'startTime': formatTime(startTime),
+ 'endTime': formatTime(endTime),
+ 'room': 204,
+ 'day': dropdownDayValue!,
+ };
+
+
+ Future getToken() async {
+ SharedPreferences prefs = await SharedPreferences.getInstance();
+ String userData = prefs.getString('user') ?? '';
+ if (userData.isNotEmpty) {
+ Map userMap = json.decode(userData);
+ return userMap['token'] ?? '';
+ } else {
+ return '';
+ }
+ }
+
+ try {
+ final String token = await getToken();
+ print(requestData);
+ final http.Response response = await http.post(
+ Uri.parse(url),
+ body: json.encode(requestData),
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Authorization': 'Token $token',
+ },
+ );
+
+ if (response.statusCode == 201) {
+ print('Data added successfully');
+ } else {
+ print('Failed to add data. Error: ${response.reasonPhrase}');
+ // You can handle the error here
+ }
+ } catch (e) {
+ print('Error: $e');
+ // Handle network errors here
+ }
+ }
+}
diff --git a/lib/screens/Compounder/homepage.dart b/lib/screens/Compounder/homepage.dart
new file mode 100644
index 00000000..17a21ae1
--- /dev/null
+++ b/lib/screens/Compounder/homepage.dart
@@ -0,0 +1,252 @@
+// import 'dart:async';
+// import 'dart:convert';
+
+import 'package:flutter/material.dart';
+import 'package:fusion/Components/appBar2.dart';
+import 'package:fusion/Components/side_drawer2.dart';
+import 'package:fusion/services/service_locator.dart';
+import 'package:fusion/services/storage_service.dart';
+import 'package:fusion/Components/bottom_navigation_bar.dart';
+import 'package:fusion/models/health.dart';
+import 'package:fusion/services/health_service.dart';
+// import 'package:fusion/services/service_locator.dart';
+// import 'package:fusion/services/storage_service.dart';
+// import 'package:http/http.dart';
+
+// ignore: must_be_immutable
+class CompounderHome extends StatefulWidget {
+ get token => null;
+
+ // String? token;
+ // CompounderHome(this.token);
+ @override
+ _CompounderHomeState createState() => _CompounderHomeState();
+}
+
+class _CompounderHomeState extends State {
+ bool _loading1 = false;
+ // late StreamController _healthController;
+ var service = locator();
+ late String curr_desig = service.getFromDisk("Current_designation");
+
+ late HeathService healthService;
+ late HealthData data;
+ String? name='Compounder';
+ // String? depttype;
+ // void initState() {
+ // super.initState();
+ // var service = locator();
+ // name = service.profileData.user!["first_name"] +
+ // " " +
+ // service.profileData.user!["last_name"];
+ // depttype = service.profileData.profile!['department']!['name'] +
+ // " " +
+ // service.profileData.profile!['user_type'];
+ // _healthController = StreamController();
+ // healthService = HeathService();
+ // getData();
+ // }
+
+ // getData() async {
+ // //print('token-'+widget.token!);
+ // try {
+ // Response response = await healthService.getHealth(widget.token!);
+ // setState(() {
+ // // print(response);
+ // data = HealthData.fromJson(jsonDecode(response.body));
+ // _loading1 = false;
+ // });
+ // } catch (e) {
+ // print(e);
+ // }
+ // }
+
+ // loadData() async {
+ // getData().then((res) {
+ // _healthController.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.w500),
+ );
+ }
+
+ Padding myContainer(String text) {
+ return Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Container(
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: myText(text),
+ ),
+ decoration: myBoxDecoration(),
+ ),
+ );
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: CustomAppBar(
+ curr_desig: curr_desig,
+ headerTitle: "Health Center",
+ onDesignationChanged: (newValue) {
+ setState(() {
+ curr_desig = newValue;
+ });
+
+ },
+ ), // This is default app bar used in all modules
+ drawer: SideDrawer(curr_desig: curr_desig),
+ bottomNavigationBar:
+ MyBottomNavigationBar(),
+ body: _loading1 == true
+ ? Center(
+ child: CircularProgressIndicator(),
+ )
+ : ListView(
+ scrollDirection: Axis.vertical,
+ children: [
+ Card(
+ elevation: 2.0,
+ margin:
+ EdgeInsets.symmetric(horizontal: 50.0, vertical: 20.0),
+ shadowColor: Colors.black,
+ child: Column(
+ children: [
+ Container(
+ margin: EdgeInsets.only(top: 20.0),
+ width: 170.0,
+ height: 170.0,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage('assets/unknown.jpg'),
+ fit: BoxFit.cover,
+ ),
+ ),
+ ),
+ SizedBox(
+ height: 10.0,
+ ),
+ Text(
+ name!,
+ style: TextStyle(fontSize: 20.0, color: Colors.black),
+ ),
+ SizedBox(
+ height: 10.0,
+ ),
+ // Text(
+ // depttype!,
+ // style: TextStyle(fontSize: 15.0, color: Colors.black),
+ // ),
+ SizedBox(
+ height: 10.0,
+ ),
+ ],
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Container(
+ child: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: Center(
+ child: Text(
+ "Health Center Module",
+ style: TextStyle(
+ fontSize: 20.0,
+ color: Colors.white,
+ ),
+ )),
+ ),
+ decoration: new BoxDecoration(
+ color: Colors.deepOrangeAccent,
+ boxShadow: [
+ BoxShadow(
+ color: Colors.black,
+ offset: Offset(0.0, 1.0),
+ blurRadius: 2.0,
+ )
+ ],
+ borderRadius:
+ new BorderRadius.all(new Radius.circular(5.0)),
+ ),
+ ),
+ ),
+ Card(
+ elevation: 2.0,
+ margin:
+ EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0),
+ shadowColor: Colors.black,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ InkWell(
+ child: myContainer("Add Doctor"),
+ onTap: () {
+ Navigator.pushNamed(
+ context, '/compounder/adddoctor');
+ },
+ ),
+ InkWell(
+ child: myContainer("Doctor Schedule"),
+ onTap: () {
+ Navigator.pushNamed(
+ context, '/compounder/doctor_schedule');
+ },
+ ),
+ InkWell(
+ child: myContainer("Pathologist Schedule"),
+ onTap: () {
+ Navigator.pushNamed(
+ context, '/compounder/pathologist_schedule');
+ },
+ ),
+ InkWell(
+ child: myContainer("Patient Log"),
+ onTap: () {
+ Navigator.pushNamed(
+ context, '/compounder/patient_log');
+ },
+ ),
+ InkWell(
+ child: myContainer("Medical Reimbursement"),
+ onTap: () {
+ Navigator.pushNamed(
+ context, '/compounder/reimbursement');
+ },
+ ),
+ InkWell(
+ child: myContainer("Inventory"),
+ onTap: () {
+ Navigator.pushNamed(context, '/compounder/inventory');
+ },
+ ),
+ InkWell(
+ child: myContainer("Make Announcements"),
+ onTap: () {
+ Navigator.pushNamed(
+ context, '/compounder/announcements');
+ },
+ ),
+ ],
+ ),
+ ),
+ ],
+ ),
+ );
+ }
+}
diff --git a/lib/screens/Compounder/inventory.dart b/lib/screens/Compounder/inventory.dart
new file mode 100644
index 00000000..12df574d
--- /dev/null
+++ b/lib/screens/Compounder/inventory.dart
@@ -0,0 +1,183 @@
+import 'package:flutter/material.dart';
+
+void main() {
+ runApp(MaterialApp(
+ home: HealthCenterInventoryPage(),
+ ));
+}
+
+class HealthCenterInventoryPage extends StatefulWidget {
+ @override
+ _HealthCenterInventoryPageState createState() =>
+ _HealthCenterInventoryPageState();
+}
+
+class _HealthCenterInventoryPageState extends State {
+ List medicines = ['Medicine A', 'Medicine B', 'Medicine C'];
+ String selectedMedicine = 'Medicine A';
+ int stock = 0;
+ String supplierName = '';
+ DateTime expiryDate = DateTime.now();
+ List expiredMedicines = [];
+ List changes = [];
+
+ TextEditingController newMedicineController = TextEditingController();
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(
+ title: Text('Health Center Inventory'),
+ ),
+ body: Padding(
+ padding: const EdgeInsets.all(20.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('Select Medicine to Update Stock:'),
+ DropdownButton(
+ value: selectedMedicine,
+ onChanged: (String? newValue) {
+ setState(() {
+ selectedMedicine = newValue!;
+ });
+ },
+ items: medicines.map>((String value) {
+ return DropdownMenuItem(
+ value: value,
+ child: Text(value),
+ );
+ }).toList(),
+ ),
+ SizedBox(height: 20),
+ Text('Update Stock:'),
+ TextField(
+ decoration: InputDecoration(labelText: 'Stock'),
+ keyboardType: TextInputType.number,
+ onChanged: (value) {
+ setState(() {
+ stock = int.parse(value);
+ });
+ },
+ ),
+ TextField(
+ controller: TextEditingController(text: supplierName),
+ decoration: InputDecoration(labelText: 'Supplier Name'),
+ onChanged: (value) {
+ setState(() {
+ supplierName = value;
+ });
+ },
+ ),
+ SizedBox(height: 10),
+ Text('Expiry Date:'),
+ SizedBox(
+ height: 100,
+ child: DatePicker(
+ selectedDate: expiryDate,
+ selectDate: (DateTime date) {
+ setState(() {
+ expiryDate = date;
+ });
+ },
+ ),
+ ),
+ SizedBox(height: 20),
+ ElevatedButton(
+ onPressed: () {
+ updateStock(selectedMedicine, stock, supplierName, expiryDate);
+ },
+ child: Text('Update Inventory'),
+ ),
+ SizedBox(height: 20),
+ Text('Add New Medicine:'),
+ TextField(
+ controller: newMedicineController,
+ decoration: InputDecoration(labelText: 'New Medicine Name'),
+ ),
+ ElevatedButton(
+ onPressed: () {
+ addNewMedicine(newMedicineController.text);
+ },
+ child: Text('Add Medicine'),
+ ),
+ SizedBox(height: 20),
+ Text('Expired Medicines:'),
+ Expanded(
+ child: ListView.builder(
+ itemCount: expiredMedicines.length,
+ itemBuilder: (BuildContext context, int index) {
+ return ListTile(
+ title: Text(expiredMedicines[index]),
+ );
+ },
+ ),
+ ),
+ SizedBox(height: 20),
+ Text('Changes Made:'),
+ Expanded(
+ child: ListView.builder(
+ itemCount: changes.length,
+ itemBuilder: (BuildContext context, int index) {
+ return ListTile(
+ title: Text(changes[index]),
+ );
+ },
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ void updateStock(String selectedMedicine, int stock, String supplierName,
+ DateTime expiryDate) {
+ setState(() {
+ // Perform update
+ String updateInfo =
+ 'Stock of $selectedMedicine updated to $stock. Supplier: $supplierName, Expiry Date: $expiryDate';
+ changes.add(updateInfo);
+ });
+ }
+
+ void addNewMedicine(String newMedicineName) {
+ setState(() {
+ medicines.add(newMedicineName);
+ changes.add('New medicine added: $newMedicineName');
+ });
+ }
+}
+
+class DatePicker extends StatelessWidget {
+ final DateTime selectedDate;
+ final ValueChanged selectDate;
+
+ DatePicker({required this.selectedDate, required this.selectDate});
+
+ Future _selectDate(BuildContext context) async {
+ final DateTime picked = (await showDatePicker(
+ context: context,
+ initialDate: selectedDate,
+ firstDate: DateTime.now(),
+ lastDate: DateTime(2101),
+ ))!;
+ if (picked != selectedDate) selectDate(picked);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return Row(
+ children: [
+ Expanded(
+ child: TextButton(
+ onPressed: () => _selectDate(context),
+ child: Text(
+ '${selectedDate.year}-${selectedDate.month}-${selectedDate.day}',
+ ),
+ ),
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/screens/Compounder/medicalReimbursement.dart b/lib/screens/Compounder/medicalReimbursement.dart
new file mode 100644
index 00000000..aab55748
--- /dev/null
+++ b/lib/screens/Compounder/medicalReimbursement.dart
@@ -0,0 +1,186 @@
+import 'package:flutter/material.dart';
+
+void main() {
+ runApp(MyApp());
+}
+
+class MyApp extends StatelessWidget {
+ @override
+ Widget build(BuildContext context) {
+ return MaterialApp(
+ title: 'Reimbursement Form Status',
+ theme: ThemeData(
+ primarySwatch: Colors.blue,
+ visualDensity: VisualDensity.adaptivePlatformDensity,
+ ),
+ home: ReimbursementPage(),
+ );
+ }
+}
+
+class ReimbursementPage extends StatefulWidget {
+ @override
+ _ReimbursementPageState createState() => _ReimbursementPageState();
+}
+
+class _ReimbursementPageState extends State {
+ String? selectedRollNumber;
+ String? formStatus ;
+ List rollNumbers = ['Roll 1', 'Roll 2', 'Roll 3']; // Sample roll numbers
+
+ List