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
Commits
642da22c
Commit
642da22c
authored
Oct 08, 2025
by
Sai Srinivas
Committed by
Sai Srinivas
Oct 13, 2025
Browse files
gen erp 08-10
parent
d2c9404a
Changes
48
Show whitespace changes
Inline
Side-by-side
lib/screens/hrm/CasualLeaveHistoryScreen.dart
0 → 100644
View file @
642da22c
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/flutter_svg.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Notifiers/hrmProvider/CasualLeaveHistoryProvider.dart'
;
import
'../../Utils/app_colors.dart'
;
class
CasualLeaveHistoryScreen
extends
StatefulWidget
{
const
CasualLeaveHistoryScreen
({
super
.
key
});
@override
State
<
CasualLeaveHistoryScreen
>
createState
()
=>
_CasualLeaveHistoryScreenState
();
}
class
_CasualLeaveHistoryScreenState
extends
State
<
CasualLeaveHistoryScreen
>
{
@override
void
initState
()
{
super
.
initState
();
// Fetch data once when the screen loads
Future
.
delayed
(
Duration
.
zero
,
()
{
final
provider
=
Provider
.
of
<
CasualLeaveHistoryProvider
>(
context
,
listen:
false
);
provider
.
fetchCasualLeaveHistory
(
context
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
final
double
screenWidth
=
MediaQuery
.
of
(
context
).
size
.
width
;
final
double
screenHeight
=
MediaQuery
.
of
(
context
).
size
.
height
;
final
bool
isSmallScreen
=
screenWidth
<
360
;
final
bool
isLargeScreen
=
screenWidth
>
600
;
final
bool
isTablet
=
screenWidth
>
768
;
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
backgroundColor:
Colors
.
white
,
title:
Row
(
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/appbar_back_button.svg"
,
height:
isSmallScreen
?
22
:
isTablet
?
28
:
25
,
),
),
SizedBox
(
width:
isSmallScreen
?
8
:
isTablet
?
12
:
10
),
Text
(
"Casual Leave History"
,
style:
TextStyle
(
fontSize:
isSmallScreen
?
16
:
isTablet
?
20
:
18
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w600
,
color:
Colors
.
black87
,
),
),
],
),
),
body:
Consumer
<
CasualLeaveHistoryProvider
>(
builder:
(
context
,
provider
,
_
)
{
if
(
provider
.
isLoading
)
{
return
const
Center
(
child:
CircularProgressIndicator
());
}
if
(
provider
.
errorMessage
!=
null
)
{
return
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
isSmallScreen
?
16
:
20
),
child:
Center
(
child:
Text
(
provider
.
errorMessage
!,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
isSmallScreen
?
14
:
16
,
fontFamily:
"Plus Jakarta Sans"
,
),
textAlign:
TextAlign
.
center
,
),
),
);
}
if
(
provider
.
casualLeaveHistoryList
.
isEmpty
)
{
return
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
isSmallScreen
?
16
:
20
),
child:
Center
(
child:
Text
(
"No leave history found"
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
isSmallScreen
?
14
:
16
,
fontFamily:
"Plus Jakarta Sans"
,
),
),
),
);
}
return
ListView
.
builder
(
padding:
EdgeInsets
.
all
(
isSmallScreen
?
8
:
isTablet
?
16
:
12
),
itemCount:
provider
.
casualLeaveHistoryList
.
length
,
itemBuilder:
(
context
,
index
)
{
final
item
=
provider
.
casualLeaveHistoryList
[
index
];
return
Padding
(
padding:
EdgeInsets
.
symmetric
(
vertical:
isSmallScreen
?
4
:
isTablet
?
8
:
6
,
),
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
isSmallScreen
?
12
:
isTablet
?
20
:
16
,
),
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
isSmallScreen
?
12
:
isTablet
?
18
:
14
,
vertical:
isSmallScreen
?
8
:
isTablet
?
14
:
10
,
),
child:
Row
(
children:
[
// --- Avatar Circle ---
Container
(
height:
isSmallScreen
?
40
:
isTablet
?
54
:
46
,
width:
isSmallScreen
?
40
:
isTablet
?
54
:
46
,
decoration:
BoxDecoration
(
color:
_getAvatarColor
(
item
.
type
),
shape:
BoxShape
.
circle
,
),
child:
Center
(
child:
Text
(
getText
(
item
.
type
),
style:
TextStyle
(
fontSize:
isSmallScreen
?
13
:
isTablet
?
17
:
15
,
fontFamily:
"Plus Jakarta Sans"
,
fontWeight:
FontWeight
.
w500
,
color:
_getAvatarTxtColor
(
item
.
type
),
),
),
),
),
SizedBox
(
width:
isSmallScreen
?
10
:
isTablet
?
16
:
12
),
// --- Main Content ---
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
item
.
des
??
"No Description"
,
style:
TextStyle
(
fontFamily:
"JakartaRegular"
,
fontSize:
isSmallScreen
?
13
:
isTablet
?
16
:
14
,
color:
AppColors
.
semi_black
,
height:
1.2
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
),
SizedBox
(
height:
isSmallScreen
?
2
:
isTablet
?
6
:
4
),
Text
(
item
.
year
??
""
,
style:
TextStyle
(
fontFamily:
"JakartaRegular"
,
fontSize:
isSmallScreen
?
12
:
isTablet
?
14
:
13
,
color:
AppColors
.
grey_semi
,
),
),
],
),
),
// --- Duration Badge (like "1 Day") ---
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
blue
.
shade50
,
borderRadius:
BorderRadius
.
circular
(
isSmallScreen
?
16
:
isTablet
?
24
:
20
,
),
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
isSmallScreen
?
12
:
isTablet
?
16
:
14
,
vertical:
isSmallScreen
?
4
:
isTablet
?
8
:
6
,
),
child:
Text
(
"
${item.cnt ?? '0'}
Day
${(item.cnt ?? '0') == '1' ? '' : 's'}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
isSmallScreen
?
12
:
isTablet
?
15
:
14
,
color:
Color
(
0xff1487c9
),
),
),
),
],
),
),
);
},
);
},
),
);
}
/// Avatar color generator
Color
_getAvatarColor
(
value
)
{
var
color
=
AppColors
.
approved_bg_color
;
switch
(
value
)
{
case
'minus'
:
return
AppColors
.
rejected_bg_color
;
case
'plus'
:
return
AppColors
.
approved_bg_color
;
}
return
color
;
}
Color
_getAvatarTxtColor
(
value
)
{
var
color
=
AppColors
.
approved_text_color
;
switch
(
value
)
{
case
'minus'
:
return
AppColors
.
rejected_text_color
;
case
'plus'
:
return
AppColors
.
approved_text_color
;
}
return
color
;
}
String
getText
(
value
)
{
switch
(
value
)
{
case
'minus'
:
return
"M"
;
case
'plus'
:
return
"P"
;
default
:
return
"-"
;
}
}
}
\ No newline at end of file
lib/screens/hrm/HrmDashboardScreen.dart
View file @
642da22c
...
...
@@ -3,6 +3,8 @@ import 'package:flutter_svg/svg.dart';
import
'package:generp/screens/hrm/Attendancelist.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'AdvanceListScreen.dart'
;
import
'CasualLeaveHistoryScreen.dart'
;
import
'LeaveApplicationScreen.dart'
;
import
'TourExpensesListScreen.dart'
;
import
'RewardListScreen.dart'
;
...
...
@@ -24,6 +26,8 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
"Tour Bill List"
,
"Rewards List"
,
"Attendance Request List"
,
"Advance List"
,
"Casual Leave List"
];
@override
...
...
@@ -215,7 +219,7 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
crossAxisCount:
(
constraints
.
maxWidth
/
180
)
.
floor
()
.
clamp
(
2
,
4
),
.
clamp
(
2
,
6
),
crossAxisSpacing:
1
,
mainAxisSpacing:
2
,
childAspectRatio:
1.8
,
...
...
@@ -224,7 +228,7 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
final
page
=
pages
[
index
];
return
_buildTile
(
label:
page
.
pageName
??
""
,
label:
page
.
pageName
??
""
,
//in page number there is 6 items comming from serever it showing only four
subtitle:
_getSubtitle
(
page
.
pageName
??
""
,
),
...
...
@@ -244,6 +248,11 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
);
},
),
////////////
SizedBox
(
height:
40
,)
],
),
],
...
...
@@ -355,6 +364,10 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
return
""
;
case
"Team Attendance Approval"
:
return
""
;
case
"Advance List"
:
return
"Advance Payment"
;
case
"Casual Leave List"
:
return
"Track Casual Leave"
;
default
:
return
""
;
}
...
...
@@ -375,6 +388,10 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
return
"assets/svg/hrm/logout_ic.svg"
;
case
"Team Attendance Approval"
:
return
"assets/svg/hrm/check_ic.svg"
;
case
"Advance List"
:
return
"assets/svg/hrm/advance_list_ic.svg"
;
case
"Casual Leave List"
:
return
"assets/svg/hrm/casual_leave_history_ic.svg"
;
default
:
return
"assets/svg/hrm/groupIc.svg"
;
}
...
...
@@ -432,6 +449,24 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
),
);
break
;
case
"Advance List"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
AdvanceListScreen
(),
),
);
break
;
case
"Casual Leave List"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
CasualLeaveHistoryScreen
(),
),
);
break
;
}
}
}
lib/screens/notifierExports.dart
View file @
642da22c
...
...
@@ -65,6 +65,6 @@ export 'package:generp/Notifiers/hrmProvider/tourExpensesDetailsProvider.dart';
export
'package:generp/Notifiers/hrmProvider/rewardListProvider.dart'
;
export
'package:generp/Notifiers/hrmProvider/LeaveApplicationListProvider.dart'
;
export
'package:generp/Notifiers/hrmProvider/LeaveApplicationDetailsProvider.dart'
;
export
'package:generp/Notifiers/hrmProvider/CasualLeaveHistoryProvider.dart'
;
export
'package:generp/Notifiers/hrmprovider/orgprovider.dart'
;
lib/screens/order/addOrder.dart
View file @
642da22c
...
...
@@ -25,8 +25,14 @@ import 'package:dropdown_search/dropdown_search.dart';
class
AddorderScreen
extends
StatefulWidget
{
final
pageTitleName
;
final
mode
;
final
leadId
;
final
feedback
;
final
followupType
;
final
inTime
;
final
loc
;
const
AddorderScreen
({
super
.
key
,
this
.
pageTitleName
,
this
.
mode
});
const
AddorderScreen
({
super
.
key
,
this
.
pageTitleName
,
this
.
mode
,
this
.
leadId
,
this
.
feedback
,
this
.
followupType
,
this
.
inTime
,
this
.
loc
});
@override
State
<
AddorderScreen
>
createState
()
=>
_AddorderScreenState
();
...
...
@@ -45,30 +51,99 @@ class _AddorderScreenState extends State<AddorderScreen> {
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
provider
=
Provider
.
of
<
Addorderprovider
>(
context
,
listen:
false
);
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
async
{
final
provider
=
Provider
.
of
<
Addorderprovider
>(
context
,
listen:
false
);
final
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
if
(
provider
.
dateNow
==
null
)
{
provider
.
setDate
(
DateTime
.
now
());
}
provider
.
getLocationPermission
(
context
);
provider
.
getCurrentLocation
();
provider
.
ordersAddOrderAPIViewFunction
(
context
,
widget
.
mode
);
provider
.
ordersAddOrderSelectAccountAPIFunction
(
// fetch select account API
await
provider
.
ordersAddOrderSelectAccountAPIFunction
(
context
,
widget
.
mode
,
provider
.
selectedAccountID
,
''
,
);
});
if
(
widget
.
pageTitleName
!=
"Add Order"
)
{
provider
.
ordersAddOrderAPIViewFunction
(
context
,
widget
.
mode
,
""
,
""
,
""
,
""
,
""
,
);
}
if
(
widget
.
pageTitleName
==
"Add Order"
)
{
await
provider
.
fetchAddOrderViewData
(
context
,
homeProvider
.
empId
,
homeProvider
.
session
,
widget
.
mode
,
widget
.
leadId
,
widget
.
feedback
,
widget
.
followupType
,
widget
.
inTime
,
widget
.
loc
,
);
debugPrint
(
" fetchAddOrderViewData finished"
);
debugPrint
(
"Assign data to all fields##################################"
);
final
account
=
provider
.
accountDetails
;
if
(
account
!=
null
)
{
await
provider
.
ordersAddOrderSelectAccountAPIFunction
(
context
,
widget
.
mode
,
account
.
id
,
""
,
);
// provider.getDistrictAPI(context, account.district);
// provider.getSubLocationAPI(context, account.subLocality);
provider
.
ordersAddOrderAccountDetailsAPIFunction
(
context
,
account
.
id
);
provider
.
selectedAccountID
=
account
.
id
;
provider
.
selectedAccountName
=
account
.
name
;
provider
.
selectedBillingStateID
=
account
.
state
;
// Fill text controllers
provider
.
billingNameController
.
text
=
account
.
name
??
""
;
provider
.
billingAddressController
.
text
=
account
.
address
??
""
;
provider
.
billingPincodeController
.
text
=
account
.
pincode
??
""
;
provider
.
orderReceivedDateController
.
text
=
account
.
date
??
""
;
provider
.
billingStateSearchController
.
text
=
account
.
state
!;
provider
.
selecetdBillingStates
=
"account.state"
as
States
?;
debugPrint
(
"Auto filled"
);
provider
.
accountList
.
first
=
account
.
name
as
AccountList
;
// provider.billingDistrictSearchController.text = district as String;
// provider.selectedBillingDistricts = district as Districts?;
//
// provider.billingSubLocSearchController.text = account.subLocality!;
// provider.selectedBillingSubLocations = account.subLocality as SubLocations?;
provider
.
dropDownSearchController
.
text
=
account
.
name
!;
provider
.
selectedAccountName
=
account
.
name
;
provider
.
notifyListeners
();
}
}
});
}
@override
void
dispose
()
{
focusNodes
.
map
((
e
)
=>
e
.
dispose
());
...
...
@@ -152,6 +227,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Addorderprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
child:
SafeArea
(
top:
false
,
...
...
@@ -295,13 +371,14 @@ class _AddorderScreenState extends State<AddorderScreen> {
if
(
value
!=
null
)
{
print
(
'Selected account:
${value.text}
'
);
provider
.
selectedAccountList
=
(
value
);
provider
.
selectedAccountID
=
value
.
id
!;
provider
.
selectedAccountName
=
value
.
text
!;
provider
.
selectedAccountID
=
value
!
.
id
!;
provider
.
selectedAccountName
=
value
!
.
text
!;
provider
.
ordersAddOrderAccountDetailsAPIFunction
(
context
,
value
.
id
,
);
}
},
selectedItem:
provider
.
selectedAccountList
,
...
...
@@ -351,6 +428,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
// },
),
if
(
provider
.
selectAccountError
!=
null
)
...[
errorWidget
(
context
,
...
...
@@ -1150,7 +1228,8 @@ class _AddorderScreenState extends State<AddorderScreen> {
.
isNotEmpty
?
provider
.
selectedDispatchDistricts
!=
null
?
provider
.
dispatchDistricts
.
firstWhere
(
?
provider
.
dispatchDistricts
.
firstWhere
(
(
ord
)
=>
ord
.
id
==
provider
...
...
@@ -1307,7 +1386,9 @@ class _AddorderScreenState extends State<AddorderScreen> {
.
isNotEmpty
?
provider
.
selectedDispatchSubLocations
!=
null
?
provider
.
dispatchSubLocations
.
firstWhere
(
?
provider
.
dispatchSubLocations
.
firstWhere
(
(
ord
)
=>
ord
.
id
==
provider
...
...
@@ -1675,11 +1756,11 @@ class _AddorderScreenState extends State<AddorderScreen> {
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
Widget
StateProperty
.
all
<
double
>(
6
,
),
Material
StateProperty
.
all
<
double
>(
6
),
thumbVisibility:
Widget
StateProperty
.
all
<
bool
>(
Material
StateProperty
.
all
<
bool
>(
true
,
),
),
...
...
@@ -1896,9 +1977,9 @@ class _AddorderScreenState extends State<AddorderScreen> {
if
(
value
!=
null
)
{
print
(
'Selected account:
${value.text}
'
);
provider
.
selectedTpcAgent
=
(
value
);
provider
.
selectedTpcAgentID
=
value
.
id
!;
provider
.
selectedTpcAgentID
=
value
!
.
id
!;
provider
.
selectedTpcAgentValue
=
value
.
text
!;
value
!
.
text
!;
}
},
selectedItem:
provider
.
selectedTpcAgent
,
...
...
@@ -2150,8 +2231,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
widget
.
mode
,
provider
.
selectedEmployeeID
,
provider
.
selectedAccountID
,
provider
.
selectedDispatchStateID
,
provider
.
selectedDispatchStateID
,
provider
.
selectedDispatchDistrictId
,
provider
...
...
@@ -2496,7 +2576,9 @@ class _AddorderScreenState extends State<AddorderScreen> {
provider
.
selectedAccountName
=
provider
.
accountList
[
index
].
text
!;
print
(
"hfjkshfg
${provider.selectedAccountID}
"
,
"hfjkshfg"
+
provider
.
selectedAccountID
.
toString
(),
);
provider
.
dropDownSearchController
.
text
=
provider
.
accountList
[
index
].
text
!;
...
...
@@ -2637,7 +2719,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
null
,
TextInputAction
.
done
,
),
if
(
provider
.
billingNameError
!=
null
)
if
(
provider
.
billingNameError
!=
null
)
errorWidget
(
context
,
provider
.
billingNameError
),
TextWidget
(
context
,
"Billing State"
),
//dd
...
...
@@ -2752,11 +2834,8 @@ class _AddorderScreenState extends State<AddorderScreen> {
],
),
),
if
(
provider
.
selectedBillingStateError
!=
null
)
errorWidget
(
context
,
provider
.
selectedBillingStateError
,
),
if
(
provider
.
selectedBillingStateError
!=
null
)
errorWidget
(
context
,
provider
.
selectedBillingStateError
),
TextWidget
(
context
,
"Billing District"
),
//dd
DropdownButtonHideUnderline
(
...
...
@@ -2871,7 +2950,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
],
),
),
if
(
provider
.
selectedBillingDistrictError
!=
null
)
if
(
provider
.
selectedBillingDistrictError
!=
null
)
errorWidget
(
context
,
provider
.
selectedBillingDistrictError
,
...
...
@@ -2978,11 +3057,8 @@ class _AddorderScreenState extends State<AddorderScreen> {
],
),
),
if
(
provider
.
selectedBillingSubLocError
!=
null
)
errorWidget
(
context
,
provider
.
selectedBillingSubLocError
,
),
if
(
provider
.
selectedBillingSubLocError
!=
null
)
errorWidget
(
context
,
provider
.
selectedBillingSubLocError
),
textControllerWidget
(
context
,
provider
.
billingAddressController
,
...
...
@@ -2996,7 +3072,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
focusNodes
[
2
],
TextInputAction
.
next
,
),
if
(
provider
.
billingAddressError
!=
null
)
if
(
provider
.
billingAddressError
!=
null
)
errorWidget
(
context
,
provider
.
billingAddressError
),
textControllerWidget
(
...
...
@@ -3013,7 +3089,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
TextInputAction
.
done
,
6
,
),
if
(
provider
.
billingPincodeError
!=
null
)
if
(
provider
.
billingPincodeError
!=
null
)
errorWidget
(
context
,
provider
.
billingPincodeError
),
TextWidget
(
context
,
"Dispatch State"
),
...
...
@@ -3570,11 +3646,10 @@ class _AddorderScreenState extends State<AddorderScreen> {
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
WidgetStateProperty
.
all
<
double
>(
6
,
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
),
thumbVisibility:
Widget
StateProperty
.
all
<
bool
>(
true
),
Material
StateProperty
.
all
<
bool
>(
true
),
),
),
menuItemStyleData:
const
MenuItemStyleData
(
...
...
@@ -3764,7 +3839,9 @@ class _AddorderScreenState extends State<AddorderScreen> {
provider
.
selectedTpcAgentValue
=
provider
.
tpcAgent
[
index
].
text
!;
print
(
"hfjkshfg
${provider.selectedTpcAgentID}
"
,
"hfjkshfg"
+
provider
.
selectedTpcAgentID
.
toString
(),
);
provider
.
dropDownTpcSearchController
...
...
@@ -3935,7 +4012,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromGallery
(
context
);
},
child:
SizedBox
(
child:
Container
(
height:
35
,
child:
Text
(
"Select photo from gallery"
),
),
...
...
@@ -3946,7 +4023,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromCamera
(
context
);
},
child:
SizedBox
(
child:
Container
(
height:
35
,
child:
Text
(
"Capture photo from camera"
),
),
...
...
@@ -3997,7 +4074,7 @@ class OrderForm extends StatelessWidget {
),
);
if
(
res
!=
null
)
{
print
(
"result
$res
"
);
print
(
"result
$
{
res
}
"
);
}
},
child:
Container
(
...
...
@@ -4061,7 +4138,7 @@ class OrderForm extends StatelessWidget {
),
);
if
(
res
!=
null
)
{
print
(
"result
$res
"
);
print
(
"result
$
{
res
}
"
);
}
},
child:
Container
(
...
...
lib/services/api_calling.dart
View file @
642da22c
import
'dart:convert'
;
import
'dart:io'
;
import
'package:flutter/cupertino.dart'
;
import
'package:generp/Models/MissedCheckoutStripResponse.dart'
;
import
'package:generp/Models/ViewVisitDetailsResponseNew.dart'
;
import
'package:generp/Models/commonModels/DistrictsResponse.dart'
;
import
'package:generp/Models/commonModels/SubLocationsResponse.dart'
;
...
...
@@ -25,7 +26,9 @@ import 'package:generp/Models/crmModels/crmProspectDetailsAddLeadsResponse.dart'
import
'package:generp/Models/crmModels/crmProspectDetailsResponse.dart'
;
import
'package:generp/Models/financeModels/addDirectPaymentResponse.dart'
;
import
'package:generp/Models/financeModels/paymentRequisitionPaymentsListResponse.dart'
;
import
'package:generp/Models/hrmModels/advanceListResponse.dart'
;
import
'package:generp/Models/hrmModels/attendanceRequestListResponse.dart'
;
import
'package:generp/Models/hrmModels/casualLeaveHistoryResponse.dart'
;
import
'package:generp/Models/hrmModels/jobDescriptionResponse.dart'
;
import
'package:generp/Models/hrmModels/leaveApplicationDetailsResponse.dart'
;
import
'package:generp/Models/hrmModels/leaveApplicationLIstResponse.dart'
;
...
...
@@ -224,6 +227,27 @@ class ApiCalling {
}
}
static
Future
<
MissedCheckoutStripResponse
?>
missedCheckoutStripApi
(
empId
,
session
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
};
// print(data);
final
res
=
await
post
(
data
,
missedCheckoutUrl
,
{});
if
(
res
!=
null
)
{
print
(
"Api call data:
${res.body}
"
);
return
MissedCheckoutStripResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
return
null
;
}
}
catch
(
e
)
{
debugPrint
(
'hello bev=bug
$e
'
);
return
null
;
}
}
static
Future
<
StatusResponse
?>
LoginFunctionApi
(
email
,
password
,
...
...
@@ -2371,16 +2395,38 @@ class ApiCalling {
empId
,
session
,
mode
,
leadId
,
feedback
,
followupType
,
inTime
,
loc
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
'mode'
:
(
mode
).
toString
(),
'lead_id'
:
(
leadId
).
toString
(),
'feedback'
:
(
feedback
).
toString
(),
'followup_type'
:
(
followupType
).
toString
(),
'in_time'
:
(
inTime
).
toString
(),
'loc'
:
(
loc
).
toString
(),
};
debugPrint
(
"===========================Input to api "
);
debugPrint
(
"Lead Id:
${leadId}
"
);
debugPrint
(
"Follow Type:
${followupType}
"
);
debugPrint
(
"In Time:
${inTime}
"
);
debugPrint
(
"Location:
${loc}
"
);
debugPrint
(
"Mode:
${mode}
"
);
debugPrint
(
"feedback:
${feedback}
"
);
debugPrint
(
"=================End of INput================="
);
final
res
=
await
post
(
data
,
ordersAddOrderViewUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
//
debugPrint(
"Response start ================== ${AddOrderViewResponse.fromJson(jsonDecode(res.body)).accountDetails?.name}"
);
return
AddOrderViewResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -3604,6 +3650,7 @@ class ApiCalling {
'lead_status'
:
leadStatus
.
toString
(),
'products'
:
products
.
toString
(),
};
debugPrint
(
"✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅✅ Product deteails
${products}
"
);
final
res
=
await
post
(
data
,
crmNewProspectLeadSubmitUrl
,
{});
if
(
res
!=
null
)
{
print
(
data
);
...
...
@@ -3738,6 +3785,21 @@ class ApiCalling {
alphabet
,
pageNumber
,
)
async
{
debugPrint
(
'crmLeadListFilterSubmitAPI Input data:'
);
debugPrint
(
'empId:
$empId
'
);
debugPrint
(
'session:
$session
'
);
debugPrint
(
'mode:
$mode
'
);
debugPrint
(
'status:
$status
'
);
debugPrint
(
'openStatus:
$openStatus
'
);
debugPrint
(
'mob:
$mob
'
);
debugPrint
(
'com:
$com
'
);
debugPrint
(
'source:
$source
'
);
debugPrint
(
'reference:
$reference
'
);
debugPrint
(
'team:
$team
'
);
debugPrint
(
'segment:
$segment
'
);
debugPrint
(
'alphabet:
$alphabet
'
);
debugPrint
(
'pageNumber:
$pageNumber
'
);
debugPrint
(
'End of input data'
);
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
...
...
@@ -3936,8 +3998,10 @@ class ApiCalling {
productId
,
qty
,
amount
,
remark
,
)
async
{
try
{
debugPrint
(
"💡💡💡💡💡💡💡💡💡AddEditProducts:
${remark}
"
);
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
...
...
@@ -3947,7 +4011,9 @@ class ApiCalling {
'product_id'
:
(
productId
).
toString
(),
'qty'
:
(
qty
).
toString
(),
'amount'
:
(
amount
).
toString
(),
'remarks'
:
(
remark
).
toString
(),
};
final
res
=
await
post
(
data
,
crmLeadDetailsAddEditProductsUrl
,
{});
if
(
res
!=
null
)
{
print
(
"AddEditProducts
$data
"
);
...
...
@@ -4591,8 +4657,10 @@ class ApiCalling {
quantity
,
amount
,
leadStatus
,
remarks
,
)
async
{
try
{
debugPrint
(
"💡💡💡💡💡💡 remarks
$remarks
"
);
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
...
...
@@ -4601,6 +4669,7 @@ class ApiCalling {
'quantity'
:
quantity
.
toString
(),
'amount'
:
amount
.
toString
(),
'lead_status'
:
leadStatus
.
toString
(),
'remarks'
:
remarks
.
toString
(),
};
final
res
=
await
post
(
data
,
crmProspectDetailsAddLeadUrl
,
{});
if
(
res
!=
null
)
{
...
...
@@ -5445,6 +5514,31 @@ class ApiCalling {
return
null
;
}
}
/// CasualLeaveHistory api
static
Future
<
CasualLeaveHistoryResponse
?>
casualLeaveHistoryAPI
(
session
,
empId
,
)
async
{
debugPrint
(
"🔥🔥🔥🔥🔥🔥🔥Response"
);
try
{
Map
<
String
,
String
>
data
=
{
'session_id'
:
(
session
).
toString
(),
'emp_id'
:
(
empId
).
toString
(),
};
final
res
=
await
post
(
data
,
CasuaLeaveHistoryUrl
,
{});
if
(
res
!=
null
)
{
print
(
data
);
debugPrint
(
res
.
body
);
return
CasualLeaveHistoryResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
return
null
;
}
}
catch
(
e
)
{
debugPrint
(
'hello bev=bug
$e
'
);
return
null
;
}
}
//add leave request
static
Future
<
CommonResponse
?>
leaveRequestAddAPI
(
...
...
@@ -5515,6 +5609,34 @@ class ApiCalling {
}
}
/// AdvanceListApi
static
Future
<
AdvanceListResponse
?>
advanceListAPI
(
session
,
empId
,
pageNumber
)
async
{
debugPrint
(
"🔥🔥🔥🔥🔥🔥🔥Response"
);
try
{
Map
<
String
,
String
>
data
=
{
'session_id'
:
(
session
).
toString
(),
'emp_id'
:
(
empId
).
toString
(),
'page_number'
:
(
pageNumber
).
toString
(),
// FIX: Use pageNumber parameter, not empId
};
final
res
=
await
post
(
data
,
AdvanceListUrl
,
{});
if
(
res
!=
null
)
{
print
(
"Request Data:
$data
"
);
debugPrint
(
"🔥🔥🔥🔥🔥🔥🔥 Response:
${res.body}
"
);
return
AdvanceListResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
return
null
;
}
}
catch
(
e
)
{
debugPrint
(
'API Error:
$e
'
);
return
null
;
}
}
// static Future<CommonResponse?> TpcIssueListApprovalAPI(
// empId,
// session,
...
...
lib/services/api_names.dart
View file @
642da22c
...
...
@@ -19,6 +19,7 @@ const employeeCheckOutUrl = "${baseUrl}home/attendance_check_out";
const
employeeAttendanceDashboardUrl
=
"
${baseUrl}
home/attendance_dashboard"
;
const
employeeMonthwiseAttendanceUrl
=
"
${baseUrl}
home/attendance_monthwise_det"
;
const
employeeDayAttendanceDetailsUrl
=
"
${baseUrl}
home/attendance_day_det"
;
const
missedCheckoutUrl
=
"
${baseUrl_test}
missed_checkout"
;
///gentracker
const
genTrackerGeneratorDetailsUrl
=
"
${baseUrl}
home/gen_tracker_generator_details"
;
...
...
@@ -181,9 +182,9 @@ const crmDashboardQuotationsUrl = "${baseUrl_test}crm_dashboard_quotations_list"
const
ogcharturl
=
"
${baseUrl_test}
organisation_structures"
;
const
JobDesciptionUrl
=
"
${baseUrl_test}
job_description"
;
///HRM
//Attendance
const
HrmAccessiblePagesUrl
=
"
${baseUrl_test}
hrm_accessible_pages"
;
const
AttendanceRequestListUrl
=
"
${baseUrl_test}
attendance_request_list"
;
const
AttendanceRequestDetailsUrl
=
"
${baseUrl_test}
attendance_request_details"
;
...
...
@@ -203,9 +204,9 @@ const LeaveApplicationDetailsUrl ="${baseUrl_test}leave_request_details";
const
LeaveRequestAdditionUrl
=
"
${baseUrl_test}
add_leave_request"
;
const
LeaveRequestRejectAprroveUrl
=
"
${baseUrl_test}
leaves_approve_reject"
;
const
CasuaLeaveHistoryUrl
=
"
${baseUrl_test}
casual_leave_history"
;
const
AdvanceListUrl
=
"
${baseUrl_test}
advance_list"
;
pubspec.lock
View file @
642da22c
...
...
@@ -1464,6 +1464,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.1.0"
photo_view:
dependency: "direct main"
description:
name: photo_view
sha256: "8036802a00bae2a78fc197af8a158e3e2f7b500561ed23b4c458107685e645bb"
url: "https://pub.dev"
source: hosted
version: "0.14.0"
pin_code_fields:
dependency: "direct main"
description:
...
...
pubspec.yaml
View file @
642da22c
...
...
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version
:
1.0.10
4
+11
2
version
:
1.0.10
6
+11
4
environment
:
sdk
:
^3.7.2
...
...
@@ -92,6 +92,8 @@ dependencies:
graphview
:
^1.2.0
file_picker
:
^8.0.0
flutter_html
:
^3.0.0
photo_view
:
^0.14.0
dev_dependencies
:
flutter_test
:
...
...
@@ -191,3 +193,4 @@ flutter:
# For details regarding fonts from package dependencies,
# see https://flutter.dev/to/font-from-package
generate
:
true
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment