From b051bcb9b07de363bcbc614d100e9f051c8cc5f4 Mon Sep 17 00:00:00 2001 From: testgithubtiwari Date: Tue, 16 Apr 2024 14:44:13 +0530 Subject: [PATCH] some new changes done --- .../adminoptions/alldesigncredits.dart | 149 +++++++++--------- lib/screens/auth/loginscreen.dart | 34 ++-- lib/screens/auth/signupscreen.dart | 34 ++-- lib/screens/homepage/homepage.dart | 1 - .../studentoptions/userapplications.dart | 15 +- lib/widgets/constants.dart | 2 +- lib/widgets/desktopappbar.dart | 16 +- lib/widgets/profilepage.dart | 12 +- 8 files changed, 141 insertions(+), 122 deletions(-) diff --git a/lib/screens/adminoptions/alldesigncredits.dart b/lib/screens/adminoptions/alldesigncredits.dart index f414e62..699f442 100644 --- a/lib/screens/adminoptions/alldesigncredits.dart +++ b/lib/screens/adminoptions/alldesigncredits.dart @@ -114,81 +114,84 @@ class _DesignCreditContainerState extends State { @override Widget build(BuildContext context) { final Size size = MediaQuery.of(context).size; - return Container( - padding: const EdgeInsets.all(15), - // height: 250, - width: size.width >= 400 ? 400 : 350, - margin: const EdgeInsets.fromLTRB(0, 0, 0, 10), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - color: const Color.fromARGB(255, 12, 44, 43), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CustomText( - text: widget.projectName, - textType: 'Project-Name:', - ), - SizedBox( - height: 10, - ), - const Divider( - height: 1, - color: Colors.white, - ), - SizedBox( - height: 10, - ), - CustomText( - text: widget.professorName, - textType: 'Professor-Name:', - ), - SizedBox( - height: 10, - ), - const Divider( - height: 1, - color: Colors.white, - ), - SizedBox( - height: 10, - ), - CustomText( - text: widget.offeredBy, - textType: 'Offered-By:', - ), - const SizedBox( - height: 10, - ), - SizedBox( - height: 10, - ), - const Divider( - height: 1, - color: Colors.white, - ), - SizedBox( - height: 10, - ), - const Text( - 'Eligible Branches:', - style: TextStyle( + return Card( + elevation: 5, + child: Container( + padding: const EdgeInsets.all(15), + // height: 250, + width: size.width >= 400 ? 400 : 350, + margin: const EdgeInsets.fromLTRB(0, 0, 0, 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: const Color.fromARGB(255, 12, 44, 43), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CustomText( + text: widget.projectName, + textType: 'Project-Name:', + ), + SizedBox( + height: 10, + ), + const Divider( + height: 1, color: Colors.white, - fontSize: 18, - fontWeight: FontWeight.bold, ), - ), - Wrap( - spacing: 5, - runSpacing: 5, - children: widget.eligibleBranches.map( - (branches) { - return CustomText1(text: branches); - }, - ).toList(), - ), - ], + SizedBox( + height: 10, + ), + CustomText( + text: widget.professorName, + textType: 'Professor-Name:', + ), + SizedBox( + height: 10, + ), + const Divider( + height: 1, + color: Colors.white, + ), + SizedBox( + height: 10, + ), + CustomText( + text: widget.offeredBy, + textType: 'Offered-By:', + ), + const SizedBox( + height: 10, + ), + SizedBox( + height: 10, + ), + const Divider( + height: 1, + color: Colors.white, + ), + SizedBox( + height: 10, + ), + const Text( + 'Eligible Branches:', + style: TextStyle( + color: Colors.white, + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + Wrap( + spacing: 5, + runSpacing: 5, + children: widget.eligibleBranches.map( + (branches) { + return CustomText1(text: branches); + }, + ).toList(), + ), + ], + ), ), ); } diff --git a/lib/screens/auth/loginscreen.dart b/lib/screens/auth/loginscreen.dart index 45a558a..e5967c6 100644 --- a/lib/screens/auth/loginscreen.dart +++ b/lib/screens/auth/loginscreen.dart @@ -323,19 +323,19 @@ class _LoginScreenState extends State { ) : Row( children: [ + // Container( + // height: size.height, + // width: size.width * 0.50, + // decoration: const BoxDecoration( + // image: DecorationImage( + // image: AssetImage(loginBackgroundImage), + // fit: BoxFit.fill, + // ), + // ), + // ), Container( height: size.height, - width: size.width * 0.50, - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage(loginBackgroundImage), - fit: BoxFit.fill, - ), - ), - ), - Container( - height: size.height, - width: size.width * 0.50, + width: size.width, decoration: const BoxDecoration( image: DecorationImage( image: AssetImage(iitjCampus), @@ -346,15 +346,15 @@ class _LoginScreenState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - height: 600, + height: 500, width: 500, decoration: BoxDecoration( - border: Border.all( - width: 1, - color: Colors.grey, - ), + // border: Border.all( + // width: 1, + // color: Colors., + // ), borderRadius: BorderRadius.circular(20), - color: const Color.fromARGB(125, 0, 0, 0), + color: Color.fromARGB(150, 0, 0, 0), ), child: Column( children: [ diff --git a/lib/screens/auth/signupscreen.dart b/lib/screens/auth/signupscreen.dart index 8256a75..d15906c 100644 --- a/lib/screens/auth/signupscreen.dart +++ b/lib/screens/auth/signupscreen.dart @@ -440,7 +440,7 @@ class _SignUpState extends State { children: [ Container( height: size.height, - width: size.width * 0.50, + width: size.width, decoration: const BoxDecoration( image: DecorationImage( image: AssetImage(iitjCampus), @@ -451,15 +451,15 @@ class _SignUpState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - height: 600, + height: 500, width: 500, decoration: BoxDecoration( - border: Border.all( - width: 1, - color: Colors.grey, - ), + // border: Border.all( + // width: 1, + // color: Colors.grey, + // ), borderRadius: BorderRadius.circular(20), - color: const Color.fromARGB(125, 0, 0, 0), + color: Color.fromARGB(137, 0, 0, 0), ), child: SingleChildScrollView( child: Column( @@ -706,16 +706,16 @@ class _SignUpState extends State { ], ), ), - Container( - height: size.height, - width: size.width * 0.50, - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage(loginBackgroundImage), - fit: BoxFit.fill, - ), - ), - ), + // Container( + // height: size.height, + // width: size.width * 0.50, + // decoration: const BoxDecoration( + // image: DecorationImage( + // image: AssetImage(loginBackgroundImage), + // fit: BoxFit.fill, + // ), + // ), + // ), ], ), ), diff --git a/lib/screens/homepage/homepage.dart b/lib/screens/homepage/homepage.dart index 5f96773..7a7e501 100644 --- a/lib/screens/homepage/homepage.dart +++ b/lib/screens/homepage/homepage.dart @@ -58,7 +58,6 @@ class _HomePageState extends State { _userFuture = result.item1; final prefs = await SharedPreferences.getInstance(); prefs.setString('userId', _userFuture?[0].sId ?? ''); - print(_userFuture?[0].email); } } diff --git a/lib/screens/studentoptions/userapplications.dart b/lib/screens/studentoptions/userapplications.dart index 3447f3a..400a181 100644 --- a/lib/screens/studentoptions/userapplications.dart +++ b/lib/screens/studentoptions/userapplications.dart @@ -3,9 +3,11 @@ import 'package:DesignCredit/api/allapplicationsapi.dart'; import 'package:DesignCredit/models/allapplicationusermodel.dart'; import 'package:DesignCredit/widgets/constants.dart'; +import 'package:DesignCredit/widgets/desktopappbar.dart'; import 'package:DesignCredit/widgets/mobileappbar.dart'; import 'package:DesignCredit/widgets/navdrawer.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -63,7 +65,7 @@ class _UserApplicationState extends State { child: SingleChildScrollView( child: Column( children: [ - const MobileAppBar(), + size.width >= 1200 ? DeskTopAppBar() : MobileAppBar(), const SizedBox( height: 20, ), @@ -194,10 +196,13 @@ class _DesignCreditContainerState extends State { const SizedBox( width: 20, ), - const Icon( - Icons.link, - color: Colors.white, - size: 30, + MouseRegion( + cursor: SystemMouseCursors.click, + child: const Icon( + Icons.link, + color: Colors.white, + size: 30, + ), ), ], ), diff --git a/lib/widgets/constants.dart b/lib/widgets/constants.dart index 626f9e2..48b8f0a 100644 --- a/lib/widgets/constants.dart +++ b/lib/widgets/constants.dart @@ -1,7 +1,7 @@ // API URLS const baseUrlMain = 'http://13.201.24.145:5000/software-project.in'; const baseUrlLocalhost = 'http://localhost:5000/software-project.in'; -const baseUrlMobileLocalhost = 'http://13.201.24.145:5000/software-project.in'; +const baseUrlMobileLocalhost = 'http://localhost:5000/software-project.in'; const adminEmail = 'tiwari.26@iitj.ac.in'; // Images const logo = 'assets/images/iitj.jpg'; diff --git a/lib/widgets/desktopappbar.dart b/lib/widgets/desktopappbar.dart index 633cf40..ec5848f 100644 --- a/lib/widgets/desktopappbar.dart +++ b/lib/widgets/desktopappbar.dart @@ -3,9 +3,11 @@ import 'package:DesignCredit/api/isprofilecompleted.dart'; import 'package:DesignCredit/screens/adminoptions/allapplications.dart'; import 'package:DesignCredit/screens/adminoptions/alluser.dart'; +import 'package:DesignCredit/screens/homepage/homepage.dart'; import 'package:DesignCredit/screens/professoroptions.dart/adddesigncredit.dart'; import 'package:DesignCredit/screens/professoroptions.dart/viewdesigncredit.dart'; import 'package:DesignCredit/screens/studentoptions/designcredits.dart'; +import 'package:DesignCredit/screens/studentoptions/userapplications.dart'; import 'package:DesignCredit/widgets/constants.dart'; import 'package:DesignCredit/widgets/profilepage.dart'; // import 'package:flutter/cupertino.dart'; @@ -108,7 +110,12 @@ class _DeskTopAppBarState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ GestureDetector( - onTap: () {}, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const HomePage())); + }, child: const MouseRegion( cursor: SystemMouseCursors.click, child: SizedBox( @@ -330,7 +337,12 @@ class _StudentOptionState extends State { ), ClickableText( text: 'My Applications', - onTap: () {}, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const UserApplication())); + }, ), const SizedBox( width: 30, diff --git a/lib/widgets/profilepage.dart b/lib/widgets/profilepage.dart index d7684f6..d6bbbcb 100644 --- a/lib/widgets/profilepage.dart +++ b/lib/widgets/profilepage.dart @@ -25,7 +25,7 @@ class UpdateProfilePage extends StatefulWidget { class _ProfilePageState extends State { List? _userFuture; - String? _email; // Make _email nullable + String? _email; String? _name; String? _userType; String? _selectedBranch; @@ -64,16 +64,15 @@ class _ProfilePageState extends State { } else if (statusCode == 500) { showToast('Internal Server Error! Please try after sometime', Colors.red); } else { + print(_userFuture); _userFuture = result.item1; final prefs = await SharedPreferences.getInstance(); prefs.setString('userId', _userFuture?[0].sId ?? ''); - _email = - _userFuture?[0].email ?? ''; // Update _email with the fetched email + _email = _userFuture?[0].email ?? ''; _name = _userFuture?[0].name ?? ''; _userType = _userFuture?[0].userType ?? ''; - _selectedBranch = _userFuture?[0].branch ?? ''; + _selectedBranch = _userFuture?[0].branch!.toUpperCase() ?? ''; _rollNumber = _userFuture?[0].rollNumber ?? ''; - setState(() {}); } } @@ -191,9 +190,10 @@ class _ProfilePageState extends State { height: 25, ), Container( + margin: EdgeInsets.fromLTRB(0, 10, 0, 10), padding: const EdgeInsets.fromLTRB(5, 20, 5, 0), height: 650, - width: size.width > 1200 ? 700 : size.width * 0.90, + width: size.width > 1200 ? 600 : size.width * 0.90, decoration: BoxDecoration( border: Border.all(width: 1, color: Colors.amberAccent), borderRadius: BorderRadius.circular(15),