Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAD-2 CHANGES #129

Open
wants to merge 3 commits into
base: test
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/Components/side_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ class _SideDrawerState extends State<SideDrawer> {
line: 'Programme Curriculum',
pageMover: '/programme_curriculum_home',
isActive: true,
),
ModulesPadding(
line: 'Iwd module',
pageMover: '/iwd_home_page',
isActive: true,
),
ModulesPadding(
line: 'Gymkhana Module',
Expand Down
17 changes: 15 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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,
),
Expand Down Expand Up @@ -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(),


},
),
);
Expand Down
595 changes: 595 additions & 0 deletions lib/screens/Iwd/ProjectRequisition/corrigendum.dart

Large diffs are not rendered by default.

167 changes: 167 additions & 0 deletions lib/screens/Iwd/ProjectRequisition/page1.dart
Original file line number Diff line number Diff line change
@@ -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<page> {
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<StorageService>();
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: <Widget>[
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')),
],
),
],
),
);
}
}
Empty file.
Empty file.
162 changes: 162 additions & 0 deletions lib/screens/Iwd/ProjectRequisition/project.dart
Original file line number Diff line number Diff line change
@@ -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<Project> createState() => _ProjectState();
}

class _ProjectState extends State<Project> {
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<StorageService>();
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')),
],
),
],
),
),
],
),
);
}
}
Loading