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
c92f4c79
Commit
c92f4c79
authored
Jul 10, 2025
by
Sai Srinivas
Browse files
ios changes in Navigation swipe gestures.
parent
ee178d55
Changes
35
Show whitespace changes
Inline
Side-by-side
lib/screens/crm/prospectOrderDetails.dart
View file @
c92f4c79
import
'dart:io'
;
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/screens/order/ordersDetailsByModes.dart'
;
import
'package:generp/screens/order/ordersDetailsByModes.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
...
@@ -10,17 +12,24 @@ import '../../Utils/commonWidgets.dart';
...
@@ -10,17 +12,24 @@ import '../../Utils/commonWidgets.dart';
class
ProspectOrderDetails
extends
StatefulWidget
{
class
ProspectOrderDetails
extends
StatefulWidget
{
final
leadID
;
final
leadID
;
const
ProspectOrderDetails
({
super
.
key
,
required
this
.
leadID
});
const
ProspectOrderDetails
({
super
.
key
,
required
this
.
leadID
});
@override
@override
State
<
ProspectOrderDetails
>
createState
()
=>
_ProspectOrderDetailsState
();
State
<
ProspectOrderDetails
>
createState
()
=>
_ProspectOrderDetailsState
();
}
}
class
_ProspectOrderDetailsState
extends
State
<
ProspectOrderDetails
>
{
class
_ProspectOrderDetailsState
extends
State
<
ProspectOrderDetails
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
@override
void
initState
()
{
void
initState
()
{
// TODO: implement initState
// TODO: implement initState
super
.
initState
();
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
crmProspectDetailsProvider
>(
final
provider
=
Provider
.
of
<
crmProspectDetailsProvider
>(
context
,
context
,
...
@@ -29,26 +38,56 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
...
@@ -29,26 +38,56 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
});
});
}
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
crmProspectDetailsProvider
>(
switch
(
_source
.
keys
.
toList
()[
0
])
{
builder:
(
context
,
provider
,
child
)
{
case
ConnectivityResult
.
mobile
:
var
customerDetails
=
provider
.
ordersList
;
connection
=
'Online'
;
return
WillPopScope
(
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
child:
SafeArea
(
top:
false
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
true
,
child:
Scaffold
(
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
crmProspectDetailsProvider
>(
builder:
(
context
,
provider
,
child
)
{
var
customerDetails
=
provider
.
ordersList
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Order Details"
),
appBar:
appbar
(
context
,
"Order Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
SizedBox
(
body:
customerDetails
.
isNotEmpty
?
SizedBox
(
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
TextWidget
(
context
,
"Order Details"
),
//
TextWidget(context, "Order Details"),
ListView
.
builder
(
ListView
.
builder
(
itemCount:
customerDetails
.
length
,
itemCount:
customerDetails
.
length
,
shrinkWrap:
true
,
shrinkWrap:
true
,
...
@@ -77,7 +116,8 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
...
@@ -77,7 +116,8 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
];
];
final
textSubheads
=
[
final
textSubheads
=
[
customerDetails
[
index
].
id
??
"-"
,
customerDetails
[
index
].
id
??
"-"
,
customerDetails
[
index
].
createdDatetime
??
"-"
,
customerDetails
[
index
].
createdDatetime
??
"-"
,
customerDetails
[
index
].
status
??
"-"
,
customerDetails
[
index
].
status
??
"-"
,
"View"
,
"View"
,
];
];
...
@@ -107,8 +147,9 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
...
@@ -107,8 +147,9 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
context
)
=>
(
Ordersdetailsbymodes
(
context
,
)
=>
Ordersdetailsbymodes
(
mode:
""
,
mode:
""
,
pageTitleName:
pageTitleName:
"Order Details"
,
"Order Details"
,
...
@@ -130,13 +171,15 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
...
@@ -130,13 +171,15 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
?
"-"
?
"-"
:
textSubheads
[
j
],
:
textSubheads
[
j
],
maxLines:
2
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
style:
TextStyle
(
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
decorationColor:
decorationColor:
AppColors
.
app_blue
,
AppColors
.
app_blue
,
decoration:
decoration:
TextDecoration
.
underline
,
TextDecoration
.
underline
,
),
),
),
),
),
),
...
@@ -169,10 +212,8 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
...
@@ -169,10 +212,8 @@ class _ProspectOrderDetailsState extends State<ProspectOrderDetails> {
],
],
),
),
),
),
),
)
:
Emptywidget
(
context
),
),
),
);
);
},
},
);
);
...
...
lib/screens/crm/prospectPaymentDetails.dart
View file @
c92f4c79
import
'dart:io'
;
import
'dart:io'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/screens/order/paymentDetailsByMode.dart'
;
import
'package:generp/screens/order/paymentDetailsByMode.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
...
@@ -18,10 +20,17 @@ class ProspectPaymentDetails extends StatefulWidget {
...
@@ -18,10 +20,17 @@ class ProspectPaymentDetails extends StatefulWidget {
}
}
class
_ProspectPaymentDetailsState
extends
State
<
ProspectPaymentDetails
>
{
class
_ProspectPaymentDetailsState
extends
State
<
ProspectPaymentDetails
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
@override
void
initState
()
{
void
initState
()
{
// TODO: implement initState
// TODO: implement initState
super
.
initState
();
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
final
provider
=
Provider
.
of
<
crmProspectDetailsProvider
>(
final
provider
=
Provider
.
of
<
crmProspectDetailsProvider
>(
context
,
context
,
...
@@ -30,27 +39,56 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
...
@@ -30,27 +39,56 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
});
});
}
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
_connectivity
.
disposeStream
();
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
crmProspectDetailsProvider
>(
switch
(
_source
.
keys
.
toList
()[
0
])
{
builder:
(
context
,
provider
,
child
)
{
case
ConnectivityResult
.
mobile
:
var
customerDetails
=
provider
.
paymentsList
;
connection
=
'Online'
;
return
WillPopScope
(
break
;
case
ConnectivityResult
.
wifi
:
connection
=
'Online'
;
break
;
case
ConnectivityResult
.
none
:
default
:
connection
=
'Offline'
;
}
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
child:
SafeArea
(
top:
false
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
child:
Scaffold
(
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
crmProspectDetailsProvider
>(
builder:
(
context
,
provider
,
child
)
{
var
customerDetails
=
provider
.
paymentsList
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
"Payment Details"
),
appBar:
appbar
(
context
,
"Payment Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
SizedBox
(
body:
customerDetails
.
isNotEmpty
?
SizedBox
(
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
children:
[
TextWidget
(
context
,
"Payment Details"
),
//
TextWidget(context, "Payment Details"),
ListView
.
builder
(
ListView
.
builder
(
itemCount:
customerDetails
.
length
,
itemCount:
customerDetails
.
length
,
shrinkWrap:
true
,
shrinkWrap:
true
,
...
@@ -77,13 +115,14 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
...
@@ -77,13 +115,14 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
"Amount"
,
"Amount"
,
"Entered By Employee"
,
"Entered By Employee"
,
"Payment Received Date"
,
"Payment Received Date"
,
"Action"
"Action"
,
];
];
final
textSubheads
=
[
final
textSubheads
=
[
customerDetails
[
index
].
paymentType
??
"-"
,
customerDetails
[
index
].
paymentType
??
"-"
,
customerDetails
[
index
].
refNo
??
"-"
,
customerDetails
[
index
].
refNo
??
"-"
,
customerDetails
[
index
].
amount
??
"-"
,
customerDetails
[
index
].
amount
??
"-"
,
customerDetails
[
index
].
employeeName
??
"-"
,
customerDetails
[
index
].
employeeName
??
"-"
,
customerDetails
[
index
].
paymentDate
??
"-"
,
customerDetails
[
index
].
paymentDate
??
"-"
,
"View Details"
,
"View Details"
,
];
];
...
@@ -104,7 +143,8 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
...
@@ -104,7 +143,8 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
),
),
if
(
textSubheads
[
j
]
==
"View Details"
)
...[
if
(
textSubheads
[
j
]
==
"View Details"
)
...[
Expanded
(
Expanded
(
flex:
3
,
flex:
3
,
child:
InkResponse
(
child:
InkResponse
(
...
@@ -113,8 +153,9 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
...
@@ -113,8 +153,9 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
context
)
=>
(
Paymentdetailsbymode
(
context
,
)
=>
Paymentdetailsbymode
(
mode:
""
,
mode:
""
,
pageTitleName:
pageTitleName:
"Payment Details"
,
"Payment Details"
,
...
@@ -137,19 +178,20 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
...
@@ -137,19 +178,20 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
?
"-"
?
"-"
:
textSubheads
[
j
],
:
textSubheads
[
j
],
maxLines:
2
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
style:
TextStyle
(
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
decorationColor:
decorationColor:
AppColors
.
app_blue
,
AppColors
.
app_blue
,
decoration:
decoration:
TextDecoration
.
underline
,
TextDecoration
.
underline
,
),
),
),
),
),
),
),
),
]
else
]
else
...[
...[
Expanded
(
Expanded
(
flex:
3
,
flex:
3
,
child:
Text
(
child:
Text
(
...
@@ -177,9 +219,8 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
...
@@ -177,9 +219,8 @@ class _ProspectPaymentDetailsState extends State<ProspectPaymentDetails> {
],
],
),
),
),
),
),
)
),
:
Emptywidget
(
context
),
),
);
);
},
},
);
);
...
...
lib/screens/finance/AllPaymentRequesitionListsByModes.dart
View file @
c92f4c79
...
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
...
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import
'package:flutter/services.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/financeProvider/RequestionListProvider.dart'
;
import
'package:generp/Notifiers/financeProvider/RequestionListProvider.dart'
;
import
'package:generp/Utils/GlobalConstants.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/finance/FileViewer.dart'
;
import
'package:generp/screens/finance/FileViewer.dart'
;
...
@@ -32,7 +33,6 @@ class Allpaymentrequesitionlistsbymodes extends StatefulWidget {
...
@@ -32,7 +33,6 @@ class Allpaymentrequesitionlistsbymodes extends StatefulWidget {
class
_AllpaymentrequesitionlistsbymodesState
class
_AllpaymentrequesitionlistsbymodesState
extends
State
<
Allpaymentrequesitionlistsbymodes
>
{
extends
State
<
Allpaymentrequesitionlistsbymodes
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
...
@@ -58,7 +58,7 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -58,7 +58,7 @@ class _AllpaymentrequesitionlistsbymodesState
);
);
final
dateRange
=
cf
.
getFormattedDateRange
(
range
);
final
dateRange
=
cf
.
getFormattedDateRange
(
range
);
// print(dateRange);
// print(dateRange);
provider
.
paymentRequestionListsAPIFunction
(
context
,
widget
.
mode
,
""
,
""
);
provider
.
paymentRequestionListsAPIFunction
(
context
,
widget
.
mode
,
""
,
""
);
});
});
}
}
...
@@ -82,17 +82,27 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -82,17 +82,27 @@ class _AllpaymentrequesitionlistsbymodesState
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
connection
==
"Online"
?
Consumer
<
Requestionlistprovider
>(
return
connection
==
"Online"
builder:
(
context
,
provider
,
child
)
{
?
Platform
.
isAndroid
final
requestLists
=
provider
.
requisitionList
;
?
WillPopScope
(
return
WillPopScope
(
onWillPop:
()
{
onWillPop:
()
{
return
onBackPressed
(
context
);
return
onBackPressed
(
context
);
},
},
child:
SafeArea
(
child:
SafeArea
(
top:
false
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
true
,
child:
Scaffold
(
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Requestionlistprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
requestLists
=
provider
.
requisitionList
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
appBar:
appbar2
(
context
,
context
,
...
@@ -106,7 +116,6 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -106,7 +116,6 @@ class _AllpaymentrequesitionlistsbymodesState
// },
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
// ),
InkResponse
(
InkResponse
(
onTap:
()
async
{
onTap:
()
async
{
var
cf
=
Commondaterangefilter
();
var
cf
=
Commondaterangefilter
();
...
@@ -138,7 +147,10 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -138,7 +147,10 @@ class _AllpaymentrequesitionlistsbymodesState
print
(
"Bottom sheet closed without selection"
);
print
(
"Bottom sheet closed without selection"
);
}
}
},
},
child:
SvgPicture
.
asset
(
"assets/svg/filter_ic.svg"
,
height:
25
,),
child:
SvgPicture
.
asset
(
"assets/svg/filter_ic.svg"
,
height:
25
,
),
),
),
],
],
),
),
...
@@ -146,11 +158,15 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -146,11 +158,15 @@ class _AllpaymentrequesitionlistsbymodesState
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
body:
provider
.
isLoading
provider
.
isLoading
?
Center
(
child:
CircularProgressIndicator
.
adaptive
(
?
Center
(
child:
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
valueColor:
AlwaysStoppedAnimation
<
Color
>(
AppColors
.
app_blue
)
AppColors
.
app_blue
,
))
),
:
requestLists
.
isNotEmpty
?
SizedBox
(
),
)
:
requestLists
.
isNotEmpty
?
SizedBox
(
child:
Scrollbar
(
child:
Scrollbar
(
thumbVisibility:
false
,
thumbVisibility:
false
,
child:
ListView
.
builder
(
child:
ListView
.
builder
(
...
@@ -160,9 +176,7 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -160,9 +176,7 @@ class _AllpaymentrequesitionlistsbymodesState
itemBuilder:
(
context
,
index
)
{
itemBuilder:
(
context
,
index
)
{
if
(
requestLists
.
isEmpty
)
{
if
(
requestLists
.
isEmpty
)
{
return
SizedBox
(
return
SizedBox
(
child:
Center
(
child:
Center
(
child:
Text
(
"No Data Available"
)),
child:
Text
(
"No Data Available"
),
),
);
);
}
}
return
Container
(
return
Container
(
...
@@ -190,8 +204,9 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -190,8 +204,9 @@ class _AllpaymentrequesitionlistsbymodesState
padding:
EdgeInsets
.
all
(
8.0
),
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFF3CE
),
color:
Color
(
0xFFFFF3CE
),
borderRadius:
borderRadius:
BorderRadius
.
circular
(
BorderRadius
.
circular
(
8
),
8
,
),
),
),
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
,
"assets/svg/fin_ic.svg"
,
...
@@ -207,22 +222,18 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -207,22 +222,18 @@ class _AllpaymentrequesitionlistsbymodesState
CrossAxisAlignment
.
start
,
CrossAxisAlignment
.
start
,
children:
[
children:
[
Text
(
Text
(
requestLists
[
index
]
requestLists
[
index
].
accountName
!,
.
accountName
!,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
color:
AppColors
.
semi_black
,
AppColors
.
semi_black
,
),
),
),
),
Text
(
Text
(
"₹"
"₹"
"
${requestLists[index].amount}
"
,
"
${requestLists[index].amount}
"
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
),
),
...
@@ -239,8 +250,9 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -239,8 +250,9 @@ class _AllpaymentrequesitionlistsbymodesState
vertical:
10
,
vertical:
10
,
),
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
borderRadius:
borderRadius:
BorderRadius
.
circular
(
BorderRadius
.
circular
(
8
),
8
,
),
color:
Color
(
0xFFE3FFE0
),
color:
Color
(
0xFFE3FFE0
),
),
),
child:
Center
(
child:
Center
(
...
@@ -277,14 +289,14 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -277,14 +289,14 @@ class _AllpaymentrequesitionlistsbymodesState
requestLists
[
index
].
date
,
requestLists
[
index
].
date
,
requestLists
[
index
].
description
,
requestLists
[
index
].
description
,
];
];
if
(
j
==
1
&&
requestLists
[
index
]
if
(
j
==
1
&&
.
attachmentViewFileName
==
""
){
requestLists
[
index
]
.
attachmentViewFileName
==
""
)
{
return
SizedBox
.
shrink
();
return
SizedBox
.
shrink
();
}
}
return
Container
(
return
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
vertical:
5
,
),
child:
Row
(
child:
Row
(
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
.
start
,
CrossAxisAlignment
.
start
,
...
@@ -328,21 +340,16 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -328,21 +340,16 @@ class _AllpaymentrequesitionlistsbymodesState
fontSize:
14
,
fontSize:
14
,
color:
color:
j
==
1
j
==
1
?
AppColors
?
AppColors
.
app_blue
.
app_blue
:
Color
(
0xFF818181
),
:
Color
(
0xFF818181
,
),
decoration:
decoration:
j
==
1
j
==
1
?
TextDecoration
?
TextDecoration
.
underline
.
underline
:
TextDecoration
:
TextDecoration
.
none
,
.
none
,
decorationColor:
decorationColor:
j
==
1
j
==
1
?
AppColors
?
AppColors
.
app_blue
.
app_blue
:
AppColors
.
white
,
:
AppColors
.
white
,
),
),
),
),
...
@@ -361,23 +368,53 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -361,23 +368,53 @@ class _AllpaymentrequesitionlistsbymodesState
(
context
)
=>
(
context
)
=>
Paymentrequestionlistdetails
(
Paymentrequestionlistdetails
(
pageName:
pageName:
widget
widget
.
pageTitleName
,
.
pageTitleName
,
mode:
widget
.
mode
,
mode:
widget
.
mode
,
paymentRequestId:
paymentRequestId:
requestLists
[
index
]
requestLists
[
index
].
id
,
.
id
,
),
settings:
RouteSettings
(
name:
"Paymentrequestionlistdetails"
,
),
),
),
),
);
);
if
(
res
==
true
){
if
(
routeSettingName
==
provider
.
paymentRequestionListsAPIFunction
(
context
,
widget
.
mode
,
""
,
""
);
"Paymentrequestionlistdetails"
)
{
print
(
"croos refresh"
);
provider
.
paymentRequestionListsAPIFunction
(
context
,
widget
.
mode
,
""
,
""
,
);
}
}
// if (res == true) {
// print("android refresh");
// provider
// .paymentRequestionListsAPIFunction(
// context,
// widget.mode,
// "",
// "",
// );
// }
// if (Platform.isIOS) {
// print("IOS Refresh");
// if (didPushed == "true" ||
// didPopped == "true") {
// provider
// .paymentRequestionListsAPIFunction(
// context,
// widget.mode,
// "",
// "",
// );
// }
// }
},
},
child:
Container
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
vertical:
5
,
),
child:
Row
(
child:
Row
(
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
.
center
,
CrossAxisAlignment
.
center
,
...
@@ -406,12 +443,11 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -406,12 +443,11 @@ class _AllpaymentrequesitionlistsbymodesState
},
},
),
),
),
),
):
Emptywidget
(
context
)
)
),
:
Emptywidget
(
context
),
),
);
);
},
},
):
NoNetwork
(
context
);
);
}
}
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
...
@@ -436,7 +472,9 @@ class _AllpaymentrequesitionlistsbymodesState
...
@@ -436,7 +472,9 @@ class _AllpaymentrequesitionlistsbymodesState
right:
15
,
right:
15
,
top:
10
,
top:
10
,
),
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
...
...
lib/screens/finance/PaymentRequestionListDetails.dart
View file @
c92f4c79
...
@@ -35,12 +35,10 @@ class Paymentrequestionlistdetails extends StatefulWidget {
...
@@ -35,12 +35,10 @@ class Paymentrequestionlistdetails extends StatefulWidget {
class
_PaymentrequestionlistdetailsState
class
_PaymentrequestionlistdetailsState
extends
State
<
Paymentrequestionlistdetails
>
{
extends
State
<
Paymentrequestionlistdetails
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
10
,
(
index
)
=>
FocusNode
()
,
);
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
10
,
(
index
)
=>
FocusNode
());
Dropdowntheme
ddtheme
=
Dropdowntheme
();
Dropdowntheme
ddtheme
=
Dropdowntheme
();
TextEditingController
approvedAmount
=
TextEditingController
();
TextEditingController
approvedAmount
=
TextEditingController
();
TextEditingController
remarks
=
TextEditingController
();
TextEditingController
remarks
=
TextEditingController
();
...
@@ -87,7 +85,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -87,7 +85,7 @@ class _PaymentrequestionlistdetailsState
@override
@override
void
dispose
()
{
void
dispose
()
{
// TODO: implement dispose
// TODO: implement dispose
focusNodes
.
map
((
e
)=>
e
.
dispose
());
focusNodes
.
map
((
e
)
=>
e
.
dispose
());
_connectivity
.
disposeStream
();
_connectivity
.
disposeStream
();
super
.
dispose
();
super
.
dispose
();
}
}
...
@@ -105,7 +103,22 @@ class _PaymentrequestionlistdetailsState
...
@@ -105,7 +103,22 @@ class _PaymentrequestionlistdetailsState
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
connection
==
"Online"
?
Consumer
<
Requesitionlidtdetailsprovider
>(
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Requesitionlidtdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
var
req_det
=
provider
.
requestsDetails
;
var
req_det
=
provider
.
requestsDetails
;
isLevel1Finalized
=
[
isLevel1Finalized
=
[
...
@@ -136,16 +149,10 @@ class _PaymentrequestionlistdetailsState
...
@@ -136,16 +149,10 @@ class _PaymentrequestionlistdetailsState
"Level 2 Approved"
,
"Level 2 Approved"
,
"Level 2 approved"
,
"Level 2 approved"
,
].
contains
(
req_det
.
status
);
].
contains
(
req_det
.
status
);
}
else
if
(
widget
.
mode
==
"self_apr_lvl2"
){
}
else
if
(
widget
.
mode
==
"self_apr_lvl2"
)
{
shouldShowButtons
=
[
shouldShowButtons
=
[
"Requested"
].
contains
(
req_det
.
status
);
"Requested"
].
contains
(
req_det
.
status
);
}
}
return
WillPopScope
(
return
Scaffold
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
appBar:
appbar2
(
context
,
context
,
...
@@ -177,9 +184,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -177,9 +184,7 @@ class _PaymentrequestionlistdetailsState
color:
Color
(
0xFFFFF3CE
),
color:
Color
(
0xFFFFF3CE
),
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
),
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
),
"assets/svg/fin_ic.svg"
,
),
),
),
),
),
SizedBox
(
width:
10
),
SizedBox
(
width:
10
),
...
@@ -263,8 +268,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -263,8 +268,7 @@ class _PaymentrequestionlistdetailsState
Expanded
(
Expanded
(
child:
InkResponse
(
child:
InkResponse
(
onTap:
()
{
onTap:
()
{
if
(
provider
.
Headings
[
j
]
==
if
(
provider
.
Headings
[
j
]
==
"Attachment"
)
{
"Attachment"
)
{
Navigator
.
push
(
Navigator
.
push
(
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
...
@@ -287,8 +291,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -287,8 +291,7 @@ class _PaymentrequestionlistdetailsState
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
context
)
=>
(
context
)
=>
Accountslistdetails
(
Accountslistdetails
(
accountID:
accountID:
provider
provider
.
requestsDetails
.
requestsDetails
...
@@ -299,9 +302,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -299,9 +302,7 @@ class _PaymentrequestionlistdetailsState
}
}
},
},
child:
Text
(
child:
Text
(
[
[
"Attachment"
].
contains
(
provider
.
Headings
[
j
])
"Attachment"
,
].
contains
(
provider
.
Headings
[
j
])
?
"View"
?
"View"
:
provider
.
subHeadings
[
j
]
==
""
:
provider
.
subHeadings
[
j
]
==
""
?
"-"
?
"-"
...
@@ -337,8 +338,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -337,8 +338,7 @@ class _PaymentrequestionlistdetailsState
),
),
);
);
}),
}),
SizedBox
(
height:
80
,)
SizedBox
(
height:
80
),
],
],
),
),
),
),
...
@@ -348,7 +348,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -348,7 +348,7 @@ class _PaymentrequestionlistdetailsState
([
"admin"
,
"self"
].
contains
(
widget
.
mode
)
||
!
shouldShowButtons
)
([
"admin"
,
"self"
].
contains
(
widget
.
mode
)
||
!
shouldShowButtons
)
?
Container
(
height:
0
)
?
Container
(
height:
0
)
:
Container
(
:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
alignment:
Alignment
.
bottomCenter
,
alignment:
Alignment
.
bottomCenter
,
height:
60
,
height:
60
,
child:
Container
(
child:
Container
(
...
@@ -379,9 +379,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -379,9 +379,7 @@ class _PaymentrequestionlistdetailsState
child:
Center
(
child:
Center
(
child:
Text
(
child:
Text
(
"Reject"
,
"Reject"
,
style:
TextStyle
(
style:
TextStyle
(
color:
Color
(
0xFFED3424
)),
color:
Color
(
0xFFED3424
),
),
),
),
),
),
),
),
...
@@ -391,7 +389,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -391,7 +389,7 @@ class _PaymentrequestionlistdetailsState
if
([
if
([
"apr_lvl1"
,
"apr_lvl1"
,
"apr_lvl2"
,
"apr_lvl2"
,
"self_apr_lvl2"
"self_apr_lvl2"
,
].
contains
(
widget
.
mode
))
...[
].
contains
(
widget
.
mode
))
...[
Expanded
(
Expanded
(
child:
InkResponse
(
child:
InkResponse
(
...
@@ -589,15 +587,9 @@ class _PaymentrequestionlistdetailsState
...
@@ -589,15 +587,9 @@ class _PaymentrequestionlistdetailsState
// ),
// ),
// ),
// ),
// ),
// ),
),
),
onWillPop:
()
{
provider
.
resetAll
();
return
onBackPressed
(
context
);
},
);
);
},
},
):
NoNetwork
(
context
);
);
}
}
Future
<
void
>
_showLevelApprovalSheet
(
BuildContext
context
,
paymentID
)
{
Future
<
void
>
_showLevelApprovalSheet
(
BuildContext
context
,
paymentID
)
{
...
@@ -672,7 +664,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -672,7 +664,7 @@ class _PaymentrequestionlistdetailsState
null
,
null
,
focusNodes
[
0
],
focusNodes
[
0
],
focusNodes
[
1
],
focusNodes
[
1
],
TextInputAction
.
next
TextInputAction
.
next
,
),
),
errorWidget
(
context
,
provider
.
ApprovedAmountError
),
errorWidget
(
context
,
provider
.
ApprovedAmountError
),
textControllerWidget
(
textControllerWidget
(
...
@@ -686,7 +678,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -686,7 +678,7 @@ class _PaymentrequestionlistdetailsState
null
,
null
,
focusNodes
[
1
],
focusNodes
[
1
],
null
,
null
,
TextInputAction
.
done
TextInputAction
.
done
,
),
),
errorWidget
(
context
,
provider
.
remarksError
),
errorWidget
(
context
,
provider
.
remarksError
),
TextWidget
(
context
,
"Proposed Payment Account"
),
TextWidget
(
context
,
"Proposed Payment Account"
),
...
@@ -911,7 +903,9 @@ class _PaymentrequestionlistdetailsState
...
@@ -911,7 +903,9 @@ class _PaymentrequestionlistdetailsState
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
null
,
null
,
focusNodes
[
2
],
null
,
TextInputAction
.
done
focusNodes
[
2
],
null
,
TextInputAction
.
done
,
),
),
errorWidget
(
context
,
provider
.
remarksError
),
errorWidget
(
context
,
provider
.
remarksError
),
InkWell
(
InkWell
(
...
@@ -978,7 +972,6 @@ class _PaymentrequestionlistdetailsState
...
@@ -978,7 +972,6 @@ class _PaymentrequestionlistdetailsState
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
return
Scaffold
(
body:
Container
(
body:
Container
(
margin:
EdgeInsets
.
only
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
bottom:
15
,
left:
15
,
left:
15
,
...
@@ -996,7 +989,8 @@ class _PaymentrequestionlistdetailsState
...
@@ -996,7 +989,8 @@ class _PaymentrequestionlistdetailsState
Expanded
(
Expanded
(
child:
SizedBox
(
child:
SizedBox
(
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
children:
[
Align
(
Align
(
...
@@ -1017,40 +1011,53 @@ class _PaymentrequestionlistdetailsState
...
@@ -1017,40 +1011,53 @@ class _PaymentrequestionlistdetailsState
(
p0
)
{},
(
p0
)
{},
),
),
TextWidget
(
context
,
"Payment Account"
),
TextWidget
(
context
,
"Payment Account"
),
DropdownButtonHideUnderline
(
DropdownButtonHideUnderline
(
child:
Row
(
child:
Row
(
children:
[
children:
[
Expanded
(
Expanded
(
child:
DropdownButton2
<
PaymentAccounts
>(
child:
DropdownButton2
<
PaymentAccounts
>(
isExpanded:
true
,
isExpanded:
true
,
hint:
Text
(
hint:
Text
(
'Select Account'
,
'Select Account'
,
style:
TextStyle
(
fontSize:
14
),
style:
TextStyle
(
overflow:
TextOverflow
.
ellipsis
,
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
items:
items:
provider
.
paymentsAccounts
provider
.
paymentsAccounts
.
map
(
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
(
paymenents
,
)
=>
DropdownMenuItem
<
PaymentAccounts
PaymentAccounts
>(
>(
value:
paymenents
,
value:
paymenents
,
child:
Text
(
child:
Text
(
paymenents
.
name
??
''
,
paymenents
.
name
??
style:
const
TextStyle
(
''
,
fontSize:
14
,
style:
const
TextStyle
(
fontSize:
14
,
),
),
overflow:
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
),
),
),
),
)
)
.
toList
(),
.
toList
(),
value:
provider
.
selectedPaymentAccounts
,
value:
onChanged:
(
PaymentAccounts
?
value
)
{
provider
.
selectedPaymentAccounts
,
onChanged:
(
PaymentAccounts
?
value
,
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
if
(
provider
if
(
provider
.
paymentsAccounts
.
paymentsAccounts
...
@@ -1060,11 +1067,14 @@ class _PaymentrequestionlistdetailsState
...
@@ -1060,11 +1067,14 @@ class _PaymentrequestionlistdetailsState
print
(
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
);
provider
.
selectedID
=
value
.
id
!;
provider
.
selectedID
=
provider
.
selectedValue
=
value
.
name
!;
value
.
id
!;
provider
.
selectedValue
=
value
.
name
!;
print
(
print
(
"hfjkshfg"
+
"hfjkshfg"
+
provider
.
selectedID
.
toString
(),
provider
.
selectedID
.
toString
(),
);
);
}
}
}
}
...
@@ -1075,7 +1085,8 @@ class _PaymentrequestionlistdetailsState
...
@@ -1075,7 +1085,8 @@ class _PaymentrequestionlistdetailsState
provider
provider
.
paymentAccountSearchController
,
.
paymentAccountSearchController
,
searchInnerWidget:
Padding
(
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
child:
TextFormField
(
controller:
controller:
provider
provider
...
@@ -1087,19 +1098,26 @@ class _PaymentrequestionlistdetailsState
...
@@ -1087,19 +1098,26 @@ class _PaymentrequestionlistdetailsState
horizontal:
10
,
horizontal:
10
,
vertical:
8
,
vertical:
8
,
),
),
hintText:
'Search account...'
,
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
border:
OutlineInputBorder
(
borderRadius:
borderRadius:
BorderRadius
.
circular
(
8
),
BorderRadius
.
circular
(
8
,
),
),
),
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
),
searchMatchFn:
(
item
,
searchValue
,
)
{
return
item
.
value
?.
name
return
item
.
value
?.
name
?.
toLowerCase
()
?.
toLowerCase
()
.
contains
(
.
contains
(
searchValue
.
toLowerCase
(),
searchValue
.
toLowerCase
(),
)
??
)
??
false
;
false
;
},
},
...
@@ -1108,12 +1126,15 @@ class _PaymentrequestionlistdetailsState
...
@@ -1108,12 +1126,15 @@ class _PaymentrequestionlistdetailsState
),
),
onMenuStateChange:
(
isOpen
)
{
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
if
(!
isOpen
)
{
provider
.
paymentAccountSearchController
provider
.
paymentAccountSearchController
.
clear
();
.
clear
();
}
}
},
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
buttonStyleData:
iconStyleData:
ddtheme
.
iconStyleData
,
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
dropdownStyleData:
...
@@ -1137,19 +1158,29 @@ class _PaymentrequestionlistdetailsState
...
@@ -1137,19 +1158,29 @@ class _PaymentrequestionlistdetailsState
"Payment Amount"
,
"Payment Amount"
,
"Enter Payment Amount"
,
"Enter Payment Amount"
,
(
p0
)
{
(
p0
)
{
if
(
numberFormat
.
parse
(
provider
.
approvedAmountReadonly
.
text
)<
numberFormat
.
parse
(
provider
.
approvedAmount
.
text
)){
if
(
numberFormat
.
parse
(
provider
.
proposedAmountError
=
"Amount Should not be greater than Approved amount"
;
provider
}
else
{
.
approvedAmountReadonly
.
text
,
)
<
numberFormat
.
parse
(
provider
.
approvedAmount
.
text
,
))
{
provider
.
proposedAmountError
=
"Amount Should not be greater than Approved amount"
;
}
else
{
provider
.
proposedAmountError
=
""
;
provider
.
proposedAmountError
=
""
;
}
}
},
},
TextInputType
.
numberWithOptions
(),
TextInputType
.
numberWithOptions
(),
false
,
false
,
null
null
,
),
),
errorWidget
(
context
,
provider
.
proposedAmountError
),
errorWidget
(
context
,
provider
.
proposedAmountError
,
),
textControllerWidget
(
textControllerWidget
(
context
,
context
,
...
@@ -1160,7 +1191,9 @@ class _PaymentrequestionlistdetailsState
...
@@ -1160,7 +1191,9 @@ class _PaymentrequestionlistdetailsState
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
null
,
null
,
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
,
),
),
textControllerWidget
(
textControllerWidget
(
...
@@ -1172,7 +1205,9 @@ class _PaymentrequestionlistdetailsState
...
@@ -1172,7 +1205,9 @@ class _PaymentrequestionlistdetailsState
TextInputType
.
text
,
TextInputType
.
text
,
false
,
false
,
null
,
null
,
focusNodes
[
4
],
null
,
TextInputAction
.
done
focusNodes
[
4
],
null
,
TextInputAction
.
done
,
),
),
InkResponse
(
InkResponse
(
...
@@ -1180,12 +1215,17 @@ class _PaymentrequestionlistdetailsState
...
@@ -1180,12 +1215,17 @@ class _PaymentrequestionlistdetailsState
_showAttachmentSheet
(
context
);
_showAttachmentSheet
(
context
);
},
},
child:
Container
(
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
vertical:
10
,
),
height:
45
,
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
12
),
borderRadius:
BorderRadius
.
circular
(
12
,
),
border:
Border
.
all
(
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
width:
0.5
,
width:
0.5
,
...
@@ -1311,15 +1351,12 @@ class _PaymentrequestionlistdetailsState
...
@@ -1311,15 +1351,12 @@ class _PaymentrequestionlistdetailsState
"Bank UPI ID"
,
"Bank UPI ID"
,
(
p0
)
{},
(
p0
)
{},
),
),
],
],
),
),
),
),
),
),
],
],
),
),
],
],
),
),
),
),
...
@@ -1327,8 +1364,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -1327,8 +1364,7 @@ class _PaymentrequestionlistdetailsState
alignment:
Alignment
.
bottomCenter
,
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
child:
InkWell
(
onTap:
()
{
onTap:
()
{
provider
provider
.
paymentrequisitionProcessSubmitAPIFunction
(
.
paymentrequisitionProcessSubmitAPIFunction
(
context
,
context
,
widget
.
mode
,
widget
.
mode
,
paymentReferenceNumber
.
text
,
paymentReferenceNumber
.
text
,
...
@@ -1373,6 +1409,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -1373,6 +1409,7 @@ class _PaymentrequestionlistdetailsState
},
},
);
);
}
}
Future
<
void
>
_showAddPaymentSheet
(
BuildContext
context
,
paymentID
)
{
Future
<
void
>
_showAddPaymentSheet
(
BuildContext
context
,
paymentID
)
{
return
showModalBottomSheet
(
return
showModalBottomSheet
(
useSafeArea:
true
,
useSafeArea:
true
,
...
@@ -1411,7 +1448,8 @@ class _PaymentrequestionlistdetailsState
...
@@ -1411,7 +1448,8 @@ class _PaymentrequestionlistdetailsState
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
child:
Padding
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
),
child:
Column
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
...
@@ -1420,7 +1458,8 @@ class _PaymentrequestionlistdetailsState
...
@@ -1420,7 +1458,8 @@ class _PaymentrequestionlistdetailsState
children:
[
children:
[
Expanded
(
Expanded
(
child:
Column
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
children:
[
Align
(
Align
(
...
@@ -1439,74 +1478,145 @@ class _PaymentrequestionlistdetailsState
...
@@ -1439,74 +1478,145 @@ class _PaymentrequestionlistdetailsState
"Enter Proposed Payment Account"
,
"Enter Proposed Payment Account"
,
(
p0
)
{},
(
p0
)
{},
),
),
TextWidget
(
context
,
"Payment Account"
),
TextWidget
(
context
,
"Payment Account"
,
),
DropdownButtonHideUnderline
(
DropdownButtonHideUnderline
(
child:
Row
(
child:
Row
(
children:
[
children:
[
Expanded
(
Expanded
(
child:
DropdownButton2
<
PaymentAccounts
>(
child:
DropdownButton2
<
PaymentAccounts
>(
isExpanded:
true
,
isExpanded:
true
,
hint:
Text
(
hint:
Text
(
'Select Account'
,
'Select Account'
,
style:
TextStyle
(
fontSize:
14
),
style:
TextStyle
(
overflow:
TextOverflow
.
ellipsis
,
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
items:
provider
.
paymentsAccounts
items:
provider
.
paymentsAccounts
.
map
(
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
PaymentAccounts
>(
(
value:
paymenents
,
paymenents
,
)
=>
DropdownMenuItem
<
PaymentAccounts
>(
value:
paymenents
,
child:
Text
(
child:
Text
(
paymenents
.
name
??
''
,
paymenents
style:
TextStyle
(
fontSize:
14
),
.
name
??
overflow:
TextOverflow
.
ellipsis
,
''
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
),
),
)
)
.
toList
(),
.
toList
(),
value:
provider
.
selectedPaymentAccounts
,
value:
onChanged:
(
PaymentAccounts
?
value
)
{
provider
if
(
value
!=
null
&&
provider
.
paymentsAccounts
.
isNotEmpty
)
{
.
selectedPaymentAccounts
,
onChanged:
(
PaymentAccounts
?
value
,
)
{
if
(
value
!=
null
&&
provider
.
paymentsAccounts
.
isNotEmpty
)
{
setState
(()
{
setState
(()
{
provider
.
selectedPaymentAccounts
=
value
;
provider
.
selectedPaymentAccounts
=
provider
.
selectedID
=
value
.
id
!;
value
;
provider
.
selectedValue
=
value
.
name
!;
provider
.
selectedID
=
print
(
"Selected Account:
${value.name}
, ID:
${value.id}
"
);
value
.
id
!;
provider
.
selectedValue
=
value
.
name
!;
print
(
"Selected Account:
${value.name}
, ID:
${value.id}
"
,
);
});
});
}
}
},
},
dropdownSearchData:
DropdownSearchData
(
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchInnerWidgetHeight:
searchController:
provider
.
paymentAccountSearchController
,
50
,
searchController:
provider
.
paymentAccountSearchController
,
searchInnerWidget:
Padding
(
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
all
(
8
,
),
child:
TextFormField
(
child:
TextFormField
(
controller:
provider
.
paymentAccountSearchController
,
controller:
provider
.
paymentAccountSearchController
,
decoration:
InputDecoration
(
decoration:
InputDecoration
(
isDense:
true
,
isDense:
true
,
contentPadding:
EdgeInsets
.
symmetric
(
contentPadding:
horizontal:
10
,
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
vertical:
8
,
),
),
hintText:
'Search account...'
,
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
),
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
),
return
item
.
value
?.
name
?.
toLowerCase
().
contains
(
searchValue
.
toLowerCase
())
??
false
;
searchMatchFn:
(
item
,
searchValue
,
)
{
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
},
},
),
),
onMenuStateChange:
(
isOpen
)
{
onMenuStateChange:
(
isOpen
,
)
{
if
(!
isOpen
)
{
if
(!
isOpen
)
{
provider
.
paymentAccountSearchController
.
clear
();
provider
.
paymentAccountSearchController
.
clear
();
}
}
},
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
buttonStyleData:
iconStyleData:
ddtheme
.
iconStyleData
,
ddtheme
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
.
buttonStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
),
),
],
],
...
@@ -1524,18 +1634,31 @@ class _PaymentrequestionlistdetailsState
...
@@ -1524,18 +1634,31 @@ class _PaymentrequestionlistdetailsState
"Payment Amount"
,
"Payment Amount"
,
"Enter Payment Amount"
,
"Enter Payment Amount"
,
(
p0
)
{
(
p0
)
{
if
(
numberFormat
.
parse
(
provider
.
approvedAmountReadonly
.
text
)
<
if
(
numberFormat
.
parse
(
numberFormat
.
parse
(
provider
.
approvedAmount
.
text
))
{
provider
provider
.
proposedAmountError
=
"Amount should not be greater than Approved amount"
;
.
approvedAmountReadonly
.
text
,
)
<
numberFormat
.
parse
(
provider
.
approvedAmount
.
text
,
))
{
provider
.
proposedAmountError
=
"Amount should not be greater than Approved amount"
;
}
else
{
}
else
{
provider
.
proposedAmountError
=
""
;
provider
.
proposedAmountError
=
""
;
}
}
},
},
TextInputType
.
numberWithOptions
(),
TextInputType
.
numberWithOptions
(),
false
,
false
,
null
,
null
,
),
),
errorWidget
(
context
,
provider
.
proposedAmountError
),
errorWidget
(
context
,
provider
.
proposedAmountError
,
),
textControllerWidget
(
textControllerWidget
(
context
,
context
,
paymentReferenceNumber
,
paymentReferenceNumber
,
...
@@ -1567,12 +1690,18 @@ class _PaymentrequestionlistdetailsState
...
@@ -1567,12 +1690,18 @@ class _PaymentrequestionlistdetailsState
_showAttachmentSheet
(
context
);
_showAttachmentSheet
(
context
);
},
},
child:
Container
(
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
vertical:
10
,
),
height:
45
,
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
,
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
12
),
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
width:
0.5
,
width:
0.5
,
...
@@ -1582,33 +1711,46 @@ class _PaymentrequestionlistdetailsState
...
@@ -1582,33 +1711,46 @@ class _PaymentrequestionlistdetailsState
child:
Text
(
child:
Text
(
"Add Attachment"
,
"Add Attachment"
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
),
),
),
),
),
),
),
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
,
),
child:
Row
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
children:
[
Text
(
Text
(
"
${provider.imagePath}
"
,
"
${provider.imagePath}
"
,
style:
TextStyle
(
style:
TextStyle
(
color:
AppColors
.
semi_black
,
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
fontWeight:
FontWeight
.
w600
,
),
),
),
),
InkResponse
(
InkResponse
(
onTap:
()
{
onTap:
()
{
setState
(()
{
setState
(()
{
provider
.
imagePicked
=
0
;
provider
.
imagePicked
=
provider
.
imagePath
=
null
;
0
;
provider
.
imageFilePath
=
null
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
});
});
},
},
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
...
@@ -1621,18 +1763,78 @@ class _PaymentrequestionlistdetailsState
...
@@ -1621,18 +1763,78 @@ class _PaymentrequestionlistdetailsState
),
),
),
),
],
],
textControllerReadonlyWidget
(
context
,
provider
.
accountName
,
"Enter Account Name"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
textControllerReadonlyWidget
(
context
,
provider
.
branch
,
"Enter Branch Name"
,
(
p0
)
{}),
context
,
textControllerReadonlyWidget
(
context
,
provider
.
requestingPurpose
,
"Enter Requesting Purpose"
,
(
p0
)
{}),
provider
.
accountName
,
textControllerReadonlyWidget
(
context
,
provider
.
description
,
"Enter Description"
,
(
p0
)
{}),
"Enter Account Name"
,
textControllerReadonlyWidget
(
context
,
provider
.
amount
,
"Enter Amount"
,
(
p0
)
{}),
(
p0
)
{},
textControllerReadonlyWidget
(
context
,
provider
.
paymentMode
,
"Enter Payment Mode"
,
(
p0
)
{}),
),
textControllerReadonlyWidget
(
context
,
provider
.
bankHolderName
,
"Bank Account Holder Name"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
textControllerReadonlyWidget
(
context
,
provider
.
bankAccountNumber
,
"Bank Account Number"
,
(
p0
)
{}),
context
,
textControllerReadonlyWidget
(
context
,
provider
.
bankName
,
"Bank Name"
,
(
p0
)
{}),
provider
.
branch
,
textControllerReadonlyWidget
(
context
,
provider
.
bankBranchName
,
"Bank Branch Name"
,
(
p0
)
{}),
"Enter Branch Name"
,
textControllerReadonlyWidget
(
context
,
provider
.
bankIfscCode
,
"Bank IFSC Code"
,
(
p0
)
{}),
(
p0
)
{},
textControllerReadonlyWidget
(
context
,
provider
.
bankUpiID
,
"Bank UPI ID"
,
(
p0
)
{}),
),
textControllerReadonlyWidget
(
context
,
provider
.
requestingPurpose
,
"Enter Requesting Purpose"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
description
,
"Enter Description"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
amount
,
"Enter Amount"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
paymentMode
,
"Enter Payment Mode"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankHolderName
,
"Bank Account Holder Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankAccountNumber
,
"Bank Account Number"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankName
,
"Bank Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankBranchName
,
"Bank Branch Name"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankIfscCode
,
"Bank IFSC Code"
,
(
p0
)
{},
),
textControllerReadonlyWidget
(
context
,
provider
.
bankUpiID
,
"Bank UPI ID"
,
(
p0
)
{},
),
],
],
),
),
),
),
...
@@ -1653,7 +1855,8 @@ class _PaymentrequestionlistdetailsState
...
@@ -1653,7 +1855,8 @@ class _PaymentrequestionlistdetailsState
),
),
child:
InkWell
(
child:
InkWell
(
onTap:
()
{
onTap:
()
{
provider
.
paymentrequisitionProcessSubmitAPIFunction
(
provider
.
paymentrequisitionProcessSubmitAPIFunction
(
context
,
context
,
widget
.
mode
,
widget
.
mode
,
paymentReferenceNumber
.
text
,
paymentReferenceNumber
.
text
,
...
@@ -1691,6 +1894,7 @@ class _PaymentrequestionlistdetailsState
...
@@ -1691,6 +1894,7 @@ class _PaymentrequestionlistdetailsState
},
},
);
);
}
}
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
return
showModalBottomSheet
(
useSafeArea:
true
,
useSafeArea:
true
,
...
...
lib/screens/finance/addPaymentReceiptList.dart
View file @
c92f4c79
...
@@ -71,13 +71,24 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -71,13 +71,24 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
connection
==
"Online"
?
Consumer
<
Paymentreceiptsprovider
>(
return
(
connection
==
"Online"
)
builder:
(
context
,
provider
,
child
)
{
?
Platform
.
isAndroid
return
WillPopScope
(
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
child:
SafeArea
(
top:
false
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
true
,
child:
Scaffold
(
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Paymentreceiptsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
white
,
backgroundColor:
AppColors
.
white
,
appBar:
appbar2
(
appBar:
appbar2
(
...
@@ -115,9 +126,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -115,9 +126,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
value:
accs
,
value:
accs
,
child:
Text
(
child:
Text
(
accs
.
name
??
''
,
accs
.
name
??
''
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
),
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
),
),
...
@@ -133,12 +142,10 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -133,12 +142,10 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
);
provider
.
receiptAccountId
=
value
.
id
!;
provider
.
receiptAccountId
=
value
.
id
!;
provider
.
receiptAccountValue
=
provider
.
receiptAccountValue
=
value
.
name
!;
value
.
name
!;
print
(
print
(
"hfjkshfg"
+
"hfjkshfg"
+
provider
.
receiptAccountId
provider
.
receiptAccountId
.
toString
(),
.
toString
(),
);
);
}
}
}
}
...
@@ -150,28 +157,22 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -150,28 +157,22 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
searchInnerWidget:
Padding
(
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
child:
TextFormField
(
controller:
controller:
provider
.
accountSearchController
,
provider
.
accountSearchController
,
decoration:
InputDecoration
(
decoration:
InputDecoration
(
isDense:
true
,
isDense:
true
,
contentPadding:
contentPadding:
const
EdgeInsets
.
symmetric
(
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
horizontal:
10
,
vertical:
8
,
vertical:
8
,
),
),
hintText:
'Search account...'
,
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
borderRadius:
BorderRadius
.
circular
(
8
),
8
,
),
),
),
),
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
return
item
.
value
?.
name
?.
toLowerCase
().
contains
(
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
searchValue
.
toLowerCase
(),
)
??
)
??
false
;
false
;
...
@@ -217,8 +218,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -217,8 +218,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
fontSize:
14
,
),
),
overflow:
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
),
),
),
),
)
)
...
@@ -229,13 +229,11 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -229,13 +229,11 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
if
(
provider
if
(
provider
.
receiptPaymentAccounts
.
receiptPaymentAccounts
.
isNotEmpty
)
{
.
isNotEmpty
)
{
provider
.
selectreceiptPaymentAccounts
=
provider
.
selectreceiptPaymentAccounts
=
value
;
value
;
print
(
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
);
provider
.
receiptPaymentAccountsID
=
provider
.
receiptPaymentAccountsID
=
value
.
id
!;
value
.
id
!;
provider
.
receiptPaymentAccountsValue
=
provider
.
receiptPaymentAccountsValue
=
value
.
name
!;
value
.
name
!;
print
(
print
(
...
@@ -254,28 +252,22 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -254,28 +252,22 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
child:
TextFormField
(
controller:
controller:
provider
provider
.
paymentAccountSearchController
,
.
paymentAccountSearchController
,
decoration:
InputDecoration
(
decoration:
InputDecoration
(
isDense:
true
,
isDense:
true
,
contentPadding:
contentPadding:
const
EdgeInsets
.
symmetric
(
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
horizontal:
10
,
vertical:
8
,
vertical:
8
,
),
),
hintText:
'Search account...'
,
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
borderRadius:
BorderRadius
.
circular
(
8
),
8
,
),
),
),
),
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
return
item
.
value
?.
name
?.
toLowerCase
().
contains
(
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
searchValue
.
toLowerCase
(),
)
??
)
??
false
;
false
;
...
@@ -285,8 +277,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -285,8 +277,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
),
),
onMenuStateChange:
(
isOpen
)
{
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
if
(!
isOpen
)
{
provider
.
paymentAccountSearchController
provider
.
paymentAccountSearchController
.
clear
();
.
clear
();
}
}
},
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
...
@@ -400,8 +391,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -400,8 +391,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
fontSize:
14
,
),
),
overflow:
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
),
),
),
),
)
)
...
@@ -409,16 +399,12 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -409,16 +399,12 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
value:
provider
.
selectreceiptPaymentModes
,
value:
provider
.
selectreceiptPaymentModes
,
onChanged:
(
PaymentModes
?
value
)
{
onChanged:
(
PaymentModes
?
value
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
if
(
provider
if
(
provider
.
receiptPaymentModes
.
isNotEmpty
)
{
.
receiptPaymentModes
provider
.
selectreceiptPaymentModes
=
value
;
.
isNotEmpty
)
{
provider
.
selectreceiptPaymentModes
=
value
;
print
(
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
);
provider
.
receiptPaymentModesID
=
provider
.
receiptPaymentModesID
=
value
.
id
!;
value
.
id
!;
provider
.
receiptPaymentModesValues
=
provider
.
receiptPaymentModesValues
=
value
.
name
!;
value
.
name
!;
print
(
print
(
...
@@ -665,15 +651,9 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
...
@@ -665,15 +651,9 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
),
),
),
),
),
),
),
),
onWillPop:
()
{
provider
.
resetForm
();
return
onBackPressed
(
context
);
},
);
);
},
},
):
NoNetwork
(
context
);
);
}
}
// void _showDialog(Widget child) {
// void _showDialog(Widget child) {
...
...
lib/screens/finance/directPaymentRequesitionList.dart
View file @
c92f4c79
...
@@ -76,13 +76,24 @@ class _DirectpaymentrequesitionlistState
...
@@ -76,13 +76,24 @@ class _DirectpaymentrequesitionlistState
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
connection
==
"Online"
?
Consumer
<
Requestionlistprovider
>(
return
(
connection
==
"Online"
)
builder:
(
context
,
provider
,
child
)
{
?
Platform
.
isAndroid
return
WillPopScope
(
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
child:
SafeArea
(
top:
false
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
true
,
child:
Scaffold
(
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Requestionlistprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
white
,
backgroundColor:
AppColors
.
white
,
appBar:
appbar
(
context
,
"
${widget.pageTitleName}
"
),
appBar:
appbar
(
context
,
"
${widget.pageTitleName}
"
),
...
@@ -119,8 +130,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -119,8 +130,7 @@ class _DirectpaymentrequesitionlistState
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
fontSize:
14
,
),
),
overflow:
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
),
),
),
),
)
)
...
@@ -149,28 +159,22 @@ class _DirectpaymentrequesitionlistState
...
@@ -149,28 +159,22 @@ class _DirectpaymentrequesitionlistState
searchInnerWidget:
Padding
(
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
child:
TextFormField
(
controller:
controller:
provider
.
accountSearchController
,
provider
.
accountSearchController
,
decoration:
InputDecoration
(
decoration:
InputDecoration
(
isDense:
true
,
isDense:
true
,
contentPadding:
contentPadding:
const
EdgeInsets
.
symmetric
(
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
horizontal:
10
,
vertical:
8
,
vertical:
8
,
),
),
hintText:
'Search account...'
,
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
borderRadius:
BorderRadius
.
circular
(
8
),
8
,
),
),
),
),
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
return
item
.
value
?.
name
?.
toLowerCase
().
contains
(
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
searchValue
.
toLowerCase
(),
)
??
)
??
false
;
false
;
...
@@ -215,9 +219,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -215,9 +219,7 @@ class _DirectpaymentrequesitionlistState
value:
accs
,
value:
accs
,
child:
Text
(
child:
Text
(
accs
.
name
??
''
,
accs
.
name
??
''
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
),
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
),
),
...
@@ -226,16 +228,12 @@ class _DirectpaymentrequesitionlistState
...
@@ -226,16 +228,12 @@ class _DirectpaymentrequesitionlistState
value:
provider
.
selectDirectPaymentAccounts
,
value:
provider
.
selectDirectPaymentAccounts
,
onChanged:
(
DirectPaymentAccounts
?
value
)
{
onChanged:
(
DirectPaymentAccounts
?
value
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
if
(
provider
if
(
provider
.
directPaymentAccounts
.
isNotEmpty
)
{
.
directPaymentAccounts
provider
.
selectDirectPaymentAccounts
=
value
;
.
isNotEmpty
)
{
provider
.
selectDirectPaymentAccounts
=
value
;
print
(
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
);
provider
.
directPaymentAccountsID
=
provider
.
directPaymentAccountsID
=
value
.
id
!;
value
.
id
!;
provider
.
directPaymentAccountsValue
=
provider
.
directPaymentAccountsValue
=
value
.
name
!;
value
.
name
!;
print
(
print
(
...
@@ -254,28 +252,22 @@ class _DirectpaymentrequesitionlistState
...
@@ -254,28 +252,22 @@ class _DirectpaymentrequesitionlistState
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
child:
TextFormField
(
controller:
controller:
provider
provider
.
paymentAccountSearchController
,
.
paymentAccountSearchController
,
decoration:
InputDecoration
(
decoration:
InputDecoration
(
isDense:
true
,
isDense:
true
,
contentPadding:
contentPadding:
const
EdgeInsets
.
symmetric
(
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
horizontal:
10
,
vertical:
8
,
vertical:
8
,
),
),
hintText:
'Search account...'
,
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
borderRadius:
BorderRadius
.
circular
(
8
),
8
,
),
),
),
),
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
return
item
.
value
?.
name
?.
toLowerCase
().
contains
(
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
searchValue
.
toLowerCase
(),
)
??
)
??
false
;
false
;
...
@@ -285,8 +277,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -285,8 +277,7 @@ class _DirectpaymentrequesitionlistState
),
),
onMenuStateChange:
(
isOpen
)
{
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
if
(!
isOpen
)
{
provider
.
paymentAccountSearchController
provider
.
paymentAccountSearchController
.
clear
();
.
clear
();
}
}
},
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
...
@@ -393,9 +384,8 @@ class _DirectpaymentrequesitionlistState
...
@@ -393,9 +384,8 @@ class _DirectpaymentrequesitionlistState
items:
items:
provider
.
directPaymentModes
provider
.
directPaymentModes
.
map
(
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
(
paymenents
)
=>
DirectPaymentModes
DropdownMenuItem
<
DirectPaymentModes
>(
>(
value:
paymenents
,
value:
paymenents
,
child:
Text
(
child:
Text
(
paymenents
.
name
??
''
,
paymenents
.
name
??
''
,
...
@@ -410,9 +400,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -410,9 +400,7 @@ class _DirectpaymentrequesitionlistState
value:
provider
.
selectDirectPaymentModes
,
value:
provider
.
selectDirectPaymentModes
,
onChanged:
(
DirectPaymentModes
?
value
)
{
onChanged:
(
DirectPaymentModes
?
value
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
if
(
provider
if
(
provider
.
directPaymentModes
.
isNotEmpty
)
{
.
directPaymentModes
.
isNotEmpty
)
{
provider
.
selectDirectPaymentModes
=
value
;
provider
.
selectDirectPaymentModes
=
value
;
print
(
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
...
@@ -514,8 +502,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -514,8 +502,7 @@ class _DirectpaymentrequesitionlistState
TextInputAction
.
next
,
TextInputAction
.
next
,
),
),
errorWidget
(
context
,
provider
.
bankHolderError
),
errorWidget
(
context
,
provider
.
bankHolderError
),
]
else
if
(
provider
.
directPaymentModesValues
==
]
else
if
(
provider
.
directPaymentModesValues
==
"UPI"
)
...[
"UPI"
)
...[
textControllerWidget
(
textControllerWidget
(
context
,
context
,
provider
.
bankUpiController
,
provider
.
bankUpiController
,
...
@@ -652,9 +639,7 @@ class _DirectpaymentrequesitionlistState
...
@@ -652,9 +639,7 @@ class _DirectpaymentrequesitionlistState
child:
child:
provider
.
submitClicked
provider
.
submitClicked
?
CircularProgressIndicator
.
adaptive
(
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
app_blue
),
AppColors
.
app_blue
,
),
)
)
:
Text
(
:
Text
(
"Submit"
,
"Submit"
,
...
@@ -666,15 +651,9 @@ class _DirectpaymentrequesitionlistState
...
@@ -666,15 +651,9 @@ class _DirectpaymentrequesitionlistState
),
),
),
),
),
),
),
),
onWillPop:
()
{
provider
.
resetForm
();
return
onBackPressed
(
context
);
},
);
);
},
},
):
NoNetwork
(
context
);
);
}
}
// void _showDialog(Widget child) {
// void _showDialog(Widget child) {
...
...
lib/screens/finance/financeDashboard.dart
View file @
c92f4c79
...
@@ -3,7 +3,11 @@ import 'dart:io';
...
@@ -3,7 +3,11 @@ import 'dart:io';
import
'package:connectivity_plus/connectivity_plus.dart'
;
import
'package:connectivity_plus/connectivity_plus.dart'
;
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/Notifiers/commonProvider/accountsListProvider.dart'
;
import
'package:generp/Notifiers/financeProvider/DashboardProvider.dart'
;
import
'package:generp/Notifiers/financeProvider/DashboardProvider.dart'
;
import
'package:generp/Notifiers/financeProvider/RequestionListProvider.dart'
;
import
'package:generp/Notifiers/financeProvider/paymentReceiptsProvider.dart'
;
import
'package:generp/Utils/GlobalConstants.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/screensExports.dart'
;
import
'package:generp/screens/screensExports.dart'
;
...
@@ -28,7 +32,6 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -28,7 +32,6 @@ class _FinancedashboardState extends State<Financedashboard> {
super
.
initState
();
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
setState
(()
=>
_source
=
source
);
});
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
...
@@ -37,6 +40,7 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -37,6 +40,7 @@ class _FinancedashboardState extends State<Financedashboard> {
provider
.
addFormfinanceFormAccessPagesAPIFunction
(
context
);
provider
.
addFormfinanceFormAccessPagesAPIFunction
(
context
);
});
});
}
}
@override
@override
void
dispose
()
{
void
dispose
()
{
// TODO: implement dispose
// TODO: implement dispose
...
@@ -97,7 +101,10 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -97,7 +101,10 @@ class _FinancedashboardState extends State<Financedashboard> {
case
"apr_lvl2"
:
case
"apr_lvl2"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv2.svg"
);
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv2.svg"
);
break
;
break
;
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
// final icons = ["comm_ic_1", "comm_ic_2"];
case
"self_apr_lvl2"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv2.svg"
);
break
;
default
:
default
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
break
;
break
;
...
@@ -302,6 +309,9 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -302,6 +309,9 @@ class _FinancedashboardState extends State<Financedashboard> {
.
accessiblePagesList2
[
index
]
.
accessiblePagesList2
[
index
]
.
pageName
!,
.
pageName
!,
),
),
settings:
RouteSettings
(
name:
"Directpaymentrequesitionlist"
,
),
),
),
);
);
}
else
if
(
provider
}
else
if
(
provider
...
@@ -318,6 +328,9 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -318,6 +328,9 @@ class _FinancedashboardState extends State<Financedashboard> {
.
accessiblePagesList2
[
index
]
.
accessiblePagesList2
[
index
]
.
pageName
!,
.
pageName
!,
),
),
settings:
RouteSettings
(
name:
"Addpaymentreceiptlist"
,
),
),
),
);
);
}
else
if
(
provider
}
else
if
(
provider
...
@@ -331,6 +344,9 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -331,6 +344,9 @@ class _FinancedashboardState extends State<Financedashboard> {
(
context
)
=>
Addcommonpayment
(
(
context
)
=>
Addcommonpayment
(
from:
"Dashboard"
,
from:
"Dashboard"
,
),
),
settings:
RouteSettings
(
name:
"Addcommonpayment"
,
),
),
),
);
);
}
else
{
}
else
{
...
@@ -344,9 +360,40 @@ class _FinancedashboardState extends State<Financedashboard> {
...
@@ -344,9 +360,40 @@ class _FinancedashboardState extends State<Financedashboard> {
pageTitleName:
pageTitleName:
"
${pages2[index].pageName}
"
,
"
${pages2[index].pageName}
"
,
),
),
settings:
RouteSettings
(
name:
"Submitpaymentrequestionlistsbymode"
,
),
),
),
);
);
}
}
switch
(
routeSettingName
)
{
case
"Submitpaymentrequestionlistsbymode"
:
print
(
"here"
);
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
).
resetForm
();
break
;
case
"Addcommonpayment"
:
Provider
.
of
<
Accountslistprovider
>(
context
,
listen:
false
,
).
resetValues
();
break
;
case
"Addpaymentreceiptlist"
:
Provider
.
of
<
Paymentreceiptsprovider
>(
context
,
listen:
false
,
).
resetForm
();
break
;
case
"Directpaymentrequesitionlist"
:
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
).
resetForm
();
break
;
}
Navigator
.
pop
(
context
);
Navigator
.
pop
(
context
);
},
},
leading:
SvgPicture
.
asset
(
leading:
SvgPicture
.
asset
(
...
...
lib/screens/finance/paymentDetailsPaymentRequisition.dart
View file @
c92f4c79
...
@@ -28,8 +28,6 @@ class Paymentdetailspaymentrequisition extends StatefulWidget {
...
@@ -28,8 +28,6 @@ class Paymentdetailspaymentrequisition extends StatefulWidget {
class
_PaymentdetailspaymentrequisitionState
class
_PaymentdetailspaymentrequisitionState
extends
State
<
Paymentdetailspaymentrequisition
>
{
extends
State
<
Paymentdetailspaymentrequisition
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
...
@@ -70,15 +68,26 @@ class _PaymentdetailspaymentrequisitionState
...
@@ -70,15 +68,26 @@ class _PaymentdetailspaymentrequisitionState
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
connection
==
"Online"
?
Consumer
<
Paymentrequisitionpaymentslistprovider
>(
return
(
connection
==
"Online"
)
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Paymentrequisitionpaymentslistprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
var
payment_det
=
provider
.
paymentDetails
;
var
payment_det
=
provider
.
paymentDetails
;
return
WillPopScope
(
return
Scaffold
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
widget
.
pageName
),
appBar:
appbar
(
context
,
widget
.
pageName
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
...
@@ -148,7 +157,7 @@ class _PaymentdetailspaymentrequisitionState
...
@@ -148,7 +157,7 @@ class _PaymentdetailspaymentrequisitionState
),
),
child:
Center
(
child:
Center
(
child:
Text
(
child:
Text
(
payment_det
.
refType
??
"-"
,
payment_det
.
refType
??
"-"
,
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontFamily:
"JakartaMedium"
,
...
@@ -163,7 +172,8 @@ class _PaymentdetailspaymentrequisitionState
...
@@ -163,7 +172,8 @@ class _PaymentdetailspaymentrequisitionState
),
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
provider
.
subHeadings
.
length
,
(
j
)
{
...
List
.
generate
(
provider
.
subHeadings
.
length
,
(
j
)
{
if
(
provider
.
Headings
[
j
]
==
"Attachment"
&&
payment_det
.
attachmentViewFileName
==
""
){
if
(
provider
.
Headings
[
j
]
==
"Attachment"
&&
payment_det
.
attachmentViewFileName
==
""
)
{
return
SizedBox
.
shrink
();
return
SizedBox
.
shrink
();
}
}
return
Container
(
return
Container
(
...
@@ -204,7 +214,9 @@ class _PaymentdetailspaymentrequisitionState
...
@@ -204,7 +214,9 @@ class _PaymentdetailspaymentrequisitionState
child:
Text
(
child:
Text
(
provider
.
Headings
[
j
]
==
"Attachment"
provider
.
Headings
[
j
]
==
"Attachment"
?
"View"
?
"View"
:
provider
.
subHeadings
[
j
]==
""
?
"-"
:
provider
.
subHeadings
[
j
]??
"-"
,
:
provider
.
subHeadings
[
j
]
==
""
?
"-"
:
provider
.
subHeadings
[
j
]
??
"-"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
fontSize:
14
,
color:
color:
...
@@ -232,15 +244,8 @@ class _PaymentdetailspaymentrequisitionState
...
@@ -232,15 +244,8 @@ class _PaymentdetailspaymentrequisitionState
),
),
),
),
),
),
),
),
onWillPop:
()
{
return
onBackPressed
(
context
);
},
);
);
},
},
):
NoNetwork
(
context
);
);
}
}
}
}
lib/screens/finance/paymentListPaymentRequisition.dart
View file @
c92f4c79
...
@@ -4,6 +4,7 @@ import 'package:connectivity_plus/connectivity_plus.dart';
...
@@ -4,6 +4,7 @@ import 'package:connectivity_plus/connectivity_plus.dart';
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
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/Utils/GlobalConstants.dart'
;
import
'package:generp/screens/finance/paymentDetailsPaymentRequisition.dart'
;
import
'package:generp/screens/finance/paymentDetailsPaymentRequisition.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Notifiers/financeProvider/paymentRequisitionPaymentsListProvider.dart'
;
import
'../../Notifiers/financeProvider/paymentRequisitionPaymentsListProvider.dart'
;
...
@@ -74,18 +75,25 @@ class _PaymentlistpaymentrequisitionState
...
@@ -74,18 +75,25 @@ class _PaymentlistpaymentrequisitionState
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
connection
==
"Online"
return
(
connection
==
"Online"
)
?
Consumer
<
Paymentrequisitionpaymentslistprovider
>(
?
Platform
.
isAndroid
builder:
(
context
,
provider
,
child
)
{
?
WillPopScope
(
final
requestLists
=
provider
.
paymentsList
;
onWillPop:
()
=>
onBackPressed
(
context
),
return
WillPopScope
(
onWillPop:
()
{
return
onBackPressed
(
context
);
},
child:
SafeArea
(
child:
SafeArea
(
top:
false
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
true
,
child:
Scaffold
(
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Paymentrequisitionpaymentslistprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
requestLists
=
provider
.
paymentsList
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
appBar:
appbar2
(
context
,
context
,
...
@@ -102,16 +110,12 @@ class _PaymentlistpaymentrequisitionState
...
@@ -102,16 +110,12 @@ class _PaymentlistpaymentrequisitionState
InkResponse
(
InkResponse
(
onTap:
()
async
{
onTap:
()
async
{
var
cf
=
Commondaterangefilter
();
var
cf
=
Commondaterangefilter
();
var
result
=
await
cf
.
showFilterBottomSheet
(
var
result
=
await
cf
.
showFilterBottomSheet
(
context
);
context
,
);
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
var
dateRange
=
var
dateRange
=
result
[
'dateRange'
]
as
DateTimeRange
?;
result
[
'dateRange'
]
as
DateTimeRange
?;
print
(
"dateRange:
$dateRange
"
);
print
(
"dateRange:
$dateRange
"
);
var
formatted
=
var
formatted
=
result
[
'formatted'
]
as
List
<
String
>;
result
[
'formatted'
]
as
List
<
String
>;
print
(
"formatted:
$formatted
"
);
print
(
"formatted:
$formatted
"
);
if
(
formatted
.
isNotEmpty
)
{
if
(
formatted
.
isNotEmpty
)
{
...
@@ -119,11 +123,7 @@ class _PaymentlistpaymentrequisitionState
...
@@ -119,11 +123,7 @@ class _PaymentlistpaymentrequisitionState
var
toDate
=
formatted
[
1
];
// To date
var
toDate
=
formatted
[
1
];
// To date
print
(
"from_date:
$fromDate
"
);
print
(
"from_date:
$fromDate
"
);
print
(
"to_date:
$toDate
"
);
print
(
"to_date:
$toDate
"
);
provider
.
paymentsListAPI
(
provider
.
paymentsListAPI
(
context
,
fromDate
,
toDate
);
context
,
fromDate
,
toDate
,
);
// You can now use fromDate and toDate as needed
// You can now use fromDate and toDate as needed
// For example, store them or pass to another function
// For example, store them or pass to another function
}
else
{
}
else
{
...
@@ -186,8 +186,9 @@ class _PaymentlistpaymentrequisitionState
...
@@ -186,8 +186,9 @@ class _PaymentlistpaymentrequisitionState
padding:
EdgeInsets
.
all
(
8.0
),
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFF3CE
),
color:
Color
(
0xFFFFF3CE
),
borderRadius:
borderRadius:
BorderRadius
.
circular
(
BorderRadius
.
circular
(
8
),
8
,
),
),
),
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
,
"assets/svg/fin_ic.svg"
,
...
@@ -206,22 +207,17 @@ class _PaymentlistpaymentrequisitionState
...
@@ -206,22 +207,17 @@ class _PaymentlistpaymentrequisitionState
requestLists
[
index
]
requestLists
[
index
]
.
receipientAccount
!,
.
receipientAccount
!,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
color:
AppColors
.
semi_black
,
AppColors
.
semi_black
,
),
),
),
),
Text
(
Text
(
"₹
${requestLists[index].amount}
"
,
"₹
${requestLists[index].amount}
"
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
color:
AppColors
.
app_blue
,
AppColors
.
app_blue
,
),
),
),
),
],
],
...
@@ -284,9 +280,7 @@ class _PaymentlistpaymentrequisitionState
...
@@ -284,9 +280,7 @@ class _PaymentlistpaymentrequisitionState
return
SizedBox
.
shrink
();
return
SizedBox
.
shrink
();
}
}
return
Container
(
return
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
vertical:
5
,
),
child:
Row
(
child:
Row
(
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
.
start
,
CrossAxisAlignment
.
start
,
...
@@ -295,11 +289,9 @@ class _PaymentlistpaymentrequisitionState
...
@@ -295,11 +289,9 @@ class _PaymentlistpaymentrequisitionState
child:
Text
(
child:
Text
(
headings
[
j
],
headings
[
j
],
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
color:
AppColors
.
semi_black
,
AppColors
.
semi_black
,
),
),
),
),
),
),
...
@@ -317,9 +309,11 @@ class _PaymentlistpaymentrequisitionState
...
@@ -317,9 +309,11 @@ class _PaymentlistpaymentrequisitionState
context
,
context
,
)
=>
Fileviewer
(
)
=>
Fileviewer
(
fileName:
fileName:
requestLists
[
index
].
attachmentViewFileName
!,
requestLists
[
index
]
.
attachmentViewFileName
!,
fileUrl:
fileUrl:
requestLists
[
index
].
attachmentDirFilePath
!,
requestLists
[
index
]
.
attachmentDirFilePath
!,
),
),
),
),
);
);
...
@@ -327,29 +321,22 @@ class _PaymentlistpaymentrequisitionState
...
@@ -327,29 +321,22 @@ class _PaymentlistpaymentrequisitionState
child:
Text
(
child:
Text
(
subHeadings
[
j
]
==
""
subHeadings
[
j
]
==
""
?
"-"
?
"-"
:
subHeadings
[
j
]
??
:
subHeadings
[
j
]
??
"-"
,
"-"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
fontSize:
14
,
color:
color:
j
==
1
j
==
1
?
AppColors
?
AppColors
.
app_blue
.
app_blue
:
Color
(
0xFF818181
),
:
Color
(
0xFF818181
,
),
decoration:
decoration:
j
==
1
j
==
1
?
TextDecoration
?
TextDecoration
.
underline
.
underline
:
TextDecoration
:
TextDecoration
.
none
,
.
none
,
decorationColor:
decorationColor:
j
==
1
j
==
1
?
AppColors
?
AppColors
.
app_blue
.
app_blue
:
AppColors
.
white
,
:
AppColors
.
white
,
),
),
),
),
),
),
...
@@ -364,29 +351,28 @@ class _PaymentlistpaymentrequisitionState
...
@@ -364,29 +351,28 @@ class _PaymentlistpaymentrequisitionState
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
(
context
)
=>
context
,
Paymentdetailspaymentrequisition
(
)
=>
Paymentdetailspaymentrequisition
(
pageName:
pageName:
widget
.
pageTitleName
,
widget
.
pageTitleName
,
paymentRequestId:
paymentRequestId:
requestLists
[
index
]
requestLists
[
index
].
id
,
.
id
,
),
settings:
RouteSettings
(
name:
"Paymentdetailspaymentrequisition"
,
),
),
),
),
);
);
if
(
res
==
true
)
{
if
(
routeSettingName
==
provider
.
paymentsListAPI
(
"Paymentdetailspaymentrequisition"
)
{
context
,
print
(
"pld"
);
''
,
''
,
provider
.
paymentsListAPI
(
context
,
''
,
''
);
);
}
}
},
},
child:
Container
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
vertical:
5
,
),
child:
Row
(
child:
Row
(
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
.
center
,
CrossAxisAlignment
.
center
,
...
@@ -417,12 +403,9 @@ class _PaymentlistpaymentrequisitionState
...
@@ -417,12 +403,9 @@ class _PaymentlistpaymentrequisitionState
),
),
)
)
:
Emptywidget
(
context
),
:
Emptywidget
(
context
),
),
),
);
);
},
},
)
);
:
NoNetwork
(
context
);
}
}
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
...
...
lib/screens/finance/paymentReceiptDetails.dart
View file @
c92f4c79
...
@@ -21,17 +21,13 @@ class Paymentreceiptdetails extends StatefulWidget {
...
@@ -21,17 +21,13 @@ class Paymentreceiptdetails extends StatefulWidget {
});
});
@override
@override
State
<
Paymentreceiptdetails
>
createState
()
=>
State
<
Paymentreceiptdetails
>
createState
()
=>
_PaymentreceiptdetailsState
();
_PaymentreceiptdetailsState
();
}
}
class
_PaymentreceiptdetailsState
class
_PaymentreceiptdetailsState
extends
State
<
Paymentreceiptdetails
>
{
extends
State
<
Paymentreceiptdetails
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
@override
void
initState
()
{
void
initState
()
{
// TODO: implement initState
// TODO: implement initState
...
@@ -48,6 +44,7 @@ class _PaymentreceiptdetailsState
...
@@ -48,6 +44,7 @@ class _PaymentreceiptdetailsState
provider
.
paymentsListDetailsAPI
(
context
,
widget
.
paymentRequestId
);
provider
.
paymentsListDetailsAPI
(
context
,
widget
.
paymentRequestId
);
});
});
}
}
@override
@override
void
dispose
()
{
void
dispose
()
{
// TODO: implement dispose
// TODO: implement dispose
...
@@ -68,18 +65,29 @@ class _PaymentreceiptdetailsState
...
@@ -68,18 +65,29 @@ class _PaymentreceiptdetailsState
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
connection
==
"Online"
?
return
(
connection
==
"Online"
)
Consumer
<
Paymentreceiptsprovider
>(
?
Platform
.
isAndroid
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Paymentreceiptsprovider
>(
builder:
(
context
,
provider
,
child
)
{
builder:
(
context
,
provider
,
child
)
{
var
payment_det
=
provider
.
receiptDetails
;
var
payment_det
=
provider
.
receiptDetails
;
return
WillPopScope
(
return
Scaffold
(
child:
SafeArea
(
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
appBar:
appbar
(
context
,
widget
.
pageName
),
//widget.pageName
appBar:
appbar
(
context
,
"Payment Receipt Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
body:
Container
(
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
...
@@ -134,13 +142,12 @@ class _PaymentreceiptdetailsState
...
@@ -134,13 +142,12 @@ class _PaymentreceiptdetailsState
),
),
),
),
),
),
],
],
),
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
provider
.
subHeadings
.
length
,
(
j
)
{
...
List
.
generate
(
provider
.
subHeadings
.
length
,
(
j
)
{
if
(
provider
.
Headings
[
j
]
==
if
(
provider
.
Headings
[
j
]
==
"Attachment"
&&
"Attachment"
&&
payment_det
.
attachmentViewFileName
==
""
){
payment_det
.
attachmentViewFileName
==
""
)
{
return
SizedBox
.
shrink
();
return
SizedBox
.
shrink
();
}
}
return
Container
(
return
Container
(
...
@@ -181,7 +188,9 @@ class _PaymentreceiptdetailsState
...
@@ -181,7 +188,9 @@ class _PaymentreceiptdetailsState
child:
Text
(
child:
Text
(
provider
.
Headings
[
j
]
==
"Attachment"
provider
.
Headings
[
j
]
==
"Attachment"
?
"View"
?
"View"
:
provider
.
subHeadings
[
j
]==
""
?
"-"
:
provider
.
subHeadings
[
j
]??
"-"
,
:
provider
.
subHeadings
[
j
]
==
""
?
"-"
:
provider
.
subHeadings
[
j
]
??
"-"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
fontSize:
14
,
color:
color:
...
@@ -209,15 +218,8 @@ class _PaymentreceiptdetailsState
...
@@ -209,15 +218,8 @@ class _PaymentreceiptdetailsState
),
),
),
),
),
),
),
),
onWillPop:
()
{
return
onBackPressed
(
context
);
},
);
);
},
},
):
NoNetwork
(
context
);
);
}
}
}
}
lib/screens/finance/paymentreceiptList.dart
View file @
c92f4c79
...
@@ -4,6 +4,7 @@ import 'package:connectivity_plus/connectivity_plus.dart';
...
@@ -4,6 +4,7 @@ import 'package:connectivity_plus/connectivity_plus.dart';
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/cupertino.dart'
;
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/Utils/GlobalConstants.dart'
;
import
'package:generp/screens/finance/paymentReceiptDetails.dart'
;
import
'package:generp/screens/finance/paymentReceiptDetails.dart'
;
import
'package:provider/provider.dart'
;
import
'package:provider/provider.dart'
;
...
@@ -58,18 +59,25 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -58,18 +59,25 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
connection
==
"Online"
return
(
connection
==
"Online"
)
?
Consumer
<
Paymentreceiptsprovider
>(
?
Platform
.
isAndroid
builder:
(
context
,
provider
,
child
)
{
?
WillPopScope
(
final
requestLists
=
provider
.
receiptsList
;
onWillPop:
()
=>
onBackPressed
(
context
),
return
WillPopScope
(
onWillPop:
()
{
return
onBackPressed
(
context
);
},
child:
SafeArea
(
child:
SafeArea
(
top:
false
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
true
,
child:
Scaffold
(
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Paymentreceiptsprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
requestLists
=
provider
.
receiptsList
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
appBar:
appbar2
(
context
,
context
,
...
@@ -86,16 +94,12 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -86,16 +94,12 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
InkResponse
(
InkResponse
(
onTap:
()
async
{
onTap:
()
async
{
var
cf
=
Commondaterangefilter
();
var
cf
=
Commondaterangefilter
();
var
result
=
await
cf
.
showFilterBottomSheet
(
var
result
=
await
cf
.
showFilterBottomSheet
(
context
);
context
,
);
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
var
dateRange
=
var
dateRange
=
result
[
'dateRange'
]
as
DateTimeRange
?;
result
[
'dateRange'
]
as
DateTimeRange
?;
print
(
"dateRange:
$dateRange
"
);
print
(
"dateRange:
$dateRange
"
);
var
formatted
=
var
formatted
=
result
[
'formatted'
]
as
List
<
String
>;
result
[
'formatted'
]
as
List
<
String
>;
print
(
"formatted:
$formatted
"
);
print
(
"formatted:
$formatted
"
);
if
(
formatted
.
isNotEmpty
)
{
if
(
formatted
.
isNotEmpty
)
{
...
@@ -103,11 +107,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -103,11 +107,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
var
toDate
=
formatted
[
1
];
// To date
var
toDate
=
formatted
[
1
];
// To date
print
(
"from_date:
$fromDate
"
);
print
(
"from_date:
$fromDate
"
);
print
(
"to_date:
$toDate
"
);
print
(
"to_date:
$toDate
"
);
provider
.
paymentsListAPI
(
provider
.
paymentsListAPI
(
context
,
fromDate
,
toDate
);
context
,
fromDate
,
toDate
,
);
// You can now use fromDate and toDate as needed
// You can now use fromDate and toDate as needed
// For example, store them or pass to another function
// For example, store them or pass to another function
}
else
{
}
else
{
...
@@ -168,8 +168,9 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -168,8 +168,9 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
padding:
EdgeInsets
.
all
(
8.0
),
padding:
EdgeInsets
.
all
(
8.0
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFF3CE
),
color:
Color
(
0xFFFFF3CE
),
borderRadius:
borderRadius:
BorderRadius
.
circular
(
BorderRadius
.
circular
(
8
),
8
,
),
),
),
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
,
"assets/svg/fin_ic.svg"
,
...
@@ -188,22 +189,17 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -188,22 +189,17 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
requestLists
[
index
]
requestLists
[
index
]
.
receipientAccount
!,
.
receipientAccount
!,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
color:
AppColors
.
semi_black
,
AppColors
.
semi_black
,
),
),
),
),
Text
(
Text
(
"₹
${requestLists[index].amount}
"
,
"₹
${requestLists[index].amount}
"
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
color:
AppColors
.
app_blue
,
AppColors
.
app_blue
,
),
),
),
),
],
],
...
@@ -227,8 +223,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -227,8 +223,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
];
];
final
subHeadings
=
[
final
subHeadings
=
[
requestLists
[
index
]
requestLists
[
index
].
receipientAccount
,
.
receipientAccount
,
"View"
,
"View"
,
requestLists
[
index
].
requestMode
,
requestLists
[
index
].
requestMode
,
...
@@ -243,9 +238,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -243,9 +238,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
return
SizedBox
.
shrink
();
return
SizedBox
.
shrink
();
}
}
return
Container
(
return
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
vertical:
5
,
),
child:
Row
(
child:
Row
(
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
.
start
,
CrossAxisAlignment
.
start
,
...
@@ -254,11 +247,9 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -254,11 +247,9 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
child:
Text
(
child:
Text
(
headings
[
j
],
headings
[
j
],
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
color:
AppColors
.
semi_black
,
AppColors
.
semi_black
,
),
),
),
),
),
),
...
@@ -276,9 +267,11 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -276,9 +267,11 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
context
,
context
,
)
=>
Fileviewer
(
)
=>
Fileviewer
(
fileName:
fileName:
requestLists
[
index
].
attachmentViewFileName
!,
requestLists
[
index
]
.
attachmentViewFileName
!,
fileUrl:
fileUrl:
requestLists
[
index
].
attachmentDirFilePath
!,
requestLists
[
index
]
.
attachmentDirFilePath
!,
),
),
),
),
);
);
...
@@ -286,29 +279,22 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -286,29 +279,22 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
child:
Text
(
child:
Text
(
subHeadings
[
j
]
==
""
subHeadings
[
j
]
==
""
?
"-"
?
"-"
:
subHeadings
[
j
]
??
:
subHeadings
[
j
]
??
"-"
,
"-"
,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
fontSize:
14
,
color:
color:
j
==
1
j
==
1
?
AppColors
?
AppColors
.
app_blue
.
app_blue
:
Color
(
0xFF818181
),
:
Color
(
0xFF818181
,
),
decoration:
decoration:
j
==
1
j
==
1
?
TextDecoration
?
TextDecoration
.
underline
.
underline
:
TextDecoration
:
TextDecoration
.
none
,
.
none
,
decorationColor:
decorationColor:
j
==
1
j
==
1
?
AppColors
?
AppColors
.
app_blue
.
app_blue
:
AppColors
.
white
,
:
AppColors
.
white
,
),
),
),
),
),
),
...
@@ -323,29 +309,27 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -323,29 +309,27 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
(
context
)
=>
Paymentreceiptdetails
(
context
,
pageName:
widget
.
pageTitleName
,
)
=>
Paymentreceiptdetails
(
pageName:
widget
.
pageTitleName
,
paymentRequestId:
paymentRequestId:
requestLists
[
index
]
requestLists
[
index
].
id
,
.
id
,
),
settings:
RouteSettings
(
name:
"Paymentreceiptdetails"
,
),
),
),
),
);
);
if
(
res
==
true
)
{
if
(
routeSettingName
==
provider
.
paymentsListAPI
(
"Paymentreceiptdetails"
)
{
context
,
debugPrint
(
"prd"
);
''
,
provider
.
paymentsListAPI
(
context
,
''
,
''
);
''
,
);
}
}
// if (res == true) {
// provider.paymentsListAPI(context, '', '');
// }
},
},
child:
Container
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
vertical:
5
,
),
child:
Row
(
child:
Row
(
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
.
center
,
CrossAxisAlignment
.
center
,
...
@@ -376,12 +360,9 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
...
@@ -376,12 +360,9 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
),
),
)
)
:
Emptywidget
(
context
),
:
Emptywidget
(
context
),
),
),
);
);
},
},
)
);
:
NoNetwork
(
context
);
}
}
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
...
...
lib/screens/finance/submitPaymentRequestionListsByMode.dart
View file @
c92f4c79
...
@@ -34,7 +34,8 @@ class Submitpaymentrequestionlistsbymode extends StatefulWidget {
...
@@ -34,7 +34,8 @@ class Submitpaymentrequestionlistsbymode extends StatefulWidget {
}
}
class
_SubmitpaymentrequestionlistsbymodeState
class
_SubmitpaymentrequestionlistsbymodeState
extends
State
<
Submitpaymentrequestionlistsbymode
>
{
extends
State
<
Submitpaymentrequestionlistsbymode
>
with
RouteAware
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
...
@@ -83,11 +84,31 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -83,11 +84,31 @@ class _SubmitpaymentrequestionlistsbymodeState
});
});
}
}
@override
void
didChangeDependencies
()
{
super
.
didChangeDependencies
();
// Subscribe to route changes
}
@override
void
didPop
()
{
// Called when the route is popped (including by swipe gesture)
if
(
mounted
)
{
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
);
provider
.
resetForm
();
}
super
.
didPop
();
}
@override
@override
void
dispose
()
{
void
dispose
()
{
scrollcontroller
.
dispose
();
scrollcontroller
.
dispose
();
focusNodes
.
map
((
e
)
=>
e
.
dispose
());
focusNodes
.
map
((
e
)
=>
e
.
dispose
());
_connectivity
.
disposeStream
();
_connectivity
.
disposeStream
();
super
.
dispose
();
super
.
dispose
();
}
}
...
@@ -123,14 +144,36 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -123,14 +144,36 @@ class _SubmitpaymentrequestionlistsbymodeState
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
connection
==
"Online"
return
(
connection
==
"Online"
)
?
Consumer
<
Requestionlistprovider
>(
?
Platform
.
isAndroid
builder:
(
context
,
provider
,
child
)
{
?
WillPopScope
(
return
WillPopScope
(
onWillPop:
()
{
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
).
resetForm
();
return
onBackPressed
(
context
);
},
child:
SafeArea
(
child:
SafeArea
(
top:
false
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
true
,
child:
Scaffold
(
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
@override
void
deactivate
()
{
// TODO: implement deactivate
super
.
deactivate
();
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Requestionlistprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
white
,
backgroundColor:
AppColors
.
white
,
appBar:
appbar2
(
appBar:
appbar2
(
...
@@ -166,16 +209,12 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -166,16 +209,12 @@ class _SubmitpaymentrequestionlistsbymodeState
items:
items:
provider
.
accounts
provider
.
accounts
.
map
(
.
map
(
(
accs
)
=>
(
accs
)
=>
DropdownMenuItem
<
Accounts
>(
DropdownMenuItem
<
Accounts
>(
value:
accs
,
value:
accs
,
child:
Text
(
child:
Text
(
"
${accs.name}
"
,
"
${accs.name}
"
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
),
fontSize:
14
,
overflow:
TextOverflow
.
ellipsis
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
),
),
)
)
...
@@ -187,20 +226,15 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -187,20 +226,15 @@ class _SubmitpaymentrequestionlistsbymodeState
?
null
?
null
:
(
Accounts
?
value
)
{
:
(
Accounts
?
value
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
if
(
provider
if
(
provider
.
accounts
.
isNotEmpty
)
{
.
accounts
provider
.
selectedAccount
=
value
;
.
isNotEmpty
)
{
provider
.
selectedAccount
=
value
;
print
(
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
);
provider
.
accountId
=
provider
.
accountId
=
value
.
id
!;
value
.
id
!;
print
(
print
(
"hfjkshfg"
+
"hfjkshfg"
+
provider
.
accountId
provider
.
accountId
.
toString
(),
.
toString
(),
);
);
provider
provider
.
paymentRequestionBankDetailsAPIFunction
(
.
paymentRequestionBankDetailsAPIFunction
(
...
@@ -217,27 +251,22 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -217,27 +251,22 @@ class _SubmitpaymentrequestionlistsbymodeState
searchInnerWidget:
Padding
(
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
child:
TextFormField
(
controller:
controller:
provider
.
accountSearchController
,
provider
.
accountSearchController
,
decoration:
InputDecoration
(
decoration:
InputDecoration
(
isDense:
true
,
isDense:
true
,
contentPadding:
contentPadding:
const
EdgeInsets
.
symmetric
(
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
horizontal:
10
,
vertical:
8
,
vertical:
8
,
),
),
hintText:
'Search account...'
,
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
border:
OutlineInputBorder
(
borderRadius:
borderRadius:
BorderRadius
.
circular
(
8
),
BorderRadius
.
circular
(
8
),
),
),
),
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
return
item
.
value
?.
name
?.
toLowerCase
().
contains
(
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
(),
searchValue
.
toLowerCase
(),
)
??
)
??
false
;
false
;
...
@@ -247,16 +276,13 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -247,16 +276,13 @@ class _SubmitpaymentrequestionlistsbymodeState
),
),
onMenuStateChange:
(
isOpen
)
{
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
if
(!
isOpen
)
{
provider
.
accountSearchController
provider
.
accountSearchController
.
clear
();
.
clear
();
}
}
},
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
),
),
if
(
widget
.
mode
==
"other"
)
...[
if
(
widget
.
mode
==
"other"
)
...[
...
@@ -282,13 +308,10 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -282,13 +308,10 @@ class _SubmitpaymentrequestionlistsbymodeState
);
);
if
(
res
!=
null
)
{
if
(
res
!=
null
)
{
print
(
"true"
);
print
(
"true"
);
Future
.
delayed
(
Future
.
delayed
(
Durations
.
long4
,
()
async
{
Durations
.
long4
,
()
async
{
print
(
"Long411"
);
print
(
"Long411"
);
autofill
(
res
);
autofill
(
res
);
},
});
);
}
}
}
}
},
},
...
@@ -297,9 +320,7 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -297,9 +320,7 @@ class _SubmitpaymentrequestionlistsbymodeState
padding:
EdgeInsets
.
all
(
8
),
padding:
EdgeInsets
.
all
(
8
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
borderRadius:
BorderRadius
.
circular
(
8
),
8
,
),
),
),
child:
SvgPicture
.
asset
(
child:
SvgPicture
.
asset
(
"assets/svg/add_account.svg"
,
"assets/svg/add_account.svg"
,
...
@@ -330,17 +351,14 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -330,17 +351,14 @@ class _SubmitpaymentrequestionlistsbymodeState
items:
items:
provider
.
requestingPurposes
provider
.
requestingPurposes
.
map
(
.
map
(
(
accs
)
=>
(
accs
)
=>
DropdownMenuItem
<
String
>(
DropdownMenuItem
<
String
>(
value:
accs
,
value:
accs
,
child:
Text
(
child:
Text
(
accs
??
''
,
accs
??
''
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
fontSize:
14
,
),
),
overflow:
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
),
),
),
),
)
)
...
@@ -350,23 +368,18 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -350,23 +368,18 @@ class _SubmitpaymentrequestionlistsbymodeState
onChanged:
(
String
?
value
)
{
onChanged:
(
String
?
value
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
provider
.
selectReqPurpose
=
value
;
provider
.
selectReqPurpose
=
value
;
print
(
print
(
"Selected Complaint Type:
${value}
,"
);
"Selected Complaint Type:
${value}
,"
,
);
print
(
print
(
"hfjkshfg"
+
"hfjkshfg"
+
provider
.
selectReqPurpose
provider
.
selectReqPurpose
.
toString
(),
.
toString
(),
);
);
}
}
},
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
),
),
],
],
...
@@ -434,17 +447,15 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -434,17 +447,15 @@ class _SubmitpaymentrequestionlistsbymodeState
items:
items:
provider
.
paymentModes
provider
.
paymentModes
.
map
(
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
(
paymenents
)
=>
PaymentModes
DropdownMenuItem
<
PaymentModes
>(
>(
value:
paymenents
,
value:
paymenents
,
child:
Text
(
child:
Text
(
paymenents
.
name
??
''
,
paymenents
.
name
??
''
,
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
fontSize:
14
,
),
),
overflow:
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
),
),
),
),
)
)
...
@@ -458,21 +469,17 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -458,21 +469,17 @@ class _SubmitpaymentrequestionlistsbymodeState
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
);
provider
.
paymentModeId
=
value
.
id
!;
provider
.
paymentModeId
=
value
.
id
!;
provider
.
paymentModeValue
=
provider
.
paymentModeValue
=
value
.
name
!;
value
.
name
!;
print
(
print
(
"hfjkshfg"
+
"hfjkshfg"
+
provider
.
paymentModeId
provider
.
paymentModeId
.
toString
(),
.
toString
(),
);
);
if
([
if
([
"Cheque"
,
"Cheque"
,
"RTGS"
,
"RTGS"
,
"IMPS"
,
"IMPS"
,
"NEFT"
,
"NEFT"
,
].
contains
(
].
contains
(
provider
.
paymentModeValue
))
{
provider
.
paymentModeValue
,
))
{
WidgetsBinding
.
instance
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
.
addPostFrameCallback
((
_
)
{
final
context
=
final
context
=
...
@@ -493,10 +500,8 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -493,10 +500,8 @@ class _SubmitpaymentrequestionlistsbymodeState
},
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
),
),
],
],
...
@@ -528,9 +533,7 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -528,9 +533,7 @@ class _SubmitpaymentrequestionlistsbymodeState
style:
const
TextStyle
(
style:
const
TextStyle
(
fontSize:
14
,
fontSize:
14
,
),
),
overflow:
overflow:
TextOverflow
.
ellipsis
,
TextOverflow
.
ellipsis
,
),
),
),
),
)
)
...
@@ -538,11 +541,8 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -538,11 +541,8 @@ class _SubmitpaymentrequestionlistsbymodeState
value:
provider
.
selectedApprovalEmployee
,
value:
provider
.
selectedApprovalEmployee
,
onChanged:
(
Employees
?
value
)
{
onChanged:
(
Employees
?
value
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
if
(
provider
if
(
provider
.
approvalEmployee
.
isNotEmpty
)
{
.
approvalEmployee
provider
.
selectedApprovalEmployee
=
value
;
.
isNotEmpty
)
{
provider
.
selectedApprovalEmployee
=
value
;
print
(
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
);
...
@@ -552,18 +552,15 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -552,18 +552,15 @@ class _SubmitpaymentrequestionlistsbymodeState
value
.
name
!;
value
.
name
!;
print
(
print
(
"hfjkshfg"
+
"hfjkshfg"
+
provider
.
paymentModeId
provider
.
paymentModeId
.
toString
(),
.
toString
(),
);
);
}
}
}
}
},
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
),
),
],
],
...
@@ -602,12 +599,9 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -602,12 +599,9 @@ class _SubmitpaymentrequestionlistsbymodeState
if
(
provider
.
imagePicked
==
1
&&
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
provider
.
imagePath
!=
null
)
...[
Padding
(
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
vertical:
4.0
,
),
child:
Row
(
child:
Row
(
mainAxisAlignment:
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
MainAxisAlignment
.
spaceBetween
,
children:
[
children:
[
Expanded
(
Expanded
(
flex:
4
,
flex:
4
,
...
@@ -767,14 +761,8 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -767,14 +761,8 @@ class _SubmitpaymentrequestionlistsbymodeState
child:
Container
(
child:
Container
(
height:
45
,
height:
45
,
alignment:
Alignment
.
center
,
alignment:
Alignment
.
center
,
margin:
EdgeInsets
.
symmetric
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
horizontal:
10
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
vertical:
10
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
borderRadius:
BorderRadius
.
circular
(
15
),
...
@@ -782,9 +770,7 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -782,9 +770,7 @@ class _SubmitpaymentrequestionlistsbymodeState
child:
child:
provider
.
submitClicked
provider
.
submitClicked
?
CircularProgressIndicator
.
adaptive
(
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
),
AppColors
.
white
,
),
)
)
:
Text
(
:
Text
(
"Submit"
,
"Submit"
,
...
@@ -796,16 +782,9 @@ class _SubmitpaymentrequestionlistsbymodeState
...
@@ -796,16 +782,9 @@ class _SubmitpaymentrequestionlistsbymodeState
),
),
),
),
),
),
),
),
onWillPop:
()
{
provider
.
resetForm
();
return
onBackPressed
(
context
);
},
);
);
},
},
)
);
:
NoNetwork
(
context
);
}
}
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
...
...
lib/screens/order/orderModuleDashboard.dart
View file @
c92f4c79
...
@@ -20,18 +20,15 @@ class Ordermoduledashboard extends StatefulWidget {
...
@@ -20,18 +20,15 @@ class Ordermoduledashboard extends StatefulWidget {
}
}
class
_OrdermoduledashboardState
extends
State
<
Ordermoduledashboard
>
{
class
_OrdermoduledashboardState
extends
State
<
Ordermoduledashboard
>
{
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
Map
_source
=
{
ConnectivityResult
.
mobile
:
true
};
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
final
MyConnectivity
_connectivity
=
MyConnectivity
.
instance
;
@override
@override
void
initState
()
{
void
initState
()
{
// TODO: implement initState
// TODO: implement initState
super
.
initState
();
super
.
initState
();
_connectivity
.
initialise
();
_connectivity
.
initialise
();
_connectivity
.
myStream
.
listen
((
source
)
{
_connectivity
.
myStream
.
listen
((
source
)
{
setState
(()
=>
_source
=
source
);
setState
(()
=>
_source
=
source
);
});
});
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
...
@@ -43,12 +40,14 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
...
@@ -43,12 +40,14 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
provider
.
ordersAccessiblePagesAPIFunction
(
context
);
provider
.
ordersAccessiblePagesAPIFunction
(
context
);
});
});
}
}
@override
@override
void
dispose
()
{
void
dispose
()
{
// TODO: implement dispose
// TODO: implement dispose
super
.
dispose
();
super
.
dispose
();
_connectivity
.
disposeStream
();
_connectivity
.
disposeStream
();
}
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
switch
(
_source
.
keys
.
toList
()[
0
])
{
...
@@ -62,12 +61,18 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
...
@@ -62,12 +61,18 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
(
connection
==
'Online'
)?
Platform
.
isAndroid
return
(
connection
==
'Online'
)
?
Platform
.
isAndroid
?
WillPopScope
(
?
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
onWillPop:
()
=>
onBackPressed
(
context
),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
)),
child:
SafeArea
(
top:
false
,
bottom:
true
,
child:
_scaffold
(
context
),
),
)
)
:
_scaffold
(
context
):
NoNetwork
(
context
);
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
}
Widget
_scaffold
(
BuildContext
context
)
{
Widget
_scaffold
(
BuildContext
context
)
{
...
@@ -82,8 +87,12 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
...
@@ -82,8 +87,12 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
child:
SingleChildScrollView
(
child:
SingleChildScrollView
(
child:
Column
(
child:
Column
(
children:
[
children:
[
if
(
provider
.
ordersgain
.
length
>
0
)
...[
Container
(
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
10
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
...
@@ -91,7 +100,10 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
...
@@ -91,7 +100,10 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
),
),
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.28
,
height:
MediaQuery
.
of
(
context
).
size
.
height
*
0.28
,
child:
GridView
.
builder
(
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
,
),
itemCount:
provider
.
ordersgain
.
length
,
itemCount:
provider
.
ordersgain
.
length
,
shrinkWrap:
true
,
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
scrollDirection:
Axis
.
horizontal
,
...
@@ -176,7 +188,7 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
...
@@ -176,7 +188,7 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
},
},
),
),
),
),
],
ListView
.
builder
(
ListView
.
builder
(
itemCount:
pages
.
length
,
itemCount:
pages
.
length
,
shrinkWrap:
true
,
shrinkWrap:
true
,
...
...
lib/screens/order/ordersListByModes.dart
View file @
c92f4c79
...
@@ -73,19 +73,28 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -73,19 +73,28 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
default
:
default
:
connection
=
'Offline'
;
connection
=
'Offline'
;
}
}
return
connection
==
"Online"
return
(
connection
==
"Online"
)
?
Consumer
<
Pagesdashboardprovider
>(
?
Platform
.
isAndroid
builder:
(
context
,
provider
,
child
)
{
?
WillPopScope
(
final
ordersList
=
provider
.
ordersList
;
return
WillPopScope
(
onWillPop:
()
{
onWillPop:
()
{
provider
.
resetAll
();
Provider
.
of
<
Pagesdashboardprovider
>(
context
)
.
resetAll
();
return
onBackPressed
(
context
);
return
onBackPressed
(
context
);
},
},
child:
SafeArea
(
child:
SafeArea
(
top:
false
,
top:
false
,
bottom:
Platform
.
isIOS
?
false
:
true
,
bottom:
true
,
child:
Scaffold
(
child:
_scaffold
(
context
),
),
)
:
_scaffold
(
context
)
:
NoNetwork
(
context
);
}
Widget
_scaffold
(
BuildContext
context
)
{
return
Consumer
<
Pagesdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
ordersList
=
provider
.
ordersList
;
return
Scaffold
(
resizeToAvoidBottomInset:
true
,
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
appBar:
appbar2
(
context
,
context
,
...
@@ -132,13 +141,10 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -132,13 +141,10 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
itemBuilder:
(
context
,
index
)
{
itemBuilder:
(
context
,
index
)
{
if
(
ordersList
.
isEmpty
)
{
if
(
ordersList
.
isEmpty
)
{
return
SizedBox
(
return
SizedBox
(
child:
Center
(
child:
Center
(
child:
Text
(
"No Data Available"
)),
child:
Text
(
"No Data Available"
),
),
);
);
}
}
if
(
ordersList
[
index
].
orderNumber
==
"GP20252605448"
)
return
Container
(
return
Container
(
padding:
EdgeInsets
.
symmetric
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
horizontal:
10
,
...
@@ -150,9 +156,7 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -150,9 +156,7 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
),
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
borderRadius:
BorderRadius
.
circular
(
16
),
16
,
),
),
),
child:
Column
(
child:
Column
(
children:
[
children:
[
...
@@ -163,13 +167,10 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -163,13 +167,10 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
child:
Container
(
child:
Container
(
height:
50
,
height:
50
,
width:
35
,
width:
35
,
padding:
EdgeInsets
.
all
(
padding:
EdgeInsets
.
all
(
8.0
),
8.0
,
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFF3CE
),
color:
Color
(
0xFFFFF3CE
),
borderRadius:
borderRadius:
BorderRadius
.
circular
(
BorderRadius
.
circular
(
8
,
8
,
),
),
),
),
...
@@ -184,31 +185,23 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -184,31 +185,23 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
child:
SizedBox
(
child:
SizedBox
(
child:
Column
(
child:
Column
(
crossAxisAlignment:
crossAxisAlignment:
CrossAxisAlignment
CrossAxisAlignment
.
start
,
.
start
,
children:
[
children:
[
Text
(
Text
(
ordersList
[
index
]
ordersList
[
index
].
accountName
!,
.
accountName
!,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
color:
AppColors
.
semi_black
,
AppColors
.
semi_black
,
),
),
),
),
Text
(
Text
(
"₹"
"₹"
"
${ordersList[index].balanceAmount}
"
,
"
${ordersList[index].balanceAmount}
"
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
color:
AppColors
.
app_blue
,
AppColors
.
app_blue
,
),
),
),
),
],
],
...
@@ -218,31 +211,24 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -218,31 +211,24 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
Expanded
(
Expanded
(
flex:
2
,
flex:
2
,
child:
Container
(
child:
Container
(
padding:
padding:
EdgeInsets
.
symmetric
(
EdgeInsets
.
symmetric
(
horizontal:
5
,
horizontal:
5
,
vertical:
10
,
vertical:
10
,
),
),
decoration:
BoxDecoration
(
decoration:
BoxDecoration
(
borderRadius:
borderRadius:
BorderRadius
.
circular
(
BorderRadius
.
circular
(
8
,
8
,
),
),
color:
Color
(
0xFFE3FFE0
),
color:
Color
(
0xFFE3FFE0
),
),
),
child:
Center
(
child:
Center
(
child:
Text
(
child:
Text
(
ordersList
[
index
]
ordersList
[
index
].
status
!,
.
status
!,
textAlign:
TextAlign
.
center
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
Color
(
color:
Color
(
0xFF0D9C00
),
0xFF0D9C00
,
),
),
),
),
),
),
),
...
@@ -266,10 +252,8 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -266,10 +252,8 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
final
subHeadings
=
[
final
subHeadings
=
[
ordersList
[
index
].
orderNumber
,
ordersList
[
index
].
orderNumber
,
ordersList
[
index
]
ordersList
[
index
].
enteredEmpName
,
.
enteredEmpName
,
ordersList
[
index
].
salesPersonEmpName
,
ordersList
[
index
]
.
salesPersonEmpName
,
// ordersList[index].createdDatetime,
// ordersList[index].createdDatetime,
ordersList
[
index
].
paidAmount
,
ordersList
[
index
].
paidAmount
,
ordersList
[
index
].
balanceAmount
,
ordersList
[
index
].
balanceAmount
,
...
@@ -286,12 +270,9 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -286,12 +270,9 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
child:
Text
(
child:
Text
(
headings
[
j
],
headings
[
j
],
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
color:
AppColors
.
semi_black
,
AppColors
.
semi_black
,
),
),
),
),
),
),
...
@@ -301,12 +282,9 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -301,12 +282,9 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
subHeadings
[
j
]!,
subHeadings
[
j
]!,
style:
TextStyle
(
style:
TextStyle
(
fontSize:
14
,
fontSize:
14
,
color:
Color
(
color:
Color
(
0xFF818181
),
0xFF818181
,
),
decoration:
decoration:
TextDecoration
TextDecoration
.
none
,
.
none
,
decorationColor:
decorationColor:
AppColors
.
white
,
AppColors
.
white
,
),
),
...
@@ -323,15 +301,11 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -323,15 +301,11 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
context
,
context
,
MaterialPageRoute
(
MaterialPageRoute
(
builder:
builder:
(
(
context
)
=>
Ordersdetailsbymodes
(
context
,
)
=>
Ordersdetailsbymodes
(
pageTitleName:
pageTitleName:
widget
widget
.
pageTitleName
,
.
pageTitleName
,
orderId:
orderId:
ordersList
[
index
]
ordersList
[
index
].
orderId
,
.
orderId
,
mode:
widget
.
mode
,
mode:
widget
.
mode
,
),
),
),
),
...
@@ -342,8 +316,7 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -342,8 +316,7 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
context
,
context
,
widget
.
mode
,
widget
.
mode
,
);
);
provider
provider
.
ordersListByModeAPIFunction
(
.
ordersListByModeAPIFunction
(
context
,
context
,
widget
.
mode
,
widget
.
mode
,
""
,
""
,
...
@@ -364,11 +337,9 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -364,11 +337,9 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
Text
(
Text
(
"View Details"
,
"View Details"
,
style:
TextStyle
(
style:
TextStyle
(
fontFamily:
fontFamily:
"JakartaMedium"
,
"JakartaMedium"
,
fontSize:
14
,
fontSize:
14
,
color:
color:
AppColors
.
app_blue
,
AppColors
.
app_blue
,
),
),
),
),
SizedBox
(
width:
5
),
SizedBox
(
width:
5
),
...
@@ -388,12 +359,9 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
...
@@ -388,12 +359,9 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
),
),
)
)
:
Emptywidget
(
context
),
:
Emptywidget
(
context
),
),
),
);
);
},
},
)
);
:
NoNetwork
(
context
);
}
}
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
)
{
...
...
pubspec.lock
View file @
c92f4c79
...
@@ -45,10 +45,10 @@ packages:
...
@@ -45,10 +45,10 @@ packages:
dependency: transitive
dependency: transitive
description:
description:
name: async
name: async
sha256:
d2872f9c1
97
3
1c
2
e5
f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
sha256:
"758e6d74e
971c
3
e5
aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
url: "https://pub.dev"
url: "https://pub.dev"
source: hosted
source: hosted
version: "2.1
2
.0"
version: "2.1
3
.0"
auto_size_text:
auto_size_text:
dependency: "direct main"
dependency: "direct main"
description:
description:
...
@@ -301,10 +301,10 @@ packages:
...
@@ -301,10 +301,10 @@ packages:
dependency: transitive
dependency: transitive
description:
description:
name: fake_async
name: fake_async
sha256: "
6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc
"
sha256: "
5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44
"
url: "https://pub.dev"
url: "https://pub.dev"
source: hosted
source: hosted
version: "1.3.
2
"
version: "1.3.
3
"
ffi:
ffi:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -948,26 +948,26 @@ packages:
...
@@ -948,26 +948,26 @@ packages:
dependency: transitive
dependency: transitive
description:
description:
name: leak_tracker
name: leak_tracker
sha256:
c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
sha256:
"8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0"
url: "https://pub.dev"
url: "https://pub.dev"
source: hosted
source: hosted
version: "1
0
.0.
8
"
version: "1
1
.0.
1
"
leak_tracker_flutter_testing:
leak_tracker_flutter_testing:
dependency: transitive
dependency: transitive
description:
description:
name: leak_tracker_flutter_testing
name: leak_tracker_flutter_testing
sha256:
f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
sha256:
"1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
url: "https://pub.dev"
url: "https://pub.dev"
source: hosted
source: hosted
version: "3.0.
9
"
version: "3.0.
10
"
leak_tracker_testing:
leak_tracker_testing:
dependency: transitive
dependency: transitive
description:
description:
name: leak_tracker_testing
name: leak_tracker_testing
sha256: "
6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3
"
sha256: "
8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1
"
url: "https://pub.dev"
url: "https://pub.dev"
source: hosted
source: hosted
version: "3.0.
1
"
version: "3.0.
2
"
lints:
lints:
dependency: transitive
dependency: transitive
description:
description:
...
@@ -1673,10 +1673,10 @@ packages:
...
@@ -1673,10 +1673,10 @@ packages:
dependency: transitive
dependency: transitive
description:
description:
name: vm_service
name: vm_service
sha256:
"0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
sha256:
ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
url: "https://pub.dev"
url: "https://pub.dev"
source: hosted
source: hosted
version: "1
4.3.1
"
version: "1
5.0.0
"
web:
web:
dependency: transitive
dependency: transitive
description:
description:
...
...
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