diff --git a/lib/Components/side_drawer.dart b/lib/Components/side_drawer.dart index be08db0e..b523a896 100644 --- a/lib/Components/side_drawer.dart +++ b/lib/Components/side_drawer.dart @@ -130,7 +130,7 @@ class _SideDrawerState extends State { ModulesPadding( line: 'Library Module', pageMover: '/library_homepage'), - ModulesPadding(line: 'Awards & Scholarship Module'), + ModulesPadding(line: 'Awards & Scholarship Module', isActive: true, pageMover: '/scholarship_awards',), ModulesPadding( line: 'Complaint Module', pageMover: '/complaint'), ModulesPadding(line: 'Central Mess Module'), diff --git a/lib/main.dart b/lib/main.dart index 29a2c810..9e8dd20a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -42,6 +42,11 @@ import 'package:fusion/screens/Healthcenter/viewschedule.dart'; import 'package:fusion/screens/Healthcenter/history.dart'; import 'package:fusion/screens/Healthcenter/HealthCenter.dart'; import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/screens/Scholarships_Awards/scholarship_awards.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/award_catalogue.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/Faculty/invite_application.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/Faculty/award_catalogue.dart'; +import 'package:fusion/screens/Scholarships_Awards/ApplyForAwards/applyforawards.dart'; void main() { WidgetsFlutterBinding.ensureInitialized(); @@ -109,6 +114,12 @@ class MyApp extends StatelessWidget { '/gymkhana_homepage/polls': (context) => Polls(), '/gymkhana_homepage/clubs': (context) => Club(), '/gymkhana_homepage/member_records': (context) => Records(), + '/scholarship_awards': (context) => ScholarshipAwards(ModalRoute.of(context)!.settings.arguments.toString()), + '/scholarship_awards/browse_award_catalogue': (context) => BrowseAwardCatalogue(), + '/scholarship_awards/manage_award_catalogue_fac': (context) => ManageAwardCatalogueFaculty(), + '/scholarship_awards/invite_application': (context) => InviteApplication(), + '/scholarship_awards/apply_for_awards': (context) => ApplyForAwards(), + '/library_homepage': (context) => LibraryHomeScreen(), '/library_homepage/book_search': (context) => BookSearch(), '/library_homepage/issued_items': (context) => IssuedItems(), diff --git a/lib/screens/Scholarships_Awards/ApplyForAwards/Convocation.dart b/lib/screens/Scholarships_Awards/ApplyForAwards/Convocation.dart new file mode 100644 index 00000000..7c00aef0 --- /dev/null +++ b/lib/screens/Scholarships_Awards/ApplyForAwards/Convocation.dart @@ -0,0 +1,76 @@ +import 'package:flutter/material.dart'; + +class Convocation extends StatefulWidget { + @override + _ConvocationState createState() => _ConvocationState(); +} + +class _ConvocationState extends State { + final GlobalKey _formKey = GlobalKey(); + String? programme_type; + List awardTypeItem = [ + "Directors Gold Medal", + "Directors Silver Medal", + 'Notional Prizes', + 'MCM Scholarship', + 'D&M Proficiency Gold Medal', + ]; + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Column( + children: [ + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 4, vertical: 16), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 16), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + ), + borderRadius: BorderRadius.circular(15), + ), + child: DropdownButton( + hint: Text('Enter Award'), + dropdownColor: Colors.grey[200], + icon: Icon(Icons.arrow_drop_down), + isExpanded: true, + underline: SizedBox(), + style: TextStyle(color: Colors.black, fontSize: 16), + onChanged: (newValue) { + setState(() { + programme_type = newValue.toString(); + }); + print(programme_type); + //print(valueItem); + }, + value: programme_type, + items: awardTypeItem.map((valueItem) { + return DropdownMenuItem( + value: valueItem, + child: Text(valueItem), + ); + }).toList(), + ), + ), + ), + SizedBox(height: 20), + SizedBox(height: 20), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 40), + child: Divider( + thickness: 1, + color: Colors.black54, + ), + ), + ] + ), + ), + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/ApplyForAwards/MCMScholarship.dart b/lib/screens/Scholarships_Awards/ApplyForAwards/MCMScholarship.dart new file mode 100644 index 00000000..57827c41 --- /dev/null +++ b/lib/screens/Scholarships_Awards/ApplyForAwards/MCMScholarship.dart @@ -0,0 +1,1346 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; + +class MCMScholarship extends StatefulWidget { + @override + _MCMScholarshipState createState() => _MCMScholarshipState(); +} + +class _MCMScholarshipState extends State { + final GlobalKey _formKey = GlobalKey(); + String? fatherocc_type; + List fatheroccTypeItem = [ + "Government", + "Private", + "Public", + "Business", + "Medical", + "Consultant", + "Pensioners", + ]; + String? motherocc_type; + List motheroccTypeItem = [ + "EMPLOYED", + "HOUSE_WIFE", + ]; + String? house_type; + List houseTypeItem = [ + 'RENTED', + 'OWNED', + ]; + @override + Widget build(BuildContext context) { + String? specific_location; + return Scaffold( + body: SingleChildScrollView( + child: new Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + new Container( + child: new Column( + children: [ + SizedBox(height: 20), + Text( + "MCM Scholarship Application Form:", + textAlign: TextAlign.center, + style: const TextStyle( + fontWeight: FontWeight.bold, fontSize: 16), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Divider( + thickness: 1, + color: Colors.black54, + ), + ), + ], + ), + ), + new Container( + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox(height: 15), + ElevatedButton.icon( + onPressed: () {}, + icon: Icon( + Icons.download, + size: 24.0, + ), + label: Text('Form A'), + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), + ), + SizedBox(height: 15), + ElevatedButton.icon( + onPressed: () {}, + icon: Icon( + Icons.download, + size: 24.0, + ), + label: Text('Form B'), + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), + ), + SizedBox(height: 15), + ElevatedButton.icon( + onPressed: () {}, + icon: Icon( + Icons.download, + size: 24.0, + ), + label: Text('Form C'), + style: ButtonStyle( + backgroundColor: MaterialStateProperty.all(Colors.blue), + ), + ), + ], + ), + ), + new Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + new Container( + padding: const EdgeInsets.fromLTRB(40, 20, 20, 0), + child: Row( + children: [ + SizedBox( + height: 40, + ), + Text( + 'Category: ', + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: 'Category', + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + 'Hall No. :', + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: 'Hall No.', + contentPadding: EdgeInsets.fromLTRB( + 20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + 'Room No. :', + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: 'Room No. ', + contentPadding: EdgeInsets.fromLTRB( + 20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ), + new Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Father's Name :", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Father's Name", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: Column(children: [ + SizedBox( + height: 16, + ), + Text( + "Father's Occupation :", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4, vertical: 2), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 6), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + ), + borderRadius: BorderRadius.circular(15), + ), + width: 140.0, + child: DropdownButton( + hint: Text('Select Item'), + dropdownColor: Colors.grey[200], + icon: Icon(Icons.arrow_drop_down), + underline: SizedBox(), + style: TextStyle(color: Colors.black, fontSize: 14), + onChanged: (newValue) { + setState(() { + fatherocc_type = newValue.toString(); + }); + print(fatherocc_type); + //print(valueItem); + }, + value: fatherocc_type, + items: fatheroccTypeItem.map((valueItem) { + return DropdownMenuItem( + value: valueItem, + child: Text(valueItem), + ); + }).toList(), + ), + ), + ), + ]), + ) + ], + ), + ), + new Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Mother's Name :", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Mother's Name ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: Column(children: [ + SizedBox( + height: 16, + ), + Text( + "Mother's Occupation :", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4, vertical: 2), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 6), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + ), + borderRadius: BorderRadius.circular(15), + ), + width: 140.0, + child: DropdownButton( + hint: Text('Select Item'), + dropdownColor: Colors.grey[200], + icon: Icon(Icons.arrow_drop_down), + underline: SizedBox(), + style: TextStyle(color: Colors.black, fontSize: 14), + onChanged: (newValue) { + setState(() { + motherocc_type = newValue.toString(); + }); + print(motherocc_type); + //print(valueItem); + }, + value: motherocc_type, + items: motheroccTypeItem.map((valueItem) { + return DropdownMenuItem( + value: valueItem, + child: Text(valueItem), + ); + }).toList(), + ), + ), + ), + ]), + ), + ], + ), + ), + new Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text( + "Father's Occupation Description *", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + SizedBox( + height: 40, + width: 350.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Father Occupation Description ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text( + "Mother's Occupation Description *", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + SizedBox( + height: 40, + width: 350.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Mother Occupation Description ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Brother's Name: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Brother's Name", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Brother's Occupation: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Occup.. ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + new Container( + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Sister's Name: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Name", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Sister's Occupation: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Occup.. ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + new Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text( + "Father's Annual Income: ", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + SizedBox( + height: 40, + width: 350.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Father Annual Income", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text( + "Mother's Annual Income: ", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + SizedBox( + height: 40, + width: 350.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Mother Annual Income: ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text( + "Other sources Annual Income: ", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + SizedBox( + height: 40, + width: 350.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Other sources Annual Income ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + padding: const EdgeInsets.fromLTRB(40, 20, 20, 0), + child: Row( + children: [ + SizedBox( + height: 40, + ), + Text( + '# of Four Wheeler : ', + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: 'Number of 4 Wheelers', + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text( + "Four Wheeler Description: ", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + SizedBox( + height: 40, + width: 350.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Four Wheeler Description ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + padding: const EdgeInsets.fromLTRB(40, 20, 20, 0), + child: Row( + children: [ + SizedBox( + height: 40, + ), + Text( + '# of Two Wheeler : ', + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: 'Number of 2 Wheelers', + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 20, + ), + Text( + "Two Wheeler Description: ", + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + ), + ), + SizedBox( + height: 40, + width: 350.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Two Wheeler Description ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + padding: const EdgeInsets.fromLTRB(40, 20, 20, 0), + child: Row( + children: [ + SizedBox( + height: 16, + ), + Text( + "House Type :", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 4, vertical: 2), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 6), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + ), + borderRadius: BorderRadius.circular(15), + ), + width: 140.0, + child: DropdownButton( + hint: Text('Select Item'), + dropdownColor: Colors.grey[200], + icon: Icon(Icons.arrow_drop_down), + underline: SizedBox(), + style: TextStyle(color: Colors.black, fontSize: 14), + onChanged: (newValue) { + setState(() { + house_type = newValue.toString(); + }); + print(house_type); + //print(valueItem); + }, + value: house_type, + items: houseTypeItem.map((valueItem) { + return DropdownMenuItem( + value: valueItem, + child: Text(valueItem), + ); + }).toList(), + ), + ), + ), + ], + ), + ), + new Container( + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Plot Area: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Area ...", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Constructed Area: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Area.. ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + new Container( + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Fees 10th Standard: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Fees ...", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Name of School: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "School.. ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + new Container( + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Fees 12th Standard: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Fees ...", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Name of College: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "College.. ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + new Container( + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Amount of Edu. Bank loan: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Amount ...", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + new Container( + child: new Column( + children: [ + SizedBox( + height: 16, + ), + Text( + "Bank Name: ", + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + SizedBox( + height: 40, + width: 140.0, + child: TextFormField( + autofocus: false, + style: TextStyle( + color: Colors.black, + ), + decoration: InputDecoration( + filled: true, + fillColor: Colors.white, + hintText: "Bank.. ", + contentPadding: + EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: + BorderRadius.all(Radius.circular(32)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + new Container( + child: new Column( + children: [ + SizedBox( + height: 20, + ), + Center( + child: ElevatedButton( + onPressed: () async {}, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + 'Submit', + style: TextStyle(fontSize: 20), + ), + ), + style: ButtonStyle( + backgroundColor: + MaterialStateProperty.resolveWith( + (Set states) { + if (states.contains(MaterialState.pressed)) + return Colors.deepOrange; + return Colors + .deepOrangeAccent; // Use the component's default. + }, + ), + ), + ), + ), + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/ApplyForAwards/ViewApplications.dart b/lib/screens/Scholarships_Awards/ApplyForAwards/ViewApplications.dart new file mode 100644 index 00000000..88d37307 --- /dev/null +++ b/lib/screens/Scholarships_Awards/ApplyForAwards/ViewApplications.dart @@ -0,0 +1,124 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:toggle_switch/toggle_switch.dart'; +import 'package:http/http.dart'; + +class ViewApplications extends StatefulWidget { + @override + _ViewApplicationsState createState() => _ViewApplicationsState(); +} + +final List> awards = [ + { + "Name": " ", + "Application ID": " ", + "Applied Date": " ", + "Status": " ", + } +]; + +class _ViewApplicationsState extends State { + + + @override + Widget build(BuildContext context) { + return listView(); + } +} + +//Main component to render the table.. +ListView listView() { + return ListView( + children: [ + SizedBox(height: 40), + ToggleSwitch( + minWidth: 800, + initialLabelIndex: 0, + totalSwitches: 2, + activeBgColor: [Colors.orange], + activeFgColor: Colors.white, + inactiveBgColor: Color.fromARGB(255, 214, 214, 214), + inactiveFgColor: Colors.grey[900], + + labels: ['Current','History'], + onToggle: (index) { + print('switched to: $index'); + }, + ), + SizedBox(height: 10), + Container( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Text( + "Current Applications", + style: TextStyle( + fontSize: 20.0, + color: Colors.deepOrangeAccent, + ), + )), + ), + ), + SizedBox(height: 20), + //To scroll pass the width + SingleChildScrollView( + scrollDirection: Axis.horizontal, + //Component to lay table on the page + child: DataTable( + // headingRowColor: + // MaterialStateColor.resolveWith((states) => Colors.blue), + dataRowHeight: 80.0, + columnSpacing: 28.0, + columns: [ + //DataColumns to lay columns of the table + DataColumn( + label: Text('Name', + style: + TextStyle(fontSize: 13, fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Application ID', + style: + TextStyle(fontSize: 14, fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Applied Date', + style: + TextStyle(fontSize: 14, fontWeight: FontWeight.bold))), + DataColumn( + label: Text('Status', + style: + TextStyle(fontSize: 14, fontWeight: FontWeight.bold))), + ], + //This method will get lay all the rows + rows: awardList(), + ), + ), + ], + ); +} + +List awardList() { + //Get the list of json and map through, to select each json and lay row to the table.. + return awards + .map( + ((element) => DataRow( + cells: [ + DataCell(Container( + width: 40, //SET width + child: Text(element[ + "Name"]!))), //Extracting from Map element the value + DataCell(Container( + width: 57, //SET width + child: Text(element["Application ID"]!))), + DataCell(Container( + width: 57, //SET width + child: Text(element["Applied Date"]!))), + DataCell(Container( + width: 57, //SET width + child: Text(element["Status"]!))), + ], + )), + ) + .toList(); +} diff --git a/lib/screens/Scholarships_Awards/ApplyForAwards/applyforawards.dart b/lib/screens/Scholarships_Awards/ApplyForAwards/applyforawards.dart new file mode 100644 index 00000000..07c68419 --- /dev/null +++ b/lib/screens/Scholarships_Awards/ApplyForAwards/applyforawards.dart @@ -0,0 +1,87 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:fusion/screens/Scholarships_Awards/ApplyForAwards/Convocation.dart'; +import 'package:fusion/screens/Scholarships_Awards/ApplyForAwards/MCMScholarship.dart'; +import 'package:fusion/screens/Scholarships_Awards/ApplyForAwards/ViewApplications.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/catalogue.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/previous_winners.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/spacs_memebers_details.dart'; +import 'package:http/http.dart'; + +class ApplyForAwards extends StatefulWidget { + @override + _ApplyForAwardsState createState() => _ApplyForAwardsState(); +} + +class _ApplyForAwardsState extends State { + bool _loading1 = true; + + @override + Widget build(BuildContext context) { + return DefaultTabController( + length: 3, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.black, + title: Text( + "Apply For Awards", + style: TextStyle(color: Colors.white), + ), + actions: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.search), + ), + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.notifications), + ), + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.more_vert), + ), + ], + //TabBar for a horizontal scrollable tob bar + bottom: TabBar( + isScrollable: true, + indicatorColor: Colors.white, + indicatorWeight: 6.0, + tabs: [ + Tab( + child: Container( + child: Text( + 'MCM Scholarship', + ), + ), + ), + Tab( + child: Container( + child: Text( + 'Convocation Medals', + ), + ), + ), + Tab( + child: Container( + child: Text( + 'View Applications Status', + ), + ), + ), + ], + ), + ), + //TabBarView contains all the children to be called when tapped. + body: TabBarView( + children: [ + MCMScholarship(), + Convocation(), + ViewApplications(), + ], + ), + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/award_catalogue.dart b/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/award_catalogue.dart new file mode 100644 index 00000000..abd097fc --- /dev/null +++ b/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/award_catalogue.dart @@ -0,0 +1,95 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/Faculty/manage_catalogue.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/catalogue.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/previous_winners.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/spacs_memebers_details.dart'; +import 'package:http/http.dart'; + +class ManageAwardCatalogueFaculty extends StatefulWidget { + @override + _ManageAwardCatalogueFacultyState createState() => _ManageAwardCatalogueFacultyState(); +} + +class _ManageAwardCatalogueFacultyState extends State { + bool _loading1 = true; + + int step = 0; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return DefaultTabController( + //Default TabController for tab scrollbar with number of elements equal to 4 + length: 3, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.black, + title: Text( + "Manage Award Catalogue", + style: TextStyle(color: Colors.white), + ), + actions: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.search), + ), + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.notifications), + ), + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.more_vert), + ), + ], + //TabBar for a horizontal scrollable tob bar + bottom: TabBar( + isScrollable: true, + indicatorColor: Colors.white, + indicatorWeight: 6.0, + tabs: [ + Tab( + child: Container( + child: Text( + 'Cataloge', + ), + ), + ), + Tab( + child: Container( + child: Text( + 'Spacs Members', + ), + ), + ), + Tab( + child: Container( + child: Text( + 'Previous Winners', + ), + ), + ), + ], + ), + ), + //TabBarView contains all the children to be called when tapped. + body: TabBarView( + children: [ + ManageCatalogue(), + SpacsMembersDetails( + ModalRoute.of(context)!.settings.arguments.toString()), + PreviousWinners( + ModalRoute.of(context)!.settings.arguments.toString()), + ], + ), + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/invite_app.dart b/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/invite_app.dart new file mode 100644 index 00000000..520d4679 --- /dev/null +++ b/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/invite_app.dart @@ -0,0 +1,176 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; + +class InviteApplications extends StatefulWidget { + @override + _InviteApplicationsState createState() => _InviteApplicationsState(); +} + +class _InviteApplicationsState extends State { + final GlobalKey _formKey = GlobalKey(); + String? programme_type; + List programmeTypeItem = [ + 'B.Tech', + 'B.des', + 'M.Tech', + 'PhD', + ]; + String? scholarship_type; + List scholarshipTypeItem = [ + 'MCM', + 'NSP', + 'Random', + ]; + String? academicyear; + List academicyearTypeItem = [ + '1st', + '2nd', + '3rd', + '4th', + ]; + // String? programme_type; + List awardTypeItem = [ + "Directors Gold Medal", + "Directors Silver Medal", + 'Notional Prizes', + 'MCM Scholarship', + 'D&M Proficiency Gold Medal', + ]; + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Column(children: [ + SizedBox(height: 10), + Container( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Text( + "Invite Applications", + style: TextStyle( + fontSize: 24.0, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + )), + ), + ), + new Container( + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Container( + padding: const EdgeInsets.fromLTRB(40, 20, 20, 0), + child: new Column( + children: [ + Text( + 'Programme', + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.w500, + fontSize: 15, + ), + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4, vertical: 16), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 6), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + ), + borderRadius: BorderRadius.circular(15), + ), + width: 140.0, + child: DropdownButton( + hint: Text('Select Item'), + dropdownColor: Colors.grey[200], + icon: Icon(Icons.arrow_drop_down), + underline: SizedBox(), + style: + TextStyle(color: Colors.black, fontSize: 14), + onChanged: (newValue) { + setState(() { + programme_type = newValue.toString(); + }); + print(programme_type); + //print(valueItem); + }, + value: programme_type, + items: programmeTypeItem.map((valueItem) { + return DropdownMenuItem( + value: valueItem, + child: Text(valueItem), + ); + }).toList(), + ), + ), + ), + ], + ), + ), + new Container( + padding: const EdgeInsets.fromLTRB(0, 20, 40, 0), + child: new Column( + children: [ + Text( + 'Academic Year*', + style: TextStyle( + fontWeight: FontWeight.w500, + fontSize: 15, + ), + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 0, vertical: 16), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 6), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + ), + borderRadius: BorderRadius.circular(15), + ), + width: 140.0, + child: DropdownButton( + hint: Text('Select Item'), + dropdownColor: Colors.grey[200], + icon: Icon(Icons.arrow_drop_down), + isExpanded: true, + underline: SizedBox(), + style: + TextStyle(color: Colors.black, fontSize: 14), + onChanged: (newValue) { + setState(() { + academicyear = newValue.toString(); + }); + }, + value: academicyear, + items: academicyearTypeItem.map((valueItem) { + return DropdownMenuItem( + value: valueItem, + child: Text(valueItem), + ); + }).toList(), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ]), + ), + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/invite_application.dart b/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/invite_application.dart new file mode 100644 index 00000000..a120f837 --- /dev/null +++ b/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/invite_application.dart @@ -0,0 +1,88 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/Faculty/invite_app.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/Faculty/recent_app.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/catalogue.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/previous_winners.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/spacs_memebers_details.dart'; +import 'package:http/http.dart'; + +class InviteApplication extends StatefulWidget { + @override + _InviteApplicationState createState() => + _InviteApplicationState(); +} + +class _InviteApplicationState + extends State { + bool _loading1 = true; + + int step = 0; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return DefaultTabController( + //Default TabController for tab scrollbar with number of elements equal to 4 + length: 3, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.black, + title: Text( + "Invite Applications", + style: TextStyle(color: Colors.white), + ), + actions: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.search), + ), + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.notifications), + ), + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.more_vert), + ), + ], + //TabBar for a horizontal scrollable tob bar + bottom: TabBar( + isScrollable: true, + indicatorColor: Colors.white, + indicatorWeight: 6.0, + tabs: [ + Tab( + child: Container( + child: Text( + 'Invite Applications', + ), + ), + ), + Tab( + child: Container( + child: Text( + 'Recent Invite Applications', + ), + ), + ), + ], + ), + ), + //TabBarView contains all the children to be called when tapped. + body: TabBarView( + children: [ + InviteApplications(), + RecentInviteApplications(), + ], + ), + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/manage_catalogue.dart b/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/manage_catalogue.dart new file mode 100644 index 00000000..3da6bdc7 --- /dev/null +++ b/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/manage_catalogue.dart @@ -0,0 +1,202 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; + +class ManageCatalogue extends StatefulWidget { + @override + _ManageCatalogueState createState() => _ManageCatalogueState(); +} + +class _ManageCatalogueState extends State { + final GlobalKey _formKey = GlobalKey(); + String? programme_type; + List awardTypeItem = [ + "Directors Gold Medal", + "Directors Silver Medal", + 'Notional Prizes', + 'MCM Scholarship', + 'D&M Proficiency Gold Medal', + ]; + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Column(children: [ + SizedBox(height: 10), + Container( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Text( + "Manage Award Scholarship Catalogue", + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + )), + ), + ), + SizedBox(height: 10), + new Container( + alignment: Alignment.center, + child: Column(children: [ + TextButton( + style: ButtonStyle( + padding: MaterialStateProperty.all( + EdgeInsets.all(14)), + backgroundColor: + MaterialStateProperty.all(Colors.orange)), + onPressed: () {}, + child: Column( + children: [ + Text( + "Directors Gold Medal", + textAlign: TextAlign.center, + style: TextStyle( + fontWeight: FontWeight.w800, + fontSize: 18, + color: Color.fromARGB(255, 255, 255, 255), + ), + ), + ], + ), + ), + ]), + ), + SizedBox(height: 10), + new Container( + alignment: Alignment.center, + child: Column(children: [ + TextButton( + style: ButtonStyle( + padding: MaterialStateProperty.all( + EdgeInsets.all(14)), + backgroundColor: + MaterialStateProperty.all(Color.fromARGB(255, 220, 202, 176))), + onPressed: () {}, + child: Column( + children: [ + Text( + "Directors Silver Medal", + textAlign: TextAlign.center, + style: TextStyle( + fontWeight: FontWeight.w800, + fontSize: 18, + color: Color.fromARGB(255, 255, 255, 255), + ), + ), + ], + ), + ), + ]), + ), + SizedBox(height: 10), + new Container( + alignment: Alignment.center, + child: Column(children: [ + TextButton( + style: ButtonStyle( + padding: MaterialStateProperty.all( + EdgeInsets.all(14)), + backgroundColor: + MaterialStateProperty.all(Color.fromARGB(255, 220, 202, 176))), + onPressed: () {}, + child: Column( + children: [ + Text( + "Notional Prizes", + textAlign: TextAlign.center, + style: TextStyle( + fontWeight: FontWeight.w800, + fontSize: 18, + color: Color.fromARGB(255, 255, 255, 255), + ), + ), + ], + ), + ), + ]), + ), + SizedBox(height: 10), + new Container( + alignment: Alignment.center, + child: Column(children: [ + TextButton( + style: ButtonStyle( + padding: MaterialStateProperty.all( + EdgeInsets.all(14)), + backgroundColor: + MaterialStateProperty.all(Color.fromARGB(255, 220, 202, 176))), + onPressed: () {}, + child: Column( + children: [ + Text( + "MCM Scholarship", + textAlign: TextAlign.center, + style: TextStyle( + fontWeight: FontWeight.w800, + fontSize: 18, + color: Color.fromARGB(255, 255, 255, 255), + ), + ), + ], + ), + ), + ]), + ), + SizedBox(height: 10), + new Container( + alignment: Alignment.center, + child: Column(children: [ + TextButton( + style: ButtonStyle( + padding: MaterialStateProperty.all( + EdgeInsets.all(14)), + backgroundColor: + MaterialStateProperty.all(Color.fromARGB(255, 220, 202, 176))), + onPressed: () {}, + child: Column( + children: [ + Text( + "D&M Proficiency Gold Medal", + textAlign: TextAlign.center, + style: TextStyle( + fontWeight: FontWeight.w800, + fontSize: 18, + color: Color.fromARGB(255, 255, 255, 255), + ), + ), + ], + ), + ), + ]), + ), + SizedBox(height: 20), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 40), + child: Divider( + thickness: 1, + color: Colors.black54, + ), + ), + Text( + "Director's Gold Medal:", + textAlign: TextAlign.left, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + Text( + "4.2 DirectorΓÇÖs Gold Medals 4.2.1 DirectorΓÇÖs Gold Medals (DGMs), to be presented at the Institute Convocation every year, shall be awarded for the best all round performance from among the graduating", + textAlign: TextAlign.start, + style: const TextStyle(fontWeight: FontWeight.normal), + ), + ]), + ), + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/recent_app.dart b/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/recent_app.dart new file mode 100644 index 00000000..557c1379 --- /dev/null +++ b/lib/screens/Scholarships_Awards/AwardCatalogue/Faculty/recent_app.dart @@ -0,0 +1,99 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; + +class RecentInviteApplications extends StatefulWidget { + @override + _RecentInviteApplicationsState createState() => + _RecentInviteApplicationsState(); +} + +class _RecentInviteApplicationsState extends State { + final GlobalKey _formKey = GlobalKey(); + String? programme_type; + List awardTypeItem = [ + "Directors Gold Medal", + "Directors Silver Medal", + 'Notional Prizes', + 'MCM Scholarship', + 'D&M Proficiency Gold Medal', + ]; + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Column(children: [ + SizedBox(height: 10), + Container( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Text( + "Recent Invite Applications", + style: TextStyle( + fontSize: 24.0, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + )), + ), + ), + Container( + + child: ListView( + shrinkWrap: true, + physics: ClampingScrollPhysics(), + padding: EdgeInsets.all(4), + children: [ + Card( + elevation: 2.0, + margin: EdgeInsets.symmetric(horizontal: 50, vertical: 20), + shadowColor: Colors.black, + color: Color.fromARGB(153, 204, 204, 204), + child: Column( + children: [ + SizedBox(height: 10), + Padding(padding: EdgeInsets.all(40)), + new Container( + alignment: Alignment.center, + child: Column(children: [ + TextButton( + style: ButtonStyle( + padding: + MaterialStateProperty.all( + EdgeInsets.all(14)), + backgroundColor: + MaterialStateProperty.all(Colors.orange)), + onPressed: () {}, + child: Column( + children: [ + Text( + "Update", + textAlign: TextAlign.center, + style: TextStyle( + fontWeight: FontWeight.w800, + fontSize: 18, + color: Color.fromARGB(255, 255, 255, 255), + ), + ), + ], + ), + ), + ]), + ), + ], + ), + ), + ], + ), + ), + ]), + ), + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/AwardCatalogue/award_catalogue.dart b/lib/screens/Scholarships_Awards/AwardCatalogue/award_catalogue.dart new file mode 100644 index 00000000..f77b197d --- /dev/null +++ b/lib/screens/Scholarships_Awards/AwardCatalogue/award_catalogue.dart @@ -0,0 +1,94 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/catalogue.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/previous_winners.dart'; +import 'package:fusion/screens/Scholarships_Awards/AwardCatalogue/spacs_memebers_details.dart'; +import 'package:http/http.dart'; + +class BrowseAwardCatalogue extends StatefulWidget { + @override + _BrowseAwardCatalogueState createState() => _BrowseAwardCatalogueState(); +} + +class _BrowseAwardCatalogueState extends State { + bool _loading1 = true; + + int step = 0; + + @override + void initState() { + super.initState(); + + } + + + @override + Widget build(BuildContext context) { + return DefaultTabController( + //Default TabController for tab scrollbar with number of elements equal to 4 + length: 3, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.black, + title: Text( + "Browse Award Catalogue", + style: TextStyle(color: Colors.white), + ), + actions: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.search), + ), + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.notifications), + ), + Padding( + padding: EdgeInsets.all(8.0), + child: Icon(Icons.more_vert), + ), + ], + //TabBar for a horizontal scrollable tob bar + bottom: TabBar( + isScrollable: true, + indicatorColor: Colors.white, + indicatorWeight: 6.0, + tabs: [ + Tab( + child: Container( + child: Text( + 'Catalogue', + ), + ), + ), + Tab( + child: Container( + child: Text( + 'Spacs Members Details', + ), + ), + ), + Tab( + child: Container( + child: Text( + 'Previous Winners', + ), + ), + ), + ], + ), + ), + //TabBarView contains all the children to be called when tapped. + body: TabBarView( + children: [ + Catalogue(), + SpacsMembersDetails(ModalRoute.of(context)!.settings.arguments.toString()), + PreviousWinners(ModalRoute.of(context)!.settings.arguments.toString()), + ], + ), + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/AwardCatalogue/catalogue.dart b/lib/screens/Scholarships_Awards/AwardCatalogue/catalogue.dart new file mode 100644 index 00000000..d52105a8 --- /dev/null +++ b/lib/screens/Scholarships_Awards/AwardCatalogue/catalogue.dart @@ -0,0 +1,129 @@ +import 'package:flutter/material.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; + + +class Catalogue extends StatefulWidget { + @override + _CatalogueState createState() => _CatalogueState(); +} + +class _CatalogueState extends State { + final GlobalKey _formKey = GlobalKey(); + String? programme_type; + List awardTypeItem = [ + "Directors Gold Medal", + "Directors Silver Medal", + 'Notional Prizes', + 'MCM Scholarship', + 'D&M Proficiency Gold Medal', + ]; + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Column(children: [ + SizedBox(height: 10), + Container( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Text( + "Catalogue", + style: TextStyle( + fontSize: 24.0, + fontWeight: FontWeight.bold, + color: Colors.black, + ), + )), + ), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 16), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 16), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + ), + borderRadius: BorderRadius.circular(15), + ), + child: DropdownButton( + hint: Text('Select Scholarship/Award'), + dropdownColor: Colors.grey[200], + icon: Icon(Icons.arrow_drop_down), + isExpanded: true, + underline: SizedBox(), + style: TextStyle(color: Colors.black, fontSize: 16), + onChanged: (newValue) { + setState(() { + programme_type = newValue.toString(); + }); + print(programme_type); + }, + value: programme_type, + items: awardTypeItem.map((valueItem) { + return DropdownMenuItem( + value: valueItem, + child: Text(valueItem), + ); + }).toList(), + ), + ), + ), + SizedBox(height: 20), + ElevatedButton( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + 'Search', + style: TextStyle(fontSize: 20.0), + ), + ), + onPressed: () { + // Respond to button press + }, + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18.0), + side: BorderSide(color: Colors.red))), + backgroundColor: MaterialStateProperty.resolveWith( + (Set states) { + if (states.contains(MaterialState.pressed)) + return Colors.deepOrange; + return Colors + .deepOrangeAccent; // Use the component's default. + }, + ), + ), + ), + SizedBox(height: 20), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 40), + child: Divider( + thickness: 1, + color: Colors.black54, + ), + ), + + Text( + "Director's Gold Medal:", + textAlign: TextAlign.left, + style: const TextStyle(fontWeight: FontWeight.bold), + ), + Text( + "4.2 DirectorΓÇÖs Gold Medals 4.2.1 DirectorΓÇÖs Gold Medals (DGMs), to be presented at the Institute Convocation every year, shall be awarded for the best all round performance from among the graduating", + textAlign: TextAlign.start, + style: const TextStyle(fontWeight: FontWeight.normal), + ), + ]), + ), + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/AwardCatalogue/previous_winners.dart b/lib/screens/Scholarships_Awards/AwardCatalogue/previous_winners.dart new file mode 100644 index 00000000..9e5a740e --- /dev/null +++ b/lib/screens/Scholarships_Awards/AwardCatalogue/previous_winners.dart @@ -0,0 +1,314 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_html/shims/dart_ui_real.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:intl/intl.dart'; + +const kTextFieldInputDecoration = InputDecoration( + filled: true, + fillColor: Colors.white, + contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(32)), + ), +); + +class PreviousWinners extends StatefulWidget { + final String? studentRollNo; + PreviousWinners(this.studentRollNo); + @override + _PreviousWinnersState createState() => _PreviousWinnersState(); +} + +class _PreviousWinnersState extends State { + final GlobalKey _formKey = GlobalKey(); + + String? programme_type; + List programmeTypeItem = [ + 'B.Tech', + 'B.des', + 'M.Tech', + 'PhD', + ]; + String? scholarship_type; + List scholarshipTypeItem = [ + 'MCM', + 'NSP', + 'Random', + ]; + String? academicyear; + List academicyearTypeItem = [ + '1st', + '2nd', + '3rd', + '4th', + ]; + + @override + Widget build(BuildContext context) { + return Scaffold( + body: SingleChildScrollView( + child: new Column( + children: [ + new Container( + child: new Column( + children: [ + SizedBox(height: 20), + Text( + "Previous Winners:", + textAlign: TextAlign.center, + style: const TextStyle( + fontWeight: FontWeight.bold, fontSize: 16), + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Divider( + thickness: 1, + color: Colors.black54, + ), + ), + ], + ), + ), + new Container( + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Container( + padding: const EdgeInsets.fromLTRB(40, 20, 20, 0), + child: new Column( + children: [ + Text( + 'Programme', + textAlign: TextAlign.left, + style: TextStyle( + fontWeight: FontWeight.w500, + fontSize: 15, + ), + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4, vertical: 16), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 6), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + ), + borderRadius: BorderRadius.circular(15), + ), + width: 140.0, + child: DropdownButton( + hint: Text('Select Item'), + dropdownColor: Colors.grey[200], + icon: Icon(Icons.arrow_drop_down), + underline: SizedBox(), + style: + TextStyle(color: Colors.black, fontSize: 14), + onChanged: (newValue) { + setState(() { + programme_type = newValue.toString(); + }); + print(programme_type); + //print(valueItem); + }, + value: programme_type, + items: programmeTypeItem.map((valueItem) { + return DropdownMenuItem( + value: valueItem, + child: Text(valueItem), + ); + }).toList(), + ), + ), + ), + ], + ), + ), + new Container( + padding: const EdgeInsets.fromLTRB(0, 20, 40, 0), + child: new Column( + children: [ + Text( + 'Academic Year*', + style: TextStyle( + fontWeight: FontWeight.w500, + fontSize: 15, + ), + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 0, vertical: 16), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 6), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + ), + borderRadius: BorderRadius.circular(15), + ), + width: 140.0, + child: DropdownButton( + hint: Text('Select Item'), + dropdownColor: Colors.grey[200], + icon: Icon(Icons.arrow_drop_down), + isExpanded: true, + underline: SizedBox(), + style: + TextStyle(color: Colors.black, fontSize: 14), + onChanged: (newValue) { + setState(() { + academicyear = newValue.toString(); + }); + }, + value: academicyear, + items: academicyearTypeItem.map((valueItem) { + return DropdownMenuItem( + value: valueItem, + child: Text(valueItem), + ); + }).toList(), + ), + ), + ), + ], + ), + ), + ], + ), + ), + new Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + new Container( + padding: const EdgeInsets.fromLTRB(40, 20, 20, 0), + child: new Column( + children: [ + Text( + 'Scholarship/Awards', + style: TextStyle( + fontWeight: FontWeight.w500, + fontSize: 15, + ), + ), + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4, vertical: 16), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 16), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey, + ), + borderRadius: BorderRadius.circular(15), + ), + width: 150.0, + child: DropdownButton( + hint: Text('Select Item'), + dropdownColor: Colors.grey[200], + icon: Icon(Icons.arrow_drop_down), + isExpanded: true, + underline: SizedBox(), + style: + TextStyle(color: Colors.black, fontSize: 14), + onChanged: (newValue) { + setState(() { + scholarship_type = newValue.toString(); + }); + print(scholarship_type); + //print(valueItem); + }, + value: scholarship_type, + items: scholarshipTypeItem.map((valueItem) { + return DropdownMenuItem( + value: valueItem, + child: Text(valueItem), + ); + }).toList(), + ), + ), + ), + ], + ), + ), + ], + ), + ), + new Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 80, + ), + Center( + child: ElevatedButton( + onPressed: () async { + TextInput.finishAutofillContext(); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + 'Submit', + style: TextStyle(fontSize: 20), + ), + ), + style: ButtonStyle( + shape: + MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18.0), + side: BorderSide(color: Colors.red))), + backgroundColor: + MaterialStateProperty.resolveWith( + (Set states) { + if (states.contains(MaterialState.pressed)) + return Colors.deepOrange; + return Colors.deepOrangeAccent; + }, + ), + ), + ), + ), + ], + ), + ), + new Container( + child: Column(children: [ + Container( + margin: EdgeInsets.all(20), + child: Table( + defaultColumnWidth: FixedColumnWidth(120.0), + border: TableBorder.all( + color: Colors.black, style: BorderStyle.solid, width: 2), + children: [ + TableRow(children: [ + Column(children: [ + Text('Award Name', style: TextStyle(fontSize: 14.0)) + ]), + Column(children: [ + Text('Winner', style: TextStyle(fontSize: 14.0)) + ]), + Column(children: [ + Text('Batch', style: TextStyle(fontSize: 14.0)) + ]), + ]), + TableRow(children: [ + Column(children: [Text('Award_Name')]), + Column(children: [Text('Student_Name')]), + Column(children: [Text('2020')]), + ]), + ], + ), + ), + ])) + ], + ), + + //Table + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/AwardCatalogue/spacs_memebers_details.dart b/lib/screens/Scholarships_Awards/AwardCatalogue/spacs_memebers_details.dart new file mode 100644 index 00000000..2d8c4659 --- /dev/null +++ b/lib/screens/Scholarships_Awards/AwardCatalogue/spacs_memebers_details.dart @@ -0,0 +1,110 @@ +import 'dart:async'; +import 'dart:convert'; +import 'package:fusion/Components/appBar.dart'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; +import 'package:http/http.dart'; +import 'package:flutter/material.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'dart:ui'; +import 'package:provider/provider.dart'; + +class SpacsMembersDetails extends StatefulWidget { + String? token; + SpacsMembersDetails(this.token); + @override + _SpacsMembersDetailsState createState() => _SpacsMembersDetailsState(); +} + +class _SpacsMembersDetailsState extends State { + bool _loading1 = true; + bool _loading2 = false; + bool _loading3 = false; + bool _loading = true; + + late StreamController _profileController; + late ProfileService profileService; + late ProfileData data; + @override + void initState() { + super.initState(); + + _profileController = StreamController(); + profileService = ProfileService(); + + getData(); + } + + getData() async { + //print('token-'+widget.token!); + try { + Response response = await profileService.getProfile(); + setState(() { + data = ProfileData.fromJson(jsonDecode(response.body)); + print(data.user!['username']); + _loading = false; + }); + } catch (e) { + print(e); + } + } + + loadData() async { + getData().then((res) { + _profileController.add(res); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: _loading == true + ? Center(child: CircularProgressIndicator()) + : Container( + color: Colors.white60, + child: ListView( + shrinkWrap: true, + physics: ClampingScrollPhysics(), + children: [ + Card( + elevation: 10.0, + margin: EdgeInsets.symmetric(horizontal: 50, vertical: 20), + shadowColor: Colors.black, + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 20), + width: 170, + height: 170, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/profile_pic.png'), + fit: BoxFit.cover, + ), + ), + ), + SizedBox(height: 10), + Text( + "Dr. Atul Gupta", + style: TextStyle(color: Colors.black, fontSize: 24, fontWeight: FontWeight.bold), + ), + SizedBox(height: 10), + Text( + "CSE Faculty", + style: TextStyle(color: Colors.black, fontSize: 16), + ), + SizedBox(height: 10), + Text( + "SPACS Convener", + style: TextStyle(color: Colors.black, fontSize: 15), + ), + SizedBox(height: 20), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/Scholarships_Awards/scholarship_awards.dart b/lib/screens/Scholarships_Awards/scholarship_awards.dart new file mode 100644 index 00000000..c61d6dbe --- /dev/null +++ b/lib/screens/Scholarships_Awards/scholarship_awards.dart @@ -0,0 +1,239 @@ +import 'dart:async'; +import 'dart:convert'; +import 'package:fusion/Components/appBar.dart'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; +import 'package:http/http.dart'; +import 'package:flutter/material.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'dart:ui'; +import 'package:provider/provider.dart'; + +class ScholarshipAwards extends StatefulWidget { + String? token; + ScholarshipAwards(this.token); + @override + _ScholarshipAwardsState createState() => _ScholarshipAwardsState(); +} + +main() async { + late ProfileService profileService; + late ProfileData data; + bool _loading = true; + late String studentType; + profileService = ProfileService(); + try { + Response response = await profileService.getProfile(); + + data = ProfileData.fromJson(jsonDecode(response.body)); + + print(data.user!['username']); + _loading = false; + studentType = data.profile!['department']!['name'] + + ' ' + + data.profile!['user_type']; + print(studentType); + } catch (e) { + print(e); + } +} + +class _ScholarshipAwardsState extends State { + bool _loading1 = true; + bool _loading2 = false; + bool _loading3 = false; + bool _loading = true; + + late StreamController _profileController; + late String studentType; + late ProfileService profileService; + late ProfileData data; + @override + void initState() { + super.initState(); + + _profileController = StreamController(); + profileService = ProfileService(); + + getData(); + } + + getData() async { + //print('token-'+widget.token!); + try { + Response response = await profileService.getProfile(); + setState(() { + data = ProfileData.fromJson(jsonDecode(response.body)); + + print(data.user!['username']); + _loading = false; + }); + studentType = data.profile!['department']!['name'] + + ' ' + + data.profile!['user_type']; + // print(studentType); + } catch (e) { + print(e); + } + } + + loadData() async { + getData().then((res) { + _profileController.add(res); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: DefaultAppBar().buildAppBar(), + drawer: SideDrawer(), + body: _loading == true + ? Center(child: CircularProgressIndicator()) + : Container( + color: Colors.white60, + child: ListView( + shrinkWrap: true, + physics: ClampingScrollPhysics(), + children: [ + Card( + elevation: 10.0, + margin: EdgeInsets.symmetric(horizontal: 50, vertical: 20), + shadowColor: Colors.black, + child: Column( + children: [ + + Container( + margin: EdgeInsets.only(top: 20), + width: 170, + height: 170, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/profile_pic.png'), + fit: BoxFit.cover, + ), + ), + ), + SizedBox(height: 16), + Text( + data.user != null + ? (data.user!['first_name'] + + ' ' + + data.user!['last_name']) + : "User does not exist on data", + style: TextStyle(color: Colors.black, fontSize: 16, fontWeight: FontWeight.bold), + ), + SizedBox(height: 10), + Text( + data.profile != null + ? (data.profile!['department']!['name'] + + ' ' + + data.profile!['user_type']) + : "No Profile", + style: TextStyle(color: Colors.black, fontSize: 15, fontWeight: FontWeight.w500), + ), + SizedBox(height: 10), + ], + ), + ), + Card( + elevation: 6.0, + margin: EdgeInsets.symmetric(horizontal: 40, vertical: 40), + shadowColor: Colors.black, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding: const EdgeInsets.all(10.0),), + TextButton( + style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.orange)), + onPressed: () { + setState(() { + _loading1 = true; + _loading2 = false; + _loading3 = false; + if (data.profile!['user_type'] == 'faculty') { + Navigator.pushNamed(context, + '/scholarship_awards/manage_award_catalogue_fac', + arguments: data.user != null + ? data.user!['username'] + : "null"); + } else { + Navigator.pushNamed(context, + '/scholarship_awards/browse_award_catalogue', + arguments: data.user != null + ? data.user!['username'] + : "null"); + } + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + data.profile!['user_type'] == 'faculty' + ? "Manage Catalogue" + : "Browse Award Catalogue", + style: TextStyle( + fontWeight: FontWeight.w800, + fontSize: 18, + color: Colors.white + ), + ), + Icon( + Icons.arrow_forward, + color: Colors.white, + ) + ], + ), + ), + SizedBox(height: 10), + TextButton( + style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Colors.orange)), + onPressed: () { + setState(() { + _loading1 = false; + _loading2 = true; + _loading3 = false; + if (data.profile!['user_type'] == 'faculty') { + Navigator.pushNamed( + context, + '/scholarship_awards/invite_application', + ); + } else { + Navigator.pushNamed( + context, + '/scholarship_awards/apply_for_awards', + ); + } + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + data.profile!['user_type'] == 'faculty' + ? "Invite Application" + : "Apply For Awards", + style: TextStyle( + fontWeight: FontWeight.w800, + fontSize: 18, + color: Color.fromARGB(255, 255, 255, 255), + ), + ), + Icon( + Icons.arrow_forward, + color: Colors.white, + ) + ], + ), + ), + SizedBox(height: 10), + ], + ), + ), + ], + ), + ), + ); + } +}