Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sai Srinivas
GEN_ERP_2025
Compare Revisions
3bcde21e43844b84bdc37911396768f3334362ba...0b7b76af134639cf286735ee0fbab23fdf8e1920
Expand all
Show whitespace changes
Inline
Side-by-side
lib/screens/hrm/AddLiveAttendance.dart
View file @
0b7b76af
...
@@ -55,12 +55,36 @@ class _AddLiveAttendanceScreenState extends State<AddLiveAttendanceScreen> {
...
@@ -55,12 +55,36 @@ class _AddLiveAttendanceScreenState extends State<AddLiveAttendanceScreen> {
}
}
Future
<
void
>
_autoFetchLocation
()
async
{
Future
<
void
>
_autoFetchLocation
()
async
{
String
loc
=
await
getCurrentLocation
();
Position
position
=
await
Geolocator
.
getCurrentPosition
(
desiredAccuracy:
LocationAccuracy
.
high
,
);
// Save raw coordinates separately (for submission)
final
coords
=
"
${position.latitude}
,
${position.longitude}
"
;
// Convert to address for display
final
placemarks
=
await
placemarkFromCoordinates
(
position
.
latitude
,
position
.
longitude
);
String
displayAddress
;
if
(
placemarks
.
isNotEmpty
)
{
final
place
=
placemarks
.
first
;
displayAddress
=
"
${place.name}
,
${place.locality}
,
${place.administrativeArea}
,
${place.country}
"
;
}
else
{
displayAddress
=
coords
;
// fallback
}
setState
(()
{
setState
(()
{
locationController
.
text
=
loc
;
locationController
.
text
=
displayAddress
;
// what user sees
_rawCoordinates
=
coords
;
// keep coords hidden for backend
});
});
}
}
// Add this field at the top of your State class:
String
?
_rawCoordinates
;
Future
<
String
>
getCurrentLocation
()
async
{
Future
<
String
>
getCurrentLocation
()
async
{
try
{
try
{
LocationPermission
permission
=
await
Geolocator
.
checkPermission
();
LocationPermission
permission
=
await
Geolocator
.
checkPermission
();
...
@@ -164,7 +188,7 @@ class _AddLiveAttendanceScreenState extends State<AddLiveAttendanceScreen> {
...
@@ -164,7 +188,7 @@ class _AddLiveAttendanceScreenState extends State<AddLiveAttendanceScreen> {
context
,
context
,
process:
"Live"
,
process:
"Live"
,
type:
selectedType
??
""
,
type:
selectedType
??
""
,
loc:
locationController
.
text
,
loc:
_rawCoordinates
??
""
,
// send actual coordinates
checkDate:
DateTime
.
now
().
toString
().
split
(
" "
).
first
,
checkDate:
DateTime
.
now
().
toString
().
split
(
" "
).
first
,
checkInTime:
checkInTime:
selectedType
==
"Check In"
?
TimeOfDay
.
now
().
format
(
context
)
:
null
,
selectedType
==
"Check In"
?
TimeOfDay
.
now
().
format
(
context
)
:
null
,
...
@@ -198,7 +222,9 @@ class _AddLiveAttendanceScreenState extends State<AddLiveAttendanceScreen> {
...
@@ -198,7 +222,9 @@ class _AddLiveAttendanceScreenState extends State<AddLiveAttendanceScreen> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
SafeArea
(
top:
false
,
child:
Scaffold
(
backgroundColor:
Colors
.
white
,
backgroundColor:
Colors
.
white
,
appBar:
AppBar
(
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
automaticallyImplyLeading:
false
,
...
@@ -404,6 +430,7 @@ class _AddLiveAttendanceScreenState extends State<AddLiveAttendanceScreen> {
...
@@ -404,6 +430,7 @@ class _AddLiveAttendanceScreenState extends State<AddLiveAttendanceScreen> {
],
],
),
),
),
),
),
);
);
}
}
...
...
lib/screens/hrm/AddManualAttendance.dart
View file @
0b7b76af
...
@@ -168,7 +168,7 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
...
@@ -168,7 +168,7 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
}
}
void
_submitForm
(
BuildContext
context
)
async
{
void
_submitForm
(
BuildContext
context
)
async
{
//
r
eset errors first
//
R
eset errors first
dateError
=
null
;
dateError
=
null
;
typeError
=
null
;
typeError
=
null
;
checkInTimeError
=
checkInLocError
=
checkInDescError
=
checkInProofError
=
null
;
checkInTimeError
=
checkInLocError
=
checkInDescError
=
checkInProofError
=
null
;
...
@@ -176,15 +176,27 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
...
@@ -176,15 +176,27 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
final
provider
=
Provider
.
of
<
Attendancelistprovider
>(
context
,
listen:
false
);
final
provider
=
Provider
.
of
<
Attendancelistprovider
>(
context
,
listen:
false
);
// --- Date Validation ---
// --- Date Validation
(allow today, yesterday, day before yesterday)
---
if
(
provider
.
dateController
.
text
.
isEmpty
)
{
if
(
provider
.
dateController
.
text
.
isEmpty
)
{
dateError
=
"Please select a date"
;
dateError
=
"Please select a date"
;
}
else
{
}
else
{
try
{
try
{
final
enteredDate
=
DateFormat
(
"dd MMM yyyy"
).
parse
(
provider
.
dateController
.
text
);
final
enteredDate
=
DateFormat
(
"dd MMM yyyy"
).
parse
(
provider
.
dateController
.
text
);
provider
.
setSelectedDate
(
enteredDate
);
provider
.
setSelectedDate
(
enteredDate
);
if
(!
provider
.
isDateValid
())
{
dateError
=
"Date must be today or yesterday"
;
final
today
=
DateTime
.
now
();
final
yesterday
=
today
.
subtract
(
const
Duration
(
days:
1
));
final
dayBeforeYesterday
=
today
.
subtract
(
const
Duration
(
days:
2
));
// Normalize dates (ignore time part)
bool
isValid
=
enteredDate
.
year
==
today
.
year
&&
enteredDate
.
month
==
today
.
month
&&
(
enteredDate
.
day
==
today
.
day
||
enteredDate
.
day
==
yesterday
.
day
||
enteredDate
.
day
==
dayBeforeYesterday
.
day
);
if
(!
isValid
)
{
dateError
=
"Date must be today, yesterday, or the day before yesterday"
;
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
dateError
=
"Invalid date format (use dd MMM yyyy)"
;
dateError
=
"Invalid date format (use dd MMM yyyy)"
;
...
@@ -225,7 +237,19 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
...
@@ -225,7 +237,19 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
checkOutDescError
,
checkOutDescError
,
checkOutProofError
checkOutProofError
].
any
((
e
)
=>
e
!=
null
))
{
].
any
((
e
)
=>
e
!=
null
))
{
setState
(()
{});
setState
(()
{});
// refresh UI to show error messages
return
;
}
// --- Format date for server ---
String
formattedDate
=
""
;
try
{
final
parsedDate
=
DateFormat
(
"dd MMM yyyy"
).
parse
(
provider
.
dateController
.
text
);
formattedDate
=
DateFormat
(
"yyyy-MM-dd"
).
format
(
parsedDate
);
}
catch
(
e
)
{
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
SnackBar
(
content:
Text
(
"Error formatting date:
$e
"
)),
);
return
;
return
;
}
}
...
@@ -268,7 +292,7 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
...
@@ -268,7 +292,7 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
:
selectedType
==
"Check Out"
:
selectedType
==
"Check Out"
?
checkOutLocation
.
text
?
checkOutLocation
.
text
:
"
${checkInLocation.text}
,
${checkOutLocation.text}
"
,
:
"
${checkInLocation.text}
,
${checkOutLocation.text}
"
,
checkDate:
provider
.
dateController
.
text
,
checkDate:
formattedDate
,
checkInTime:
finalCheckInTime
,
checkInTime:
finalCheckInTime
,
checkInLoc:
finalCheckInLoc
,
checkInLoc:
finalCheckInLoc
,
checkInProof:
finalCheckInProof
,
checkInProof:
finalCheckInProof
,
...
@@ -278,14 +302,13 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
...
@@ -278,14 +302,13 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
note:
finalNote
,
note:
finalNote
,
);
);
//
Check the response from provider
//
--- Response handling ---
if
(
provider
.
addResponse
!=
null
&&
provider
.
addResponse
!.
error
==
"0"
)
{
if
(
provider
.
addResponse
!=
null
&&
provider
.
addResponse
!.
error
==
"0"
)
{
// Success case
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
SnackBar
(
content:
Text
(
provider
.
addResponse
!.
message
??
"Attendance Submitted Successfully"
)),
SnackBar
(
content:
Text
(
provider
.
addResponse
!.
message
??
"Attendance Submitted Successfully"
)),
);
);
//
---
Reset fields
---
// Reset fields
setState
(()
{
setState
(()
{
selectedType
=
null
;
selectedType
=
null
;
provider
.
dateController
.
clear
();
provider
.
dateController
.
clear
();
...
@@ -301,19 +324,20 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
...
@@ -301,19 +324,20 @@ class _AddManualAttendanceScreenState extends State<AddManualAttendanceScreen> {
_fetchInitialLocation
();
_fetchInitialLocation
();
}
else
{
}
else
{
// Error case - show appropriate message
String
errorMessage
=
provider
.
errorMessage
??
"Failed to submit attendance"
;
String
errorMessage
=
provider
.
errorMessage
??
"Failed to submit attendance"
;
// Handle specific server error for Check Out without Check In
if
(
errorMessage
.
contains
(
"Check In is not Available"
))
{
if
(
errorMessage
.
contains
(
"Check In is not Available"
))
{
errorMessage
=
"Cannot submit Check Out without a Check In record for this date"
;
errorMessage
=
"Cannot submit Check Out without a Check In record for this date"
;
}
}
if
(
errorMessage
.
contains
(
"2"
)){
errorMessage
=
"Only One manual Request can be added in a month !"
;
}
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
ScaffoldMessenger
.
of
(
context
).
showSnackBar
(
SnackBar
(
content:
Text
(
errorMessage
),
backgroundColor:
Colors
.
red
),
SnackBar
(
content:
Text
(
errorMessage
),
backgroundColor:
Colors
.
red
),
);
);
}
}
}
}
// it's date picker need to take day before yesterday, yesterday and today
...
...
lib/screens/hrm/AttendanceRequestDetail.dart
View file @
0b7b76af
This diff is collapsed.
Click to expand it.
lib/screens/hrm/Attendancelist.dart
View file @
0b7b76af
This diff is collapsed.
Click to expand it.
lib/screens/hrm/HrmDashboardScreen.dart
View file @
0b7b76af
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/screens/hrm/
OrganizationStructureScreen
.dart'
;
import
'package:generp/screens/hrm/
Attendancelist
.dart'
;
import
'package:
generp/screens/hrm/RewardListScreen
.dart'
;
import
'package:
provider/provider
.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'AttendanceRequestDetail.dart'
;
import
'AttendanceRequestDetail.dart'
;
import
'LeaveApplicationScreen.dart'
;
import
'LeaveApplicationScreen.dart'
;
import
'TourExpensesListScreen.dart'
;
import
'TourExpensesListScreen.dart'
;
import
'attendancelist.dart'
;
import
'RewardListScreen.dart'
;
import
'OrganizationStructureScreen.dart'
;
import
'../../Notifiers/hrmProvider/hrmAccessiblePagesProvider.dart'
;
import
'oggchart.dart'
;
import
'oggchart.dart'
;
class
HrmdashboardScreen
extends
StatefulWidget
{
class
HrmdashboardScreen
extends
StatefulWidget
{
...
@@ -17,17 +19,32 @@ class HrmdashboardScreen extends StatefulWidget {
...
@@ -17,17 +19,32 @@ class HrmdashboardScreen extends StatefulWidget {
}
}
class
_HrmdashboardScreenState
extends
State
<
HrmdashboardScreen
>
{
class
_HrmdashboardScreenState
extends
State
<
HrmdashboardScreen
>
{
final
allowedPages
=
[
"Team Leave Request Approval"
,
"Team Attendance Approval"
,
"Leave Request List"
,
"Tour Bill List"
,
"Rewards List"
,
"Attendance Request List"
,
];
@override
void
initState
()
{
super
.
initState
();
Future
.
microtask
(()
=>
Provider
.
of
<
HrmAccessiblePagesProvider
>(
context
,
listen:
false
)
.
fetchAccessiblePages
(
context
));
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
SafeArea
(
top:
false
,
child:
Scaffold
(
appBar:
AppBar
(
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
automaticallyImplyLeading:
false
,
backgroundColor:
const
Color
(
0xFFCEEDFF
),
backgroundColor:
const
Color
(
0xFFCEEDFF
),
// elevation: 2.0,
title:
Row
(
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
children:
[
InkResponse
(
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
...
@@ -37,28 +54,23 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
...
@@ -37,28 +54,23 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
),
),
),
),
const
SizedBox
(
width:
10
),
const
SizedBox
(
width:
10
),
InkResponse
(
Text
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"HRM"
,
"HRM"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
18
,
fontSize:
18
,
height:
1.1
,
fontFamily:
"Plus Jakarta Sans"
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w600
,
fontWeight:
FontWeight
.
w600
,
color:
AppColors
.
semi_black
,
color:
AppColors
.
semi_black
,
),
),
),
),
),
],
],
),
),
),
),
),
backgroundColor:
const
Color
(
0xffF6F6F8
),
backgroundColor:
Color
(
0xffF6F6F8
),
body:
SingleChildScrollView
(
body:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
children:
[
children:
[
/// Background
elements
/// Background
Stack
(
Stack
(
children:
[
children:
[
Container
(
Container
(
...
@@ -75,7 +87,7 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
...
@@ -75,7 +87,7 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
colors:
[
colors:
[
Color
(
0xFFCEEDFF
),
Color
(
0xFFCEEDFF
),
Color
(
0xFFf9f9fb
),
Color
(
0xFFf9f9fb
),
Color
(
0xffF6F6F8
)
Color
(
0xffF6F6F8
)
,
],
],
begin:
Alignment
.
topCenter
,
begin:
Alignment
.
topCenter
,
end:
Alignment
.
bottomCenter
,
end:
Alignment
.
bottomCenter
,
...
@@ -93,25 +105,21 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
...
@@ -93,25 +105,21 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
),
),
),
),
/// Content
Column
(
Column
(
children:
[
children:
[
/// Top
Section with Gradient
/// Top
Illustration & Button
Container
(
Container
(
width:
double
.
infinity
,
width:
double
.
infinity
,
padding:
const
EdgeInsets
.
only
(
top:
60
,
bottom:
30
),
padding:
const
EdgeInsets
.
only
(
top:
60
,
bottom:
30
),
child:
Column
(
child:
Column
(
children:
[
children:
[
/// Illustration
SvgPicture
.
asset
(
SvgPicture
.
asset
(
"assets/images/capa.svg"
,
"assets/images/capa.svg"
,
height:
146
,
height:
146
,
width:
400
,
width:
400
,
fit:
BoxFit
.
contain
,
),
),
const
SizedBox
(
height:
32
),
const
SizedBox
(
height:
32
),
/// Organization Structure Button
Container
(
Container
(
padding:
const
EdgeInsets
.
symmetric
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20
,
vertical:
8
),
horizontal:
20
,
vertical:
8
),
...
@@ -154,174 +162,144 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
...
@@ -154,174 +162,144 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
],
],
),
),
),
),
/// Bottom Grid Section
// Bottom
Grid Section
///
Grid Section
LayoutBuilder
(
LayoutBuilder
(
builder:
(
context
,
constraints
)
{
builder:
(
context
,
constraints
)
{
final
itemWidth
=
180.0
;
// Fixed desired width for each item
final
availableWidth
=
constraints
.
maxWidth
;
final
crossAxisCount
=
(
availableWidth
/
itemWidth
).
floor
().
clamp
(
2
,
4
);
return
Padding
(
return
Padding
(
padding:
const
EdgeInsets
.
all
(
14
),
padding:
const
EdgeInsets
.
all
(
14
),
child:
GridView
.
count
(
child:
Consumer
<
HrmAccessiblePagesProvider
>(
crossAxisCount:
crossAxisCount
,
builder:
(
context
,
provider
,
child
)
{
if
(
provider
.
isLoading
)
{
return
const
Center
(
child:
CircularProgressIndicator
());
}
if
(
provider
.
errorMessage
!=
null
)
{
return
Center
(
child:
Text
(
provider
.
errorMessage
!));
}
final
pages
=
(
provider
.
response
?.
pagesAccessible
??
[])
.
where
((
page
)
=>
allowedPages
.
contains
(
page
.
pageName
))
.
toList
();
return
GridView
.
builder
(
itemCount:
pages
.
length
,
shrinkWrap:
true
,
physics:
const
NeverScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
(
constraints
.
maxWidth
/
180
).
floor
().
clamp
(
2
,
4
),
crossAxisSpacing:
8.5
,
crossAxisSpacing:
8.5
,
mainAxisSpacing:
16
,
mainAxisSpacing:
16
,
childAspectRatio:
1.7
,
childAspectRatio:
1.7
,
shrinkWrap:
true
,
physics:
const
NeverScrollableScrollPhysics
(),
children:
[
_buildTile
(
label:
"Attendance List"
,
subtitle:
"Real-time request"
,
assetIcon:
"assets/svg/hrm/attendanceList.svg"
,
txtColor:
const
Color
(
0xff1487C9
),
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
const
Attendancelist
(),
),
),
);
itemBuilder:
(
context
,
index
)
{
},
final
page
=
pages
[
index
];
),
_buildTile
(
return
_buildTile
(
label:
"Leave Application
"
,
label:
page
.
pageName
??
"
"
,
subtitle:
"Apply & Track"
,
subtitle:
_getSubtitle
(
page
.
pageName
??
""
)
,
assetIcon:
"assets/svg/hrm/leaveApplication.svg"
,
assetIcon:
_getIcon
(
page
.
pageName
??
""
)
,
txtColor:
const
Color
(
0xff1487C9
),
txtColor:
const
Color
(
0xff1487C9
),
onTap:
()
{
onTap:
()
=>
_handleNavigation
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
page
.
pageName
??
""
,
builder:
(
context
)
=>
const
LeaveApplicationListScreen
()
,
page
.
mode
??
""
,
),
),
);
);
},
},
),
_buildTile
(
label:
"Rewards List"
,
subtitle:
"Track earned rewards"
,
assetIcon:
"assets/svg/hrm/rewardList.svg"
,
txtColor:
const
Color
(
0xff1487C9
),
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
const
RewardListScreen
(),
),
);
);
},
},
),
),
_buildTile
(
label:
"Tour Expenses"
,
subtitle:
"Submit and manage claims"
,
assetIcon:
"assets/svg/hrm/tourExp.svg"
,
txtColor:
const
Color
(
0xff1487C9
),
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
const
TourExpensesListScreen
(),
),
);
);
},
},
),
),
],
],
),
),
);
},
),
],
],
),
),
],
],
),
),
],
),
),
),
),
);
);
}
}
/// Reusable Tile Widget (Row style)
/// Card builder
/// Reusable Tile Widget (Row style) - Updated to match design
Widget
_buildTile
({
Widget
_buildTile
({
required
String
label
,
required
String
label
,
required
String
subtitle
,
required
String
subtitle
,
required
String
assetIcon
,
// SVG/PNG asset
required
String
assetIcon
,
required
Color
txtColor
,
required
Color
txtColor
,
VoidCallback
?
onTap
,
VoidCallback
?
onTap
,
})
{
})
{
return
LayoutBuilder
(
builder:
(
context
,
constraints
)
{
return
InkWell
(
return
InkWell
(
onTap:
onTap
,
onTap:
onTap
,
borderRadius:
BorderRadius
.
circular
(
14
),
borderRadius:
BorderRadius
.
circular
(
14
),
child:
Container
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
,
vertical:
constraints
.
maxHeight
*
0.05
,
horizontal:
15
,
horizontal:
constraints
.
maxWidth
*
0.05
,
),
margin:
EdgeInsets
.
symmetric
(
vertical:
7
,
horizontal:
5
,
),
),
margin:
const
EdgeInsets
.
symmetric
(
vertical:
7
,
horizontal:
5
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
borderRadius:
BorderRadius
.
circular
(
14
),
),
),
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
children:
[
/// Left side text
Expanded
(
Expanded
(
flex:
2
,
flex:
2
,
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
children:
[
Text
(
Flexible
(
child:
Text
(
label
,
label
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
),
),
softWrap:
true
,
overflow:
TextOverflow
.
visible
,
),
),
SizedBox
(
height:
4
),
),
Text
(
const
SizedBox
(
height:
4
),
Flexible
(
child:
Text
(
subtitle
,
subtitle
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
12
,
fontSize:
12
,
color:
AppColors
.
grey_semi
,
color:
AppColors
.
grey_semi
,
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
),
),
softWrap:
true
,
overflow:
TextOverflow
.
visible
,
),
),
),
],
],
),
),
),
),
SizedBox
(
width:
10
),
/// Right side icon (SVG/PNG)
Expanded
(
Expanded
(
flex:
1
,
flex:
1
,
child:
Container
(
child:
Container
(
height:
42
,
height:
constraints
.
maxHeight
*
0.39
,
width:
42
,
width:
constraints
.
maxHeight
*
0.39
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
shape:
BoxShape
.
circle
,
color:
const
Color
(
0xFFEDF8FF
),
// icon bg
color:
const
Color
(
0xFFEDF8FF
),
),
),
child:
Center
(
child:
Center
(
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
height:
25
,
width:
25
,
assetIcon
,
assetIcon
,
fit:
BoxFit
.
contain
,
height:
constraints
.
maxHeight
*
0.19
,
width:
constraints
.
maxHeight
*
0.19
,
),
),
),
),
),
),
...
@@ -330,5 +308,114 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
...
@@ -330,5 +308,114 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
),
),
),
),
);
);
},
);
}
/// Mapping subtitles
String
_getSubtitle
(
String
pageName
)
{
switch
(
pageName
)
{
case
"Attendance Request List"
:
return
"Real-time request"
;
case
"Leave Request List"
:
return
"Apply & Track"
;
case
"Rewards List"
:
return
"Track earned rewards"
;
case
"Tour Bill List"
:
return
"Submit and manage claims"
;
case
"Team Leave Request Approval"
:
return
""
;
case
"Team Attendance Approval"
:
return
""
;
default
:
return
""
;
}
}
/// Mapping icons
String
_getIcon
(
String
pageName
)
{
switch
(
pageName
)
{
case
"Attendance Request List"
:
return
"assets/svg/hrm/attendanceList.svg"
;
case
"Leave Request List"
:
return
"assets/svg/hrm/leaveApplication.svg"
;
case
"Rewards List"
:
return
"assets/svg/hrm/rewardList.svg"
;
case
"Tour Bill List"
:
return
"assets/svg/hrm/tourExp.svg"
;
case
"Team Leave Request Approval"
:
return
"assets/svg/hrm/leaveApplication.svg"
;
case
"Team Attendance Approval"
:
return
"assets/svg/hrm/attendanceList.svg"
;
default
:
return
"assets/svg/hrm/groupIc.svg"
;
}
}
/// Navigation mapping
void
_handleNavigation
(
BuildContext
context
,
String
pageName
,
String
mode
,
)
{
switch
(
pageName
)
{
case
"Attendance Request List"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AttendanceListScreen
(
mode:
mode
),
),
);
break
;
case
"Leave Request List"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LeaveApplicationListScreen
(
mode:
mode
,
),
),
);
break
;
case
"Rewards List"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
RewardListScreen
(),
),
);
break
;
case
"Tour Bill List"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
TourExpensesListScreen
(),
),
);
break
;
case
"Team Leave Request Approval"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
LeaveApplicationListScreen
(
mode:
mode
,
),
),
);
break
;
case
"Team Attendance Approval"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AttendanceListScreen
(
mode:
mode
),
),
);
break
;
}
}
}
}
}
lib/screens/hrm/LeaveApplicationDetailScreen.dart
View file @
0b7b76af
This diff is collapsed.
Click to expand it.
lib/screens/hrm/LeaveApplicationScreen.dart
View file @
0b7b76af
...
@@ -11,7 +11,8 @@ import 'AddLeaveRequestScreen.dart';
...
@@ -11,7 +11,8 @@ import 'AddLeaveRequestScreen.dart';
import
'LeaveApplicationDetailScreen.dart'
;
import
'LeaveApplicationDetailScreen.dart'
;
class
LeaveApplicationListScreen
extends
StatefulWidget
{
class
LeaveApplicationListScreen
extends
StatefulWidget
{
const
LeaveApplicationListScreen
({
super
.
key
});
final
mode
;
const
LeaveApplicationListScreen
({
super
.
key
,
required
this
.
mode
});
@override
@override
State
<
LeaveApplicationListScreen
>
createState
()
=>
_LeaveApplicationListScreenState
();
State
<
LeaveApplicationListScreen
>
createState
()
=>
_LeaveApplicationListScreenState
();
...
@@ -30,11 +31,13 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -30,11 +31,13 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
ChangeNotifierProvider
(
return
SafeArea
(
top:
false
,
child:
ChangeNotifierProvider
(
create:
(
_
)
{
create:
(
_
)
{
final
provider
=
LeaveApplicationListProvider
();
final
provider
=
LeaveApplicationListProvider
();
Future
.
microtask
(()
{
Future
.
microtask
(()
{
provider
.
fetchLeaveApplications
(
context
);
provider
.
fetchLeaveApplications
(
context
,
widget
.
mode
);
});
});
return
provider
;
return
provider
;
},
},
...
@@ -59,6 +62,7 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -59,6 +62,7 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
provider
.
setDateRangeFilter
(
"Custom"
,
customRange:
dateRange
);
provider
.
setDateRangeFilter
(
"Custom"
,
customRange:
dateRange
);
provider
.
fetchLeaveApplications
(
provider
.
fetchLeaveApplications
(
context
,
context
,
widget
.
mode
,
dateRange:
"Custom"
,
dateRange:
"Custom"
,
customRange:
dateRange
,
customRange:
dateRange
,
);
);
...
@@ -118,7 +122,7 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -118,7 +122,7 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
final
list
=
provider
.
response
!.
requestList
!;
final
list
=
provider
.
response
!.
requestList
!;
return
ListView
.
builder
(
return
ListView
.
builder
(
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
8
,
vertical:
10
),
itemCount:
list
.
length
,
itemCount:
list
.
length
,
itemBuilder:
(
context
,
index
)
{
itemBuilder:
(
context
,
index
)
{
final
item
=
list
[
index
];
final
item
=
list
[
index
];
...
@@ -138,10 +142,11 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -138,10 +142,11 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
MaterialPageRoute
(
MaterialPageRoute
(
builder:
(
context
)
=>
LeaveApplicationDetailScreen
(
builder:
(
context
)
=>
LeaveApplicationDetailScreen
(
leaveRequestId:
item
.
id
.
toString
(),
leaveRequestId:
item
.
id
.
toString
(),
mode:
widget
.
mode
,
),
),
),
),
).
then
((
_
)
{
).
then
((
_
)
{
provider
.
fetchLeaveApplications
(
context
);
provider
.
fetchLeaveApplications
(
context
,
widget
.
mode
);
});
});
},
},
...
@@ -149,7 +154,7 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -149,7 +154,7 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
8.5
,
vertical:
5
),
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
8.5
,
vertical:
5
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
12
,
vertical:
12
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
12
,
vertical:
12
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
//Color(int.parse(item.rowColor!.replaceFirst('#', '0xff'))),
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
),
child:
Row
(
child:
Row
(
...
@@ -182,7 +187,9 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -182,7 +187,9 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
Text
(
Text
(
item
.
leaveType
??
"-"
,
widget
.
mode
==
"teamleader"
?
item
.
employeeName
??
"-"
:
item
.
leaveType
??
"-"
,
maxLines:
1
,
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
style:
TextStyle
(
...
@@ -225,22 +232,23 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -225,22 +232,23 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
),
),
),
),
// /// Right Status
/// Right Status
// Container(
if
(
widget
.
mode
==
"teamleader"
)
// padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
Container
(
// decoration: BoxDecoration(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
8
,
vertical:
4
),
// color: _getStatusBackgroundColor(item.status),
decoration:
BoxDecoration
(
// borderRadius: BorderRadius.circular(10),
color:
Color
(
0x00FFFFFF
),
// ),
borderRadius:
BorderRadius
.
circular
(
10
),
// child: Text(
),
// item.status ?? "-",
child:
Text
(
// style: TextStyle(
item
.
leaveType
??
"-"
,
// fontFamily: "JakartaMedium",
style:
TextStyle
(
// fontSize: 13,
fontFamily:
"JakartaMedium"
,
// color: _getStatusTextColor(item.status),
fontSize:
13
,
// ),
color:
AppColors
.
app_blue
,
// ),
),
// ),
),
),
],
],
),
),
),
),
...
@@ -249,13 +257,17 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -249,13 +257,17 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
);
);
},
},
),
),
)
),
SizedBox
(
height:
28
,)
],
],
),
),
floatingActionButtonLocation:
bottomNavigationBar:
widget
.
mode
==
"teamleader"
FloatingActionButtonLocation
.
centerFloat
,
?
null
floatingActionButton:
InkResponse
(
:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
color:
Colors
.
white
,
child:
InkResponse
(
onTap:
()
{
onTap:
()
{
HapticFeedback
.
selectionClick
();
HapticFeedback
.
selectionClick
();
Navigator
.
push
(
Navigator
.
push
(
...
@@ -267,7 +279,7 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -267,7 +279,7 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
),
),
),
),
).
then
((
_
)
{
).
then
((
_
)
{
provider
.
fetchLeaveApplications
(
context
);
provider
.
fetchLeaveApplications
(
context
,
widget
.
mode
);
});
});
// show add bill screen here
// show add bill screen here
...
@@ -275,8 +287,8 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -275,8 +287,8 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
child:
Container
(
child:
Container
(
height:
45
,
height:
45
,
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
20
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
14
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
,
vertical:
5
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
borderRadius:
BorderRadius
.
circular
(
15
),
...
@@ -291,15 +303,20 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -291,15 +303,20 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
),
),
),
),
),
),
),
);
);
},
},
);
);
},
},
),
);
);
}
}
/// Get status background color
/// Get status background color
Color
_getStatusBackgroundColor
(
String
?
status
)
{
Color
_getStatusBackgroundColor
(
String
?
status
)
{
switch
(
status
?.
toLowerCase
())
{
switch
(
status
?.
toLowerCase
())
{
...
@@ -313,13 +330,14 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
...
@@ -313,13 +330,14 @@ class _LeaveApplicationListScreenState extends State<LeaveApplicationListScreen>
}
}
}
}
/// Get status text color
/// Get status text color
Color
_getStatusTextColor
(
String
?
status
)
{
Color
_getStatusTextColor
(
String
?
status
)
{
switch
(
status
?.
toLowerCase
())
{
switch
(
status
?.
toLowerCase
())
{
case
'approved'
:
case
'approved'
:
return
AppColors
.
approved_text_color
;
return
AppColors
.
approved_text_color
;
case
'rejected'
:
case
'rejected'
:
return
App
Colors
.
re
jected_text_color
;
return
Colors
.
re
dAccent
.
shade200
;
case
'requested'
:
case
'requested'
:
default
:
default
:
return
AppColors
.
requested_text_color
;
return
AppColors
.
requested_text_color
;
...
...
lib/screens/hrm/RewardListScreen.dart
View file @
0b7b76af
...
@@ -17,7 +17,9 @@ class RewardListScreen extends StatefulWidget {
...
@@ -17,7 +17,9 @@ class RewardListScreen extends StatefulWidget {
class
_RewardListScreenState
extends
State
<
RewardListScreen
>
{
class
_RewardListScreenState
extends
State
<
RewardListScreen
>
{
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
ChangeNotifierProvider
(
return
SafeArea
(
top:
false
,
child:
ChangeNotifierProvider
(
create:
(
_
)
=>
create:
(
_
)
=>
RewardListProvider
()..
fetchRewardList
(
context
),
RewardListProvider
()..
fetchRewardList
(
context
),
child:
Consumer
<
RewardListProvider
>(
child:
Consumer
<
RewardListProvider
>(
...
@@ -296,6 +298,7 @@ class _RewardListScreenState extends State<RewardListScreen> {
...
@@ -296,6 +298,7 @@ class _RewardListScreenState extends State<RewardListScreen> {
);
);
}
}
)
)
),
);
);
}
}
...
@@ -315,13 +318,13 @@ class _RewardListScreenState extends State<RewardListScreen> {
...
@@ -315,13 +318,13 @@ class _RewardListScreenState extends State<RewardListScreen> {
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
circular
(
16
),
boxShadow:
[
//
boxShadow: [
BoxShadow
(
//
BoxShadow(
color:
Colors
.
grey
.
withOpacity
(
0.1
),
//
color: Colors.grey.withOpacity(0.1),
blurRadius:
6
,
//
blurRadius: 6,
offset:
const
Offset
(
0
,
3
),
//
offset: const Offset(0, 3),
)
//
)
],
//
],
),
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
lib/screens/hrm/TourExpensesDetailsScreen.dart
View file @
0b7b76af
...
@@ -19,7 +19,9 @@ class TourExpensesDetailsScreen extends StatefulWidget {
...
@@ -19,7 +19,9 @@ class TourExpensesDetailsScreen extends StatefulWidget {
class
_TourExpensesDetailsScreenState
extends
State
<
TourExpensesDetailsScreen
>{
class
_TourExpensesDetailsScreenState
extends
State
<
TourExpensesDetailsScreen
>{
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
ChangeNotifierProvider
(
return
SafeArea
(
top:
false
,
child:
ChangeNotifierProvider
(
create:
(
_
)
=>
TourExpensesDetailsProvider
()
create:
(
_
)
=>
TourExpensesDetailsProvider
()
..
fetchTourExpensesDetails
(
context
,
widget
.
tourBillId
),
..
fetchTourExpensesDetails
(
context
,
widget
.
tourBillId
),
child:
Scaffold
(
child:
Scaffold
(
...
@@ -179,8 +181,16 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
...
@@ -179,8 +181,16 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
context
)
=>
Image
.
network
(
t
.
imageDirFilePath
.
toString
()),
(
// Fileviewer(fileName: label, fileUrl: "assets/images/capa.svg"),
context
,
)
=>
Fileviewer
(
fileName:
t
.
imageDirFilePath
??
""
,
fileUrl:
t
.
imageDirFilePath
??
""
,
),
),
),
);
);
},
},
...
@@ -228,16 +238,19 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
...
@@ -228,16 +238,19 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
toDate:
h
.
toDate
??
"-"
,
toDate:
h
.
toDate
??
"-"
,
onViewTap:
()
{
onViewTap:
()
{
debugPrint
(
"Open:
${h.imageDirFilePath}
"
);
debugPrint
(
"Open:
${h.imageDirFilePath}
"
);
showDialog
(
Navigator
.
push
(
context:
context
,
context
,
builder:
(
_
)
=>
Dialog
(
MaterialPageRoute
(
shape:
RoundedRectangleBorder
(
builder:
borderRadius:
BorderRadius
.
circular
(
12
),
(
),
context
,
child:
ClipRRect
(
)
=>
Fileviewer
(
borderRadius:
BorderRadius
.
circular
(
12
),
fileName:
child:
Image
.
network
(
h
.
imageDirFilePath
.
toString
())
h
.
imageDirFilePath
??
""
,
fileUrl:
h
.
imageDirFilePath
??
""
,
),
),
),
),
);
);
...
@@ -285,16 +298,19 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
...
@@ -285,16 +298,19 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
date:
o
.
otherDate
??
"-"
,
date:
o
.
otherDate
??
"-"
,
onViewTap:
()
{
onViewTap:
()
{
debugPrint
(
"Open:
${o.imageDirFilePath}
"
);
debugPrint
(
"Open:
${o.imageDirFilePath}
"
);
showDialog
(
Navigator
.
push
(
context:
context
,
context
,
builder:
(
_
)
=>
Dialog
(
MaterialPageRoute
(
shape:
RoundedRectangleBorder
(
builder:
borderRadius:
BorderRadius
.
circular
(
12
),
(
),
context
,
child:
ClipRRect
(
)
=>
Fileviewer
(
borderRadius:
BorderRadius
.
circular
(
12
),
fileName:
child:
Image
.
network
(
o
.
imageDirFilePath
.
toString
())
o
.
imageDirFilePath
??
""
,
fileUrl:
o
.
imageDirFilePath
??
""
,
),
),
),
),
);
);
...
@@ -314,6 +330,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
...
@@ -314,6 +330,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
},
},
),
),
),
),
),
);
);
}
}
...
@@ -334,13 +351,13 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
...
@@ -334,13 +351,13 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
circular
(
16
),
boxShadow:
[
//
boxShadow: [
BoxShadow
(
//
BoxShadow(
color:
Colors
.
grey
.
withOpacity
(
0.1
),
//
color: Colors.grey.withOpacity(0.1),
blurRadius:
6
,
//
blurRadius: 6,
offset:
const
Offset
(
0
,
3
),
//
offset: const Offset(0, 3),
)
//
)
],
//
],
),
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
@@ -407,13 +424,13 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
...
@@ -407,13 +424,13 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
circular
(
16
),
boxShadow:
[
//
boxShadow: [
BoxShadow
(
//
BoxShadow(
color:
Colors
.
grey
.
withOpacity
(
0.1
),
//
color: Colors.grey.withOpacity(0.1),
blurRadius:
6
,
//
blurRadius: 6,
offset:
const
Offset
(
0
,
3
),
//
offset: const Offset(0, 3),
)
//
)
],
//
],
),
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
@@ -477,13 +494,13 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
...
@@ -477,13 +494,13 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
circular
(
16
),
boxShadow:
[
//
boxShadow: [
BoxShadow
(
//
BoxShadow(
color:
Colors
.
grey
.
withOpacity
(
0.1
),
//
color: Colors.grey.withOpacity(0.1),
blurRadius:
6
,
//
blurRadius: 6,
offset:
const
Offset
(
0
,
3
),
//
offset: const Offset(0, 3),
)
//
)
],
//
],
),
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
@@ -548,13 +565,13 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
...
@@ -548,13 +565,13 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
borderRadius:
BorderRadius
.
circular
(
16
),
boxShadow:
[
//
boxShadow: [
BoxShadow
(
//
BoxShadow(
color:
Colors
.
grey
.
withOpacity
(
0.1
),
//
color: Colors.grey.withOpacity(0.1),
blurRadius:
6
,
//
blurRadius: 6,
offset:
const
Offset
(
0
,
3
),
//
offset: const Offset(0, 3),
)
//
)
],
//
],
),
),
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
@@ -681,7 +698,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
...
@@ -681,7 +698,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen>{
bottomRight:
Radius
.
circular
(
30
),
bottomRight:
Radius
.
circular
(
30
),
),
),
),
),
elevation:
2
,
elevation:
0
,
child:
Container
(
child:
Container
(
decoration:
const
BoxDecoration
(
decoration:
const
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
...
...
lib/screens/hrm/TourExpensesListScreen.dart
View file @
0b7b76af
...
@@ -168,38 +168,36 @@ class _TourExpensesListScreenState extends State<TourExpensesListScreen> {
...
@@ -168,38 +168,36 @@ class _TourExpensesListScreenState extends State<TourExpensesListScreen> {
],
],
),
),
floatingActionButtonLocation:
bottomNavigationBar:
Container
(
FloatingActionButtonLocation
.
centerFloat
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
18
,
vertical:
10
),
floatingActionButton:
InkResponse
(
color:
Colors
.
white
,
onTap:
()
{
child:
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
const
Color
(
0xff1487c9
),
// App blue
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
15
),
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
14
),
elevation:
0
,
// Optional: remove shadow
),
onPressed:
()
{
HapticFeedback
.
selectionClick
();
HapticFeedback
.
selectionClick
();
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
(
context
)
=>
builder:
(
context
)
=>
const
AddBillScreen
(
pageTitleName:
"Add Bill"
),
const
AddBillScreen
(
pageTitleName:
"Add Bill"
,),
settings:
const
RouteSettings
(
name:
'AddTourExpBillScreen'
),
settings:
const
RouteSettings
(
name:
'AddTourExpBillScreen'
),
),
),
).
then
((
_
)
{
).
then
((
_
)
{
provider
.
fetchTourExpenses
(
context
,
"1"
);
provider
.
fetchTourExpenses
(
context
,
"1"
);
});
});
// show add bill screen here
},
},
child:
Container
(
child:
const
Text
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
20
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
Text
(
"Add Bill"
,
"Add Bill"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
1
5
,
fontSize:
1
6
,
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
white
,
color:
Colors
.
white
,
),
),
),
),
...
...
lib/screens/notifierExports.dart
View file @
0b7b76af
...
@@ -57,6 +57,7 @@ export 'package:generp/Notifiers/crmProvider/followUpUpdateProvider.dart';
...
@@ -57,6 +57,7 @@ export 'package:generp/Notifiers/crmProvider/followUpUpdateProvider.dart';
export
'package:generp/Notifiers/crmProvider/appointmentCalendarProvider.dart'
;
export
'package:generp/Notifiers/crmProvider/appointmentCalendarProvider.dart'
;
export
'package:generp/Notifiers/crmProvider/addNewLeadsandProspectsProvider.dart'
;
export
'package:generp/Notifiers/crmProvider/addNewLeadsandProspectsProvider.dart'
;
export
'package:generp/Notifiers/hrmProvider/hrmAccessiblePagesProvider.dart'
;
export
'package:generp/Notifiers/hrmProvider/attendanceListProvider.dart'
;
export
'package:generp/Notifiers/hrmProvider/attendanceListProvider.dart'
;
export
'package:generp/Notifiers/hrmProvider/AttendanceDetailsProvider.dart'
;
export
'package:generp/Notifiers/hrmProvider/AttendanceDetailsProvider.dart'
;
export
'package:generp/Notifiers/hrmProvider/tourExpensesProvider.dart'
;
export
'package:generp/Notifiers/hrmProvider/tourExpensesProvider.dart'
;
...
...
lib/services/api_calling.dart
View file @
0b7b76af
...
@@ -4995,11 +4995,13 @@ class ApiCalling {
...
@@ -4995,11 +4995,13 @@ class ApiCalling {
type
,
type
,
from
,
from
,
to
,
to
,
mode
)
async
{
)
async
{
try
{
try
{
Map
<
String
,
String
>
data
=
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
'session_id'
:
(
session
).
toString
(),
'mode'
:
(
mode
),
'type'
:
(
type
),
'type'
:
(
type
),
'from'
:
(
from
),
'from'
:
(
from
),
'to'
:
(
to
),
'to'
:
(
to
),
...
@@ -5019,6 +5021,7 @@ class ApiCalling {
...
@@ -5019,6 +5021,7 @@ class ApiCalling {
}
}
}
}
static
Future
<
attendanceRequestDetailsResponse
?>
attendanceRequestDetailAPI
(
static
Future
<
attendanceRequestDetailsResponse
?>
attendanceRequestDetailAPI
(
empId
,
empId
,
session
,
session
,
...
@@ -5045,6 +5048,38 @@ class ApiCalling {
...
@@ -5045,6 +5048,38 @@ class ApiCalling {
}
}
}
}
static
Future
<
CommonResponse
?>
attendanceRequestApproveRejectAPI
(
session
,
empId
,
mode
,
type
,
remarks
,
id
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'session_id'
:
(
session
).
toString
(),
'emp_id'
:
(
empId
).
toString
(),
'mode'
:
(
mode
).
toString
(),
'type'
:
(
type
).
toString
(),
'remarks'
:
(
remarks
).
toString
(),
'id'
:
(
id
).
toString
(),
};
final
res
=
await
post
(
data
,
AttendanceRequestRejectUrl
,
{});
if
(
res
!=
null
)
{
print
(
"Attendance App Reje:
${data}
"
);
debugPrint
(
res
.
body
);
return
CommonResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
return
null
;
}
}
catch
(
e
)
{
debugPrint
(
'hello bev=bug
$e
'
);
return
null
;
}
}
static
Future
<
CommonResponse
?>
addAttendanceRequestAPI
({
static
Future
<
CommonResponse
?>
addAttendanceRequestAPI
({
required
String
sessionId
,
required
String
sessionId
,
required
String
empId
,
required
String
empId
,
...
@@ -5317,12 +5352,14 @@ class ApiCalling {
...
@@ -5317,12 +5352,14 @@ class ApiCalling {
// Leave Application api
// Leave Application api
// Leave Application api
static
Future
<
leaveApplicationLIstResponse
?>
leaveApplicationListAPI
(
static
Future
<
leaveApplicationLIstResponse
?>
leaveApplicationListAPI
(
session
,
session
,
empId
,
empId
,
dateFrom
,
dateFrom
,
dateTo
dateTo
,
mode
)
async
{
)
async
{
try
{
try
{
Map
<
String
,
String
>
data
=
{
Map
<
String
,
String
>
data
=
{
...
@@ -5330,6 +5367,8 @@ class ApiCalling {
...
@@ -5330,6 +5367,8 @@ class ApiCalling {
'emp_id'
:
(
empId
).
toString
(),
'emp_id'
:
(
empId
).
toString
(),
'requested_date_from'
:
(
dateFrom
),
'requested_date_from'
:
(
dateFrom
),
'requested_date_to'
:
(
dateTo
),
'requested_date_to'
:
(
dateTo
),
'mode'
:
(
mode
),
};
};
final
res
=
await
post
(
data
,
LeaveApplicationListUrl
,
{});
final
res
=
await
post
(
data
,
LeaveApplicationListUrl
,
{});
if
(
res
!=
null
)
{
if
(
res
!=
null
)
{
...
@@ -5408,6 +5447,38 @@ class ApiCalling {
...
@@ -5408,6 +5447,38 @@ class ApiCalling {
}
}
}
}
static
Future
<
CommonResponse
?>
leaveRequestRejectApproveAPI
(
session
,
empId
,
mode
,
type
,
remarks
,
id
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'session_id'
:
(
session
).
toString
(),
'emp_id'
:
(
empId
).
toString
(),
'mode'
:
(
mode
).
toString
(),
'type'
:
(
type
).
toString
(),
'remarks'
:
(
remarks
).
toString
(),
'id'
:
(
id
).
toString
(),
};
final
res
=
await
post
(
data
,
LeaveRequestRejectAprroveUrl
,
{});
if
(
res
!=
null
)
{
print
(
data
);
debugPrint
(
res
.
body
);
return
CommonResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
return
null
;
}
}
catch
(
e
)
{
debugPrint
(
'hello bev=bug
$e
'
);
return
null
;
}
}
// static Future<CommonResponse?> TpcIssueListApprovalAPI(
// static Future<CommonResponse?> TpcIssueListApprovalAPI(
// empId,
// empId,
...
...
lib/services/api_names.dart
View file @
0b7b76af
...
@@ -180,13 +180,16 @@ const crmDashboardQuotationsUrl = "${baseUrl_test}crm_dashboard_quotations_list"
...
@@ -180,13 +180,16 @@ const crmDashboardQuotationsUrl = "${baseUrl_test}crm_dashboard_quotations_list"
const
ogcharturl
=
"
${baseUrl_test}
organisation_structures"
;
const
ogcharturl
=
"
${baseUrl_test}
organisation_structures"
;
const
JobDesciptionUrl
=
"
${baseUrl_test}
job_description"
;
///HRM
///HRM
//Attendance
//Attendance
const
HrmAccessiblePagesUrl
=
"
${baseUrl_test}
hrm_accessible_pages"
;
const
HrmAccessiblePagesUrl
=
"
${baseUrl_test}
hrm_accessible_pages"
;
const
AttendanceRequestListUrl
=
"
${baseUrl_test}
attendance_request_list"
;
const
AttendanceRequestListUrl
=
"
${baseUrl_test}
attendance_request_list"
;
const
AttendanceRequestDetailsUrl
=
"
${baseUrl_test}
attendance_request_details"
;
const
AttendanceRequestDetailsUrl
=
"
${baseUrl_test}
attendance_request_details"
;
const
AddAttendanceRequestUrl
=
"
${baseUrl_test}
add_attendance_request"
;
const
AddAttendanceRequestUrl
=
"
${baseUrl_test}
add_attendance_request"
;
const
AttendanceRequestRejectUrl
=
"
${baseUrl_test}
attendance_approve_reject"
;
const
AttendanceRequestAproveUrl
=
"
${baseUrl_test}
attendance_approve_reject"
;
// reward list
// reward list
const
RewardListUrl
=
"
${baseUrl_test}
hrm_emp_self_rewards"
;
const
RewardListUrl
=
"
${baseUrl_test}
hrm_emp_self_rewards"
;
// Tour Expenses hrm_emp_self_rewards
// Tour Expenses hrm_emp_self_rewards
...
@@ -198,6 +201,7 @@ const AddTourExpensesUrl ="${baseUrl_test}add_tour_bill";
...
@@ -198,6 +201,7 @@ const AddTourExpensesUrl ="${baseUrl_test}add_tour_bill";
const
LeaveApplicationListUrl
=
"
${baseUrl_test}
leave_request_list"
;
const
LeaveApplicationListUrl
=
"
${baseUrl_test}
leave_request_list"
;
const
LeaveApplicationDetailsUrl
=
"
${baseUrl_test}
leave_request_details"
;
const
LeaveApplicationDetailsUrl
=
"
${baseUrl_test}
leave_request_details"
;
const
LeaveRequestAdditionUrl
=
"
${baseUrl_test}
add_leave_request"
;
const
LeaveRequestAdditionUrl
=
"
${baseUrl_test}
add_leave_request"
;
const
LeaveRequestRejectAprroveUrl
=
"
${baseUrl_test}
leaves_approve_reject"
;
...
...
Prev
1
2
3
Next