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
2c0d16b2
Commit
2c0d16b2
authored
Jun 26, 2025
by
Sai Srinivas
Browse files
23-06-2025 By Sai Srinivas
Prospect details - add/edit, edit order - order module
parent
fd66d000
Changes
24
Show whitespace changes
Inline
Side-by-side
lib/screens/notifierExports.dart
View file @
2c0d16b2
...
...
@@ -39,6 +39,7 @@ export 'package:generp/Notifiers/ordersProvider/tpcAgentsProvider.dart';
export
'package:generp/Notifiers/ordersProvider/addPaymentProvider.dart'
;
export
'package:generp/Notifiers/ordersProvider/addOrderProvider.dart'
;
export
'package:generp/Notifiers/ordersProvider/editPaymentProvider.dart'
;
export
'package:generp/Notifiers/ordersProvider/editOrderProvider.dart'
;
export
'package:generp/Notifiers/crmProvider/crmDashboardProvider.dart'
;
export
'package:generp/Notifiers/crmProvider/LeadListProvider.dart'
;
...
...
@@ -49,4 +50,6 @@ export 'package:generp/Notifiers/crmProvider/ProspectListProvider.dart';
export
'package:generp/Notifiers/crmProvider/crmProspectDetailsProvider.dart'
;
export
'package:generp/Notifiers/crmProvider/crmNearbyOpenLeadsProvider.dart'
;
export
'package:generp/Notifiers/crmProvider/crmGenerateQuotationProvider.dart'
;
export
'package:generp/Notifiers/crmProvider/crmEditProspectAccountProvider.dart'
;
export
'package:generp/Notifiers/crmProvider/addProspectLeadsProvider.dart'
;
lib/screens/order/editOrderAccountDetails.dart
0 → 100644
View file @
2c0d16b2
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Models/commonModels/DistrictsResponse.dart'
;
import
'package:generp/Models/commonModels/SubLocationsResponse.dart'
;
import
'package:generp/Utils/dropdownTheme.dart'
;
import
'package:provider/provider.dart'
;
import
'package:generp/Models/ordersModels/ordersDetailsEditOrderViewResponse.dart'
;
import
'../../Notifiers/ordersProvider/editOrderProvider.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
class
Editorderaccountdetails
extends
StatefulWidget
{
final
pageTitleName
;
final
mode
;
final
orderID
;
const
Editorderaccountdetails
({
super
.
key
,
required
this
.
pageTitleName
,
required
this
.
mode
,
required
this
.
orderID
});
@override
State
<
Editorderaccountdetails
>
createState
()
=>
_EditorderaccountdetailsState
();
}
class
_EditorderaccountdetailsState
extends
State
<
Editorderaccountdetails
>
{
FocusNode
focusNode
=
FocusNode
();
FocusNode
focusNodetpc
=
FocusNode
();
Dropdowntheme
ddtheme
=
Dropdowntheme
();
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
provider
=
Provider
.
of
<
Editorderprovider
>(
context
,
listen:
false
);
provider
.
ordersEditOrderAPIViewFunction
(
context
,
widget
.
orderID
);
});
}
@override
void
dispose
()
{
super
.
dispose
();
}
Future
<
bool
>
_onBackPressed
(
BuildContext
context
)
async
{
Navigator
.
pop
(
context
,
true
);
return
true
;
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Editorderprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
white
,
appBar:
appbar2
(
context
,
"
${widget.pageTitleName}
"
,
provider
.
resetForm
,
SizedBox
(
width:
0
),
),
body:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
TextWidget
(
context
,
"Dispatch State"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
States
>(
isExpanded:
true
,
hint:
Text
(
"Select State"
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
dispatchStates
.
map
(
(
e
)
=>
DropdownMenuItem
<
States
>(
value:
e
,
child:
Text
(
e
.
name
!,
style:
const
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selecetdDispatchStates
,
onChanged:
(
States
?
value
)
{
if
(
provider
.
dispatchStates
.
isNotEmpty
)
{
provider
.
selecetdDispatchStates
=
value
;
provider
.
selectedDispatchStateID
=
value
!.
id
!;
provider
.
selectedDispatchStateName
=
value
!.
name
!;
if
(
provider
.
dispatchDistricts
.
isNotEmpty
)
{
provider
.
dispatchDistricts
.
clear
();
provider
.
selectedDispatchDistricts
=
null
;
provider
.
selectedDispatchDistrictId
=
null
;
provider
.
selectedDispatchDistrictValue
=
""
;
}
provider
.
getDispatchDistrictAPI
(
context
,
provider
.
selectedDispatchStateID
,
);
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
//dd
TextWidget
(
context
,
"Dispatch District"
),
//dd
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
Districts
>(
isExpanded:
true
,
hint:
Text
(
"Select District"
,
style:
const
TextStyle
(
fontSize:
14
),
),
items:
provider
.
dispatchDistricts
.
map
(
(
e
)
=>
DropdownMenuItem
<
Districts
>(
value:
e
,
child:
Text
(
e
.
district
!,
style:
const
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedDispatchDistricts
,
onChanged:
(
Districts
?
value
)
{
if
(
provider
.
dispatchDistricts
.
isNotEmpty
)
{
provider
.
selectedDispatchDistricts
=
value
;
provider
.
selectedDispatchDistrictId
=
value
!.
id
!;
provider
.
selectedDispatchDistrictValue
=
value
!.
district
!;
if
(
provider
.
dispatchSubLocations
.
isNotEmpty
)
{
provider
.
dispatchSubLocations
.
clear
();
provider
.
selectedDispatchSubLocations
=
null
;
provider
.
selectedDispatchSubLocID
=
null
;
provider
.
selectedDispatchSubLocValue
=
""
;
}
provider
.
getDispatchSubLocationAPI
(
context
,
provider
.
selectedDispatchDistrictId
,
);
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
TextWidget
(
context
,
"Dispatch Sub Location"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
SubLocations
>(
hint:
Text
(
"Select Sub Locality"
,
style:
const
TextStyle
(
fontSize:
14
),
),
items:
provider
.
dispatchSubLocations
.
map
(
(
e
)
=>
DropdownMenuItem
<
SubLocations
>(
value:
e
,
child:
Text
(
e
.
subLocality
!,
style:
const
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedDispatchSubLocations
,
onChanged:
(
SubLocations
?
value
)
{
if
(
provider
.
dispatchSubLocations
.
isNotEmpty
)
{
provider
.
selectedDispatchSubLocations
=
value
;
provider
.
selectedDispatchSubLocID
=
value
!.
id
!;
provider
.
selectedDispatchSubLocValue
=
value
!.
subLocality
!;
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
//dd
textControllerWidget
(
context
,
provider
.
dispatchAddressController
,
"Dispatch Address"
,
provider
.
onChangedDispatchAddress
,
TextInputType
.
text
,
false
,
null
,
),
errorWidget
(
context
,
provider
.
dispatchAddressError
),
textControllerWidget
(
context
,
provider
.
dispatchPincodeController
,
"Dispatch Pin code"
,
provider
.
onChangedDispatchPincode
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
),
errorWidget
(
context
,
provider
.
dispatchPincodeError
),
textControllerWidget
(
context
,
provider
.
noteController
,
"Enter Note"
,
provider
.
onChangedNote
,
TextInputType
.
text
,
false
,
null
,
),
errorWidget
(
context
,
provider
.
noteError
),
InkResponse
(
onTap:
()
{
_showAttachmentSheet
(
context
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
),
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
),
),
child:
Center
(
child:
Text
(
"Upload Purchase Order"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
),
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
),
),
InkResponse
(
onTap:
()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
],
),
),
],
TextWidget
(
context
,
"Unloading Scope"
),
//dd
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
String
>(
hint:
Text
(
"Select Unloading Scope"
,
style:
const
TextStyle
(
fontSize:
14
),
),
items:
provider
.
unloadingScope
.
map
(
(
e
)
=>
DropdownMenuItem
<
String
>(
value:
e
!,
child:
Text
(
e
,
style:
const
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedUnloadingScope
,
onChanged:
(
String
?
value
)
{
if
(
provider
.
unloadingScope
.
isNotEmpty
)
{
provider
.
selectedUnloadingScope
=
value
;
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
TextWidget
(
context
,
"Freight Scope"
),
//dd
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
String
>(
hint:
Text
(
"Select Freight Scope"
,
style:
const
TextStyle
(
fontSize:
14
),
),
items:
provider
.
freightScope
.
map
(
(
e
)
=>
DropdownMenuItem
<
String
>(
value:
e
!,
child:
Text
(
e
,
style:
const
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedFreightScope
,
onChanged:
(
String
?
value
)
{
if
(
provider
.
freightScope
.
isNotEmpty
)
{
provider
.
selectedFreightScope
=
value
;
}
},
buttonStyleData:
ButtonStyleData
(
height:
50
,
width:
160
,
padding:
const
EdgeInsets
.
only
(
left:
14
,
right:
14
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
),
iconStyleData:
IconStyleData
(
icon:
SvgPicture
.
asset
(
"assets/svg/arrow_dropdown.svg"
,
height:
25
,
width:
20
,
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
,
),
thumbVisibility:
MaterialStateProperty
.
all
<
bool
>(
true
),
),
),
menuItemStyleData:
const
MenuItemStyleData
(
height:
40
,
padding:
EdgeInsets
.
only
(
left:
14
,
right:
14
),
),
),
),
],
),
),
TextWidget
(
context
,
"Erection Scope"
),
//dd
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
String
>(
hint:
Text
(
"Select Erection Scope"
,
style:
const
TextStyle
(
fontSize:
14
),
),
items:
provider
.
erectionScope
.
map
(
(
e
)
=>
DropdownMenuItem
<
String
>(
value:
e
!,
child:
Text
(
e
,
style:
const
TextStyle
(
fontSize:
14
,
),
),
),
)
.
toList
(),
value:
provider
.
selectedErectionScope
,
onChanged:
(
String
?
value
)
{
if
(
provider
.
erectionScope
.
isNotEmpty
)
{
provider
.
selectedErectionScope
=
value
;
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
],
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
bottomNavigationBar:
InkResponse
(
onTap:
provider
.
submitClicked
?
null
:
()
{
provider
.
submitClicked
=
true
;
provider
.
ordersEditOrderAPISubmitFunction
(
context
,
widget
.
orderID
,
provider
.
selectedDispatchStateID
,
provider
.
selectedDispatchDistrictId
,
provider
.
selectedDispatchSubLocID
,
provider
.
selectedUnloadingScope
,
provider
.
selectedFreightScope
,
provider
.
selectedErectionScope
);
},
child:
Container
(
height:
45
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
provider
.
submitClicked
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
AppColors
.
app_blue
,
),
)
:
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
color:
Colors
.
white
,
),
),
),
),
),
onWillPop:
()
async
{
provider
.
resetForm
();
return
_onBackPressed
(
context
);
},
);
},
);
}
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
backgroundColor:
Colors
.
white
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
Editorderprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
,
).
viewInsets
.
bottom
,
// This handles keyboard
),
child:
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
"Select Source"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontFamily:
"JakrtaMedium"
,
fontSize:
16
,
),
),
),
SizedBox
(
height:
15
),
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromGallery
(
context
);
},
child:
Container
(
height:
35
,
child:
Text
(
"Select photo from gallery"
),
),
),
SizedBox
(
height:
10
),
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromCamera
(
context
);
},
child:
Container
(
height:
35
,
child:
Text
(
"Capture photo from camera"
),
),
),
],
),
),
),
);
},
),
);
},
);
},
);
}
}
lib/screens/order/ordersDetailsByModes.dart
View file @
2c0d16b2
...
...
@@ -14,15 +14,18 @@ class Ordersdetailsbymodes extends StatefulWidget {
final
orderId
;
final
mode
;
const
Ordersdetailsbymodes
(
{
super
.
key
,
required
this
.
pageTitleName
,
required
this
.
orderId
,
required
this
.
mode
});
const
Ordersdetailsbymodes
({
super
.
key
,
required
this
.
pageTitleName
,
required
this
.
orderId
,
required
this
.
mode
,
});
@override
State
<
Ordersdetailsbymodes
>
createState
()
=>
_OrdersdetailsbymodesState
();
}
class
_OrdersdetailsbymodesState
extends
State
<
Ordersdetailsbymodes
>
{
@override
void
initState
()
{
// TODO: implement initState
...
...
@@ -33,11 +36,13 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
listen:
false
,
);
provider
.
ordersDetailsByModeAPIFunction
(
context
,
widget
.
orderId
,
widget
.
mode
);
context
,
widget
.
orderId
,
widget
.
mode
,
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Pagesdashboardprovider
>(
...
...
@@ -47,15 +52,17 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
return
WillPopScope
(
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
widget
.
pageTitleName
,
provider
.
resetAll
,
appBar:
appbar2
(
context
,
widget
.
pageTitleName
,
provider
.
resetAll
,
InkResponse
(
onTap:
()
{
_showOptionsSheet
(
context
);
_showOptionsSheet
(
context
);
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_more.svg"
,
height:
30
,),
),),
child:
SvgPicture
.
asset
(
"assets/svg/ic_more.svg"
,
height:
30
),
),
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
...
...
@@ -162,8 +169,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Fileviewer
(
(
context
)
=>
Fileviewer
(
fileName:
orderDetails
.
tpcPaymentAttachementViewFileName
!,
...
...
@@ -182,15 +188,18 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
style:
TextStyle
(
fontSize:
14
,
color:
provider
.
Headings
[
j
]
==
"Purchase Order"
provider
.
Headings
[
j
]
==
"Purchase Order"
?
AppColors
.
app_blue
:
Color
(
0xFF818181
),
decoration:
provider
.
Headings
[
j
]
==
"Purchase Order"
provider
.
Headings
[
j
]
==
"Purchase Order"
?
TextDecoration
.
underline
:
TextDecoration
.
none
,
decorationColor:
provider
.
Headings
[
j
]
==
"Purchase Order"
provider
.
Headings
[
j
]
==
"Purchase Order"
?
AppColors
.
app_blue
:
AppColors
.
white
,
),
...
...
@@ -207,9 +216,9 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
),
bottomNavigationBar:
[
"self"
,
"pending_approval"
].
contains
(
widget
.
mode
)
?
Container
(
height:
0
)
:
Container
(
[
"self"
,
"pending_approval"
].
contains
(
widget
.
mode
)
?
Container
(
height:
0
)
:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
alignment:
Alignment
.
bottomCenter
,
height:
60
,
...
...
@@ -220,15 +229,18 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
if
([
if
([
"level_one_approval"
,
"level_two_approval"
,
"level_two_rejected"
].
contains
(
widget
.
mode
))...[
"level_two_rejected"
,
].
contains
(
widget
.
mode
))
...[
Expanded
(
child:
InkResponse
(
onTap:
()
{
_showLevelApprovalRejectionSheet
(
context
,
"Reject"
);
_showLevelApprovalRejectionSheet
(
context
,
"Reject"
,
);
},
child:
Container
(
decoration:
BoxDecoration
(
...
...
@@ -252,12 +264,12 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
],
SizedBox
(
width:
10
),
if
([
if
([
"level_one_approval"
,
"level_two_approval"
,
"level_two_rejected"
,
"sales_order_registered"
].
contains
(
widget
.
mode
))...[
"sales_order_registered"
,
].
contains
(
widget
.
mode
))
...[
Expanded
(
child:
InkResponse
(
onTap:
()
{
...
...
@@ -267,7 +279,9 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
// provider.requestsDetails.id,
// );
_showLevelApprovalRejectionSheet
(
context
,
"Approve"
);
context
,
"Approve"
,
);
},
child:
Container
(
decoration:
BoxDecoration
(
...
...
@@ -291,7 +305,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
],
if
([
"admin"
].
contains
(
widget
.
mode
))...[
if
([
"admin"
].
contains
(
widget
.
mode
))
...[
Expanded
(
child:
InkResponse
(
onTap:
()
{
...
...
@@ -318,14 +332,11 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
),
],
if
(
widget
.
mode
==
"dispatched"
)...[
]
if
(
widget
.
mode
==
"dispatched"
)
...[],
],
),
),
),
),
onWillPop:
()
{
...
...
@@ -336,8 +347,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
);
}
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
,)
{
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
...
...
@@ -359,7 +369,9 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
...
...
@@ -371,8 +383,10 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
"order_list_svg_1"
,
"order_list_svg_2"
,
"order_list_svg_3"
,
"order_list_svg_3"
,
];
final
Headingnames
=
[
"Edit Order"
,
"Payment History"
,
"Products Details"
,
"Feedback History"
,
...
...
@@ -381,39 +395,46 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
onTap:
()
async
{
switch
(
index
)
{
case
0
:
Navigator
.
pop
(
context
);
// Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) =>
// Orderdetailspaymenthistory(),
// ),
// );
break
;
case
1
:
Navigator
.
pop
(
context
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Orderdetailspaymenthistory
(
),
Orderdetailspaymenthistory
(),
),
);
break
;
case
1
:
case
2
:
Navigator
.
pop
(
context
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Orderdetailsproductshistory
(
),
Orderdetailsproductshistory
(),
),
);
break
;
case
2
:
case
3
:
Navigator
.
pop
(
context
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Orderdetailsfeedbackhistory
(
),
Orderdetailsfeedbackhistory
(),
),
);
break
;
...
...
@@ -422,9 +443,10 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
leading:
SvgPicture
.
asset
(
"assets/svg/
${assetnames[index]}
.svg"
,
),
title:
Text
(
Headingnames
[
index
],
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),),
title:
Text
(
Headingnames
[
index
],
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),
),
trailing:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
...
...
@@ -457,7 +479,6 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
Pagesdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
details
=
provider
.
orderDetails
;
return
Container
(
...
...
@@ -467,7 +488,9 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -476,19 +499,21 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
Align
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
type
==
"Approve"
?
"
${provider
.approvalSheetHeading}
"
:
"
${provider
.rejecetionSheetHeading}
"
,
type
==
"Approve"
?
"
${provider
.approvalSheetHeading}
"
:
"
${provider
.rejecetionSheetHeading}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
if
(
widget
.
mode
==
"sales_order_registered"
)...[
if
(
widget
.
mode
==
"sales_order_registered"
)
...[
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
,
top:
8.0
),
bottom:
5.0
,
top:
8.0
,
),
child:
Text
(
"Company Name"
),
),
Container
(
...
...
@@ -500,16 +525,21 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
10.0
,
0.0
,
10
,
0
,
),
child:
TextFormField
(
controller:
provider
.
editCompanyController
,
controller:
provider
.
editCompanyController
,
readOnly:
true
,
keyboardType:
TextInputType
.
text
,
maxLines:
1
,
onChanged:
provider
.
onChangeEditCompanyName
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontSize:
14
),
color:
Color
(
0xFF818181
),
fontSize:
14
,
),
decoration:
InputDecoration
(
hintText:
"Enter Company Name"
,
hintStyle:
TextStyle
(
...
...
@@ -524,19 +554,24 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
),
),
if
(
provider
.
companyNameError
!=
null
)...[
if
(
provider
.
companyNameError
!=
null
)
...[
Container
(
alignment:
Alignment
.
topLeft
,
margin:
EdgeInsets
.
only
(
top:
2.5
,
left:
25
),
child:
Text
(
"
${provider.companyNameError}
"
,
style:
TextStyle
(
color:
Colors
.
red
,
fontSize:
10
),
style:
TextStyle
(
color:
Colors
.
red
,
fontSize:
10
,
),
),
),
],
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
,
top:
8.0
),
bottom:
5.0
,
top:
8.0
,
),
child:
Text
(
"Sale Order Number"
),
),
Container
(
...
...
@@ -548,16 +583,22 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
10.0
,
0.0
,
10
,
0
,
),
child:
TextFormField
(
controller:
provider
.
saleOrderNumberController
,
controller:
provider
.
saleOrderNumberController
,
readOnly:
true
,
keyboardType:
TextInputType
.
text
,
maxLines:
1
,
onChanged:
provider
.
onChangeSaleOrderNumber
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontSize:
14
),
color:
Color
(
0xFF818181
),
fontSize:
14
,
),
decoration:
InputDecoration
(
hintText:
"Enter Order Number"
,
hintStyle:
TextStyle
(
...
...
@@ -572,22 +613,26 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
),
),
if
(
provider
.
saleOrderNumberError
!=
null
)...[
if
(
provider
.
saleOrderNumberError
!=
null
)
...[
Container
(
alignment:
Alignment
.
topLeft
,
margin:
EdgeInsets
.
only
(
top:
2.5
,
left:
25
),
child:
Text
(
"
${provider.saleOrderNumberError}
"
,
style:
TextStyle
(
color:
Colors
.
red
,
fontSize:
10
),
style:
TextStyle
(
color:
Colors
.
red
,
fontSize:
10
,
),
),
),
]
],
],
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
,
top:
8.0
),
bottom:
5.0
,
top:
8.0
,
),
child:
Text
(
"Remarks"
),
),
Container
(
...
...
@@ -599,16 +644,22 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
10.0
,
0.0
,
10
,
0
,
),
child:
TextFormField
(
controller:
provider
.
approveRejectFeedbackController
,
controller:
provider
.
approveRejectFeedbackController
,
readOnly:
true
,
keyboardType:
TextInputType
.
text
,
maxLines:
60
,
onChanged:
provider
.
onChangeApproveRejection
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontSize:
14
),
color:
Color
(
0xFF818181
),
fontSize:
14
,
),
decoration:
InputDecoration
(
hintText:
"Write Remarks"
,
hintStyle:
TextStyle
(
...
...
@@ -623,32 +674,47 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
),
),
if
(
provider
.
approveRejectFeedbackError
!=
null
)...[
if
(
provider
.
approveRejectFeedbackError
!=
null
)
...[
Container
(
alignment:
Alignment
.
topLeft
,
margin:
EdgeInsets
.
only
(
top:
2.5
,
left:
25
),
child:
Text
(
"
${provider.approveRejectFeedbackError}
"
,
style:
TextStyle
(
color:
Colors
.
red
,
fontSize:
10
),
style:
TextStyle
(
color:
Colors
.
red
,
fontSize:
10
,
),
),
),
],
InkWell
(
onTap:
()
{
provider
.
approvalRejectionAPIFunction
(
context
,
details
.
status
,
details
.
id
,
type
==
"Approve"
?
"Approved"
:
"Rejected"
,
type
==
"Approve"
?
"Approved"
:
"Rejected"
,
details
.
tpcApplicable
,
details
.
tpcApplicable
==
"Yes"
?(
widget
.
mode
==
"level_one_approval"
?
details
.
level1TpcApprovedAmount
:
details
.
level2TpcApprovedAmount
):
""
,
widget
.
mode
==
"dispatched"
?
details
.
invoiceNumber
:
""
,
widget
.
mode
==
"dispatched"
?
details
.
vehicleNumber
:
""
,
widget
.
mode
==
"dispatched"
?
details
.
driverName
:
""
,
widget
.
mode
==
"dispatched"
?
details
.
driverMobileNumber
:
""
,
widget
.
mode
==
"dispatched"
?[]:[],
widget
.
mode
);
details
.
tpcApplicable
==
"Yes"
?
(
widget
.
mode
==
"level_one_approval"
?
details
.
level1TpcApprovedAmount
:
details
.
level2TpcApprovedAmount
)
:
""
,
widget
.
mode
==
"dispatched"
?
details
.
invoiceNumber
:
""
,
widget
.
mode
==
"dispatched"
?
details
.
vehicleNumber
:
""
,
widget
.
mode
==
"dispatched"
?
details
.
driverName
:
""
,
widget
.
mode
==
"dispatched"
?
details
.
driverMobileNumber
:
""
,
widget
.
mode
==
"dispatched"
?
[]
:
[],
widget
.
mode
,
);
},
child:
Container
(
...
...
@@ -708,7 +774,9 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -725,10 +793,11 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
),
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
5.0
,
top:
8.0
),
bottom:
5.0
,
top:
8.0
,
),
child:
Text
(
"Remarks"
),
),
Container
(
...
...
@@ -740,16 +809,21 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
10.0
,
0.0
,
10
,
0
,
),
child:
TextFormField
(
controller:
provider
.
deleteFeedbackController
,
readOnly:
true
,
keyboardType:
TextInputType
.
text
,
maxLines:
60
,
onChanged:
provider
.
onChangeDeletion
,
onChanged:
provider
.
onChangeDeletion
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontSize:
14
),
color:
Color
(
0xFF818181
),
fontSize:
14
,
),
decoration:
InputDecoration
(
hintText:
"Write Remarks"
,
hintStyle:
TextStyle
(
...
...
@@ -764,20 +838,25 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
),
),
),
if
(
provider
.
deleteFeedbackError
!=
null
)...[
if
(
provider
.
deleteFeedbackError
!=
null
)
...[
Container
(
alignment:
Alignment
.
topLeft
,
margin:
EdgeInsets
.
only
(
top:
2.5
,
left:
25
),
child:
Text
(
"
${provider.deleteFeedbackError}
"
,
style:
TextStyle
(
color:
Colors
.
red
,
fontSize:
10
),
style:
TextStyle
(
color:
Colors
.
red
,
fontSize:
10
,
),
),
),
],
InkWell
(
onTap:
()
{
provider
.
delectionAPIFunction
(
context
,
provider
.
orderDetails
.
id
);
context
,
provider
.
orderDetails
.
id
,
);
},
child:
Container
(
alignment:
Alignment
.
center
,
...
...
lib/services/api_calling.dart
View file @
2c0d16b2
...
...
@@ -90,6 +90,7 @@ import '../Models/ordersModels/addOrderTpcAgentListResponse.dart';
import
'../Models/ordersModels/commonResponse.dart'
;
import
'../Models/ordersModels/ordersAccessiblePagesResponse.dart'
;
import
'../Models/ordersModels/ordersDetailsByModeResponse.dart'
;
import
'../Models/ordersModels/ordersDetailsEditOrderViewResponse.dart'
;
import
'../Models/ordersModels/ordersListByModeFilterResponse.dart'
;
import
'../Models/ordersModels/ordersListByModeResponse.dart'
;
import
'../Models/ordersModels/paymentDetailsByModeFilterResponse.dart'
;
...
...
@@ -2404,6 +2405,86 @@ class ApiCalling {
}
}
static
Future
<
ordersDetailsEditOrderViewResponse
?>
ordersDetailsEditOrderViewAPI
(
empId
,
session
,
order_id
,
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'emp_id'
:
(
empId
).
toString
(),
'session_id'
:
(
session
).
toString
(),
'order_id'
:
order_id
.
toString
(),
};
var
res
=
await
post
(
data
,
ordersOrderDetailsEditOrderUrl
,
{});
if
(
res
!=
null
){
return
ordersDetailsEditOrderViewResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
}
}
catch
(
e
)
{
debugPrint
(
'hello bev=bug
$e
'
);
return
null
;
}
}
static
Future
<
CommonResponse
?>
ordersDetailsEditOrderSubmitAPI
(
empId
,
session
,
order_id
,
attachment_file
,
dispatch_state_id
,
district
,
sub_locality
,
dispatch_pincode
,
dispatch_address
,
unloading
,
freight
,
erection
,
note
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
'empId,'
:
empId
.
toString
(),
'session,'
:
session
.
toString
(),
'order_id,'
:
order_id
.
toString
(),
'dispatch_state_id,'
:
dispatch_state_id
.
toString
(),
'district,'
:
district
.
toString
(),
'sub_locality,'
:
sub_locality
.
toString
(),
'dispatch_pincode,'
:
dispatch_pincode
.
toString
(),
'dispatch_address,'
:
dispatch_address
.
toString
(),
'unloading,'
:
unloading
.
toString
(),
'freight,'
:
freight
.
toString
(),
'erection,'
:
erection
.
toString
(),
'note'
:
note
.
toString
(),
};
var
res
;
if
(
attachment_file
!=
null
)
{
res
=
await
postImageNew
(
data
,
{},
ordersOrderDetailsEditOrderSubmitUrl
,
attachment_file
,
"attachment_file"
,
);
res
=
jsonDecode
(
res
);
}
else
{
res
=
await
post
(
data
,
ordersOrderDetailsEditOrderSubmitUrl
,
{});
res
=
jsonDecode
(
res
.
body
);
}
return
CommonResponse
.
fromJson
(
res
);
}
catch
(
e
)
{
debugPrint
(
'hello bev=bug
$e
'
);
return
null
;
}
}
static
Future
<
CommonResponse
?>
ordersDetailsApproveRejectAPI
(
empId
,
session
,
...
...
@@ -3680,7 +3761,7 @@ class ApiCalling {
final
res
=
await
post
(
data
,
crmProspectDetailsEditAccountViewUrl
,
{});
if
(
res
!=
null
)
{
print
(
"Filter:
${data}
"
);
debugPrint
(
res
.
body
);
print
(
"Stetets:
${jsonDecode(res.body)['states']}
"
);
return
crmProspectDetailsEditAccountViewResponse
.
fromJson
(
jsonDecode
(
res
.
body
),
);
...
...
Prev
1
2
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