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
b269a97b
Commit
b269a97b
authored
May 09, 2025
by
Sai Srinivas
Browse files
09-05-2025 By Sai Srinivas
Service Engineer Module without Nearby Generators.
parent
c09dfa71
Changes
59
Show whitespace changes
Inline
Side-by-side
lib/screens/WebWhizzdomScreen.dart
View file @
b269a97b
...
...
@@ -6,6 +6,7 @@ import 'package:flutter_download_manager/flutter_download_manager.dart';
import
'package:flutter_downloader/flutter_downloader.dart'
;
import
'package:flutter_inappwebview/flutter_inappwebview.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:permission_handler/permission_handler.dart'
;
import
'WebERPScreen.dart'
;
...
...
@@ -77,33 +78,7 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
return
true
;
// Allow default back button behavior
},
child:
Scaffold
(
appBar:
AppBar
(
elevation:
0
,
title:
Container
(
child:
Row
(
children:
[
SizedBox
(
width:
10
),
Container
(
child:
InkWell
(
onTap:
()
=>
Navigator
.
pop
(
context
,
true
),
child:
Text
(
"Whizzdom"
,
textAlign:
TextAlign
.
left
,
style:
TextStyle
(
color:
AppColors
.
semi_black
,
fontSize:
18
,
)),
),
),
],
)),
titleSpacing:
0
,
leading:
Container
(
width:
10
,
),
leadingWidth:
20
,
),
appBar:
appbar
(
context
,
"Whizzdom"
),
body:
Container
(
child:
Column
(
children:
<
Widget
>[
Expanded
(
...
...
lib/screens/inventory/GeneratorPartDetailsScreen.dart
View file @
b269a97b
...
...
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Notifiers/InventoryProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:provider/provider.dart'
;
class
GeneratorPartDetailsScreen
extends
StatefulWidget
{
...
...
@@ -40,9 +41,7 @@ class _GeneratorPartDetailsScreenState extends State<GeneratorPartDetailsScreen>
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
AppBar
(
automaticallyImplyLeading:
false
,
),
appBar:
appbar
(
context
,
"Gen Inventory"
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
...
...
lib/screens/inventory/InventoryScreen.dart
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:generp/Notifiers/HomeScreenNotifier.dart'
;
import
'package:generp/Notifiers/InventoryProvider.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:provider/provider.dart'
;
import
'package:qr_code_scanner/qr_code_scanner.dart'
;
...
...
@@ -37,7 +38,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
appBar:
A
pp
B
ar
(),
appBar:
a
pp
b
ar
(
context
,
"Gen Inventory"
),
body:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
black
),
child:
Column
(
...
...
lib/screens/serviceEngineer/AccountSuggestions.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:generp/Notifiers/PaymentCollectionProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/serviceEngineer/PaymentDetails.dart'
;
import
'package:provider/provider.dart'
;
class
Accountsuggestions
extends
StatefulWidget
{
const
Accountsuggestions
({
super
.
key
});
@override
State
<
Accountsuggestions
>
createState
()
=>
_AccountsuggestionsState
();
}
class
_AccountsuggestionsState
extends
State
<
Accountsuggestions
>
{
final
TextEditingController
_searchController
=
TextEditingController
();
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Paymentcollectionprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
appBar:
appbar
(
context
,
"Accounts"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Column
(
children:
[
const
SizedBox
(
height:
10
,
),
Container
(
alignment:
Alignment
.
center
,
height:
55
,
margin:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
),
child:
TextField
(
controller:
_searchController
,
keyboardType:
TextInputType
.
text
,
onChanged:
(
value
)
{
if
(
value
.
length
>=
3
)
{
provider
.
AccountSuggestionAPI
(
context
,
value
);
}
},
decoration:
InputDecoration
(
hintText:
"Enter Account Name....."
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
),
filled:
true
,
),
),
),
Container
(
margin:
EdgeInsets
.
only
(
top:
5.0
,
left:
25.0
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Note: Enter Minimum 3 Characters"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w300
,
),
),
),
Expanded
(
child:
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
Container
(
child:
GridView
.
builder
(
itemCount:
provider
.
accountList
!.
length
,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
1
,
// 4 items in a row for tablet
crossAxisSpacing:
4
,
mainAxisSpacing:
2
,
childAspectRatio:
(
100
/
25
)),
padding:
const
EdgeInsets
.
all
(
5
),
physics:
const
BouncingScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
context
,
index
)
{
var
accountList
=
provider
.
accountList
;
if
(
accountList
!.
length
>
0
)
{
return
InkWell
(
onTap:
()
{
// if(actname == "pendingComplaints"&&status=="Open"){
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Account"
,
name:
accountList
![
index
].
accountName
,
genId:
""
,
referenceID:
accountList
![
index
].
accountId
,
),
));
// }
},
child:
SizedBox
(
child:
Container
(
width:
MediaQuery
.
of
(
context
).
size
.
width
*
0.9
,
padding:
EdgeInsets
.
fromLTRB
(
0
,
5
,
0
,
5
),
child:
Text
(
"
${accountList![index].accountName}
"
,
textAlign:
TextAlign
.
start
,
maxLines:
3
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w300
,
),
),
),
),
);
}
else
{
return
Expanded
(
child:
SingleChildScrollView
(
physics:
AlwaysScrollableScrollPhysics
(),
child:
Container
(
width:
double
.
infinity
,
height:
MediaQuery
.
of
(
context
)
.
size
.
height
,
// Set width to fill parent width
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
30.0
),
topRight:
Radius
.
circular
(
30.0
),
),
),
padding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
child:
Container
(
child:
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
"No Data Available"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
overflow:
TextOverflow
.
ellipsis
,
),
)),
)),
));
}
}),
),
))
],
),
);
}
);
}
}
lib/screens/serviceEngineer/AddContact.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
class
Addcontact
extends
StatefulWidget
{
const
Addcontact
({
super
.
key
});
@override
State
<
Addcontact
>
createState
()
=>
_AddcontactState
();
}
class
_AddcontactState
extends
State
<
Addcontact
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
const
Placeholder
();
}
}
lib/screens/serviceEngineer/Followupdetails.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Notifiers/VisitDetailsProvider.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'../../Utils/commonWidgets.dart'
;
class
Followupdetails
extends
StatefulWidget
{
final
complaintID
;
const
Followupdetails
({
super
.
key
,
required
this
.
complaintID
});
@override
State
<
Followupdetails
>
createState
()
=>
_FollowupdetailsState
();
}
class
_FollowupdetailsState
extends
State
<
Followupdetails
>
{
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
visitdetails
=
Provider
.
of
<
Visitdetailsprovider
>(
context
,
listen:
false
,
);
visitdetails
.
LoadFollowupListAPI
(
context
,
widget
.
complaintID
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Visitdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
followups
=
provider
.
followUpList
;
return
Scaffold
(
appBar:
appbar
(
context
,
"Follow Up Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
ListView
.
builder
(
itemCount:
provider
.
followUpList
.
length
,
itemBuilder:
(
context
,
index
)
{
return
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
children:
[
Row
(
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
4
,
(
j
)
{
final
textheads
=
[
"Name"
,
"Date"
,
"Type"
,
"Time"
,
"Feedback"
,
];
final
textSubheads
=
[
"
${followups[index].ename}
"
,
"
${followups[index].date}
"
,
"
${followups[index].type}
"
,
"
${followups[index].time}
"
,
"
${followups[index].feedback}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.8
,
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
),
],
),
],
),
),
);
}),
),
],
),
],
),
);
},
),
),
);
},
);
}
}
lib/screens/serviceEngineer/MonthlyCollection.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/PaymentCollectionProvider.dart'
;
import
'package:generp/screens/WebERPScreen.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'AccountSuggestions.dart'
;
class
Monthlycollection
extends
StatefulWidget
{
const
Monthlycollection
({
super
.
key
});
@override
State
<
Monthlycollection
>
createState
()
=>
_MonthlycollectionState
();
}
class
_MonthlycollectionState
extends
State
<
Monthlycollection
>
{
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
provider
=
Provider
.
of
<
Paymentcollectionprovider
>(
context
,
listen:
false
,
);
provider
.
PaymentCollectionAPI
(
context
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Paymentcollectionprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
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
,
),
),
Text
(
"Payment Collection"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
Spacer
(),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Accountsuggestions
(),
),
);
},
child:
SvgPicture
.
asset
(
"assets/svg/scanner.svg"
),
),
],
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
),
body:
Container
(
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
itemCount:
provider
.
paymenCollectionList
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
itemBuilder:
(
context
,
index
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
),
),
SizedBox
(
width:
5
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.paymenCollectionList[index].accountName}
"
,
),
// Text("Gen Pvt. Ltd"),
],
),
Spacer
(),
Expanded
(
flex:
2
,
child:
Text
(
"₹
${provider.paymenCollectionList[index].amount}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),
),
),
// Expanded(
// flex: 1,
// child: InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: Icon(Icons.more_vert),
// ),
// ),
],
),
SizedBox
(
height:
10
),
...
List
.
generate
(
2
,
(
j
)
{
final
textheads
=
[
"ID"
,
"Generator Type"
];
final
textSubheads
=
[
provider
.
paymenCollectionList
[
index
].
paymentRefNo
,
provider
.
paymenCollectionList
[
index
].
paymentMode
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
Text
(
textSubheads
[
j
].
toString
()),
],
),
if
(
j
==
1
)
Container
(
height:
30
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE3FFE0
),
borderRadius:
BorderRadius
.
circular
(
8
),
),
child:
Center
(
child:
Text
(
"
${provider.paymenCollectionList[index].approvalStatus}
"
,
style:
TextStyle
(
color:
Color
(
0xFF0D9C00
),
),
),
),
),
],
),
if
(
j
==
0
)
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
),
),
],
),
);
}),
SizedBox
(
height:
10
),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
WebErpScreen
(
erp_url:
provider
.
paymenCollectionList
[
index
]
.
paymentProofFilePath
??
""
,
),
),
);
},
child:
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"View Attachment"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),
),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
),
],
),
),
),
],
),
);
},
),
),
);
},
);
}
}
lib/screens/serviceEngineer/NearbyGenerators.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
class
Nearbygenerators
extends
StatefulWidget
{
const
Nearbygenerators
({
super
.
key
});
@override
State
<
Nearbygenerators
>
createState
()
=>
_NearbygeneratorsState
();
}
class
_NearbygeneratorsState
extends
State
<
Nearbygenerators
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
const
Placeholder
();
}
}
lib/screens/serviceEngineer/PCWallet.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/PCWalletProvider.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Models/PaymentCollectionWalletResponse.dart'
;
import
'../../Utils/app_colors.dart'
;
class
Pcwallet
extends
StatefulWidget
{
const
Pcwallet
({
super
.
key
});
@override
State
<
Pcwallet
>
createState
()
=>
_PcwalletState
();
}
class
_PcwalletState
extends
State
<
Pcwallet
>
{
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
provider
=
Provider
.
of
<
Pcwalletprovider
>(
context
,
listen:
false
);
provider
.
LoadTransactionsListAPI
(
context
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Pcwalletprovider
>(
builder:
(
context
,
provider
,
child
)
{
final
groupedData
=
provider
.
groupByDate
(
provider
.
historyList
);
return
Scaffold
(
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
,
),
),
Text
(
"P.C. Wallet"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
Spacer
(),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
),
height:
40
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFF2FAFF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
'assets/svg/pc_wallet.svg'
,
height:
30
,
),
SizedBox
(
width:
5
),
Text
(
"
${provider.totlDetails.balanceAmount}
"
,
style:
TextStyle
(
fontSize:
14
),
),
],
),
),
],
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
children:
[
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFE7FFE5
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"₹"
,
style:
TextStyle
(
height:
1
,
color:
Color
(
0xFF0D9C00
),
),
),
Text
(
"
${provider.totlDetails.creditAmount}
"
,
style:
TextStyle
(
fontSize:
30
,
height:
1
,
color:
Color
(
0xFF0D9C00
),
),
),
],
),
Text
(
"Credited"
),
],
),
),
),
SizedBox
(
width:
10
),
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFEFEF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"₹"
,
style:
TextStyle
(
height:
1
,
color:
Color
(
0xFFED3424
),
),
),
Text
(
"
${provider.totlDetails.debitAmount}
"
,
style:
TextStyle
(
fontSize:
30
,
height:
1
,
color:
Color
(
0xFFED3424
),
),
),
],
),
Text
(
"Debited"
),
],
),
),
),
],
),
),
ListView
.
builder
(
physics:
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
itemCount:
groupedData
.
keys
.
length
,
itemBuilder:
(
context
,
index
)
{
String
date
=
groupedData
.
keys
.
elementAt
(
index
);
List
<
HistoryList
>
items
=
groupedData
[
date
]!;
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
bottom:
5
),
child:
Text
(
date
,
style:
TextStyle
(
fontSize:
14
,
color:
Color
(
0xFF818181
),
),
),
),
...
items
.
map
((
item
)
{
String
part1
=
item
.
description
!.
split
(
' ('
).
first
;
RegExp
regExp
=
RegExp
(
r'\(([^)]+)\)'
);
String
?
part2
=
regExp
.
firstMatch
(
item
.
description
!)
?.
group
(
1
);
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
,
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
part1
),
Text
(
"
${part2}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
],
),
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
item
.
transactionType
==
"Credit"
?
"+"
:
"-"
,
style:
TextStyle
(
color:
item
.
transactionType
==
"Credit"
?
Color
(
0xFF0D9C00
)
:
Color
(
0xFFED3424
),
fontSize:
16
,
fontFamily:
"Lexend"
,
),
),
TextSpan
(
text:
"₹
${item.amount!}
"
,
style:
TextStyle
(
color:
item
.
transactionType
==
"Credit"
?
Color
(
0xFF0D9C00
)
:
Color
(
0xFFED3424
),
fontSize:
16
,
fontFamily:
"Lexend"
,
),
),
],
),
),
],
),
);
}).
toList
(),
],
),
);
},
),
],
),
),
),
);
},
);
}
}
lib/screens/serviceEngineer/PaymentDetails.dart
0 → 100644
View file @
b269a97b
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/Notifiers/PaymentCollectionProvider.dart'
;
import
'package:generp/Notifiers/PaymentDetailsProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:pin_code_fields/pin_code_fields.dart'
;
import
'package:provider/provider.dart'
;
import
'../../Models/TechnicianLoadNumbersResponse.dart'
;
class
Paymentdetails
extends
StatefulWidget
{
final
accountName
,
referenceID
,
name
,
genId
;
const
Paymentdetails
({
super
.
key
,
required
this
.
accountName
,
required
this
.
name
,
required
this
.
genId
,
required
this
.
referenceID
,
});
@override
State
<
Paymentdetails
>
createState
()
=>
_PaymentdetailsState
();
}
class
_PaymentdetailsState
extends
State
<
Paymentdetails
>
{
TextEditingController
Amountcontroller
=
TextEditingController
();
TextEditingController
Referencecontroller
=
TextEditingController
();
TextEditingController
nameController
=
TextEditingController
();
TextEditingController
designationController
=
TextEditingController
();
TextEditingController
mobController
=
TextEditingController
();
TextEditingController
altMobController
=
TextEditingController
();
TextEditingController
telController
=
TextEditingController
();
TextEditingController
emailController
=
TextEditingController
();
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
Future
.
microtask
(()
{
var
provider
=
Provider
.
of
<
Paymentdetailsprovider
>(
context
,
listen:
false
,
);
provider
.
LoadNumbersAPI
(
context
,
widget
.
accountName
,
widget
.
referenceID
,
widget
.
genId
);
},);
},);
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Paymentdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
// Debug prints to inspect contactsDropDown and selectContact
debugPrint
(
"contactsDropDown:
${provider.contactsDropDown}
"
);
debugPrint
(
"selectContact:
${provider.selectContact}
"
);
return
Scaffold
(
appBar:
appbar
(
context
,
"Payment Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
)
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Text
(
"
${widget.name}
"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),)),
SizedBox
(
height:
10
,),
Text
(
"Phone Number"
),
Row
(
children:
[
Expanded
(
child:
DropdownButtonHideUnderline
(
child:
DropdownButton2
<
Contacts
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Phone Number'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
items:
[
...
provider
.
contactsDropDown
.
map
((
contacts
)
{
return
DropdownMenuItem
<
Contacts
>(
value:
contacts
,
// You can use the entire object, but we need to ensure it's unique
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
contacts
.
name
??
""
,
maxLines:
1
,
style:
const
TextStyle
(
fontSize:
12
,
),
overflow:
TextOverflow
.
ellipsis
,
),
Text
(
contacts
.
mob1
??
""
,
style:
const
TextStyle
(
fontSize:
12
,
),
overflow:
TextOverflow
.
ellipsis
,
),
],
),
);
}).
toList
(),
DropdownMenuItem
<
Contacts
>(
value:
null
,
// No value associated with the button
enabled:
false
,
// To disable selecting this item
child:
InkWell
(
onTap:
()
{
_addContactSheet
(
context
);
},
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
12
,
horizontal:
14
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
const
[
Text
(
'Add Contact'
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
blue
),
),
],
),
),
),
),
],
value:
provider
.
selectContact
,
// The selected value is now the entire 'Contacts' object
onChanged:
(
Contacts
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
contactsDropDown
.
isNotEmpty
)
{
provider
.
selectContact
=
value
;
// Set the selected contact
provider
.
contact
=
value
.
name
??
""
;
// Update the contact name
provider
.
contactID
=
value
.
mob1
??
""
;
// Update the contact ID
debugPrint
(
"Selected Contact:
${value
.name}
, Phone:
${value.mob1}
"
);
}
}
},
buttonStyleData:
ButtonStyleData
(
height:
50
,
width:
160
,
padding:
const
EdgeInsets
.
only
(
left:
14
,
right:
14
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
),
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down_sharp
,
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
280
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
),
thumbVisibility:
MaterialStateProperty
.
all
<
bool
>(
true
),
),
),
menuItemStyleData:
const
MenuItemStyleData
(
height:
60
,
padding:
EdgeInsets
.
only
(
left:
14
,
right:
14
),
),
),
),
),
],
),
SizedBox
(
height:
10
,),
Text
(
"Complaint Type"
),
Row
(
children:
[
Expanded
(
child:
DropdownButtonHideUnderline
(
child:
DropdownButton2
<
PaymentModeList
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Complaint Type'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
items:
provider
.
paymentModeDropDown
.
map
((
paymentMode
)
=>
DropdownMenuItem
<
PaymentModeList
>(
value:
paymentMode
,
child:
Text
(
paymentMode
.
name
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
))
.
toList
(),
value:
provider
.
selectPaymentMode
,
onChanged:
(
PaymentModeList
?
value
)
{
if
(
value
!=
null
)
{
if
(
provider
.
paymentModeDropDown
.
isNotEmpty
)
{
provider
.
selectPaymentMode
=
value
;
print
(
"Selected Complaint Type:
${value
.name}
, ID:
${value.id}
"
);
provider
.
PaymentMode
=
value
?.
name
;
provider
.
paymentModeID
=
value
?.
id
;
print
(
"hfjkshfg"
+
provider
.
paymentModeID
.
toString
());
}
}
},
buttonStyleData:
ButtonStyleData
(
height:
50
,
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
padding:
const
EdgeInsets
.
only
(
left:
14
,
right:
14
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
),
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down
,
),
iconSize:
12
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
340
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
),
thumbVisibility:
MaterialStateProperty
.
all
<
bool
>(
true
),
),
),
menuItemStyleData:
const
MenuItemStyleData
(
height:
40
,
padding:
EdgeInsets
.
only
(
left:
14
,
right:
14
),
),
),
),
),
],
),
SizedBox
(
height:
10
,),
Text
(
"Amount"
),
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
Amountcontroller
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter Amount"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
SizedBox
(
height:
10
,),
Text
(
"Reference Number"
),
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
Referencecontroller
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter Reference Number"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
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
(
"Scan Document"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),),
),
),
),
],
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkWell
(
onTap:
()
{
provider
.
CheckValidations
(
context
,
Referencecontroller
.
text
,
Amountcontroller
.
text
);
if
(
provider
.
CollectionId
!=
0
)
{
_showOTPSheetSheet
(
context
);
}
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30.0
),
),
child:
Center
(
child:
Text
(
"Send OTP"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
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
<
Paymentdetailsprovider
>(
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
.
imgFromGallery
(
context
,
Referencecontroller
.
text
,
Amountcontroller
.
text
);
},
child:
Container
(
height:
35
,
child:
Text
(
"Select photo from gallery"
),
),
),
SizedBox
(
height:
10
),
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromCamera
(
context
,
Referencecontroller
.
text
,
Amountcontroller
.
text
);
},
child:
Container
(
height:
35
,
child:
Text
(
"Capture photo from camera"
),
),
),
],
),
),
),
);
},
),
);
},
);
},
);
}
Future
<
void
>
_showOTPSheetSheet
(
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
<
Paymentdetailsprovider
>(
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
(
"Enter OTP"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
),
),
),
SizedBox
(
height:
15
,),
Column
(
children:
[
Container
(
alignment:
Alignment
.
center
,
height:
50
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
),
child:
PinCodeTextField
(
appContext:
context
,
pastedTextStyle:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
),
length:
4
,
blinkWhenObscuring:
true
,
animationType:
AnimationType
.
fade
,
// validator: (v) {
// if (v!.length < 3) {
// return "I'm from validator";
// } else {
// return null;
// }
// },
pinTheme:
PinTheme
(
shape:
PinCodeFieldShape
.
underline
,
borderRadius:
BorderRadius
.
circular
(
16
),
fieldHeight:
60
,
fieldWidth:
60
,
activeFillColor:
AppColors
.
text_field_color
,
activeColor:
AppColors
.
app_blue
,
selectedColor:
AppColors
.
text_field_color
,
selectedFillColor:
AppColors
.
text_field_color
,
inactiveFillColor:
AppColors
.
text_field_color
,
inactiveColor:
AppColors
.
text_field_color
,
fieldOuterPadding:
EdgeInsets
.
only
(
left:
5
,
right:
5
,
),
inactiveBorderWidth:
0
,
activeBorderWidth:
0.5
,
),
enableActiveFill:
true
,
keyboardType:
TextInputType
.
number
,
boxShadows:
const
[
BoxShadow
(
offset:
Offset
(
0
,
1
),
color:
Colors
.
black12
,
blurRadius:
10
,
),
],
onCompleted:
(
String
enteredCode
)
{
provider
.
enteredOtp
=
enteredCode
;
// clearText = true;
provider
.
OTPVerifyAPI
(
context
);
Navigator
.
pop
(
context
,
true
);
debugPrint
(
"Completed"
);
},
// onTap: () {
// print("Pressed");
// },
onChanged:
(
String
enteredCode
)
{
debugPrint
(
enteredCode
);
provider
.
enteredOtp
=
enteredCode
;
},
onSubmitted:
(
String
enteredCode
)
{
provider
.
enteredOtp
=
enteredCode
;
// clearText = true;
// Verify_otp();
},
enablePinAutofill:
true
,
useExternalAutoFillGroup:
true
,
beforeTextPaste:
(
text
)
{
debugPrint
(
"Allowing to paste
$text
"
);
//if you return true then it will show the paste confirmation dialog. Otherwise if false, then nothing will happen.
//but you can show anything you want here, like your pop up saying wrong paste format or etc
return
true
;
},
),
),
SizedBox
(
height:
15
),
Container
(
width:
110
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
10.0
,
right:
10.0
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
TextButton
(
onPressed:
()
=>
{
Navigator
.
of
(
context
).
pop
(
false
),
provider
.
OTPVerifyAPI
(
context
),
},
child:
Text
(
"Submit"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w300
),
),
),
),
],
),
],
),
),
),
);
},
),
);
},
);
},
);
}
Future
<
void
>
_addContactSheet
(
BuildContext
context
)
{
final
controllers
=
[
nameController
,
designationController
,
mobController
,
altMobController
,
telController
,
emailController
];
final
controllersNames
=
[
"Name"
,
"Designation"
,
"Mobile Number"
,
"Alternate Mobile Number"
,
"Telephone Number"
,
"Email ID"
];
final
hintTextNames
=
[
"Enter Name"
,
"Enter Designation"
,
"Enter Mobile Number"
,
"Enter Alternate Mobile Number"
,
"Enter Telephone Number"
,
"Enter Email ID"
];
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
<
Paymentdetailsprovider
>(
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:
[
SizedBox
(
height:
15
),
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
"Add Contact"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
,
fontSize:
16
),
),
),
...
List
.
generate
(
controllers
.
length
,
(
index
)
{
return
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${controllersNames[index]}
"
,
),
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
25
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
controllers
[
index
],
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"
${hintTextNames[index]}
"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
],
);
},),
InkWell
(
onTap:
()
{
provider
.
AddContactAPIFunction
(
context
,
widget
.
accountName
,
widget
.
genId
,
nameController
.
text
,
designationController
.
text
,
mobController
.
text
,
altMobController
.
text
,
telController
.
text
,
emailController
.
text
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
],
),
),
),
);
},
),
);
},
);
},
);
}
}
lib/screens/serviceEngineer/PendingComplaints.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/PendingComplaintsProvider.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/serviceEngineer/PaymentDetails.dart'
;
import
'package:generp/screens/serviceEngineer/VisitDetails.dart'
;
import
'package:provider/provider.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'../../Utils/app_colors.dart'
;
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'UpdateComplaints.dart'
;
class
Pendingcomplaints
extends
StatefulWidget
{
const
Pendingcomplaints
({
super
.
key
});
@override
State
<
Pendingcomplaints
>
createState
()
=>
_PendingcomplaintsState
();
}
class
_PendingcomplaintsState
extends
State
<
Pendingcomplaints
>
{
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
complaintsprovider
=
Provider
.
of
<
Pendingcomplaintsprovider
>(
context
,
listen:
false
,
);
complaintsprovider
.
TechnicianPendingComplaints
(
context
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Pendingcomplaintsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
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
,
),
),
Text
(
"Pending Complaints"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
Spacer
(),
SvgPicture
.
asset
(
"assets/svg/scanner.svg"
),
],
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
),
body:
Container
(
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
itemCount:
provider
.
technician_complaint_list
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
itemBuilder:
(
context
,
index
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
),
),
SizedBox
(
width:
5
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.technician_complaint_list[index].contactName}
"
,
),
Text
(
"
${provider.technician_complaint_list[index].companyName}
"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
],
),
Spacer
(),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
launch
(
'tel://
${provider.technician_complaint_list[index].mobileNo}
'
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/se_call_customer.svg"
,
),
),
),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
_showOptionsSheet
(
context
,
provider
.
technician_complaint_list
[
index
]
.
companyName
,
provider
.
technician_complaint_list
[
index
]
.
genId
,
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
);
},
child:
Icon
(
Icons
.
more_vert
),
),
),
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
3
,
(
j
)
{
final
textheads
=
[
"ID"
,
"Generator Type"
,
"Address"
];
final
textSubheads
=
[
provider
.
technician_complaint_list
[
index
].
genId
,
provider
.
technician_complaint_list
[
index
].
productName
,
provider
.
technician_complaint_list
[
index
].
address
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
Text
(
textSubheads
[
j
].
toString
(),
style:
TextStyle
(
color:
Color
(
0xFF818181
)),
),
],
),
);
}),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Visitdetails
(
complaintID:
provider
.
technician_complaint_list
[
index
]
.
complaintId
,
),
),
);
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"View Details"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),
),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
),
],
),
),
],
),
);
},
),
),
);
},
);
}
Future
<
void
>
_showOptionsSheet
(
BuildContext
context
,
companyName
,
genId
,
complaintId
,
)
{
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
<
Pendingcomplaintsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
child:
SingleChildScrollView
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SizedBox
(
height:
15
),
...
List
.
generate
(
3
,
(
index
)
{
final
assetnames
=
[
"se_locate_customer"
,
"se_update_complaint"
,
"se_payment_details"
,
];
final
Headingnames
=
[
"Location"
,
"Update Complaint"
,
"Payment Details"
,
];
return
ListTile
(
onTap:
()
async
{
switch
(
index
)
{
case
0
:
{
var
loc
=
provider
.
technician_complaint_list
[
index
]
.
loc
?.
split
(
","
)
.
toString
();
var
uri
=
Uri
.
parse
(
"google.navigation:q=
${loc![0]}
,
${loc![1]}
&mode=d"
,
);
if
(
await
canLaunch
(
uri
.
toString
()))
{
await
launch
(
uri
.
toString
());
}
else
{
throw
'Could not launch
${uri.toString()}
'
;
}
}
break
;
case
1
:
Navigator
.
pop
(
context
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Updatecomplaints
(
ComplaintID:
complaintId
,
),
),
);
break
;
case
2
:
Navigator
.
pop
(
context
);
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Account"
,
name:
companyName
,
genId:
genId
,
referenceID:
complaintId
,
),
),
);
break
;
}
},
leading:
SvgPicture
.
asset
(
"assets/svg/
${assetnames[index]}
.svg"
,
),
title:
Text
(
Headingnames
[
index
]),
trailing:
Icon
(
Icons
.
arrow_forward_ios_sharp
,
size:
16
,
),
);
}),
],
),
),
);
},
),
);
},
);
},
);
}
}
lib/screens/serviceEngineer/TodayMontlyVisists.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/screens/serviceEngineer/PaymentDetails.dart'
;
import
'package:generp/screens/serviceEngineer/VisitDetails.dart'
;
import
'package:provider/provider.dart'
;
import
'package:url_launcher/url_launcher.dart'
;
import
'../../Notifiers/TodayMontlyVisitsProvider.dart'
;
import
'../../Utils/app_colors.dart'
;
class
Todaymontlyvisists
extends
StatefulWidget
{
final
String
visitType
;
const
Todaymontlyvisists
({
super
.
key
,
required
this
.
visitType
});
@override
State
<
Todaymontlyvisists
>
createState
()
=>
_TodaymontlyvisistsState
();
}
class
_TodaymontlyvisistsState
extends
State
<
Todaymontlyvisists
>
{
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
visitsProvider
=
Provider
.
of
<
Todaymontlyvisitsprovider
>(
context
,
listen:
false
,
);
switch
(
widget
.
visitType
)
{
case
"Month"
:
visitsProvider
.
title
=
"Monthly Visits"
;
visitsProvider
.
LoadMonthVisitsListAPI
(
context
);
break
;
case
"Today"
:
visitsProvider
.
title
=
"Today Visits"
;
visitsProvider
.
LoadTodayVisitsListAPI
(
context
);
break
;
}
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Todaymontlyvisitsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
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
,
),
),
Text
(
provider
.
title
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
Spacer
(),
SvgPicture
.
asset
(
"assets/svg/scanner.svg"
),
],
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
),
body:
Container
(
child:
ListView
.
builder
(
scrollDirection:
Axis
.
vertical
,
shrinkWrap:
true
,
itemCount:
provider
.
visitsList
.
length
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
itemBuilder:
(
context
,
index
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
margin:
EdgeInsets
.
symmetric
(
vertical:
5
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
),
),
SizedBox
(
width:
5
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"
${provider.visitsList[index]
.companyName}
"
,
),
Text
(
"Gen Pvt. Ltd"
),
],
),
Spacer
(),
Expanded
(
flex:
1
,
child:
InkResponse
(
onTap:
()
{
launch
(
'tel://
${provider
.visitsList[index]
.mobileNo}
'
,
);
},
child:
SvgPicture
.
asset
(
"assets/svg/se_call_customer.svg"
,
),
),
),
// Expanded(
// flex: 1,
// child: InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: Icon(Icons.more_vert),
// ),
// ),
],
),
Divider
(
thickness:
0.5
,
color:
Color
(
0xFFD7D7D7
)),
...
List
.
generate
(
3
,
(
j
)
{
final
textheads
=
[
"ID"
,
"Generator Type"
,
"Address"
];
final
textSubheads
=
[
provider
.
visitsList
[
index
].
genId
,
provider
.
visitsList
[
index
].
productName
,
provider
.
visitsList
[
index
].
address
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
Text
(
textSubheads
[
j
].
toString
()),
],
),
);
}),
SizedBox
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Paymentdetails
(
accountName:
"Generator"
,
name:
provider
.
visitsList
[
index
].
companyName
,
genId:
provider
.
visitsList
[
index
].
genId
,
referenceID:
provider
.
visitsList
[
index
].
complaintId
),));
},
child:
SvgPicture
.
asset
(
"assets/svg/se_payment_details.svg"
,
),
),
Spacer
(),
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Visitdetails
(
complaintID:
provider
.
visitsList
[
index
].
complaintId
),));
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"View Details"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),),
SizedBox
(
width:
5
),
SvgPicture
.
asset
(
"assets/svg/next_button.svg"
,
),
],
),
),
],
),
),
],
),
);
},
),
),
);
},
);
}
Future
<
void
>
_showOptionsSheet
(
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
<
Todaymontlyvisitsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Container
(
margin:
EdgeInsets
.
only
(
bottom:
15
,
left:
15
,
right:
15
,
top:
10
,
),
child:
SingleChildScrollView
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SizedBox
(
height:
15
),
ListTile
(
onTap:
()
async
{
// _showUpdateComplaintSheet(context,provider.visitsList[index].complaintId);
},
leading:
SvgPicture
.
asset
(
"assets/svg/se_payment_details.svg"
,
),
title:
Text
(
"Payment Details"
),
trailing:
Icon
(
Icons
.
arrow_forward_ios_sharp
,
size:
16
,),
)
],
),
),
);
},
),
);
},
);
},
);
}
}
lib/screens/serviceEngineer/UpdateComplaints.dart
0 → 100644
View file @
b269a97b
import
'package:dropdown_button2/dropdown_button2.dart'
;
import
'package:flutter/material.dart'
;
import
'package:generp/Notifiers/PendingComplaintsProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:provider/provider.dart'
;
class
Updatecomplaints
extends
StatefulWidget
{
final
ComplaintID
;
const
Updatecomplaints
({
super
.
key
,
required
this
.
ComplaintID
});
@override
State
<
Updatecomplaints
>
createState
()
=>
_UpdatecomplaintsState
();
}
class
_UpdatecomplaintsState
extends
State
<
Updatecomplaints
>
{
TextEditingController
fsrNumberController
=
TextEditingController
();
TextEditingController
runningHoursController
=
TextEditingController
();
TextEditingController
feedbackController
=
TextEditingController
();
final
List
<
Map
<
String
,
dynamic
>>
CompletedStatus
=
[
{
"id"
:
"1"
,
"name"
:
"Pending"
},
{
"id"
:
"2"
,
"name"
:
"Completed"
}
];
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Pendingcomplaintsprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
appBar:
appbar
(
context
,
"Update Complaint"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
)
),
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SizedBox
(
height:
15
),
Text
(
"Complaint Status"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
),
),
Row
(
children:
[
Expanded
(
child:
DropdownButtonHideUnderline
(
child:
DropdownButton2
<
String
>(
isExpanded:
true
,
hint:
const
Row
(
children:
[
Expanded
(
child:
Text
(
'Select Complaint Status'
,
style:
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
),
],
),
items:
CompletedStatus
.
map
(
(
complaintStatus
)
=>
DropdownMenuItem
<
String
>(
value:
complaintStatus
[
'name'
],
child:
Text
(
complaintStatus
[
'name'
]
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
),
overflow:
TextOverflow
.
ellipsis
,
),
)).
toList
(),
value:
provider
.
statusID
,
onChanged:
(
value
)
{
if
(
value
!=
null
)
{
provider
.
statusID
=
value
;
print
(
"statusId:
${provider.statusID}
"
);
}
},
buttonStyleData:
ButtonStyleData
(
height:
50
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
padding:
const
EdgeInsets
.
only
(
left:
14
,
right:
14
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
),
iconStyleData:
const
IconStyleData
(
icon:
Icon
(
Icons
.
keyboard_arrow_down_sharp
,
),
iconSize:
14
,
iconEnabledColor:
Color
(
0xFF2D2D2D
),
iconDisabledColor:
Colors
.
grey
,
),
dropdownStyleData:
DropdownStyleData
(
maxHeight:
200
,
width:
310
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
14
),
color:
AppColors
.
text_field_color
,
),
scrollbarTheme:
ScrollbarThemeData
(
radius:
const
Radius
.
circular
(
15
),
thickness:
MaterialStateProperty
.
all
<
double
>(
6
),
thumbVisibility:
MaterialStateProperty
.
all
<
bool
>(
true
),
),
),
menuItemStyleData:
const
MenuItemStyleData
(
height:
40
,
padding:
EdgeInsets
.
only
(
left:
14
,
right:
14
),
),
),
),
),
],
),
Text
(
"FSR Number"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
),
),
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
fsrNumberController
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter FSR Number"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
Row
(
children:
[
Expanded
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20.0
),
child:
Text
(
"Select Time"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
),
),
),
),
Expanded
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20.0
),
child:
Text
(
"Running Hours"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
),
),
),
),
],
),
Row
(
children:
[
Expanded
(
child:
Container
(
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
InkWell
(
onTap:
()
{
provider
.
selectTime
(
context
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
15.0
,
right:
15.0
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
15.0
),
),
child:
Row
(
children:
[
Text
(
provider
.
selectedTime
.
hour
.
toString
()
+
":"
+
provider
.
selectedTime
.
minute
.
toString
()
??
"Enter in Time"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
),
),
]),
),
)),
),
SizedBox
(
width:
10
,),
Expanded
(
child:
Container
(
height:
50
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
runningHoursController
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter FSR Number"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
),
],
),
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
(
"Scan Document"
,
style:
TextStyle
(
color:
AppColors
.
app_blue
),),
),
),
),
Text
(
"Feedback"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Colors
.
grey
,
),
),
Container
(
height:
150
,
alignment:
Alignment
.
center
,
decoration:
BoxDecoration
(
color:
AppColors
.
text_field_color
,
borderRadius:
BorderRadius
.
circular
(
14
),
),
child:
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
10.0
,
0.0
,
10
,
0
),
child:
TextFormField
(
controller:
feedbackController
,
maxLines:
60
,
keyboardType:
TextInputType
.
text
,
decoration:
InputDecoration
(
hintText:
"Enter Feedback"
,
hintStyle:
TextStyle
(
fontWeight:
FontWeight
.
w400
,
color:
Color
(
0xFFB4BEC0
),
fontSize:
14
),
enabledBorder:
InputBorder
.
none
,
focusedBorder:
InputBorder
.
none
,
),
),
),
),
],
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
floatingActionButton:
InkWell
(
onTap:
()
{
provider
.
UpdateComplaintAPIFunction
(
context
,
widget
.
ComplaintID
,
feedbackController
.
text
,
fsrNumberController
.
text
,
runningHoursController
.
text
,
provider
.
statusID
);
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
45
,
margin:
EdgeInsets
.
only
(
left:
5.0
,
right:
5.0
,
top:
5.0
,
bottom:
5.0
,
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
//1487C9
borderRadius:
BorderRadius
.
circular
(
30.0
),
),
child:
Center
(
child:
Text
(
"Submit"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
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
<
Pendingcomplaintsprovider
>(
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
.
imgFromGallery
();
},
child:
Container
(
height:
35
,
child:
Text
(
"Select photo from gallery"
),
),
),
SizedBox
(
height:
10
),
InkWell
(
onTap:
()
{
Navigator
.
of
(
context
).
pop
(
false
);
provider
.
imgFromCamera
(
);
},
child:
Container
(
height:
35
,
child:
Text
(
"Capture photo from camera"
),
),
),
],
),
),
),
);
},
),
);
},
);
},
);
}
}
lib/screens/serviceEngineer/VisitDetails.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/VisitDetailsProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:provider/provider.dart'
;
import
'Followupdetails.dart'
;
class
Visitdetails
extends
StatefulWidget
{
final
complaintID
;
const
Visitdetails
({
super
.
key
,
required
this
.
complaintID
});
@override
State
<
Visitdetails
>
createState
()
=>
_VisitdetailsState
();
}
class
_VisitdetailsState
extends
State
<
Visitdetails
>
{
@override
void
initState
()
{
// TODO: implement initState
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
visitdetails
=
Provider
.
of
<
Visitdetailsprovider
>(
context
,
listen:
false
,
);
visitdetails
.
LoadVisitDetailsAPI
(
context
,
widget
.
complaintID
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Visitdetailsprovider
>(
builder:
(
context
,
provider
,
child
)
{
var
customerDetails
=
provider
.
customerDetails
;
var
generatorDetails
=
provider
.
generatorDetails
;
var
complaintDetails
=
provider
.
complaintDetailsNew
;
return
Scaffold
(
appBar:
appbar
(
context
,
"Visit Details"
),
backgroundColor:
AppColors
.
scaffold_bg_color
,
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"Customer Details"
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
children:
[
Row
(
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
4
,
(
j
)
{
final
textheads
=
[
"
${customerDetails.cname}
"
,
"Mobile Number"
,
"Contact Person Number"
,
"Mail ID"
,
];
final
textSubheads
=
[
"
${customerDetails.aname}
"
,
"
${customerDetails.mob1}
"
,
"
${customerDetails.mob2}
"
,
"
${customerDetails.mail}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
if
(
j
==
0
)
...[
SvgPicture
.
asset
(
"assets/svg/se_block_head.svg"
,
),
SizedBox
(
width:
5
),
],
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.75
,
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
),
],
),
],
),
),
);
}),
),
],
),
],
),
),
Text
(
"Generator Details"
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
children:
[
Row
(
children:
[
SvgPicture
.
asset
(
"assetName"
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
6
,
(
j
)
{
final
textheads
=
[
"Gen ID"
,
"Engine Number"
,
"Address"
,
"Product Name"
,
"Engine Model"
,
"Date Of Supply"
,
];
final
textSubheads
=
[
"
${generatorDetails.genHashId}
"
,
"
${generatorDetails.engineNo}
"
,
"
${generatorDetails.address}
"
,
"
${generatorDetails.spname}
"
,
"
${generatorDetails.engineModel}
"
,
"
${complaintDetails.dateOfSupply}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.8
,
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
),
),
],
),
],
),
);
}),
),
],
),
],
),
),
Text
(
"Complaint Details"
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
5
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
10
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
children:
[
Row
(
children:
[
SvgPicture
.
asset
(
"assetName"
),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
List
.
generate
(
4
,
(
j
)
{
final
textheads
=
[
"Complaint ID"
,
"Complaint Description"
,
"Opened Date"
,
"Complaint Type"
,
];
final
textSubheads
=
[
"
${complaintDetails.complaintId}
"
,
"
${complaintDetails.complaintDesc}
"
,
"
${complaintDetails.openedDate}
"
,
"
${complaintDetails.complaintType}
"
,
];
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
3
,
horizontal:
0
,
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
textheads
[
j
].
toString
()),
SizedBox
(
// height:45,
width:
MediaQuery
.
of
(
context
,
).
size
.
width
*
0.8
,
child:
Text
(
textSubheads
[
j
],
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
),
),
),
],
),
),
],
),
],
),
);
}),
),
],
),
],
),
),
SizedBox
(
height:
75
),
],
),
),
),
floatingActionButton:
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
InkWell
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Followupdetails
(
complaintID:
widget
.
complaintID
),
),
);
},
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
45
,
width:
MediaQuery
.
of
(
context
).
size
.
width
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
),
decoration:
BoxDecoration
(
color:
AppColors
.
app_blue
,
borderRadius:
BorderRadius
.
circular
(
30.0
),
),
child:
Center
(
child:
Text
(
"Followup Details"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
white
),
),
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation
.
centerFloat
,
);
},
);
}
}
lib/screens/serviceEngineer/serviceEngineerDashboard.dart
0 → 100644
View file @
b269a97b
import
'package:flutter/material.dart'
;
import
'package:flutter_svg/svg.dart'
;
import
'package:generp/Notifiers/ServiceEngineerDashboardProvider.dart'
;
import
'package:generp/Utils/app_colors.dart'
;
import
'package:generp/Utils/commonWidgets.dart'
;
import
'package:generp/screens/serviceEngineer/MonthlyCollection.dart'
;
import
'package:generp/screens/serviceEngineer/PCWallet.dart'
;
import
'package:generp/screens/serviceEngineer/PendingComplaints.dart'
;
import
'package:generp/screens/serviceEngineer/TodayMontlyVisists.dart'
;
import
'package:provider/provider.dart'
;
class
Serviceengineerdashboard
extends
StatefulWidget
{
const
Serviceengineerdashboard
({
super
.
key
});
@override
State
<
Serviceengineerdashboard
>
createState
()
=>
_ServiceengineerdashboardState
();
}
class
_ServiceengineerdashboardState
extends
State
<
Serviceengineerdashboard
>
{
@override
void
initState
()
{
super
.
initState
();
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
var
serviceProvider
=
Provider
.
of
<
Serviceengineerdashboardprovider
>(
context
,
listen:
false
,
);
serviceProvider
.
LoadTechnicianDashboard
(
context
);
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
Consumer
<
Serviceengineerdashboardprovider
>(
builder:
(
context
,
provider
,
child
)
{
return
Scaffold
(
backgroundColor:
AppColors
.
scaffold_bg_color
,
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
,
),
),
Text
(
"Service Engineer"
,
style:
TextStyle
(
fontSize:
16
,
height:
1.1
,
color:
AppColors
.
semi_black
,
),
),
Spacer
(),
Container
(
height:
25
,
width:
45
,
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFF6E2
),
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SvgPicture
.
asset
(
'assets/svg/engineer_rating.svg'
,
height:
15
,
),
SizedBox
(
width:
5
),
Text
(
provider
.
avgRating
.
toString
(),
style:
TextStyle
(
fontSize:
14
),
),
],
),
),
],
),
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
30
),
// Adjust the radius as needed
),
),
),
body:
Container
(
child:
SingleChildScrollView
(
child:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
0
,
bottom:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
vertical
(
bottom:
Radius
.
circular
(
16
),
),
),
child:
Column
(
children:
[
InkResponse
(
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
Pendingcomplaints
(),
),
);
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
,
),
decoration:
BoxDecoration
(
color:
Color
(
0xFFFFEFEF
),
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Expanded
(
child:
SizedBox
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"
${provider.pendingComplaints}
"
,
style:
TextStyle
(
fontSize:
30
,
color:
Color
(
0xFFED3424
),
),
),
Text
(
"Pending Complaints"
),
],
),
),
),
],
),
),
),
],
),
),
Container
(
padding:
EdgeInsets
.
only
(
left:
15
),
alignment:
Alignment
.
topLeft
,
child:
Text
(
"Collections & Visits"
,
style:
TextStyle
(
color:
Color
(
0xFF818181
),
fontSize:
14
),
),
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
15
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
),
),
child:
GridView
.
builder
(
padding:
EdgeInsets
.
symmetric
(
vertical:
15
,
horizontal:
10
,
),
itemCount:
4
,
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
10
,
mainAxisSpacing:
10
,
childAspectRatio:
22
/
10
,
),
itemBuilder:
(
context
,
index
)
{
final
numbers
=
[
provider
.
monthlyPaymentCollectionAmount
,
provider
.
paymentCollectionWalletBalanceAmount
,
provider
.
thisMonthsVisits
,
provider
.
todayVisits
,
];
final
names
=
[
"Month Collection"
,
"P.C. Wallet"
,
"Month Visits"
,
"Today Visits"
,
];
final
List
<
int
>
colorCodes
=
[
0xFFEEFCFF
,
0xFFE7FFE5
,
0xFFF3EDFF
,
0xFFFFF6F0
,
];
final
List
<
int
>
textColorCodes
=
[
0xFF1487C9
,
0xFF0D9C00
,
0xFF493272
,
0xFF91481B
,
];
return
InkResponse
(
onTap:
()
{
var
route
;
switch
(
index
)
{
case
0
:
route
=
Monthlycollection
();
break
;
case
1
:
route
=
Pcwallet
();
break
;
case
2
:
route
=
Todaymontlyvisists
(
visitType:
"Month"
);
break
;
case
3
:
route
=
Todaymontlyvisists
(
visitType:
"Today"
);
break
;
}
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
=>
route
),
);
},
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
15
,
top:
5
,
bottom:
5
,
),
decoration:
BoxDecoration
(
color:
Color
(
colorCodes
[
index
]),
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
numbers
[
index
].
toString
(),
style:
TextStyle
(
fontSize:
30
,
color:
Color
(
textColorCodes
[
index
]),
),
),
Text
(
names
[
index
]),
],
),
),
);
},
),
),
Container
(
height:
60
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
,
vertical:
0
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
20
),
),
child:
Row
(
children:
[
Expanded
(
flex:
1
,
child:
SvgPicture
.
asset
(
"assets/svg/find_generator.svg"
,
),
),
Expanded
(
flex:
4
,
child:
Text
(
"Find Nearby Generators"
),
),
],
),
),
],
),
),
),
);
},
);
}
}
lib/services/api_calling.dart
View file @
b269a97b
import
'dart:convert'
;
import
'dart:io'
;
import
'package:flutter/cupertino.dart'
;
import
'package:generp/Models/ViewVisitDetailsResponseNew.dart'
;
import
'package:generp/services/api_names.dart'
;
import
'package:generp/services/api_post_request.dart'
;
import
'package:path_provider/path_provider.dart'
;
...
...
@@ -280,9 +281,7 @@ class ApiCalling {
res
=
jsonDecode
(
res
);
}
if
(
res
!=
null
)
{
print
(
data
);
print
(
check_in_pic
);
debugPrint
(
"Check in:
${res}
"
);
return
CheckInResponse
.
fromJson
(
res
);
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -312,7 +311,6 @@ class ApiCalling {
res
=
jsonDecode
(
res
);
}
if
(
res
!=
null
)
{
debugPrint
(
res
);
return
CheckOutResponse
.
fromJson
(
res
);
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -806,7 +804,6 @@ class ApiCalling {
res
=
jsonDecode
(
res
);
}
if
(
res
!=
null
)
{
debugPrint
(
res
);
return
TechnicianAddPaymentCollectionResponse
.
fromJson
(
res
);
}
else
{
debugPrint
(
"Null Response"
);
...
...
@@ -887,7 +884,7 @@ class ApiCalling {
}
}
static
Future
<
ViewVisitDetailsResponse
?>
loadVisitDetailsAPI
(
static
Future
<
ViewVisitDetailsResponse
New
?>
loadVisitDetailsAPI
(
empId
,
session
,
comp_id
)
async
{
try
{
Map
<
String
,
String
>
data
=
{
...
...
@@ -898,7 +895,7 @@ class ApiCalling {
final
res
=
await
post
(
data
,
technicianComplaintDetailsUrl
,
{});
if
(
res
!=
null
)
{
debugPrint
(
res
.
body
);
return
ViewVisitDetailsResponse
.
fromJson
(
jsonDecode
(
res
.
body
));
return
ViewVisitDetailsResponse
New
.
fromJson
(
jsonDecode
(
res
.
body
));
}
else
{
debugPrint
(
"Null Response"
);
return
null
;
...
...
@@ -982,6 +979,8 @@ class ApiCalling {
'running_hrs'
:
(
running_hrs
).
toString
(),
'complaint_status'
:
(
complaint_status
).
toString
(),
};
print
(
data
);
print
(
fsr_file
);
var
res
;
if
(
fsr_file
!=
null
)
{
res
=
await
postImage4
(
data
,
{},
technicianUpdateVisitUrl
,
fsr_file
);
...
...
@@ -990,8 +989,9 @@ class ApiCalling {
res
=
await
post
(
data
,
technicianUpdateVisitUrl
,
{});
res
=
jsonDecode
(
res
);
}
// debugPrint(res);
if
(
res
!=
null
)
{
debugPrint
(
res
);
//
debugPrint(res);
return
UpdateComplaintResponse
.
fromJson
(
res
);
}
else
{
debugPrint
(
"Null Response"
);
...
...
lib/services/api_post_request.dart
View file @
b269a97b
...
...
@@ -112,7 +112,7 @@ Future<String?> postImage4 (Map<String, String> body,Map<String, String> headers
final
resBody
=
await
res
.
stream
.
bytesToString
();
if
(
res
.
statusCode
>=
200
&&
res
.
statusCode
<
300
)
{
print
(
"****
$resBody
....
$res
"
);
print
(
"****
$resBody
....
$
{
res
.statusCode}
"
);
return
resBody
;
}
else
{
print
(
"error:
${res.reasonPhrase}
"
);
...
...
pubspec.lock
View file @
b269a97b
...
...
@@ -193,6 +193,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
dropdown_button2:
dependency: "direct main"
description:
name: dropdown_button2
sha256: b0fe8d49a030315e9eef6c7ac84ca964250155a6224d491c1365061bc974a9e1
url: "https://pub.dev"
source: hosted
version: "2.3.9"
fake_async:
dependency: transitive
description:
...
...
@@ -1016,6 +1024,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.1.0"
pin_code_fields:
dependency: "direct main"
description:
name: pin_code_fields
sha256: "4c0db7fbc889e622e7c71ea54b9ee624bb70c7365b532abea0271b17ea75b729"
url: "https://pub.dev"
source: hosted
version: "8.0.1"
platform:
dependency: transitive
description:
...
...
pubspec.yaml
View file @
b269a97b
...
...
@@ -66,6 +66,8 @@ dependencies:
camera
:
^0.11.1
get
:
^4.7.2
qr_code_scanner
:
^1.0.1
dropdown_button2
:
^2.3.9
pin_code_fields
:
^8.0.1
dev_dependencies
:
flutter_test
:
...
...
@@ -96,6 +98,7 @@ flutter:
assets
:
-
assets/
-
assets/images/
-
assets/svg/
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment