From ef28e43edd7845e28a95ee89b64723a725cf0044 Mon Sep 17 00:00:00 2001 From: azharhayat271 Date: Thu, 9 May 2024 02:54:57 +0500 Subject: [PATCH] updated code --- .flutter-plugins | 7 ++ .flutter-plugins-dependencies | 2 +- lib/cards/departments_card.dart | 42 +++++--- lib/cards/details/bme.dart | 68 +++++++++++++ lib/cards/details/civil.dart | 70 +++++++++++++ lib/cards/details/cs.dart | 71 ++++++++++++++ lib/cards/details/department.dart | 97 +++++++++++++++++++ lib/cards/details/electrical.dart | 69 +++++++++++++ lib/cards/details/mechnical.dart | 68 +++++++++++++ lib/cards/info_card.dart | 47 +++++---- lib/cards/information.dart | 69 +++++++++++++ lib/ui/chatbot_screen.dart | 5 +- lib/ui/login.dart | 1 - lib/ui/main.dart | 2 +- lib/ui/splash_screen.dart | 1 - linux/flutter/generated_plugin_registrant.cc | 4 + linux/flutter/generated_plugins.cmake | 1 + macos/Flutter/GeneratedPluginRegistrant.swift | 2 + pubspec.lock | 66 ++++++++++++- pubspec.yaml | 3 +- .../flutter/generated_plugin_registrant.cc | 3 + windows/flutter/generated_plugins.cmake | 1 + 22 files changed, 656 insertions(+), 43 deletions(-) create mode 100644 lib/cards/details/bme.dart create mode 100644 lib/cards/details/civil.dart create mode 100644 lib/cards/details/cs.dart create mode 100644 lib/cards/details/department.dart create mode 100644 lib/cards/details/electrical.dart create mode 100644 lib/cards/details/mechnical.dart create mode 100644 lib/cards/information.dart diff --git a/.flutter-plugins b/.flutter-plugins index df05251..993da4c 100644 --- a/.flutter-plugins +++ b/.flutter-plugins @@ -1,6 +1,13 @@ # This is a generated file; do not edit or check into version control. mapbox_gl=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\mapbox_gl-0.16.0\\ mapbox_gl_web=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\mapbox_gl_web-0.16.0\\ +url_launcher=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher-6.2.6\\ +url_launcher_android=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_android-6.3.1\\ +url_launcher_ios=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_ios-6.2.5\\ +url_launcher_linux=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_linux-3.1.1\\ +url_launcher_macos=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_macos-3.1.0\\ +url_launcher_web=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_web-2.3.1\\ +url_launcher_windows=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\url_launcher_windows-3.1.1\\ webview_flutter=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\webview_flutter-4.7.0\\ webview_flutter_android=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\webview_flutter_android-3.16.1\\ webview_flutter_wkwebview=C:\\Users\\azhar\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\webview_flutter_wkwebview-3.13.0\\ diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index f0a7548..441b440 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mapbox_gl","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\mapbox_gl-0.16.0\\\\","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\webview_flutter_wkwebview-3.13.0\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"mapbox_gl","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\mapbox_gl-0.16.0\\\\","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\webview_flutter_android-3.16.1\\\\","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[{"name":"mapbox_gl_web","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\mapbox_gl_web-0.16.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"mapbox_gl","dependencies":["mapbox_gl_web"]},{"name":"mapbox_gl_web","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2024-05-08 23:25:29.370343","version":"3.19.5"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mapbox_gl","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\mapbox_gl-0.16.0\\\\","native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_ios-6.2.5\\\\","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\webview_flutter_wkwebview-3.13.0\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"mapbox_gl","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\mapbox_gl-0.16.0\\\\","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_android-6.3.1\\\\","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\webview_flutter_android-3.16.1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_macos-3.1.0\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_linux-3.1.1\\\\","native_build":true,"dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_windows-3.1.1\\\\","native_build":true,"dependencies":[]}],"web":[{"name":"mapbox_gl_web","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\mapbox_gl_web-0.16.0\\\\","dependencies":[]},{"name":"url_launcher_web","path":"C:\\\\Users\\\\azhar\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_web-2.3.1\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"mapbox_gl","dependencies":["mapbox_gl_web"]},{"name":"mapbox_gl_web","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2024-05-09 02:40:58.550639","version":"3.19.5"} \ No newline at end of file diff --git a/lib/cards/departments_card.dart b/lib/cards/departments_card.dart index 67df90e..d25c343 100644 --- a/lib/cards/departments_card.dart +++ b/lib/cards/departments_card.dart @@ -1,26 +1,36 @@ import 'package:flutter/material.dart'; +import './details//department.dart'; // Import your department screen file class DepartmentsCard extends StatelessWidget { const DepartmentsCard({super.key}); @override Widget build(BuildContext context) { - return Card( - elevation: 5.0, - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: const [ - Icon(Icons.school, size: 40, color: Colors.brown), - SizedBox(height: 10), - Text('Acedemia', style: TextStyle(fontWeight: FontWeight.bold)), - SizedBox(height: 5), - Padding( - padding: EdgeInsets.only(left: 16.0), - child: Text('Explore academic programs.'), - ), - ], + return GestureDetector( + onTap: () { + // Navigate to your department screen + Navigator.push( + context, + MaterialPageRoute(builder: (context) => DepartmentScreen()), + ); + }, + child: const Card( + elevation: 5.0, + child: Padding( + padding: EdgeInsets.all(16.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(Icons.school, size: 40, color: Colors.brown), + SizedBox(height: 10), + Text('Academia', style: TextStyle(fontWeight: FontWeight.bold)), + SizedBox(height: 5), + Padding( + padding: EdgeInsets.only(left: 16.0), + child: Text('Explore academic programs.'), + ), + ], + ), ), ), ); diff --git a/lib/cards/details/bme.dart b/lib/cards/details/bme.dart new file mode 100644 index 0000000..fabfb4d --- /dev/null +++ b/lib/cards/details/bme.dart @@ -0,0 +1,68 @@ +import 'package:flutter/material.dart'; + +class BiomedicalEngineeringScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Biomedical Engineering Department'), + ), + body: SingleChildScrollView( + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Programs Offered:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text( + 'Masters Programs', + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(height: 10), + Text( + 'Bachelors Programs:', + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text('- Biomedical Engineering'), + SizedBox(height: 20), + Text( + 'Total Students: 200', + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(height: 20), + Text( + 'Departmental Societies:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text('- Biomedical Engineers Society'), + SizedBox(height: 20), + Text( + 'Staff:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text('- Dr. Ali Khan (Chairman)'), + Text('- Dr. Sarah Ahmed'), + Text('- Dr. Usman Ali'), + Text('- Dr. Ayesha Siddiqua'), + Text('- Miss Saba Naz'), + // Add other staff members similarly + ], + ), + ), + ); + } +} diff --git a/lib/cards/details/civil.dart b/lib/cards/details/civil.dart new file mode 100644 index 0000000..9ab6479 --- /dev/null +++ b/lib/cards/details/civil.dart @@ -0,0 +1,70 @@ +import 'package:flutter/material.dart'; + +class CivilEngineeringScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Civil Engineering Department'), + ), + body: SingleChildScrollView( + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Programs Offered:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text( + 'Masters Programs', + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(height: 10), + Text( + 'Bachelors Programs:', + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text('- Civil Engineering'), + SizedBox(height: 20), + Text( + 'Total Students: 250', + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(height: 20), + Text( + 'Departmental Societies:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text('- Codator'), + SizedBox(height: 20), + Text( + 'Staff:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text('- Dr. Muhammad Idrees (Chairman)'), + Text('- Dr. Mubasshir Khatana'), + Text('- Dr. Yaseen ul haq'), + Text('- Dr. Iqra Muneer'), + Text('- Miss Fatima Shahzadi'), + Text('- Miss Sadia Tariq'), + Text('- Miss Rabia Sana'), + // Add other staff members similarly + ], + ), + ), + ); + } +} diff --git a/lib/cards/details/cs.dart b/lib/cards/details/cs.dart new file mode 100644 index 0000000..6f7fb3f --- /dev/null +++ b/lib/cards/details/cs.dart @@ -0,0 +1,71 @@ +import 'package:flutter/material.dart'; + +class ComputerScienceScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Computer Science Department'), + ), + body: SingleChildScrollView( + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Programs Offered:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text( + 'Masters Programs', + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(height: 10), + Text( + 'Bachelors Programs:', + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text('- Computer Science'), + SizedBox(height: 20), + Text( + 'Total Students: 250', + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(height: 20), + Text( + 'Departmental Societies:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text('- Codator'), + SizedBox(height: 20), + Text( + 'Staff:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text('- Dr. Muhammad Idrees (Chairman)'), + Text('- Dr. Mubasshir Khatana'), + Text('- Dr. Yaseen ul haq'), + Text('- Dr. Iqra Muneer'), + Text('- Miss Fatima Shahzadi'), + Text('- Miss Sadia Tariq'), + Text('- Miss Rabia Sana'), + + // Add other staff members similarly + ], + ), + ), + ); + } +} diff --git a/lib/cards/details/department.dart b/lib/cards/details/department.dart new file mode 100644 index 0000000..b7a902d --- /dev/null +++ b/lib/cards/details/department.dart @@ -0,0 +1,97 @@ +// DepartmentScreen.dart +import 'package:flutter/material.dart'; +import './cs.dart'; +import './civil.dart'; +import './electrical.dart'; +import './mechnical.dart'; +import './bme.dart'; +// Import other department screen files + +class DepartmentScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Departments'), + ), + body: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: ListView( + children: [ + DepartmentCard( + departmentName: 'Computer Science', + chairman: 'Dr. Muhammad Idrees', + icon: Icons.computer, + departmentScreen: ComputerScienceScreen(), + ), + DepartmentCard( + departmentName: 'Civil Engineering', + chairman: 'Dr. Khawaja Adeel', + icon: Icons.flash_on, + departmentScreen: CivilEngineeringScreen(), + ), + + DepartmentCard( + departmentName: 'Electrical Engineering', + chairman: 'Dr. Muhammad Usman', + icon: Icons.electrical_services, + departmentScreen: ElectricalEngineeringScreen(), + ), + + DepartmentCard( + departmentName: 'Mechanical Engineering', + chairman: 'Dr. Muhammad Usman', + icon: Icons.engineering, + departmentScreen: MechanicalEngineeringScreen(), + ), + + DepartmentCard( + departmentName: 'Biomedical Engineering', + chairman: 'Dr. Muhammad Usman', + icon: Icons.medical_services, + departmentScreen: BiomedicalEngineeringScreen(), + ), + + // Add other department cards similarly + ], + ), + ), + ], + ), + ); + } +} + +class DepartmentCard extends StatelessWidget { + final String departmentName; + final String chairman; + final IconData icon; + final Widget departmentScreen; + + const DepartmentCard({ + required this.departmentName, + required this.chairman, + required this.icon, + required this.departmentScreen, + }); + + @override + Widget build(BuildContext context) { + return Card( + elevation: 5.0, + child: ListTile( + leading: Icon(icon), + title: Text(departmentName), + subtitle: Text('Chairman: $chairman'), + onTap: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => departmentScreen), + ); + }, + ), + ); + } +} diff --git a/lib/cards/details/electrical.dart b/lib/cards/details/electrical.dart new file mode 100644 index 0000000..d4cf4da --- /dev/null +++ b/lib/cards/details/electrical.dart @@ -0,0 +1,69 @@ +import 'package:flutter/material.dart'; + +class ElectricalEngineeringScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Electrical Engineering Department'), + ), + body: SingleChildScrollView( + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Programs Offered:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text( + 'Masters Programs', + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(height: 10), + Text( + 'Bachelors Programs:', + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text('- Electrical Engineering'), + SizedBox(height: 20), + Text( + 'Total Students: 300', + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(height: 20), + Text( + 'Departmental Societies:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text('- Electrician Society'), + SizedBox(height: 20), + Text( + 'Staff:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text('- Dr. Ali Khan (Chairman)'), + Text('- Dr. Sarah Ahmed'), + Text('- Dr. Usman Ali'), + Text('- Dr. Ayesha Siddiqua'), + Text('- Miss Saba Naz'), + Text('- Miss Saima Bibi'), + // Add other staff members similarly + ], + ), + ), + ); + } +} diff --git a/lib/cards/details/mechnical.dart b/lib/cards/details/mechnical.dart new file mode 100644 index 0000000..6531c78 --- /dev/null +++ b/lib/cards/details/mechnical.dart @@ -0,0 +1,68 @@ +import 'package:flutter/material.dart'; + +class MechanicalEngineeringScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Mechanical Engineering Department'), + ), + body: SingleChildScrollView( + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Programs Offered:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text( + 'Masters Programs', + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(height: 10), + Text( + 'Bachelors Programs:', + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text('- Mechanical Engineering'), + SizedBox(height: 20), + Text( + 'Total Students: 350', + style: TextStyle(fontWeight: FontWeight.bold), + ), + SizedBox(height: 20), + Text( + 'Departmental Societies:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text('- Mechanical Engineers Club'), + SizedBox(height: 20), + Text( + 'Staff:', + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 10), + Text('- Dr. Khalid Mahmood (Chairman)'), + Text('- Dr. Maria Khan'), + Text('- Dr. Amir Ali'), + Text('- Dr. Zainab Malik'), + Text('- Miss Ayesha Jamil'), + // Add other staff members similarly + ], + ), + ), + ); + } +} diff --git a/lib/cards/info_card.dart b/lib/cards/info_card.dart index 3ecd419..29b57a7 100644 --- a/lib/cards/info_card.dart +++ b/lib/cards/info_card.dart @@ -1,29 +1,40 @@ import 'package:flutter/material.dart'; +import './information.dart'; // Import the Information.dart screen class InformationCard extends StatelessWidget { - const InformationCard({super.key}); + const InformationCard({Key? key}); @override Widget build(BuildContext context) { return Card( elevation: 5.0, - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: const [ - Icon(Icons.info_outline, - size: 40, color: Colors.blue), // Informative icon - SizedBox(height: 10), - Text('Information Hub', - style: TextStyle(fontWeight: FontWeight.bold)), - SizedBox(height: 5), - Padding( - padding: EdgeInsets.only(left: 8.0), - child: - Text('Essential resources and updates at your fingertips.'), - ), - ], + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + InformationScreen()), // Navigate to Information.dart screen + ); + }, + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: const [ + Icon(Icons.info_outline, + size: 40, color: Colors.blue), // Informative icon + SizedBox(height: 10), + Text('Information Hub', + style: TextStyle(fontWeight: FontWeight.bold)), + SizedBox(height: 5), + Padding( + padding: EdgeInsets.only(left: 8.0), + child: + Text('Essential resources and updates at your fingertips.'), + ), + ], + ), ), ), ); diff --git a/lib/cards/information.dart b/lib/cards/information.dart new file mode 100644 index 0000000..15361ce --- /dev/null +++ b/lib/cards/information.dart @@ -0,0 +1,69 @@ +import 'package:flutter/material.dart'; + +class InformationScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('University Information'), + ), + body: SingleChildScrollView( + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildSection( + icon: Icons.location_city, // Icon for campus coordinator + title: 'Campus Coordinator', + content: 'Dr Muhammad Shahbaz', + ), + SizedBox(height: 20), + _buildSection( + icon: Icons.people, // Icon for DSA + title: 'DSA (Directors of Student Affairs)', + content: 'Dr Habib ur Rehman', + ), + SizedBox(height: 20), + _buildSection( + icon: Icons.group, // Icon for campus societies + title: 'Campus Societies', + content: 'UET Newsline, UET Tribune, UET Media Society', + ), + ], + ), + ), + ); + } + + Widget _buildSection( + {required IconData icon, + required String title, + required String content}) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(icon, size: 30, color: Colors.blue), + SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold), + ), + SizedBox(height: 5), + Text(content), + ], + ), + ), + ], + ), + Divider(), // Add a divider between sections + ], + ); + } +} diff --git a/lib/ui/chatbot_screen.dart b/lib/ui/chatbot_screen.dart index b016b81..6784129 100644 --- a/lib/ui/chatbot_screen.dart +++ b/lib/ui/chatbot_screen.dart @@ -6,6 +6,7 @@ class ChatScreen extends StatefulWidget { const ChatScreen({super.key}); @override + // ignore: library_private_types_in_public_api _ChatScreenState createState() => _ChatScreenState(); } @@ -32,9 +33,7 @@ class _ChatScreenState extends State { if (response.statusCode == 200) { Map data = json.decode(response.body); String answer = data['answer']; - return answer != null - ? answer - : "Error: No answer provided by the server"; + return answer; } else { return "Error: Failed to fetch response"; } diff --git a/lib/ui/login.dart b/lib/ui/login.dart index 43755db..6f2005f 100644 --- a/lib/ui/login.dart +++ b/lib/ui/login.dart @@ -1,7 +1,6 @@ import 'dart:convert'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; import 'package:http/http.dart' as http; import 'package:smart_assistant_uni/ui/signup.dart'; import 'navbar.dart'; diff --git a/lib/ui/main.dart b/lib/ui/main.dart index ceda879..7669dc5 100644 --- a/lib/ui/main.dart +++ b/lib/ui/main.dart @@ -17,7 +17,7 @@ class MyApp extends StatelessWidget { home: SplashScreen(), // Set SplashScreen as the initial route routes: { '/home': (context) => - LoginPage(), // Define the route for the home screen + const LoginPage(), // Define the route for the home screen }, ); } diff --git a/lib/ui/splash_screen.dart b/lib/ui/splash_screen.dart index 16adce3..0dc1b52 100644 --- a/lib/ui/splash_screen.dart +++ b/lib/ui/splash_screen.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import ''; class SplashScreen extends StatefulWidget { @override diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index e71a16d..f6f23bf 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -6,6 +6,10 @@ #include "generated_plugin_registrant.h" +#include void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); + url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); } diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 2e1de87..f16b4c3 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index cccf817..8236f57 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,8 @@ import FlutterMacOS import Foundation +import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index c7cc17a..014abae 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -325,6 +325,70 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: "6ce1e04375be4eed30548f10a315826fd933c1e493206eab82eed01f438c8d2e" + url: "https://pub.dev" + source: hosted + version: "6.2.6" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "360a6ed2027f18b73c8d98e159dda67a61b7f2e0f6ec26e86c3ada33b0621775" + url: "https://pub.dev" + source: hosted + version: "6.3.1" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5" + url: "https://pub.dev" + source: hosted + version: "6.2.5" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 + url: "https://pub.dev" + source: hosted + version: "3.1.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 + url: "https://pub.dev" + source: hosted + version: "3.1.0" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 + url: "https://pub.dev" + source: hosted + version: "3.1.1" vector_graphics: dependency: transitive description: @@ -415,4 +479,4 @@ packages: version: "6.5.0" sdks: dart: ">=3.3.0 <4.0.0" - flutter: ">=3.16.6" + flutter: ">=3.19.0" diff --git a/pubspec.yaml b/pubspec.yaml index 006bf73..6ff44d7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -37,9 +37,10 @@ dependencies: cupertino_icons: ^1.0.6 http: ^1.2.1 flutter_svg: ^2.0.10+1 - flutter_stetho: ^0.3.1 + # flutter_stetho: ^0.3.1 webview_flutter: ^4.7.0 mapbox_gl: ^0.16.0 + url_launcher: ^6.2.6 dev_dependencies: diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 8b6d468..4f78848 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -6,6 +6,9 @@ #include "generated_plugin_registrant.h" +#include void RegisterPlugins(flutter::PluginRegistry* registry) { + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index b93c4c3..88b22e5 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -3,6 +3,7 @@ # list(APPEND FLUTTER_PLUGIN_LIST + url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST