diff --git a/lib/Components/side_drawer.dart b/lib/Components/side_drawer.dart index be08db0e..5dd67447 100644 --- a/lib/Components/side_drawer.dart +++ b/lib/Components/side_drawer.dart @@ -120,6 +120,11 @@ class _SideDrawerState extends State { line: 'Programme Curriculum', pageMover: '/programme_curriculum_home', isActive: true, + ), + ModulesPadding( + line: 'Iwd module', + pageMover: '/iwd_home_page', + isActive: true, ), ModulesPadding( line: 'Gymkhana Module', diff --git a/lib/main.dart b/lib/main.dart index 9ca81ff8..02ae0475 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,6 +5,8 @@ import 'package:fusion/screens/Complaint/ComplaintHistory/complain_history.dart' import 'package:fusion/screens/Complaint/Feedback/feedback.dart'; import 'package:fusion/screens/Complaint/LodgeComplaint/lodge_complaint.dart'; import 'package:fusion/screens/Establishment/establishment_home_page.dart'; +import 'package:fusion/screens/Iwd/ProjectRequisition/page1.dart'; + import 'package:fusion/screens/Library/Book_Search.dart'; import 'package:fusion/screens/Library/dues.dart'; import 'package:fusion/screens/Library/issued_items.dart'; @@ -43,6 +45,10 @@ 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/Iwd/iwd_home_page.dart'; + +import 'package:fusion/screens/Iwd/ViewRequisition/view.dart'; + void main() { WidgetsFlutterBinding.ensureInitialized(); setupLocator(); @@ -72,8 +78,9 @@ class MyApp extends StatelessWidget { debugShowCheckedModeBanner: false, theme: ThemeData( // primarySwatch: Colors.blueGrey, - // colorSchemeSeed: Color(0xFF2085D0), - colorSchemeSeed: Color(0xFFF36C35), + + colorSchemeSeed: Color.fromARGB(255, 58, 32, 208), + fontFamily: 'Nunito', useMaterial3: true, ), @@ -127,6 +134,12 @@ class MyApp extends StatelessWidget { '/health_center/feedback': (context) => FeedBack(), '/health_center/viewschedule': (context) => ViewSchedule(), '/health_center/history': (context) => History(), + + '/iwd_home_page': (context) => IwdHomePage(), + '/iwd_home_page/page1': (context) => page(), + '/iwd_home_page/view': (context) => View(), + + }, ), ); diff --git a/lib/screens/Iwd/ProjectRequisition/corrigendum.dart b/lib/screens/Iwd/ProjectRequisition/corrigendum.dart new file mode 100644 index 00000000..d4aa7127 --- /dev/null +++ b/lib/screens/Iwd/ProjectRequisition/corrigendum.dart @@ -0,0 +1,595 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:fusion/Components/appBar.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:http/http.dart'; + +import 'package:flutter/material.dart'; + +class CorrigendumpageWidget extends StatefulWidget { + @override + _CorrigendumpageWidgetState createState() => _CorrigendumpageWidgetState(); +} + +class _CorrigendumpageWidgetState extends State { + @override + Widget build(BuildContext context) { + // Figma Flutter Generator CorrigendumpageWidget - FRAME + + return Container( + width: 360, + height: 640, + decoration: BoxDecoration( + color: Color.fromRGBO(255, 255, 255, 1), + ), + child: Stack(children: [ + Positioned( + top: -2, + left: 0, + child: Container( + width: 381, + height: 642, + decoration: BoxDecoration(), + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Container( + width: 360, + height: 80, + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Container( + width: 360, + height: 80, + decoration: BoxDecoration( + color: Color.fromRGBO(243, 108, 53, 1), + ))), + Positioned( + top: 35, + left: 21, + child: Container( + width: 23.076923370361328, + height: 17, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + 'assets/images/Image3.png'), + fit: BoxFit.fitWidth), + ))), + Positioned( + top: 32, + left: 50, + child: Text( + 'Institute Works Department', + textAlign: TextAlign.center, + style: TextStyle( + color: Color.fromRGBO(255, 255, 255, 1), + fontFamily: 'Montserrat', + fontSize: 20, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + ]))), + Positioned( + top: 137, + left: 27, + child: Container( + width: 318, + height: 53, + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Text( + 'Dated', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 14, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + Positioned( + top: 25, + left: 0, + child: Container( + width: 318, + height: 28, + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Container( + width: 318, + height: 28, + decoration: BoxDecoration( + borderRadius: + BorderRadius.only( + topLeft: Radius.circular(8), + topRight: + Radius.circular(8), + bottomLeft: + Radius.circular(8), + bottomRight: + Radius.circular(8), + ), + color: Color.fromRGBO( + 243, 243, 243, 1), + ))), + ]))), + ]))), + Positioned( + top: 219, + left: 21, + child: Container( + width: 318, + height: 53, + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Text( + 'Ref No: Our NIT NO.', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 14, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + Positioned( + top: 25, + left: 0, + child: Container( + width: 318, + height: 28, + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Container( + width: 318, + height: 28, + decoration: BoxDecoration( + borderRadius: + BorderRadius.only( + topLeft: Radius.circular(8), + topRight: + Radius.circular(8), + bottomLeft: + Radius.circular(8), + bottomRight: + Radius.circular(8), + ), + color: Color.fromRGBO( + 243, 243, 243, 1), + ))), + ]))), + ]))), + Positioned( + top: 305, + left: 26, + child: Container( + width: 318, + height: 53, + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Text( + 'Name of Work', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 14, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + Positioned( + top: 25, + left: 0, + child: Container( + width: 318, + height: 28, + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Container( + width: 318, + height: 28, + decoration: BoxDecoration( + borderRadius: + BorderRadius.only( + topLeft: Radius.circular(8), + topRight: + Radius.circular(8), + bottomLeft: + Radius.circular(8), + bottomRight: + Radius.circular(8), + ), + color: Color.fromRGBO( + 243, 243, 243, 1), + ))), + ]))), + ]))), + Positioned( + top: 601, + left: 21, + child: Container( + width: 353, + height: 106, + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Text( + 'Date of opening of bid(envelop-1):', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 14, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + Positioned( + top: 25, + left: 0, + child: Container( + width: 318, + height: 28, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + bottomLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + color: Color.fromRGBO(243, 243, 243, 1), + ))), + Positioned( + top: 25, + left: 0, + child: Text( + 'dd-mm-yyyy', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 8, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + Positioned( + top: 78, + left: 0, + child: Container( + width: 318, + height: 28, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + bottomLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + color: Color.fromRGBO(243, 243, 243, 1), + ))), + Positioned( + top: 78, + left: 3, + child: Text( + '--:--', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 17.5, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + ]))), + Positioned( + top: 729, + left: 21, + child: Container( + width: 353, + height: 106, + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Text( + 'Date of opening of bid(envelop-2):', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 14, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + Positioned( + top: 25, + left: 0, + child: Container( + width: 318, + height: 28, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + bottomLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + color: Color.fromRGBO(243, 243, 243, 1), + ))), + Positioned( + top: 25, + left: 2, + child: Text( + 'dd-mm-yyyy', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 8, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + Positioned( + top: 78, + left: 0, + child: Container( + width: 318, + height: 28, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + bottomLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + color: Color.fromRGBO(243, 243, 243, 1), + ))), + Positioned( + top: 78, + left: 3, + child: Text( + '--:--', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 17.5, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + ]))), + Positioned( + top: 387, + left: 24, + child: Text( + 'This is for information to all: In reference to above work the crucial dates of tender are being changed as under. The other terms & conditions of the tender shall remain the same.', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 12, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + Positioned( + top: 473, + left: 27, + child: Container( + width: 354, + height: 106, + child: Stack(children: [ + Positioned( + top: 0, + left: 1, + child: Text( + 'Last Date & Time of sumbission of bid', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 14, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + Positioned( + top: 25, + left: 1, + child: Container( + width: 318, + height: 28, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + bottomLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + color: Color.fromRGBO(243, 243, 243, 1), + ))), + Positioned( + top: 78, + left: 1, + child: Container( + width: 318, + height: 28, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + topRight: Radius.circular(8), + bottomLeft: Radius.circular(8), + bottomRight: Radius.circular(8), + ), + color: Color.fromRGBO(243, 243, 243, 1), + ))), + Positioned( + top: 78, + left: 4, + child: Text( + '--:--', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 17.5, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + Positioned( + top: 27, + left: 0, + child: Text( + 'dd-mm-yyyy', + textAlign: TextAlign.left, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 8, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + ]))), + Positioned( + top: 886, + left: 242, + child: Container( + width: 97, + height: 28, + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Container( + width: 97, + height: 28, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(4), + topRight: Radius.circular(4), + bottomLeft: Radius.circular(4), + bottomRight: Radius.circular(4), + ), + color: Color.fromRGBO(243, 108, 53, 1), + ))), + Positioned( + top: 6, + left: 33, + child: Text( + 'Next', + textAlign: TextAlign.center, + style: TextStyle( + color: Color.fromRGBO(255, 255, 255, 1), + fontFamily: 'Montserrat', + fontSize: 13, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + ]))), + Positioned( + top: 886, + left: 21, + child: Container( + width: 97, + height: 28, + child: Stack(children: [ + Positioned( + top: 0, + left: 0, + child: Container( + width: 97, + height: 28, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(4), + topRight: Radius.circular(4), + bottomLeft: Radius.circular(4), + bottomRight: Radius.circular(4), + ), + color: Color.fromRGBO(96, 97, 98, 1), + ))), + Positioned( + top: 6, + left: 20, + child: Text( + 'Previous', + textAlign: TextAlign.center, + style: TextStyle( + color: Color.fromRGBO(255, 255, 255, 1), + fontFamily: 'Montserrat', + fontSize: 13, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + ]))), + Positioned( + top: 98, + left: 128, + child: Text( + 'Corrigendum', + textAlign: TextAlign.center, + style: TextStyle( + color: Color.fromRGBO(0, 0, 0, 1), + fontFamily: 'Montserrat', + fontSize: 14, + letterSpacing: + 0 /*percentages not used in flutter. defaulting to zero*/, + fontWeight: FontWeight.normal, + height: 1), + )), + ]))), + ])); + } +} \ No newline at end of file diff --git a/lib/screens/Iwd/ProjectRequisition/page1.dart b/lib/screens/Iwd/ProjectRequisition/page1.dart new file mode 100644 index 00000000..ca7ef3d1 --- /dev/null +++ b/lib/screens/Iwd/ProjectRequisition/page1.dart @@ -0,0 +1,167 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:fusion/Components/appBar.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:http/http.dart'; + +class page extends StatefulWidget { + @override + Page_1 createState() => Page_1(); +} + +class Page_1 extends State { + bool _loading1 = true; + + //integrating_api + late StreamController _profileController; + late ProfileService profileService; + late ProfileData data; + @override + void initState() { + // TODO: implement initState + super.initState(); + _profileController = StreamController(); + profileService = ProfileService(); + var service = locator(); + try { + data = service.profileData; + _loading1 = false; + } catch (e) { + getData(); + } + //TODO: Remove this? + getData(); + } + + getData() async { + try { + Response response = await profileService.getProfile(); + setState(() { + data = ProfileData.fromJson(jsonDecode(response.body)); + _loading1 = false; + }); + } catch (e) { + print(e); + } + } + + BoxDecoration myBoxDecoration() { + return BoxDecoration( + border: new Border.all( + color: Colors.deepOrangeAccent, + width: 2.0, + style: BorderStyle.solid, + ), + borderRadius: new BorderRadius.all(new Radius.circular(15.0))); + } + + Text myText(String text) { + return Text( + text, + style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500), + ); + } + + Padding myContainer(String text) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: myText(text), + ), + decoration: myBoxDecoration(), + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: DefaultAppBar().buildAppBar(), + drawer: SideDrawer(), + body: ListView( + physics: ClampingScrollPhysics(), + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + InkWell( + child: myContainer('Create project requisition:'), + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + ElevatedButton( + onPressed: () { + Navigator.pushNamed(context, '/iwd_home_page/page1', + arguments: data); + }, + child: const Text('Fill Page 1')), + SizedBox( + width: 10.0, + ), + ElevatedButton( + onPressed: () {}, child: const Text('Fill Page 2')), + SizedBox( + width: 10.0, + ), + ElevatedButton( + onPressed: () {}, child: const Text('Fill Page 3')), + ], + ), + ]), + SizedBox( + height: 10.0, + ), + Text('AES'), + SizedBox( + height: 10.0, + ), + Text('SI. NO.'), + TextFormField(), + SizedBox( + height: 10.0, + ), + Text('Description of item'), + TextFormField(), + SizedBox( + height: 10.0, + ), + Text('Unit'), + TextFormField(), + SizedBox( + height: 10.0, + ), + Text('Quantity'), + TextFormField(), + SizedBox( + height: 10.0, + ), + Text('Amount'), + TextFormField(), + SizedBox( + height: 10.0, + ), + Row( + children: [ + ElevatedButton(onPressed: () {}, child: const Text('Previous')), + SizedBox( + width: 10.0, + ), + ElevatedButton(onPressed: () {}, child: const Text('Submit')), + ], + ), + ], + ), + ); + } +} diff --git a/lib/screens/Iwd/ProjectRequisition/page2.dart b/lib/screens/Iwd/ProjectRequisition/page2.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/screens/Iwd/ProjectRequisition/page3.dart b/lib/screens/Iwd/ProjectRequisition/page3.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/screens/Iwd/ProjectRequisition/project.dart b/lib/screens/Iwd/ProjectRequisition/project.dart new file mode 100644 index 00000000..b4993f7b --- /dev/null +++ b/lib/screens/Iwd/ProjectRequisition/project.dart @@ -0,0 +1,162 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:fusion/Components/appBar.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:http/http.dart'; + +class Project extends StatefulWidget { + @override + State createState() => _ProjectState(); +} + +class _ProjectState extends State { + bool _loading1 = true; + + //integrating_api + late StreamController _profileController; + late ProfileService profileService; + late ProfileData data; + @override + void initState() { + // TODO: implement initState + super.initState(); + _profileController = StreamController(); + profileService = ProfileService(); + var service = locator(); + try { + data = service.profileData; + _loading1 = false; + } catch (e) { + getData(); + } + //TODO: Remove this? + getData(); + } + + getData() async { + try { + Response response = await profileService.getProfile(); + setState(() { + data = ProfileData.fromJson(jsonDecode(response.body)); + _loading1 = false; + }); + } catch (e) { + print(e); + } + } + + BoxDecoration myBoxDecoration() { + return BoxDecoration( + border: new Border.all( + color: Colors.deepOrangeAccent, + width: 2.0, + style: BorderStyle.solid, + ), + borderRadius: new BorderRadius.all(new Radius.circular(15.0))); + } + + Text myText(String text) { + return Text( + text, + style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500), + ); + } + + Padding myContainer(String text) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: myText(text), + ), + decoration: myBoxDecoration(), + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: DefaultAppBar().buildAppBar(), + drawer: SideDrawer(), + body: ListView( + shrinkWrap: true, + physics: ClampingScrollPhysics(), + children: [ + Card( + elevation: 2.0, + margin: EdgeInsets.symmetric(horizontal: 50.0, vertical: 20.0), + shadowColor: Colors.black, + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 20.0), + width: 170.0, + height: 170.0, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/unknown.jpg'), + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + height: 10.0, + ), + Text( + data.user!['first_name'] + ' ' + data.user!['last_name'], + style: TextStyle(fontSize: 20.0, color: Colors.black), + ), + SizedBox( + height: 10.0, + ), + Text( + // 'CSE', + data.profile!['department']!['name'] + + ' | ' + + data.profile!['user_type'], + style: TextStyle(fontSize: 15.0, color: Colors.black), + ), + SizedBox( + height: 10.0, + ), + ], + ), + ), + Card( + elevation: 2.0, + margin: EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0), + shadowColor: Colors.black, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + child: myContainer('Create project requisition:'), + ), + SizedBox( + width: 10.0, + ), + Row( + children: [ + ElevatedButton(onPressed: () {}, child: const Text('Previous')), + SizedBox( + width: 10.0, + ), + ElevatedButton(onPressed: () {}, child: const Text('Submit')), + ], + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/screens/Iwd/ViewRequisition/view.dart b/lib/screens/Iwd/ViewRequisition/view.dart new file mode 100644 index 00000000..8a0ce26f --- /dev/null +++ b/lib/screens/Iwd/ViewRequisition/view.dart @@ -0,0 +1,127 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:fusion/Components/appBar.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:http/http.dart'; + +class View extends StatefulWidget { + @override + _ViewState createState() => _ViewState(); +} + +class _ViewState extends State { + bool _loading1 = true; + + //integrating_api + late StreamController _profileController; + late ProfileService profileService; + late ProfileData data; + @override + void initState() { + // TODO: implement initState + super.initState(); + _profileController = StreamController(); + profileService = ProfileService(); + var service = locator(); + try { + data = service.profileData; + _loading1 = false; + } catch (e) { + getData(); + } + //TODO: Remove this? + getData(); + } + + getData() async { + try { + Response response = await profileService.getProfile(); + setState(() { + data = ProfileData.fromJson(jsonDecode(response.body)); + _loading1 = false; + }); + } catch (e) { + print(e); + } + } + + BoxDecoration myBoxDecoration() { + return BoxDecoration( + border: new Border.all( + color: Colors.deepOrangeAccent, + width: 2.0, + style: BorderStyle.solid, + ), + borderRadius: new BorderRadius.all(new Radius.circular(15.0))); + } + + Text myText(String text) { + return Text( + text, + style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500), + ); + } + + Padding myContainer(String text) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: myText(text), + ), + decoration: myBoxDecoration(), + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: DefaultAppBar().buildAppBar(), + drawer: SideDrawer(), + body: ListView( + shrinkWrap: true, + physics: ClampingScrollPhysics(), + children: [ + + Card( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + TextField( + decoration: const InputDecoration( + labelText: 'Enter Project ID', + suffixText: '*', + suffixStyle: TextStyle( + color: Colors.red, + ), + ), + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + ElevatedButton(onPressed: () {}, child: const Text('Previous')), + SizedBox( + width: 10.0, + ), + ElevatedButton(onPressed: () {}, child: const Text('Submit')), + ], + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/screens/Iwd/iwd_home_page.dart b/lib/screens/Iwd/iwd_home_page.dart new file mode 100644 index 00000000..6ba90028 --- /dev/null +++ b/lib/screens/Iwd/iwd_home_page.dart @@ -0,0 +1,170 @@ +import 'dart:async'; +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:fusion/Components/appBar.dart'; +import 'package:fusion/Components/side_drawer.dart'; +import 'package:fusion/models/profile.dart'; +import 'package:fusion/services/profile_service.dart'; +import 'package:fusion/services/service_locator.dart'; +import 'package:fusion/services/storage_service.dart'; +import 'package:http/http.dart'; + +class IwdHomePage extends StatefulWidget { + @override + _IwdHomePageState createState() => _IwdHomePageState(); +} + +class _IwdHomePageState extends State { + bool _loading1 = true; + + //integrating_api + late StreamController _profileController; + late ProfileService profileService; + late ProfileData data; + @override + void initState() { + // TODO: implement initState + super.initState(); + _profileController = StreamController(); + profileService = ProfileService(); + var service = locator(); + try { + data = service.profileData; + _loading1 = false; + } catch (e) { + getData(); + } + //TODO: Remove this? + getData(); + } + + getData() async { + try { + Response response = await profileService.getProfile(); + setState(() { + data = ProfileData.fromJson(jsonDecode(response.body)); + _loading1 = false; + }); + } catch (e) { + print(e); + } + } + + BoxDecoration myBoxDecoration() { + return BoxDecoration( + border: new Border.all( + color: Colors.deepOrangeAccent, + width: 2.0, + style: BorderStyle.solid, + ), + borderRadius: new BorderRadius.all(new Radius.circular(15.0))); + } + + Text myText(String text) { + return Text( + text, + style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500), + ); + } + + Padding myContainer(String text) { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Container( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: myText(text), + ), + decoration: myBoxDecoration(), + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: DefaultAppBar().buildAppBar(), + drawer: SideDrawer(), + body: ListView( + shrinkWrap: true, + physics: ClampingScrollPhysics(), + children: [ + Card( + elevation: 2.0, + margin: EdgeInsets.symmetric(horizontal: 50.0, vertical: 20.0), + shadowColor: Colors.black, + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 20.0), + width: 170.0, + height: 170.0, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage('assets/unknown.jpg'), + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + height: 10.0, + ), + Text( + //NAME OF USER + // 'Rajat Gupta', + data.user!['first_name'] + ' ' + data.user!['last_name'], + style: TextStyle(fontSize: 20.0, color: Colors.black), + ), + SizedBox( + height: 10.0, + ), + Text( + // 'CSE', + data.profile!['department']!['name'] + + ' | ' + + data.profile!['user_type'], + style: TextStyle(fontSize: 15.0, color: Colors.black), + ), + SizedBox( + height: 10.0, + ), + ], + ), + ), + Card( + elevation: 2.0, + margin: EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0), + shadowColor: Colors.black, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + InkWell( + child: myContainer("Create Project requisition"), + onTap: () { + Navigator.pushNamed(context, '/iwd_home_page/page1', + arguments: data); + }, + ), + InkWell( + child: myContainer("Corrigendum Page"), + onTap: () { + Navigator.pushNamed(context, '/iwd_home_page/corrigendum', + arguments: data); + }, + ), + InkWell( + child: myContainer("Veiw Project Details"), + onTap: () { + Navigator.pushNamed(context, '/iwd_home_page/view', + arguments: data); + }, + ), + ], + ), + ), + ], + ), + ); + } +}