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
2ccf19cc
Commit
2ccf19cc
authored
Jul 04, 2025
by
Sai Srinivas
Browse files
04-07-2025 By Sai Srinivas
Test cases and Order Module, Crm Module.
parent
4b790bef
Changes
94
Show whitespace changes
Inline
Side-by-side
lib/screens/crm/crmDashboard.dart
View file @
2ccf19cc
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/screens/crm/universalSearchScreen.dart'
;
import
'package:provider/provider.dart'
;
import
'package:generp/screens/screensExports.dart'
;
...
...
@@ -15,12 +17,16 @@ class CrmdashboardScreen extends StatefulWidget {
}
class
_CrmdashboardScreenState
extends
State
<
CrmdashboardScreen
>
{
FocusNode
focusNode
=
FocusNode
();
@override
void
initState
()
{
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
prov
=
Provider
.
of
<
Crmdashboardprovider
>(
context
,
listen:
false
);
prov
.
accessPagesAPIFunction
(
context
);
prov
.
crmDashboardAPIFunction
(
context
,
"executive"
,
""
,
""
,
""
);
prov
.
crmPendingTasksAPIFunction
(
context
);
});
}
...
...
@@ -30,7 +36,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
builder:
(
context
,
provider
,
child
)
{
final
gridPages
=
provider
.
accessPages
.
where
((
page
)
=>
![
8
,
9
,
23
,
24
,
51
,
50
].
contains
(
page
.
id
))
.
where
((
page
)
=>
![
8
,
9
,
23
,
24
,
51
,
50
].
contains
(
page
.
id
))
.
toList
();
return
WillPopScope
(
...
...
@@ -38,54 +44,294 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"CRM"
),
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
elevation:
2.0
,
title:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
SvgPicture
.
asset
(
"assets/svg/app_bar_back.svg"
,
height:
25
,
),
),
InkResponse
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"CRM"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
fontFamily:
"JakartaSemiBold"
,
color:
AppColors
.
semi_black
,
),
),
),
],
),
),
bottom:
PreferredSize
(
preferredSize:
Size
.
fromHeight
(
50
),
child:
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
5.0
,
0.0
,
10
,
0
),
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
border:
focusNode
.
hasFocus
?
Border
.
all
(
color:
AppColors
.
app_blue
):
null
),
child:
Row
(
children:
[
Expanded
(
child:
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
0.0
,
0.0
,
10
,
0
),
margin:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
10
),
child:
TextFormField
(
controller:
provider
.
searchController
,
keyboardType:
TextInputType
.
text
,
maxLines:
1
,
onChanged:
(
value
)
{},
focusNode:
focusNode
,
onTapUpOutside:
(
event
)
{
focusNode
.
requestFocus
();
},
textInputAction:
TextInputAction
.
done
,
onEditingComplete:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Universalsearchscreen
(
text:
provider
.
searchController
.
text
),
settings:
RouteSettings
(
name:
'SearchScreen'
),
));
},
enabled:
true
,
decoration:
InputDecoration
(
counterText:
""
,
hintText:
"Search"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
,
),
enabled:
true
,
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
SvgPicture
.
asset
(
"assets/svg/search_ic.svg"
)
],
),
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
),
body:
SafeArea
(
child:
ListView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
child:
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
height:
MediaQuery
.
of
(
context
)
.
size
.
height
*
0.28
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
0
,
vertical:
5
,
),
itemCount:
provider
.
allLeads
.
length
,
shrinkWrap:
true
,
scrollDirection:
Axis
.
horizontal
,
physics:
AlwaysScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
0.65
,
),
itemBuilder:
(
context
,
jndex
)
{
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
final
leadTitles
=
[
'Hot Leads'
,
'Cold Leads'
,
'Warm Leads'
,
'Total Leads'
,
'Order Lost'
,
'No Requirement'
,
'Open Enquiries'
,
];
final
colors
=
[
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFFCD5
,
0xFFFFF6F0
,
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFFCD5
,
0xFFFFF6F0
,
];
final
textcolors
=
[
0xFF0D9C00
,
0xFF493272
,
0xFF605C00
,
0xFF91481B
,
0xFF0D9C00
,
0xFF493272
,
0xFF605C00
,
0xFF91481B
,
];
return
InkResponse
(
onTap:
()
async
{
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!=
""
)
{
if
(
provider
.
allLeads
[
jndex
].
filter
!.
pageName
!
.
contains
(
"Lead List"
))
{
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Leadlistbymode
(
pageTitleName:
provider
.
allLeads
[
jndex
]
.
filter
!
.
pageName
!,
mode:
provider
.
allLeads
[
jndex
]
.
filter
!
.
mode
,
filter:
provider
.
allLeads
[
jndex
]
.
filter
!,
),
),
);
}
}
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
13
),
decoration:
BoxDecoration
(
color:
Color
(
colors
[
jndex
]),
borderRadius:
BorderRadius
.
circular
(
12
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
provider
.
allLeads
[
jndex
].
count
!,
style:
TextStyle
(
fontSize:
30
,
fontFamily:
"JakartaMedium"
,
color:
Color
(
textcolors
[
jndex
]),
),
),
Text
(
leadTitles
[
jndex
],
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
],
),
),
);
},
),
),
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
gridPages
.
length
,
itemBuilder:
(
context
,
index
)
{
// final icons = ["comm_ic_1", "comm_ic_2"];
Widget
?
SvgIcon
;
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
);
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/home_icons_5.svg"
,
height:
18
,
width:
18
,);
}
else
{
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/home_icons_5.svg"
,
height:
18
,
width:
18
,
);
}
else
{
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
}
return
InkResponse
(
onTap:
()
{
print
(
gridPages
[
index
].
pageName
!);
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
))
{
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Lead List"
,
))
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Leadlistbymode
(
(
context
)
=>
Leadlistbymode
(
mode:
gridPages
[
index
].
mode
,
pageTitleName:
gridPages
[
index
].
pageName
,
pageTitleName:
gridPages
[
index
].
pageName
,
),
),
);
}
else
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Prospect List"
))
{
}
else
if
(
gridPages
[
index
].
pageName
!.
contains
(
"Prospect List"
,
))
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ProspectListByMode
(
(
context
)
=>
ProspectListByMode
(
mode:
gridPages
[
index
].
mode
,
pageTitleName:
gridPages
[
index
].
pageName
,
pageTitleName:
gridPages
[
index
].
pageName
,
),
),
);
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
)
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
NearbyOpenLeads
(),
),
);
}
else
if
(
gridPages
[
index
].
pageName
==
"Nearby Leads"
){
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
NearbyOpenLeads
(),));
}
// switch (gridPages[index].pageName!) {
// case "Lead List":
...
...
@@ -111,7 +357,10 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
...
...
@@ -139,6 +388,55 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
);
},
),
if
(
provider
.
pendingTasksLists
.
length
>
0
)
...[
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
child:
Text
(
"Pending Tasks"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
grey_semi
,
),
),
),
),
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
provider
.
pendingTasksLists
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
child:
Row
(
children:
[
Text
(
provider
.
pendingTasksLists
[
index
].
aname
!),
],
),
);
},
),
],
],
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
...
...
@@ -197,7 +495,12 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
)
.
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
...
...
lib/screens/crm/editAccountDetails.dart
View file @
2ccf19cc
...
...
@@ -66,6 +66,7 @@ class _EditAccountDetailsState extends State<EditAccountDetails> {
textControllerWidget
(
context
,
provider
.
editCompanyNameController
,
"Name"
,
"Enter Name"
,
provider
.
onChangedCompanyName
,
TextInputType
.
text
,
...
...
lib/screens/crm/editProductsList.dart
View file @
2ccf19cc
...
...
@@ -550,11 +550,12 @@ class _EditProductsListState extends State<EditProductsList> {
child:
textControllerWidget
(
context
,
editProvider
.
editProductPriceControllers
[
j
],
"Product Price"
,
"Enter Product Price"
,
(
value
)
=>
editProvider
.
updateTotalAmount
(
j
),
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
null
),
),
],
...
...
@@ -567,6 +568,7 @@ class _EditProductsListState extends State<EditProductsList> {
child:
textControllerWidget
(
context
,
editProvider
.
editQuantityControllers
[
j
],
"Quantity"
,
"Enter Quantity"
,
(
value
)
=>
editProvider
.
updateTotalAmount
(
j
),
TextInputType
.
number
,
...
...
@@ -576,6 +578,7 @@ class _EditProductsListState extends State<EditProductsList> {
),
],
),
errorWidget
(
context
,
"Note: Submit Quantity as Zero (0) to delete Product"
),
const
SizedBox
(
height:
10
),
Row
(
children:
[
...
...
@@ -584,6 +587,7 @@ class _EditProductsListState extends State<EditProductsList> {
child:
textControllerWidget
(
context
,
editProvider
.
editTotalAmountControllers
[
j
],
"Amount"
,
"Total Amount"
,
(
_
)
{},
TextInputType
.
number
,
...
...
lib/screens/crm/generateQuotationScreen.dart
View file @
2ccf19cc
...
...
@@ -68,6 +68,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
textControllerWidget
(
context
,
provider
.
mailIdController
,
"Email Id"
,
"Enter Email Id"
,
provider
.
onChangemailId
,
TextInputType
.
emailAddress
,
...
...
@@ -79,6 +80,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
textControllerWidget
(
context
,
provider
.
mobileController
,
"Mobile Number"
,
"Enter Mobile Number"
,
provider
.
onChangemobile
,
TextInputType
.
phone
,
...
...
@@ -90,6 +92,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
textControllerWidget
(
context
,
provider
.
subjectsController
,
"Subject"
,
"Enter Subject"
,
provider
.
onChangesubjects
,
TextInputType
.
text
,
...
...
@@ -222,6 +225,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
child:
textControllerWidget
(
context
,
provider
.
editProductPriceControllers
[
j
],
"Product Price"
,
"Enter Product Price"
,
(
value
)
=>
provider
.
updateTotalAmount
(
j
),
...
...
@@ -240,6 +244,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
child:
textControllerWidget
(
context
,
provider
.
editQuantityControllers
[
j
],
"Quantity"
,
"Enter Quantity"
,
(
value
)
=>
provider
.
updateTotalAmount
(
j
),
...
...
@@ -258,6 +263,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
child:
textControllerWidget
(
context
,
provider
.
editTotalAmountControllers
[
j
],
"Amount"
,
"Total Amount"
,
(
_
)
{},
TextInputType
.
number
,
...
...
@@ -283,6 +289,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
context
,
provider
.
taxesController
,
"Taxes"
,
"Enter Taxes"
,
provider
.
onChangetaxes
,
TextInputType
.
text
,
false
,
...
...
@@ -294,6 +301,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
context
,
provider
.
SpecialNoteController
,
"Special Note"
,
"Enter Special Note"
,
provider
.
onChangeSpecialNote
,
TextInputType
.
text
,
false
,
...
...
@@ -305,6 +313,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
context
,
provider
.
forController
,
"FOR"
,
"Enter FOR"
,
provider
.
onChangefor
,
TextInputType
.
text
,
false
,
...
...
@@ -316,6 +325,7 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
context
,
provider
.
paymentTermsController
,
"Payment Terms"
,
"Enter Payment Terms"
,
provider
.
onChangepaymentTerms
,
TextInputType
.
text
,
false
,
...
...
lib/screens/crm/productDetails.dart
View file @
2ccf19cc
...
...
@@ -45,7 +45,7 @@ class _ProductdetailsState extends State<Productdetails> {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
TextWidget
(
context
,
"Product Details"
),
//
TextWidget(context,"Product Details"),
ListView
.
builder
(
itemCount:
customerDetails
.
length
,
shrinkWrap:
true
,
...
...
lib/screens/crm/prospectContactDetails.dart
View file @
2ccf19cc
...
...
@@ -262,6 +262,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
nameController
,
"Name"
,
"Enter Name"
,
provider
.
onChangeName
,
TextInputType
.
number
,
...
...
@@ -272,6 +273,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
designationController
,
"Designation"
,
"Enter Designation"
,
provider
.
onChangeDesignation
,
TextInputType
.
number
,
...
...
@@ -282,6 +284,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
mobileNumberController
,
"Mobile Number"
,
"Enter Mobile Number"
,
provider
.
onChangeMobile
,
TextInputType
.
number
,
...
...
@@ -292,6 +295,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
alternativeMobileController
,
"Alternative Mobile Number"
,
"Enter Alternative Mobile Number"
,
provider
.
onChangeAltMobile
,
TextInputType
.
number
,
...
...
@@ -302,6 +306,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
telephoneController
,
"Telephone Number"
,
"Enter Telephone Number"
,
provider
.
onChangeTelephone
,
TextInputType
.
number
,
...
...
@@ -312,7 +317,8 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
emailController
,
"Enter EmailID"
,
"Email ID"
,
"Enter Email ID"
,
provider
.
onChangeEmailId
,
TextInputType
.
number
,
false
,
...
...
@@ -402,6 +408,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
editNameController
,
"Name"
,
"Enter Name"
,
provider
.
onChangeEditName
,
TextInputType
.
number
,
...
...
@@ -412,6 +419,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
editDesignationController
,
"Designation"
,
"Enter Designation"
,
provider
.
onChangeEditDesignation
,
TextInputType
.
number
,
...
...
@@ -422,6 +430,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
editMobileNumberController
,
"Mobile Number"
,
"Enter Mobile Number"
,
provider
.
onChangeEditMobile
,
TextInputType
.
number
,
...
...
@@ -433,6 +442,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
editAlternativeMobileController
,
"Alternative Mobile Number"
,
"Enter Alternative Mobile Number"
,
provider
.
onChangeEditAltMobile
,
TextInputType
.
number
,
...
...
@@ -443,6 +453,7 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
editTelephoneController
,
"Telephone Number"
,
"Enter Telephone Number"
,
provider
.
onChangeEditTelephone
,
TextInputType
.
number
,
...
...
@@ -454,7 +465,8 @@ class _ProspectContactDetailsState extends State<ProspectContactDetails> {
textControllerWidget
(
context
,
provider
.
editEmailController
,
"Enter EmailID"
,
"Email ID"
,
"Enter Email ID"
,
provider
.
onChangeEditEmailId
,
TextInputType
.
number
,
false
,
...
...
lib/screens/crm/universalSearchScreen.dart
0 → 100644
View file @
2ccf19cc
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/screens/crm/ProspectDetailsByMode.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Notifiers/crmProvider/crmDashboardProvider.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
class
Universalsearchscreen
extends
StatefulWidget
{
final
text
;
const
Universalsearchscreen
({
super
.
key
,
required
this
.
text
});
@override
State
<
Universalsearchscreen
>
createState
()
=>
_UniversalsearchscreenState
();
}
class
_UniversalsearchscreenState
extends
State
<
Universalsearchscreen
>
{
@override
void
initState
()
{
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
prov
=
Provider
.
of
<
Crmdashboardprovider
>(
context
,
listen:
false
);
prov
.
crmUniversalSearchFunction
(
context
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Crmdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Search"
),
body:
SafeArea
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
if
(
provider
.
accountsList
.
length
>
0
)
...[
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
child:
Text
(
"Accounts"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
grey_semi
,
),
),
),
),
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
provider
.
accountsList
.
length
,
itemBuilder:
(
context
,
index
)
{
return
InkResponse
(
onTap:
()
{
Navigator
.
pushAndRemoveUntil
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
ProspectDetailsByMode
(
pageTitleName:
"Account Details"
,
mode:
"Executive"
,
leadId:
provider
.
accountsList
[
index
].
aid
,
),
settings:
RouteSettings
(
name:
'ProspectDetails'
),
),
(
Route
<
dynamic
>
route
)
=>
route
.
settings
.
name
==
'CrmdashboardScreen'
,
);
},
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
only
(
bottom:
5
,
left:
5
,
right:
5
,
top:
5
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
ListTile
(
title:
Text
(
provider
.
accountsList
[
index
].
aname
!,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
trailing:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
),
);
},
),
],
if
(
provider
.
leadsList
.
length
>
0
)
...[
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
child:
Text
(
"Leads"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
grey_semi
,
),
),
),
),
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
provider
.
leadsList
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
only
(
bottom:
5
,
left:
5
,
right:
5
,
top:
5
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
ListTile
(
title:
Text
(
provider
.
leadsList
[
index
].
aname
!,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
trailing:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
);
},
),
],
if
(
provider
.
enquiresList
.
length
>
0
)
...[
Align
(
alignment:
Alignment
.
centerLeft
,
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
6
),
child:
Text
(
"Enquiries"
,
style:
TextStyle
(
fontSize:
16
,
color:
AppColors
.
grey_semi
,
),
),
),
),
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
,
),
itemCount:
provider
.
enquiresList
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
margin:
EdgeInsets
.
only
(
bottom:
5
,
left:
5
,
right:
5
,
top:
5
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
ListTile
(
title:
Text
(
provider
.
enquiresList
[
index
].
companyName
==
""
?
provider
.
enquiresList
[
index
].
name
!
:
provider
.
enquiresList
[
index
].
companyName
!,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
),
),
trailing:
SvgPicture
.
asset
(
"assets/svg/arrow_right_new.svg"
,
),
),
);
},
),
],
],
),
),
),
),
);
},
);
}
}
lib/screens/finance/PaymentRequestionListDetails.dart
View file @
2ccf19cc
...
...
@@ -9,6 +9,7 @@ import 'package:generp/screens/notifierExports.dart';
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/commom/accountsListDetails.dart'
;
import
'package:intl/intl.dart'
;
import
'package:provider/provider.dart'
;
import
'FileViewer.dart'
;
...
...
@@ -57,7 +58,7 @@ class _PaymentrequestionlistdetailsState
// Final decision on whether to show buttons
bool
shouldShowButtons
=
false
;
final
numberFormat
=
NumberFormat
.
decimalPattern
();
@override
void
initState
()
{
// TODO: implement initState
...
...
@@ -633,6 +634,7 @@ class _PaymentrequestionlistdetailsState
textControllerWidget
(
context
,
approvedAmount
,
"Approved Amount"
,
"Enter Approved Amount"
,
(
p0
)
{},
TextInputType
.
numberWithOptions
(),
...
...
@@ -645,6 +647,7 @@ class _PaymentrequestionlistdetailsState
textControllerWidget
(
context
,
remarks
,
"Remarks"
,
"Enter Remarks"
,
(
p0
)
{},
TextInputType
.
text
,
...
...
@@ -870,6 +873,7 @@ class _PaymentrequestionlistdetailsState
textControllerWidget
(
context
,
remarks
,
"Remarks"
,
"Enter Remarks"
,
(
p0
)
{},
TextInputType
.
text
,
...
...
@@ -924,7 +928,7 @@ class _PaymentrequestionlistdetailsState
);
}
Future
<
void
>
_showAddPaymentSheet
(
BuildContext
context
,
paymentID
)
{
Future
<
void
>
_showAddPaymentSheet
1
(
BuildContext
context
,
paymentID
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
...
...
@@ -939,7 +943,9 @@ class _PaymentrequestionlistdetailsState
return
SafeArea
(
child:
Consumer
<
Requesitionlidtdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Container
(
return
Scaffold
(
body:
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
...
...
@@ -950,7 +956,12 @@ class _PaymentrequestionlistdetailsState
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
children:
[
Row
(
children:
[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
...
...
@@ -974,6 +985,7 @@ class _PaymentrequestionlistdetailsState
),
TextWidget
(
context
,
"Payment Account"
),
DropdownButtonHideUnderline
(
child:
Row
(
...
...
@@ -1081,14 +1093,35 @@ class _PaymentrequestionlistdetailsState
textControllerReadonlyWidget
(
context
,
provider
.
approvedAmount
,
provider
.
approvedAmount
Readonly
,
"Approved Amount"
,
(
p0
)
{},
),
textControllerWidget
(
context
,
provider
.
approvedAmount
,
"Payment Amount"
,
"Enter Payment Amount"
,
(
p0
)
{
if
(
numberFormat
.
parse
(
provider
.
approvedAmountReadonly
.
text
)<
numberFormat
.
parse
(
provider
.
approvedAmount
.
text
)){
provider
.
proposedAmountError
=
"Amount Should not be greater than Approved amount"
;
}
else
{
provider
.
proposedAmountError
=
""
;
}
},
TextInputType
.
numberWithOptions
(),
false
,
null
),
errorWidget
(
context
,
provider
.
proposedAmountError
),
textControllerWidget
(
context
,
paymentReferenceNumber
,
"Payment Reference Number"
,
"Enter Payment Reference Number"
,
(
p0
)
{},
TextInputType
.
text
,
...
...
@@ -1100,6 +1133,7 @@ class _PaymentrequestionlistdetailsState
textControllerWidget
(
context
,
remarks
,
"Remarks"
,
"Enter Remarks"
,
(
p0
)
{},
TextInputType
.
text
,
...
...
@@ -1245,13 +1279,27 @@ class _PaymentrequestionlistdetailsState
(
p0
)
{},
),
InkWell
(
],
),
),
),
],
),
],
),
),
bottomNavigationBar:
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
{
provider
.
paymentrequisitionProcessSubmitAPIFunction
(
context
,
widget
.
mode
,
paymentReferenceNumber
.
text
,
provider
.
approvedAmount
.
text
,
paymentID
,
provider
.
selectedID
,
remarks
.
text
,
...
...
@@ -1259,7 +1307,7 @@ class _PaymentrequestionlistdetailsState
);
},
child:
Container
(
alignment:
Alignment
.
c
enter
,
alignment:
Alignment
.
bottomC
enter
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
...
...
@@ -1282,9 +1330,325 @@ class _PaymentrequestionlistdetailsState
),
),
),
),
);
},
),
);
},
);
},
);
}
Future
<
void
>
_showAddPaymentSheet
(
BuildContext
context
,
paymentID
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
backgroundColor:
Colors
.
white
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
Requesitionlidtdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
// Fallback UI if provider data is not ready
if
(
provider
.
paymentsAccounts
==
null
)
{
return
Center
(
child:
CircularProgressIndicator
());
}
return
Container
(
// Constrain the height to avoid overflow
constraints:
BoxConstraints
(
maxHeight:
MediaQuery
.
of
(
context
).
size
.
height
*
0.8
,
),
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
child:
Column
(
children:
[
// Scrollable content
Expanded
(
child:
SingleChildScrollView
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Row
(
children:
[
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Align
(
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Add Approval"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
textControllerReadonlyWidget
(
context
,
provider
.
proposedPaymentAccount
,
"Enter Proposed Payment Account"
,
(
p0
)
{},
),
TextWidget
(
context
,
"Payment Account"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
PaymentAccounts
>(
isExpanded:
true
,
hint:
Text
(
'Select Account'
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
paymentsAccounts
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
PaymentAccounts
>(
value:
paymenents
,
child:
Text
(
paymenents
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedPaymentAccounts
,
onChanged:
(
PaymentAccounts
?
value
)
{
if
(
value
!=
null
&&
provider
.
paymentsAccounts
.
isNotEmpty
)
{
setState
(()
{
provider
.
selectedPaymentAccounts
=
value
;
provider
.
selectedID
=
value
.
id
!;
provider
.
selectedValue
=
value
.
name
!;
print
(
"Selected Account:
${value.name}
, ID:
${value.id}
"
);
});
}
},
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
paymentAccountSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
paymentAccountSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
),
),
),
),
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
?.
toLowerCase
().
contains
(
searchValue
.
toLowerCase
())
??
false
;
},
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
provider
.
paymentAccountSearchController
.
clear
();
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
textControllerReadonlyWidget
(
context
,
provider
.
approvedAmountReadonly
,
"Approved Amount"
,
(
p0
)
{},
),
textControllerWidget
(
context
,
provider
.
approvedAmount
,
"Payment Amount"
,
"Enter Payment Amount"
,
(
p0
)
{
if
(
numberFormat
.
parse
(
provider
.
approvedAmountReadonly
.
text
)
<
numberFormat
.
parse
(
provider
.
approvedAmount
.
text
))
{
provider
.
proposedAmountError
=
"Amount should not be greater than Approved amount"
;
}
else
{
provider
.
proposedAmountError
=
""
;
}
},
TextInputType
.
numberWithOptions
(),
false
,
null
,
),
errorWidget
(
context
,
provider
.
proposedAmountError
),
textControllerWidget
(
context
,
paymentReferenceNumber
,
"Enter Payment Reference Number"
,
"Payment Reference Number"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
,
),
textControllerWidget
(
context
,
remarks
,
"Remarks"
,
"Enter Remarks"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
null
,
focusNodes
[
4
],
null
,
TextInputAction
.
done
,
),
InkResponse
(
onTap:
()
{
_showAttachmentSheet
(
context
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
),
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
),
),
child:
Center
(
child:
Text
(
"Add Attachment"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
),
),
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
),
),
InkResponse
(
onTap:
()
{
setState
(()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
});
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
],
),
),
],
textControllerReadonlyWidget
(
context
,
provider
.
accountName
,
"Enter Account Name"
,
(
p0
)
{}),
textControllerReadonlyWidget
(
context
,
provider
.
branch
,
"Enter Branch Name"
,
(
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
)
{}),
],
),
),
],
),
],
),
),
),
),
// Sticky Submit Button
Padding
(
padding:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
child:
InkWell
(
onTap:
()
{
provider
.
paymentrequisitionProcessSubmitAPIFunction
(
context
,
widget
.
mode
,
paymentReferenceNumber
.
text
,
provider
.
approvedAmount
.
text
,
paymentID
,
provider
.
selectedID
,
remarks
.
text
,
provider
.
imagePath
,
);
},
child:
Container
(
height:
45
,
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
14.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
),
],
),
);
},
),
...
...
@@ -1294,7 +1658,6 @@ class _PaymentrequestionlistdetailsState
},
);
}
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
...
...
lib/screens/finance/addPaymentReceiptList.dart
View file @
2ccf19cc
...
...
@@ -253,6 +253,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
context
,
provider
.
amountController
,
"Amount"
,
"Enter Amount"
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
null
,
...
...
@@ -393,6 +394,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
context
,
provider
.
bankNameController
,
"Bank Name"
,
"Enter Bank Name"
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
2
],
...
...
@@ -403,6 +405,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
context
,
provider
.
bankBranchController
,
"Bank Branch"
,
"Enter Bank Branch"
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
...
...
@@ -413,6 +416,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
context
,
provider
.
bankAccNumberController
,
"Account Number"
,
"Enter Account Number"
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
4
],
...
...
@@ -423,6 +427,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
context
,
provider
.
bankIfscController
,
"Bank IFSC"
,
"Enter Bank IFSC"
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
5
],
...
...
@@ -433,6 +438,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
context
,
provider
.
bankAcHolderController
,
"Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
6
],
...
...
@@ -445,6 +451,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
context
,
provider
.
bankUpiController
,
"UPI ID"
,
"Enter UPI ID"
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
7
],
...
...
@@ -456,6 +463,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
context
,
provider
.
paymentReferenceController
,
"Payment Reference Number"
,
"Enter Payment Reference Number"
,
provider
.
updatereference
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
8
],
...
...
@@ -466,6 +474,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
textControllerWidget
(
context
,
provider
.
descController
,
"Description"
,
"Enter Description"
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
9
],
...
...
lib/screens/finance/directPaymentRequesitionList.dart
View file @
2ccf19cc
...
...
@@ -265,6 +265,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
context
,
provider
.
amountController
,
"Amount"
,
"Enter Amount"
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
null
,
...
...
@@ -405,6 +406,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
context
,
provider
.
bankNameController
,
"Bank Name"
,
"Enter Bank Name"
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
2
],
...
...
@@ -415,6 +417,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
context
,
provider
.
bankBranchController
,
"Bank Branch"
,
"Enter Bank Branch"
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
...
...
@@ -425,6 +428,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
context
,
provider
.
bankAccNumberController
,
"Account Number"
,
"Enter Account Number"
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
4
],
...
...
@@ -435,6 +439,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
context
,
provider
.
bankIfscController
,
"Bank IFSC"
,
"Enter Bank IFSC"
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
5
],
...
...
@@ -445,6 +450,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
context
,
provider
.
bankAcHolderController
,
"Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
6
],
...
...
@@ -456,6 +462,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
context
,
provider
.
bankUpiController
,
"UPI ID"
,
"Enter UPI ID"
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
7
],
...
...
@@ -467,6 +474,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
context
,
provider
.
paymentReferenceController
,
"Payment Reference Number"
,
"Enter Payment Reference Number"
,
provider
.
updateReference
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
8
],
...
...
@@ -477,6 +485,7 @@ class _DirectpaymentrequesitionlistState
textControllerWidget
(
context
,
provider
.
descController
,
"Description"
,
"Enter Description"
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
9
],
...
...
@@ -579,63 +588,63 @@ class _DirectpaymentrequesitionlistState
);
}
void
_showDialog
(
Widget
child
)
{
showCupertinoModalPopup
<
void
>(
context:
context
,
builder:
(
BuildContext
context
)
=>
Container
(
height:
216
,
padding:
const
EdgeInsets
.
only
(
top:
6.0
),
// The Bottom margin is provided to align the popup above the system
// navigation bar.
margin:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
// Provide a background color for the popup.
color:
CupertinoColors
.
systemBackground
.
resolveFrom
(
context
),
// Use a SafeArea widget to avoid system overlaps.
child:
SafeArea
(
top:
false
,
child:
Column
(
children:
[
Expanded
(
flex:
1
,
child:
SizedBox
(
height:
40
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
// Add a Cancel button (optional)
CupertinoButton
(
child:
Text
(
'Cancel'
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),
),
onPressed:
()
{
Navigator
.
pop
(
context
);
},
),
// Add a Done button
CupertinoButton
(
child:
Text
(
'Done'
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
),
),
onPressed:
()
{
Navigator
.
pop
(
context
);
// Dismiss the dialog
},
),
],
),
),
),
Expanded
(
flex:
3
,
child:
child
),
],
),
),
),
);
}
//
void _showDialog(Widget child) {
//
showCupertinoModalPopup<void>(
//
context: context,
//
builder:
//
(BuildContext context) => Container(
//
height: 216,
//
padding: const EdgeInsets.only(top: 6.0),
//
// The Bottom margin is provided to align the popup above the system
//
// navigation bar.
//
margin: EdgeInsets.only(
//
bottom: MediaQuery.of(context).viewInsets.bottom,
//
),
//
// Provide a background color for the popup.
//
color: CupertinoColors.systemBackground.resolveFrom(context),
//
// Use a SafeArea widget to avoid system overlaps.
//
child: SafeArea(
//
top: false,
//
child: Column(
//
children: [
//
Expanded(
//
flex: 1,
//
child: SizedBox(
//
height: 40,
//
child: Row(
//
mainAxisAlignment: MainAxisAlignment.spaceBetween,
//
children: [
//
// Add a Cancel button (optional)
//
CupertinoButton(
//
child: Text(
//
'Cancel',
//
style: TextStyle(fontFamily: "JakartaMedium"
,color: AppColors.app_blue
),
//
),
//
onPressed: () {
//
Navigator.pop(context);
//
},
//
),
//
// Add a Done button
//
CupertinoButton(
//
child: Text(
//
'Done',
//
style: TextStyle(fontFamily: "JakartaMedium"
,color: AppColors.app_blue
),
//
),
//
onPressed: () {
//
Navigator.pop(context); // Dismiss the dialog
//
},
//
),
//
],
//
),
//
),
//
),
//
Expanded(flex: 3, child: child),
//
],
//
),
//
),
//
),
//
);
//
}
...
...
lib/screens/finance/financeDashboard.dart
View file @
2ccf19cc
...
...
@@ -29,6 +29,8 @@ class _FinancedashboardState extends State<Financedashboard> {
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Dashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
pages
=
provider
.
accessiblePagesList
;
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
...
...
@@ -41,12 +43,12 @@ class _FinancedashboardState extends State<Financedashboard> {
child:
Column
(
children:
[
ListView
.
builder
(
itemCount:
p
rovider
.
accessiblePagesList
.
length
,
itemCount:
p
ages
.
length
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
Widget
?
SvgIcon
;
switch
(
p
rovider
.
accessiblePagesList
[
index
].
mode
)
{
switch
(
p
ages
[
index
].
mode
)
{
case
"apr_lvl1"
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_lv1.svg"
,
...
...
@@ -57,16 +59,17 @@ class _FinancedashboardState extends State<Financedashboard> {
"assets/svg/fin_lv2.svg"
,
);
break
;
final
icons
=
[
"comm_ic_1"
,
"comm_ic_2"
];
default
:
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
);
SvgIcon
=
SvgPicture
.
asset
(
"assets/svg/fin_ic.svg"
,
);
break
;
}
return
InkResponse
(
onTap:
()
async
{
var
navigate
;
if
(
provider
.
accessiblePagesList
[
index
].
pageName
==
"Payments List"
)
{
if
(
pages
[
index
].
pageName
==
"Payments List"
)
{
navigate
=
Paymentlistpaymentrequisition
(
pageTitleName:
provider
...
...
@@ -83,9 +86,21 @@ class _FinancedashboardState extends State<Financedashboard> {
.
accessiblePagesList
[
index
]
.
pageName
!,
);
}
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account List"
)
{
navigate
=
Accountslist
();
// break;
}
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account Ledger"
)
{
navigate
=
Accountledger
();
}
else
{
navigate
=
Allpaymentrequesitionlistsbymodes
(
mode:
p
rovider
.
accessiblePagesList
[
index
].
mode
!,
mode:
p
ages
[
index
].
mode
!,
pageTitleName:
provider
.
accessiblePagesList
[
index
]
...
...
@@ -94,7 +109,9 @@ class _FinancedashboardState extends State<Financedashboard> {
}
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
navigate
),
MaterialPageRoute
(
builder:
(
context
)
=>
navigate
,
),
);
},
child:
Container
(
...
...
@@ -112,12 +129,30 @@ class _FinancedashboardState extends State<Financedashboard> {
),
child:
Row
(
children:
[
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account List"
)...[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/comm_ic_1.svg"
,
width:
25
,
),
)
]
else
if
(
provider
.
accessiblePagesList
[
index
]
.
pageName
==
"Account Ledger"
)...[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/comm_ic_2.svg"
,
width:
25
,
),
)
]
else
...[
Expanded
(
flex:
1
,
child:
SvgIcon
),
],
Expanded
(
flex:
5
,
child:
Text
(
"
${provider.accessiblePagesList[index].pageName}
"
,
),
child:
Text
(
"
${pages[index].pageName}
"
),
),
Expanded
(
flex:
1
,
...
...
@@ -152,7 +187,7 @@ class _FinancedashboardState extends State<Financedashboard> {
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
Text
(
"Add
Payment Request
"
,
"Add"
,
style:
TextStyle
(
fontSize:
15
,
fontFamily:
"JakartaMedium"
,
...
...
@@ -182,6 +217,7 @@ class _FinancedashboardState extends State<Financedashboard> {
return
SafeArea
(
child:
Consumer
<
Dashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
pages2
=
provider
.
accessiblePagesList2
;
return
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
...
...
@@ -189,34 +225,35 @@ class _FinancedashboardState extends State<Financedashboard> {
right:
15
,
top:
10
,
),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,),
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
),
child:
SingleChildScrollView
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SizedBox
(
height:
15
),
...
List
.
generate
(
p
rovider
.
accessiblePagesList
2
.
length
,
(
index
,
)
{
print
(
provider
.
accessiblePagesList2
[
index
].
mode
);
List
<
String
>
mode_lst
=
[
"self
"
,
"other
"
,
"process
"
,
"admin"
,
"direct"
,
];
final
Headingnames
=
[
"Add
Self
Payment Requisition"
,
"Add
Other
Payment Requisition"
,
"Add
Processed
Payment Requisition"
,
"Add
Admin
Payment
Requisition
"
,
"Add
Direct Payme
nt"
,
];
...
List
.
generate
(
p
ages
2
.
length
,
(
index
)
{
print
(
pages2
[
index
].
mode
);
// List<String> mode_lst = [
// "self",
// "other",
// "process
",
// "admin
",
// "direct
",
//
"admin"
// ];
// final Headingnames = [
// "Add Self Payment Requisition",
//
"Add
Other
Payment Requisition",
//
"Add
Processed
Payment Requisition",
//
"Add
Admin
Payment Requisition",
//
"Add
Direct
Payment",
//
"Add
Accou
nt"
//
];
return
ListTile
(
onTap:
()
async
{
var
res
;
if
(
provider
.
accessiblePagesList2
[
index
]
...
...
@@ -236,7 +273,7 @@ class _FinancedashboardState extends State<Financedashboard> {
),
),
);
}
else
if
(
provider
}
else
if
(
provider
.
accessiblePagesList2
[
index
]
.
pageName
==
"Add Payment Receipt"
)
{
...
...
@@ -244,9 +281,7 @@ class _FinancedashboardState extends State<Financedashboard> {
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
Addpaymentreceiptlist
(
(
context
)
=>
Addpaymentreceiptlist
(
pageTitleName:
provider
.
accessiblePagesList2
[
index
]
...
...
@@ -254,18 +289,27 @@ class _FinancedashboardState extends State<Financedashboard> {
),
),
);
}
else
if
(
provider
.
accessiblePagesList2
[
index
]
.
pageName
!.
contains
(
"Add Account"
))
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Addcommonpayment
(
from:
"Dashboard"
,
),
),
);
}
else
{
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
,
)
=>
Submitpaymentrequestionlistsbymode
(
mode:
"
${provider.accessiblePagesList2[index].mode}
"
,
(
context
)
=>
Submitpaymentrequestionlistsbymode
(
mode:
"
${pages2[index].mode}
"
,
pageTitleName:
"
${provider.accessiblePagesList
2[index].pageName}
"
,
"
${pages
2[index].pageName}
"
,
),
),
);
...
...
@@ -276,7 +320,7 @@ class _FinancedashboardState extends State<Financedashboard> {
"assets/svg/fin_ic.svg"
,
),
title:
Text
(
"
${p
rovider.accessiblePagesList
2[index].pageName}
"
,
"
${p
ages
2[index].pageName}
"
,
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaMedium"
,
...
...
lib/screens/finance/paymentListPaymentRequisition.dart
View file @
2ccf19cc
...
...
@@ -168,30 +168,30 @@ late Commondaterangefilter cf;
),
),
),
Expanded
(
flex:
2
,
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
5
,
vertical:
10
,
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
),
color:
Color
(
0xFFE3FFE0
),
),
child:
Center
(
child:
Text
(
requestLists
[
index
].
refType
!,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
,
color:
Color
(
0xFF0D9C00
),
),
),
),
),
),
//
Expanded(
//
flex: 2,
//
child: Container(
//
padding: EdgeInsets.symmetric(
//
horizontal: 5,
//
vertical: 10,
//
),
//
decoration: BoxDecoration(
//
borderRadius: BorderRadius.circular(8),
//
color: Color(0xFFE3FFE0),
//
),
//
child: Center(
//
child: Text(
//
requestLists[index].refType!,
//
textAlign: TextAlign.center,
//
style: TextStyle(
//
fontFamily: "JakartaMedium",
//
fontSize: 14,
//
color: Color(0xFF0D9C00),
//
),
//
),
//
),
//
),
//
),
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
...
lib/screens/finance/submitPaymentRequestionListsByMode.dart
View file @
2ccf19cc
...
...
@@ -6,6 +6,8 @@ import 'package:generp/Notifiers/financeProvider/RequestionListProvider.dart';
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/Utils/dropdownTheme.dart'
;
import
'package:generp/screens/commom/addCommonPayment.dart'
;
import
'package:get/utils.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Models/financeModels/addPaymentRequestionResponse.dart'
;
...
...
@@ -13,34 +15,68 @@ import '../../Models/financeModels/addPaymentRequestionResponse.dart';
class
Submitpaymentrequestionlistsbymode
extends
StatefulWidget
{
final
String
mode
;
final
String
pageTitleName
;
const
Submitpaymentrequestionlistsbymode
({
super
.
key
,
required
this
.
mode
,
required
this
.
pageTitleName
});
const
Submitpaymentrequestionlistsbymode
({
super
.
key
,
required
this
.
mode
,
required
this
.
pageTitleName
,
});
@override
State
<
Submitpaymentrequestionlistsbymode
>
createState
()
=>
_SubmitpaymentrequestionlistsbymodeState
();
}
class
_SubmitpaymentrequestionlistsbymodeState
extends
State
<
Submitpaymentrequestionlistsbymode
>
{
Dropdowntheme
ddtheme
=
Dropdowntheme
();
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
11
,
(
index
)
=>
FocusNode
(),);
List
<
FocusNode
>
focusNodes
=
List
.
generate
(
11
,
(
index
)
=>
FocusNode
());
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
);
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
);
provider
.
addPaymentRequestionViewAPI
(
context
,
widget
.
mode
);
});
}
@override
void
dispose
()
{
focusNodes
.
map
((
e
)=>
e
.
dispose
());
focusNodes
.
map
((
e
)
=>
e
.
dispose
());
super
.
dispose
();
}
autofill
(
res
){
print
(
"auto"
);
var
provider
=
Provider
.
of
<
Requestionlistprovider
>(
context
,
listen:
false
,
);
if
(
provider
.
accounts
!=
null
)
{
provider
.
selectedAccount
=
provider
.
accounts
.
firstWhereOrNull
((
element
)
=>
element
.
id
==
res
,);
print
(
"sdsd,al;,al
${provider.selectedAccount}
"
);
provider
.
accountId
=
provider
.
accounts
.
firstWhere
(
(
e
)
=>
e
.
id
==
res
,
)
.
id
!;
provider
.
accountValue
=
provider
.
accounts
.
firstWhere
(
(
e
)
=>
e
.
id
==
res
,
)
.
name
!;
}
}
Future
<
bool
>
_onBackPressed
(
BuildContext
context
)
async
{
Navigator
.
pop
(
context
,
true
);
return
true
;
...
...
@@ -61,7 +97,12 @@ class _SubmitpaymentrequestionlistsbymodeState
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
white
,
appBar:
appbar2
(
context
,
"
${widget.pageTitleName}
"
,
provider
.
resetForm
,
SizedBox
(
width:
0
,)),
appBar:
appbar2
(
context
,
"
${widget.pageTitleName}
"
,
provider
.
resetForm
,
SizedBox
(
width:
0
),
),
body:
SafeArea
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
...
...
@@ -78,6 +119,7 @@ class _SubmitpaymentrequestionlistsbymodeState
child:
Row
(
children:
[
Expanded
(
flex:
5
,
child:
DropdownButton2
<
Accounts
>(
isExpanded:
true
,
hint:
Text
(
...
...
@@ -115,28 +157,38 @@ class _SubmitpaymentrequestionlistsbymodeState
provider
.
accountId
=
value
.
id
!;
print
(
"hfjkshfg"
+
provider
.
accountId
.
toString
(),
provider
.
accountId
.
toString
(),
);
provider
.
paymentRequestionBankDetailsAPIFunction
(
context
,
provider
.
accountId
,
);
provider
.
paymentRequestionBankDetailsAPIFunction
(
context
,
provider
.
accountId
);
}
}
},
dropdownSearchData:
DropdownSearchData
(
searchInnerWidgetHeight:
50
,
searchController:
provider
.
accountSearchController
,
searchController:
provider
.
accountSearchController
,
searchInnerWidget:
Padding
(
padding:
const
EdgeInsets
.
all
(
8
),
child:
TextFormField
(
controller:
provider
.
accountSearchController
,
controller:
provider
.
accountSearchController
,
decoration:
InputDecoration
(
isDense:
true
,
contentPadding:
const
EdgeInsets
.
symmetric
(
contentPadding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
8
,
),
hintText:
'Search account...'
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
8
),
borderRadius:
BorderRadius
.
circular
(
8
,
),
),
),
),
...
...
@@ -144,11 +196,13 @@ class _SubmitpaymentrequestionlistsbymodeState
searchMatchFn:
(
item
,
searchValue
)
{
return
item
.
value
?.
name
?.
toLowerCase
()
.
contains
(
searchValue
.
toLowerCase
())
??
.
contains
(
searchValue
.
toLowerCase
(),
)
??
false
;
},
// Optional: clear search text when dropdown closes
// Optional: clear search text when dropdown closes
),
onMenuStateChange:
(
isOpen
)
{
if
(!
isOpen
)
{
...
...
@@ -161,6 +215,52 @@ class _SubmitpaymentrequestionlistsbymodeState
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
if
(
widget
.
mode
==
"other"
)
...[
SizedBox
(
width:
5
),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
async
{
var
res
=
await
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Addcommonpayment
(
from:
"Requesition"
,),
),
);
print
(
"return Response:
${res}
"
);
if
(
res
!=
true
)
{
provider
.
addPaymentRequestionViewAPI
(
context
,
widget
.
mode
,
);
if
(
res
!=
null
)
{
print
(
"true"
);
Future
.
delayed
(
Durations
.
long4
,
()
async
{
print
(
"Long411"
);
autofill
(
res
);
},
);
}
}
},
child:
Container
(
height:
45
,
padding:
EdgeInsets
.
all
(
8
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
SvgPicture
.
asset
(
"assets/svg/add_account.svg"
,
color:
Colors
.
white
,
),
),
),
),
],
],
),
),
...
...
@@ -199,11 +299,14 @@ class _SubmitpaymentrequestionlistsbymodeState
onChanged:
(
String
?
value
)
{
if
(
value
!=
null
)
{
provider
.
selectReqPurpose
=
value
;
print
(
"Selected Complaint Type:
${value}
,"
);
print
(
"Selected Complaint Type:
${value}
,"
,
);
print
(
"hfjkshfg"
+
provider
.
selectReqPurpose
.
toString
(),
provider
.
selectReqPurpose
.
toString
(),
);
}
},
...
...
@@ -220,11 +323,15 @@ class _SubmitpaymentrequestionlistsbymodeState
textControllerWidget
(
context
,
provider
.
reqPurposeController
,
"Request Purpose"
,
"Enter Request Purpose"
,
provider
.
updateReqPupose
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateReqPupose
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
0
],
focusNodes
[
1
],
TextInputAction
.
next
TextInputAction
.
next
,
),
],
errorWidget
(
context
,
provider
.
reqPurposeError
),
...
...
@@ -232,23 +339,30 @@ class _SubmitpaymentrequestionlistsbymodeState
textControllerWidget
(
context
,
provider
.
descController
,
"Description"
,
"Enter Description"
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateDescription
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
1
],
focusNodes
[
2
],
TextInputAction
.
next
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
descriptionError
),
textControllerWidget
(
context
,
provider
.
amountController
,
"Amount"
,
"Enter Amount"
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
provider
.
updateAmount
,
TextInputType
.
numberWithOptions
(),
false
,
null
,
focusNodes
[
2
],
null
,
TextInputAction
.
done
TextInputAction
.
done
,
),
errorWidget
(
context
,
provider
.
amountError
),
...
...
@@ -275,7 +389,8 @@ class _SubmitpaymentrequestionlistsbymodeState
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
),
),
)
...
...
@@ -308,6 +423,65 @@ class _SubmitpaymentrequestionlistsbymodeState
),
errorWidget
(
context
,
provider
.
selectPaymentError
),
if
(
widget
.
mode
==
"other"
)...[
TextWidget
(
context
,
"Select Approval Employee"
),
DropdownButtonHideUnderline
(
child:
Row
(
children:
[
Expanded
(
child:
DropdownButton2
<
Employees
>(
isExpanded:
true
,
hint:
Text
(
'Select Approval Employee'
,
style:
TextStyle
(
fontSize:
14
),
overflow:
TextOverflow
.
ellipsis
,
),
items:
provider
.
approvalEmployee
.
map
(
(
paymenents
)
=>
DropdownMenuItem
<
Employees
>(
value:
paymenents
,
child:
Text
(
paymenents
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
)
.
toList
(),
value:
provider
.
selectedApprovalEmployee
,
onChanged:
(
Employees
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
approvalEmployee
.
isNotEmpty
)
{
provider
.
selectedApprovalEmployee
=
value
;
print
(
"Selected Complaint Type:
${value.name}
, ID:
${value.id}
"
,
);
provider
.
selectedApprovalEmployeeID
=
value
.
id
!;
provider
.
selectedApprovalEmployeeValue
=
value
.
name
!;
print
(
"hfjkshfg"
+
provider
.
paymentModeId
.
toString
(),
);
}
}
},
buttonStyleData:
ddtheme
.
buttonStyleData
,
iconStyleData:
ddtheme
.
iconStyleData
,
menuItemStyleData:
ddtheme
.
menuItemStyleData
,
dropdownStyleData:
ddtheme
.
dropdownStyleData
,
),
),
],
),
),
errorWidget
(
context
,
provider
.
selectPaymentError
),
],
InkResponse
(
onTap:
()
{
_showAttachmentSheet
(
context
);
...
...
@@ -335,27 +509,36 @@ class _SubmitpaymentrequestionlistsbymodeState
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)...[
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
Text
(
"
${provider.imagePath}
"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
),),
fontWeight:
FontWeight
.
w600
,
),
),
InkResponse
(
onTap:
()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,))
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
],
),
)
)
,
],
errorWidget
(
context
,
provider
.
FileError
),
...
...
@@ -368,66 +551,97 @@ class _SubmitpaymentrequestionlistsbymodeState
textControllerWidget
(
context
,
provider
.
bankNameController
,
"Bank Name"
,
"Enter Bank Name"
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateBankName
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
3
],
focusNodes
[
4
],
TextInputAction
.
next
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankNameError
),
textControllerWidget
(
context
,
provider
.
bankBranchController
,
"Bank Branch"
,
"Enter Bank Branch"
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateBankBranch
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
4
],
focusNodes
[
5
],
TextInputAction
.
next
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankBranchError
),
textControllerWidget
(
context
,
provider
.
bankAccNumberController
,
"Account Number"
,
"Enter Account Number"
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
provider
.
updateNumber
,
TextInputType
.
number
,
false
,
FilteringTextInputFormatter
.
digitsOnly
,
focusNodes
[
5
],
focusNodes
[
6
],
TextInputAction
.
next
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankNumberError
),
textControllerWidget
(
context
,
provider
.
bankIfscController
,
"Bank IFSC"
,
"Enter Bank IFSC"
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateIFSC
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
6
],
focusNodes
[
7
],
TextInputAction
.
next
TextInputAction
.
next
,
),
errorWidget
(
context
,
provider
.
bankIFSCError
),
],
if
([
"Cheque"
,
"RTGS"
,
"IMPS"
,
"NEFT"
,
"UPI"
].
contains
(
provider
.
paymentModeValue
))
...[
textControllerWidget
(
context
,
provider
.
bankAcHolderController
,
"Bank Account Holder Name"
,
"Enter Bank Account Holder Name"
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateHolder
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
7
],
null
,
TextInputAction
.
done
TextInputAction
.
done
,
),
errorWidget
(
context
,
provider
.
bankHolderError
),
]
else
if
(
provider
.
paymentModeValue
==
"UPI"
)
...[
textControllerWidget
(
context
,
provider
.
bankUpiController
,
"UPI ID"
,
"Enter UPI ID"
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
provider
.
updateUPI
,
TextInputType
.
text
,
false
,
null
,
focusNodes
[
8
],
null
,
TextInputAction
.
done
TextInputAction
.
done
,
),
errorWidget
(
context
,
provider
.
UPIError
),
],
...
...
@@ -439,11 +653,16 @@ class _SubmitpaymentrequestionlistsbymodeState
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
bottomNavigationBar:
InkResponse
(
onTap:
provider
.
submitClicked
?
null
:
()
{
provider
.
submitClicked
=
true
;
onTap:
provider
.
submitClicked
?
null
:
()
{
provider
.
submitClicked
=
false
;
provider
.
addPaymentRequestionSubmitAPI
(
context
,
widget
.
mode
,
provider
.
selectedApprovalEmployeeID
);
},
child:
Container
(
...
...
@@ -452,10 +671,15 @@ class _SubmitpaymentrequestionlistsbymodeState
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15
),
),
child:
provider
.
submitClicked
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
),):
Text
(
child:
provider
.
submitClicked
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
),
)
:
Text
(
"Submit"
,
style:
TextStyle
(
fontSize:
15
,
...
...
@@ -475,7 +699,6 @@ class _SubmitpaymentrequestionlistsbymodeState
);
}
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
...
...
lib/screens/genTracker/ComplaintHistory.dart
View file @
2ccf19cc
...
...
@@ -7,7 +7,8 @@ import '../../Utils/app_colors.dart';
import
'../../Utils/commonWidgets.dart'
;
class
Complainthistory
extends
StatefulWidget
{
const
Complainthistory
({
super
.
key
});
final
genHashID
;
const
Complainthistory
({
super
.
key
,
required
this
.
genHashID
});
@override
State
<
Complainthistory
>
createState
()
=>
_ComplainthistoryState
();
...
...
@@ -24,7 +25,7 @@ class _ComplainthistoryState extends State<Complainthistory> {
listen:
false
,
);
var
homeProvider
=
Provider
.
of
<
HomescreenNotifier
>(
context
,
listen:
false
);
details
.
LoadgeneratorComplaintHistoryApifunction
(
homeProvider
,
context
,
details
.
gen
ID
);
details
.
LoadgeneratorComplaintHistoryApifunction
(
homeProvider
,
context
,
widget
.
genHash
ID
);
});
}
...
...
@@ -54,9 +55,12 @@ class _ComplainthistoryState extends State<Complainthistory> {
return
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${ provider.complaintList[index].compRegdate}
"
,
style:
TextStyle
(
Padding
(
padding:
const
EdgeInsets
.
only
(
left:
5.0
),
child:
Text
(
"
${ provider.complaintList[index].compRegdate}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)
),),
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
decoration:
BoxDecoration
(
...
...
@@ -83,7 +87,7 @@ class _ComplainthistoryState extends State<Complainthistory> {
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
15
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
6
),
child:
Row
(
children:
[
Expanded
(
...
...
lib/screens/genTracker/GenTrackerDashboard.dart
View file @
2ccf19cc
...
...
@@ -4,6 +4,7 @@ import 'package:generp/Utils/commonWidgets.dart';
import
'package:generp/screens/genTracker/ScanEnterGeneratorIDScreen.dart'
;
import
'../../Utils/app_colors.dart'
;
class
Gentrackerdashboard
extends
StatefulWidget
{
const
Gentrackerdashboard
({
super
.
key
});
...
...
@@ -14,6 +15,18 @@ class Gentrackerdashboard extends StatefulWidget {
class
_GentrackerdashboardState
extends
State
<
Gentrackerdashboard
>
{
@override
Widget
build
(
BuildContext
context
)
{
final
names
=
[
"Generator Details"
,
// "Register Complaint",
// "Tag Location",
"Tag Generator"
,
];
final
icons
=
[
"gent_gen_det"
,
// "gent_reg_comp",
// "gent_tag_loc",
"gent_tag_den"
,
];
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
...
...
@@ -21,42 +34,66 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
appbar
(
context
,
"Gen Tracker"
),
body:
SafeArea
(
child:
Column
(
children:
[
Expanded
(
flex:
1
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
itemCount:
4
,
padding:
EdgeInsets
.
symmetric
(
vertical:
10
,
horizontal:
10
),
itemCount:
names
.
length
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
),
physics:
NeverScrollableScrollPhysics
(),
itemBuilder:
(
context
,
index
)
{
final
names
=
[
"Generator Details"
,
"Register Complaint"
,
"Tag Location"
,
"Tag Generator"
,
];
final
icons
=
[
"gent_gen_det"
,
"gent_reg_comp"
,
"gent_tag_loc"
,
"gent_tag_den"
,
];
return
InkResponse
(
onTap:
()
{
switch
(
names
[
index
])
{
case
"Generator Details"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Generator Details"
,)));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Generator Details"
,
),
),
);
break
;
case
"Register Complaint"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Register Complaint"
,)));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Register Complaint"
,
),
),
);
break
;
case
"Tag Location"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Scanentergeneratoridscreen
(
from:
"Tag Location"
,)));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Tag Location"
,
),
),
);
break
;
case
"Tag Generator"
:
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)=>
Scanentergeneratoridscreen
(
from:
"Tag Generator"
,)));
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Scanentergeneratoridscreen
(
from:
"Tag Generator"
,
),
),
);
break
;
default
:
...
...
@@ -73,10 +110,8 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
"assets/svg/
${icons[index]}
.svg"
,
),
SizedBox
(
height:
10
,),
SvgPicture
.
asset
(
"assets/svg/
${icons[index]}
.svg"
),
SizedBox
(
height:
10
),
Text
(
names
[
index
]),
],
),
...
...
@@ -85,6 +120,22 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
},
),
),
SizedBox
(
height:
10
),
Expanded
(
flex:
3
,
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Text
(
"Note: 'Tag Location' and 'Register Complaint' are moved to 'Generator Details'."
,
style:
TextStyle
(
color:
AppColors
.
grey_thick
,
fontSize:
14
),
),
),
),
SizedBox
(
height:
10
),
],
),
),
),
);
}
...
...
lib/screens/genTracker/GeneratorDetails.dart
View file @
2ccf19cc
...
...
@@ -10,6 +10,7 @@ import 'package:url_launcher/url_launcher.dart';
import
'../../Notifiers/HomeScreenNotifier.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
import
'ScanEnterGeneratorIDScreen.dart'
;
class
Generatordetails
extends
StatefulWidget
{
final
activityName
;
...
...
@@ -48,55 +49,34 @@ class _GeneratordetailsState extends State<Generatordetails> {
""
,
widget
.
generatorId
,
);
}
else
{
details
.
LoadgeneratorDetailsApifunction
(
homeProvider
,
context
,
""
,
widget
.
generatorId
,
);
}
// else {
// details.LoadgeneratorDetailsApifunction(
// homeProvider,
// context,
// "",
// widget.generatorId,
// "3"
// );
// }
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Generatordetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
sendwidget
=
Container
(
padding:
EdgeInsets
.
only
(
right:
10.0
),
child:
InkWell
(
onTap:
()
async
{
if
(
widget
.
genLocation
!=
null
)
{
var
loc
=
widget
.
genLocation
?.
split
(
","
).
toString
();
var
uri
=
Uri
.
parse
(
"google.navigation:q=
${loc![0]}
,
${loc![1]}
&mode=d"
,
);
if
(
Platform
.
isIOS
)
{
uri
=
Uri
.
parse
(
"maps://?q=
${loc![0]}
,
${loc![1]}
&z=10&daddr=
${loc![0]}
,
${loc![1]}
&dirflg=d"
,
);
}
if
(
await
canLaunch
(
uri
.
toString
()))
{
await
launch
(
uri
.
toString
());
}
else
{
throw
'Could not launch
${uri.toString()}
'
;
}
// val intent = Intent(Intent.ACTION_VIEW, Uri.parse(uri))
}
},
child:
SvgPicture
.
asset
(
"assets/svg/directions_ic.svg"
),
),
);
return
Consumer2
<
Generatordetailsprovider
,
HomescreenNotifier
>(
builder:
(
context
,
provider
,
Homeprovider
,
child
)
{
var
sendwidget
=
SizedBox
(
width:
0
);
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
widget
.
activityName
==
"NearByGenerators"
?
appbar2
(
context
,
"Generator Details"
,
provider
.
resetForm
,
sendwidget
)
:
appbar
(
context
,
"Generator Details"
),
appBar:
appbar2
(
context
,
"Generator Details"
,
provider
.
resetForm
,
sendwidget
,
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
SafeArea
(
child:
Container
(
...
...
@@ -105,15 +85,23 @@ class _GeneratordetailsState extends State<Generatordetails> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
child:
Text
(
"Customer Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
,
),
),
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
,
...
...
@@ -130,73 +118,55 @@ class _GeneratordetailsState extends State<Generatordetails> {
horizontal:
0
,
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
),
SizedBox
(
width:
5
),
SizedBox
(
width:
10
),
Column
(
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
SizedBox
(
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.75
,
child:
Text
(
"
${provider.cname}
"
,
Text
(
"
${provider.aname}
"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
),
fontSize:
14
,
),
),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.75
,
child:
Text
(
"
${provider.aname}
"
,
Text
(
"
${provider.cname}
"
,
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
,
),
),
color:
Color
(
0xFF818181
),
),
),
],
),
),
],
),
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
3
,
(
j
)
{
children:
List
.
generate
(
4
,
(
j
)
{
final
textheads
=
[
"Mobile Number"
,
"Contact Person Number"
,
"Mail ID"
,
"Location"
,
];
final
textSubheads
=
[
"
${provider.mob1}
"
,
"
${provider.mob2}
"
,
"
${provider.mail}
"
,
provider
.
mob1
??
"-"
,
provider
.
mob2
??
"-"
,
provider
.
mail
??
"-"
,
"View"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
...
...
@@ -204,44 +174,133 @@ class _GeneratordetailsState extends State<Generatordetails> {
horizontal:
0
,
),
child:
Row
(
children:
[
Expanded
(
flex:
1
,
flex:
1
,
child:
SizedBox
(
child:
Text
(
textheads
[
j
].
toString
(),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
14
fontSize:
14
,
),
),
),
),
SizedBox
(
width:
5
,),
SizedBox
(
width:
5
),
if
(
textSubheads
[
j
]
==
"View"
)
...[
Expanded
(
flex:
2
,
child:
SizedBox
(
child:
Container
(
padding:
EdgeInsets
.
only
(
right:
10.0
,
),
child:
InkWell
(
onTap:
()
async
{
if
(
widget
.
genLocation
!=
null
)
{
provider
.
genLocationLatLngs
=
widget
.
genLocation
?.
split
(
","
)
.
toString
();
}
else
{
provider
.
genLocationLatLngs
=
provider
.
genLocation
?.
split
(
","
)
.
toString
();
}
var
uri
=
Uri
.
parse
(
"google.navigation:q=
${provider.genLocationLatLngs![0]}
,
${provider.genLocationLatLngs![1]}
&mode=d"
,
);
if
(
Platform
.
isIOS
)
{
uri
=
Uri
.
parse
(
"maps://?q=
${provider.genLocationLatLngs![0]}
,
${provider.genLocationLatLngs![1]}
&z=10&daddr=
${provider.genLocationLatLngs![0]}
,
${provider.genLocationLatLngs![1]}
&dirflg=d"
,
);
}
if
(
await
canLaunch
(
uri
.
toString
(),
))
{
await
launch
(
uri
.
toString
());
}
else
{
throw
'Could not launch
${uri.toString()}
'
;
}
},
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
,
color:
AppColors
.
app_blue
,
decoration:
TextDecoration
.
underline
,
decorationColor:
AppColors
.
app_blue
,
),
),
),
),
),
]
else
...[
Expanded
(
flex:
2
,
child:
InkResponse
(
onTap:
textheads
[
j
]
!=
"Mobile Number"
?
null
:
()
async
{
final
Uri
phoneUri
=
Uri
(
scheme:
'tel'
,
path:
provider
.
mob1
==
""
?
provider
.
mob2
:
provider
.
mob1
,
);
if
(
await
canLaunchUrl
(
phoneUri
,
))
{
await
launchUrl
(
phoneUri
,
);
}
else
{
throw
'Could not launch
$phoneUri
'
;
}
},
child:
SizedBox
(
child:
Text
(
textSubheads
[
j
]
==
""
?
"-"
:
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
textheads
[
j
]
==
"Mobile Number"
?
AppColors
.
app_blue
:
Color
(
0xFF818181
),
decorationColor:
textheads
[
j
]
==
"Mobile Number"
?
AppColors
.
app_blue
:
null
,
decoration:
textheads
[
j
]
==
"Mobile Number"
?
TextDecoration
.
underline
:
null
,
),
),
),
),
),
],
],
),
);
...
...
@@ -252,15 +311,23 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
child:
Text
(
"Generator Details"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontFamily:
"JakartaMedium"
,
),
),
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
,
...
...
@@ -273,19 +340,19 @@ class _GeneratordetailsState extends State<Generatordetails> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
6
,
(
j
)
{
final
textheads
=
[
"Gen ID"
,
"Engine Number"
,
"Address"
,
"Product Name"
,
"Gen Hash ID"
,
"Engine Number"
,
"Engine Model"
,
"Address"
,
"Date Of Supply"
,
];
final
textSubheads
=
[
"
${provider.genID}
"
,
"
${provider.engineNo}
"
,
"
${provider.address}
"
,
"
${provider.spname}
"
,
"
${provider.genHashID}
"
,
"
${provider.engineNo}
"
,
"
${provider.emodel}
"
,
"
${provider.address}
"
,
"
${provider.dateOfEngineSale}
"
,
];
return
Container
(
...
...
@@ -294,30 +361,31 @@ class _GeneratordetailsState extends State<Generatordetails> {
horizontal:
0
,
),
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Expanded
(
flex:
1
,
child:
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
flex:
1
,
child:
Text
(
textheads
[
j
].
toString
(),
style:
TextStyle
(
fontSize:
14
,
fontFamily:
"JakartaMedium"
),),),
SizedBox
(
width:
5
,),
fontFamily:
"JakartaMedium"
,
),
),
),
SizedBox
(
width:
5
),
Expanded
(
flex:
2
,
flex:
2
,
child:
SizedBox
(
child:
Text
(
textSubheads
[
j
],
textSubheads
[
j
]
==
""
?
"-"
:
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
,
),
color:
Color
(
0xFF818181
),
),
),
),
...
...
@@ -328,7 +396,127 @@ class _GeneratordetailsState extends State<Generatordetails> {
}),
),
),
InkWell
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
TagLocationScreen
(
genHashID:
provider
.
genHashID
,
),
),
);
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
// width: Med1iaQuery.of(context).size.width,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
// decoration: BoxDecoration(
// color: AppColors.app_blue,
// borderRadius: BorderRadius.circular(15.0),
// ),
child:
Center
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
SvgPicture
.
asset
(
"assets/svg/gent_tag_loc.svg"
,
width:
20
,
),
SizedBox
(
width:
10
),
Text
(
"Tag Location"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
decoration:
TextDecoration
.
underline
,
decorationColor:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
),
),
],
),
),
),
),
InkWell
(
onTap:
()
{
provider
.
LoadgeneratorDetailsApifunction
(
Homeprovider
,
context
,
"Register Complaint"
,
provider
.
genHashID
,
"2"
,
);
// Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => Scanentergeneratoridscreen(
// from: "Register Complaint",
// ),
// ),
// );
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
// width: Med1iaQuery.of(context).size.width,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
,
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
// decoration: BoxDecoration(
// color: AppColors.app_blue,
// borderRadius: BorderRadius.circular(15.0),
// ),
child:
Center
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
SvgPicture
.
asset
(
"assets/svg/gent_reg_comp.svg"
,
width:
20
,
),
SizedBox
(
width:
10
),
Text
(
"Register Complaint"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
decoration:
TextDecoration
.
underline
,
decorationColor:
AppColors
.
app_blue
,
color:
AppColors
.
app_blue
,
),
),
],
),
),
),
),
SizedBox
(
height:
75
),
],
),
...
...
@@ -341,7 +529,11 @@ class _GeneratordetailsState extends State<Generatordetails> {
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Complainthistory
()),
MaterialPageRoute
(
builder:
(
context
)
=>
Complainthistory
(
genHashID:
provider
.
genHashID
),
),
);
},
child:
Container
(
...
...
@@ -360,7 +552,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
color:
Colors
.
white
),
color:
Colors
.
white
,
),
),
),
),
...
...
@@ -374,3 +567,225 @@ class _GeneratordetailsState extends State<Generatordetails> {
);
}
}
class
TagLocationScreen
extends
StatefulWidget
{
final
genHashID
;
const
TagLocationScreen
({
super
.
key
,
required
this
.
genHashID
});
@override
State
<
TagLocationScreen
>
createState
()
=>
_TagLocationScreenState
();
}
class
_TagLocationScreenState
extends
State
<
TagLocationScreen
>
{
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer2
<
Generatordetailsprovider
,
HomescreenNotifier
>(
builder:
(
context
,
provider
,
Homeprovider
,
child
)
{
var
sendwidget
=
SizedBox
(
width:
0
);
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
appBar:
appbar2
(
context
,
"Tag Location"
,
provider
.
resetForm
,
sendwidget
,
),
backgroundColor:
AppColors
.
white
,
body:
SafeArea
(
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
textControllerReadonlyWidget
(
context
,
TextEditingController
(
text:
widget
.
genHashID
),
"Gen ID"
,
(
p0
)
{},
),
SizedBox
(
height:
10
,),
InkResponse
(
onTap:
()
{
_showAttachmentSheet
(
context
);
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
),
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFE6F6FF
),
borderRadius:
BorderRadius
.
circular
(
12
),
border:
Border
.
all
(
color:
AppColors
.
app_blue
,
width:
0.5
,
),
),
child:
Center
(
child:
Text
(
"Add Proof"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),
),
),
),
),
if
(
provider
.
imagePicked
==
1
&&
provider
.
imagePath
!=
null
)
...[
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
4.0
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Expanded
(
flex:
4
,
child:
Text
(
"
${provider.imagePath}
"
,
overflow:
TextOverflow
.
visible
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
11
,
fontWeight:
FontWeight
.
w600
,
),
),
),
SizedBox
(
width:
10
,),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
provider
.
imagePicked
=
0
;
provider
.
imagePath
=
null
;
provider
.
imageFilePath
=
null
;
},
child:
SvgPicture
.
asset
(
"assets/svg/ic_close.svg"
,
width:
15
,
height:
15
,
),
),
),
],
),
),
],
errorWidget
(
context
,
provider
.
imageError
)
],
),
),
),
bottomNavigationBar:
InkWell
(
onTap:
()
{
provider
.
TagLocationAPIFunction
(
Homeprovider
,
context
,
provider
.
genHashID
,
);
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Center
(
child:
Text
(
"Tag Location"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
fontSize:
15
,
color:
Colors
.
white
,
),
),
),
),
),
),
);
},
);
}
Future
<
void
>
_showAttachmentSheet
(
BuildContext
context
)
{
return
showModalBottomSheet
(
useSafeArea:
true
,
isDismissible:
true
,
isScrollControlled:
true
,
showDragHandle:
true
,
backgroundColor:
Colors
.
white
,
enableDrag:
true
,
context:
context
,
builder:
(
context
)
{
return
StatefulBuilder
(
builder:
(
context
,
setState
)
{
return
SafeArea
(
child:
Consumer
<
Generatordetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
MediaQuery
.
of
(
context
,
).
viewInsets
.
bottom
,
// This handles keyboard
),
child:
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
"Select Source"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
,
),
),
),
SizedBox
(
height:
15
),
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromCamera
();
},
child:
Container
(
height:
35
,
child:
Text
(
"Capture photo from camera"
),
),
),
],
),
),
),
);
},
),
);
},
);
},
);
}
}
lib/screens/genTracker/ScanEnterGeneratorIDScreen.dart
View file @
2ccf19cc
import
'package:flutter/material.dart'
;
import
'package:generp/Notifiers/GeneratorDetailsProvider.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
import
'package:generp/services/api_calling.dart'
;
import
'package:provider/provider.dart'
;
import
'package:qr_code_scanner/qr_code_scanner.dart'
;
...
...
@@ -40,6 +42,15 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
});
}
@override
void
dispose
()
{
// TODO: implement dispose
super
.
dispose
();
genIDcontroller
.
clear
();
genIDcontroller
.
dispose
();
}
@override
...
...
@@ -99,10 +110,12 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
),
InkResponse
(
onTap:
()
async
{
provider
.
qrViewController
!.
pauseCamera
();
provider
.
submitLoading
=
false
;
_showgenIdBottomSheet
(
context
);
},
child:
Text
(
"Tap to Enter Gen
erator
ID"
,
"Tap to Enter Gen ID"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18
,
fontFamily:
"JakartaMedium"
,
...
...
@@ -158,7 +171,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Gen
erator
ID"
,
"Gen ID"
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontFamily:
"JakartaMedium"
,
...
...
@@ -210,36 +223,50 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
//contentPadding: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 10.0),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
hintText:
'Enter Gen
erator
ID'
,
hintText:
'Enter Gen ID'
,
),
),
),
),
SizedBox
(
height:
15
,),
InkWell
(
onTap:
()
{
onTap:
provider
.
submitLoading
?
null
:
()
async
{
switch
(
widget
.
from
){
case
"Generator Details"
:
provider
.
submitLoading
=
true
;
provider
.
LoadgeneratorDetailsApifunction
(
homeProvider
,
context
,
widget
.
from
,
genIDcontroller
.
text
,
"1"
,
);
genIDcontroller
.
clear
();
break
;
case
"Register Complaint"
:
provider
.
LoadgeneratorDetailsApifunction
(
homeProvider
,
context
,
widget
.
from
,
genIDcontroller
.
text
,
);
break
;
case
"Tag Location"
:
provider
.
TagLocationAPIFunction
(
homeProvider
,
context
,
genIDcontroller
.
text
);
break
;
// case "Register Complaint":
// provider.LoadgeneratorDetailsApifunction(
// homeProvider,
// context,
// widget.from,
// genIDcontroller.text,
// "2"
// );
// break;
// case "Tag Location":
// provider.TagLocationAPIFunction(homeProvider, context, genIDcontroller.text);
// break;
case
"Tag Generator"
:
provider
.
submitLoading
=
false
;
final
data
=
await
ApiCalling
.
LoadGeneratorDetailsAPI
(
homeProvider
.
empId
,
homeProvider
.
session
,
genIDcontroller
.
text
);
if
(
data
!=
null
){
if
(
data
.
error
==
0
){
provider
.
showTagGeneratorBottomSheet
(
context
,
genIDcontroller
.
text
);
}
else
{
toast
(
context
,
"Enter Correct ID!!"
);
}
}
break
;
default
:
...
...
@@ -261,8 +288,11 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
child:
provider
.
submitLoading
?
CircularProgressIndicator
.
adaptive
(
valueColor:
AlwaysStoppedAnimation
(
AppColors
.
white
),
padding:
EdgeInsets
.
all
(
10
),
):
Text
(
"Search"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
,
fontFamily:
"JakartaMedium"
,
...
...
@@ -283,7 +313,13 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
},
);
},
).
whenComplete
(()
{
var
provider
=
Provider
.
of
<
Generatordetailsprovider
>(
context
,
listen:
false
,
);
provider
.
qrViewController
!.
resumeCamera
();
},);
}
...
...
lib/screens/inventory/GeneratorPartDetailsScreen.dart
View file @
2ccf19cc
import
'package:flutter/material.dart'
;
import
'package:generp/screens/finance/FileViewer.dart'
;
import
'package:generp/screens/notifierExports.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonServices.dart'
;
...
...
@@ -49,10 +50,14 @@ class _GeneratorPartDetailsScreenState
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
InventoryProvider
>(
builder:
(
context
,
provider
,
child
)
{
return
Consumer
2
<
InventoryProvider
,
HomescreenNotifier
>(
builder:
(
context
,
provider
,
homeProvider
,
child
)
{
return
WillPopScope
(
onWillPop:
()
=>
onBackPressed
(
context
),
child:
RefreshIndicator
.
adaptive
(
onRefresh:
()
async
{
initialiseFunction
(
context
,
homeProvider
);
},
child:
Scaffold
(
resizeToAvoidBottomInset:
true
,
backgroundColor:
AppColors
.
scaffold_bg_color
,
...
...
@@ -163,7 +168,9 @@ class _GeneratorPartDetailsScreenState
color:
Color
(
0xFFED3424
),
width:
0.5
,
),
borderRadius:
BorderRadius
.
circular
(
12
),
borderRadius:
BorderRadius
.
circular
(
12
,
),
),
child:
Center
(
child:
Text
(
...
...
@@ -193,7 +200,9 @@ class _GeneratorPartDetailsScreenState
color:
Color
(
0xFF0D9C00
),
width:
0.5
,
),
borderRadius:
BorderRadius
.
circular
(
12
),
borderRadius:
BorderRadius
.
circular
(
12
,
),
),
child:
Center
(
child:
Text
(
...
...
@@ -238,16 +247,16 @@ class _GeneratorPartDetailsScreenState
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
List
.
generate
(
3
,
(
index
)
{
children:
List
.
generate
(
2
,
(
index
)
{
final
headings
=
[
"Product Name"
,
"Product ID"
,
//
"Product ID",
"Project"
,
];
final
values
=
[
provider
.
partData
.
prodName
,
provider
.
partData
.
id
,
//
provider.partData.id,
provider
.
partData
.
project
,
];
return
Container
(
...
...
@@ -272,7 +281,9 @@ class _GeneratorPartDetailsScreenState
flex:
2
,
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
...
...
@@ -336,7 +347,9 @@ class _GeneratorPartDetailsScreenState
flex:
2
,
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
...
...
@@ -371,14 +384,27 @@ class _GeneratorPartDetailsScreenState
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
children:
List
.
generate
(
3
,
(
index
)
{
final
headings
=
[
"Sub Group"
,
"Units"
,
"MSL"
];
children:
List
.
generate
(
5
,
(
index
)
{
final
headings
=
[
"Sub Group"
,
"Units"
,
"MSL"
,
"Description"
,
"Image"
,
];
final
values
=
[
provider
.
partData
.
subGroup
,
provider
.
partData
.
units
,
provider
.
partData
.
msl
,
provider
.
partData
.
prodDesc
,
"View"
,
];
if
(
index
==
4
&&
provider
.
partData
.
imageDirFilePath
==
""
){
return
SizedBox
.
shrink
();
}
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
...
...
@@ -397,77 +423,115 @@ class _GeneratorPartDetailsScreenState
),
),
),
if
(
values
[
index
]
==
"View"
)
...[
Expanded
(
flex:
2
,
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
child:
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Fileviewer
(
fileName:
provider
.
partData
.
imageViewFileName
!,
fileUrl:
provider
.
partData
.
imageDirFilePath
!,
),
],
),
);
}),
),
),
Container
(
alignment:
Alignment
.
topLeft
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
},
child:
Text
(
"Description
"
,
"
${values[index]}
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
Color
(
0xFF818181
),
color:
AppColors
.
app_blue
,
decoration:
TextDecoration
.
underline
,
decorationColor:
AppColors
.
app_blue
,
),
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
child:
Row
(
children:
[
]
else
...[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
[
Text
(
"Description"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
),
),
Text
(
"
${provider.partData.prodDesc}
"
,
flex:
2
,
child:
Text
(
"
${values[index]}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
),
),
],
],
),
);
}),
),
),
// Container(
// alignment: Alignment.topLeft,
// padding: EdgeInsets.symmetric(horizontal: 10),
// child: Text(
// "Description",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// color: Color(0xFF818181),
// ),
// ),
// ),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// margin: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(16),
// ),
// child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: 10,
// vertical: 10,
// ),
// child: Row(
// children: [
// Expanded(
// child: SizedBox(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Text(
// "Description",
// style: TextStyle(
// fontFamily: "JakartaMedium",
// ),
// ),
// Text(
//
// style: TextStyle(
// color: Color(0xFF818181),
// ),
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// ),
SizedBox
(
height:
150
),
],
),
...
...
@@ -475,6 +539,7 @@ class _GeneratorPartDetailsScreenState
),
),
),
),
);
},
);
...
...
@@ -560,7 +625,10 @@ class _GeneratorPartDetailsScreenState
),
child:
TextField
(
controller:
quantitycontroller
,
keyboardType:
TextInputType
.
numberWithOptions
(
decimal:
true
,
signed:
true
),
keyboardType:
TextInputType
.
numberWithOptions
(
decimal:
true
,
signed:
true
,
),
focusNode:
quantityFocusNode
,
style:
TextStyle
(
fontSize:
14
),
...
...
@@ -653,9 +721,7 @@ class _GeneratorPartDetailsScreenState
),
),
InkWell
(
onTap:
provider
.
isButtonEnabled
?
()
{
onTap:
()
{
print
(
provider
.
isButtonEnabled
);
if
(
type
==
"Recieve"
)
{
provider
.
issuetype
=
"Recieved"
;
...
...
@@ -673,32 +739,8 @@ class _GeneratorPartDetailsScreenState
);
quantitycontroller
.
clear
();
descriptioncontroller
.
clear
();
}
:
()
{
if
(
quantitycontroller
.
text
.
isEmpty
)
{
toast
(
context
,
"Please Enter Quantity."
,
);
}
else
if
(
descriptioncontroller
.
text
.
isEmpty
)
{
toast
(
context
,
"Please Enter Description."
,
);
}
else
if
(
quantitycontroller
.
text
.
isEmpty
&&
descriptioncontroller
.
text
.
isEmpty
)
{
toast
(
context
,
"Quantity and Description are mandatory."
,
);
}
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
...
...
lib/screens/order/addOrder.dart
View file @
2ccf19cc
...
...
@@ -324,6 +324,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
provider
.
billingNameController
,
"Billing Name"
,
"Enter Billing Name"
,
provider
.
onChangedBillingName
,
TextInputType
.
text
,
false
,
...
...
@@ -369,7 +370,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
value
!.
name
!;
if
(
provider
.
billingDistricts
.
isNotEmpty
)
{
provider
.
billingDistricts
.
clear
();
provider
.
selectedBillingDistricts
=
null
;
//
provider.selectedBillingDistricts
=
null;
provider
.
selectedBillingDistrictId
=
null
;
provider
.
selectedBillingDistrictValue
=
""
;
}
...
...
@@ -463,7 +464,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
value
!.
district
!;
if
(
provider
.
billingSubLocations
.
isNotEmpty
)
{
provider
.
billingSubLocations
.
clear
();
provider
.
selectedBillingSubLocations
=
null
;
//
provider.selectedBillingSubLocations = null;
provider
.
selectedBillingSubLocID
=
null
;
provider
.
selectedBillingSubLocValue
=
""
;
}
...
...
@@ -608,6 +609,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
provider
.
billingAddressController
,
"Billing Address"
,
"Enter Billing Address"
,
provider
.
onChangedBillingAddress
,
TextInputType
.
text
,
false
,
...
...
@@ -622,6 +624,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
provider
.
billingPincodeController
,
"Billing Pin code"
,
"Enter Billing Pin code"
,
provider
.
onChangedBillingPincode
,
TextInputType
.
number
,
false
,
...
...
@@ -668,7 +671,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
value
!.
name
!;
if
(
provider
.
dispatchDistricts
.
isNotEmpty
)
{
provider
.
dispatchDistricts
.
clear
();
provider
.
selectedDispatchDistricts
=
null
;
//
provider.selectedDispatchDistricts = null;
provider
.
selectedDispatchDistrictId
=
null
;
provider
.
selectedDispatchDistrictValue
=
""
;
}
...
...
@@ -765,8 +768,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
.
dispatchSubLocations
.
isNotEmpty
)
{
provider
.
dispatchSubLocations
.
clear
();
provider
.
selectedDispatchSubLocations
=
null
;
// provider.selectedDispatchSubLocations=null;
provider
.
selectedDispatchSubLocID
=
null
;
provider
.
selectedDispatchSubLocValue
=
""
;
}
...
...
@@ -912,6 +914,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
provider
.
dispatchAddressController
,
"Dispatch Address"
,
"Enter Dispatch Address"
,
provider
.
onChangedDispatchAddress
,
TextInputType
.
text
,
false
,
...
...
@@ -926,6 +929,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
provider
.
dispatchPincodeController
,
"Dispatch Pin code"
,
"Enter Dispatch Pin code"
,
provider
.
onChangedDispatchPincode
,
TextInputType
.
number
,
false
,
...
...
@@ -941,6 +945,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
provider
.
gstController
,
"GST Number"
,
"Enter GST Number"
,
provider
.
onChangedGst
,
TextInputType
.
text
,
false
,
...
...
@@ -1308,8 +1313,8 @@ class _AddorderScreenState extends State<AddorderScreen> {
provider
.
selectedTpcAgentID
.
toString
(),
);
provider
.
dropDownSearchController
.
text
=
provider
.
accountLis
t
[
index
].
text
!;
provider
.
dropDown
Tpc
SearchController
.
text
=
provider
.
tpcAgen
t
[
index
].
text
!;
}
// provider.ordersAddPaymentSelectOrderAPIFunction(context, provider.selectedAccountID);
// provider.tpcAgent = [];
...
...
@@ -1335,6 +1340,7 @@ class _AddorderScreenState extends State<AddorderScreen> {
context
,
provider
.
tpcAmountController
,
"TPC Amount"
,
"Enter TPC Amount"
,
provider
.
onChangeTpcAmount
,
TextInputType
.
number
,
false
,
...
...
@@ -1614,10 +1620,7 @@ class OrderForm extends StatelessWidget {
),
)
.
toList
(),
value:
provider
.
saleProducts
.
contains
(
provider
.
selectedSaleProducts
,
)
value:
provider
.
selectedSaleProductID
[
index
]!=
null
?
provider
.
saleProducts
.
firstWhere
(
(
product
)
=>
product
.
id
==
...
...
@@ -1625,6 +1628,7 @@ class OrderForm extends StatelessWidget {
.
selectedSaleProductID
[
index
],
)
:
null
,
onChanged:
(
SaleProducts
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
...
...
@@ -1664,6 +1668,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
PriceControllers
[
index
],
"Price"
,
"Enter Price"
,
(
p0
)
{},
TextInputType
.
number
,
false
,
...
...
@@ -1698,6 +1703,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
QuantityControllers
[
index
],
"Quantity"
,
"Enter Quantity"
,
(
p0
)
{
provider
.
updateRowCalculations
(
index
);
},
...
...
@@ -1737,6 +1743,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
CGSTControllers
[
index
],
"CGST %"
,
"Enter CGST %"
,
(
p0
)
{
provider
.
updateRowCalculations
(
index
);
},
...
...
@@ -1772,6 +1779,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
SGSTControllers
[
index
],
"SGST %"
,
"Enter SGST %"
,
(
p0
)
{
provider
.
updateRowCalculations
(
index
);
},
...
...
@@ -1807,6 +1815,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
IGSTControllers
[
index
],
"IGST %"
,
"Enter IGST %"
,
(
p0
)
{
provider
.
updateRowCalculations
(
index
);
},
...
...
@@ -1842,6 +1851,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
TaxableValueControllers
[
index
],
"Total Price"
,
"Enter Total Price"
,
(
p0
)
{
provider
.
updateRowCalculations
(
index
);
},
...
...
@@ -1885,6 +1895,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
basicAmountReadOnlyController
,
"Basic Amount"
,
"Enter Basic Amount"
,
(
p0
)
{},
TextInputType
.
text
,
true
,
...
...
@@ -1897,6 +1908,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
cgstReadOnlyController
,
"CGST Amount"
,
"Enter CGST Amount"
,
(
p0
)
{},
TextInputType
.
text
,
true
,
...
...
@@ -1909,6 +1921,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
sgstReadOnlyController
,
"SGST Amount"
,
"Enter SGST Amount"
,
(
p0
)
{},
TextInputType
.
text
,
true
,
...
...
@@ -1921,6 +1934,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
igstReadOnlyController
,
"IGST Amount"
,
"Enter IGST Amount"
,
(
p0
)
{},
TextInputType
.
text
,
true
,
...
...
@@ -1933,6 +1947,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
totalReadOnlyAmountController
,
"Total Amount"
,
"Enter Total Amount"
,
(
p0
)
{},
TextInputType
.
text
,
true
,
...
...
@@ -1945,6 +1960,7 @@ class OrderForm extends StatelessWidget {
context
,
provider
.
noteController
,
"Note"
,
"Enter Note"
,
(
p0
)
{},
TextInputType
.
text
,
false
,
...
...
lib/screens/order/addPayment.dart
View file @
2ccf19cc
...
...
@@ -218,6 +218,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
context
,
provider
.
amountController
,
"Amount"
,
"Enter Amount"
,
provider
.
onChangeAmount
,
TextInputType
.
number
,
false
,
...
...
@@ -393,6 +394,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
context
,
provider
.
orderAmountControllers
[
index
],
"Order Amount"
,
"Enter Order Amount"
,
(
p0
)
{
provider
.
updateAdjustedAmount
();
...
...
@@ -427,6 +429,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
context
,
provider
.
orderAdjustedAmountController
,
"Order Adjusted Amount"
,
"Enter Order Adjusted Amount"
,
provider
.
onChangeorderAdjustedAmount
,
TextInputType
.
number
,
false
,
...
...
@@ -597,7 +600,8 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
textControllerWidget
(
context
,
provider
.
paymentRefController
,
"Payment Reference No. / Cheque No. / UTR No. tf"
,
"Payment Reference No"
,
"Enter Payment Reference No. / Cheque No. / UTR No."
,
provider
.
onChangepaymentRef
,
TextInputType
.
text
,
false
,
...
...
@@ -626,7 +630,7 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
),
child:
Center
(
child:
Text
(
"Payment
Attachment
"
,
"Payment
Reference
"
,
style:
TextStyle
(
fontFamily:
"JakartaMedium"
,
color:
AppColors
.
app_blue
,
...
...
@@ -672,9 +676,9 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
bottomNavigationBar:
provider
.
submitClicked
?
null
:
bottomNavigationBar:
InkResponse
(
onTap:
()
{
onTap:
provider
.
submitClicked
?
null
:
()
{
provider
.
submitClicked
=
true
;
provider
.
selectedOrders
=
provider
.
getFormData
();
provider
.
ordersAddPaymentAPISubmitFunction
(
...
...
Prev
1
2
3
4
5
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