Commit 379460f6 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

04-07-2025 By Sai Srinivas

Test cases and Order Module, Crm Module.
parent 2ccf19cc
......@@ -56,12 +56,12 @@ class _PaymentlistsbymodeState extends State<Paymentlistsbymode> {
provider.resetAll,
Row(
children: [
InkResponse(
onTap: () {
_showOptionsSheet(context);
},
child: SvgPicture.asset("assets/svg/ic_download.svg",),
),
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
InkResponse(
onTap: () async {
......
......@@ -51,12 +51,12 @@ class _TpcagentissuelistState extends State<Tpcagentissuelist> {
provider.resetAll,
Row(
children: [
InkResponse(
onTap: () {
// _showOptionsSheet(context);
},
child: SvgPicture.asset("assets/svg/ic_download.svg",),
),
// InkResponse(
// onTap: () {
// // _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
],
......
......@@ -53,12 +53,12 @@ class _TpcagentlistbymodeState extends State<Tpcagentlistbymode> {
provider.resetAll,
Row(
children: [
InkResponse(
onTap: () {
// _showOptionsSheet(context);
},
child: SvgPicture.asset("assets/svg/ic_download.svg",),
),
// InkResponse(
// onTap: () {
// // _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
],
......
......@@ -47,7 +47,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(16),
borderRadius: BorderRadius.circular(14),
border:
searchFocusNode.hasFocus
? Border.all(color: AppColors.app_blue, width: 0.5)
......
......@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/PaymentDetailsProvider.dart';
import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonServices.dart';
import 'package:generp/Utils/commonWidgets.dart';
import 'package:pin_code_fields/pin_code_fields.dart';
import 'package:provider/provider.dart';
......@@ -27,15 +28,8 @@ class Paymentdetails extends StatefulWidget {
class _PaymentdetailsState extends State<Paymentdetails> {
Dropdowntheme ddtheme = Dropdowntheme();
TextEditingController Amountcontroller = TextEditingController();
TextEditingController Referencecontroller = TextEditingController();
TextEditingController nameController = TextEditingController();
TextEditingController designationController = TextEditingController();
TextEditingController mobController = TextEditingController();
TextEditingController altMobController = TextEditingController();
TextEditingController telController = TextEditingController();
TextEditingController emailController = TextEditingController();
List<FocusNode> focusNodes = List.generate(7, (index) => FocusNode(),);
@override
void initState() {
// TODO: implement initState
......@@ -47,9 +41,13 @@ class _PaymentdetailsState extends State<Paymentdetails> {
listen: false,
);
provider.LoadNumbersAPI(
context, widget.accountName, widget.referenceID, widget.genId);
},);
},);
context,
widget.accountName,
widget.referenceID,
widget.genId,
);
});
});
}
@override
......@@ -58,30 +56,53 @@ class _PaymentdetailsState extends State<Paymentdetails> {
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: RefreshIndicator.adaptive(
color: AppColors.app_blue,
onRefresh: () async {
provider.LoadNumbersAPI(
context,
widget.accountName,
widget.referenceID,
widget.genId,
);
},
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Payment Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea(
child: SingleChildScrollView(
child: RefreshIndicator.adaptive(
color: AppColors.app_blue,
onRefresh: () async {
provider.LoadNumbersAPI(
context,
widget.accountName,
widget.referenceID,
widget.genId,
);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20)
borderRadius: BorderRadius.circular(20),
),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Text("${widget.name}",
child: Text(
"${widget.name}",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue),)),
SizedBox(height: 10,),
color: AppColors.app_blue,
),
),
),
SizedBox(height: 10),
Padding(
padding: const EdgeInsets.only(bottom: 5.0),
child: Text("Phone Number"),
......@@ -97,9 +118,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
Expanded(
child: Text(
'Select Phone Number',
style: TextStyle(
fontSize: 14,
),
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
),
......@@ -110,8 +129,8 @@ class _PaymentdetailsState extends State<Paymentdetails> {
return DropdownMenuItem<Contacts>(
value: contacts,
child: Column(
crossAxisAlignment: CrossAxisAlignment
.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
contacts.name ?? "",
......@@ -133,11 +152,15 @@ class _PaymentdetailsState extends State<Paymentdetails> {
);
}).toList(),
DropdownMenuItem<Contacts>(
onTap: () {
},
value: null,
// No value associated with the button
enabled: false,
// To disable selecting this item
child: InkWell(
onTap: () {
_addContactSheet(context);
},
......@@ -146,21 +169,26 @@ class _PaymentdetailsState extends State<Paymentdetails> {
decoration: BoxDecoration(
border: Border.all(
color: AppColors.app_blue,
width: 0.5
width: 0.5,
),
borderRadius: BorderRadius.circular(
12,
),
borderRadius: BorderRadius.circular(12)
),
padding: const EdgeInsets.symmetric(
vertical: 5, horizontal: 14),
vertical: 5,
horizontal: 14,
),
child: Row(
mainAxisAlignment: MainAxisAlignment
.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: const [
Text(
'Add Contact',
style: TextStyle(fontSize: 14,
color: Colors.blue),
style: TextStyle(
fontSize: 14,
color: Colors.blue,
),
),
],
),
......@@ -168,19 +196,28 @@ class _PaymentdetailsState extends State<Paymentdetails> {
),
),
],
value: provider.selectContact,
// value: provider.selectContact,
value:
provider.contactsDropDown.contains(
provider.selectContact
)
? provider.selectContact
: null,
// 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 ??
provider.contact =
value.name ??
""; // Update the contact name
provider.contactID = value.mob1 ??
provider.contactID =
value.mob1 ??
""; // Update the contact ID
debugPrint("Selected Contact: ${value
.name}, Phone: ${value.mob1}");
debugPrint(
"Selected Contact: ${value.name}, Phone: ${value.mob1}",
);
}
}
},
......@@ -193,7 +230,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
],
),
),
SizedBox(height: 10,),
SizedBox(height: 10),
Padding(
padding: const EdgeInsets.only(bottom: 5.0),
child: Text("Payment Type"),
......@@ -209,16 +246,16 @@ class _PaymentdetailsState extends State<Paymentdetails> {
Expanded(
child: Text(
'Select Payment Type',
style: TextStyle(
fontSize: 14,
),
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
),
],
),
items: provider.paymentModeDropDown
.map((paymentMode) =>
items:
provider.paymentModeDropDown
.map(
(paymentMode) =>
DropdownMenuItem<PaymentModeList>(
value: paymentMode,
child: Text(
......@@ -226,22 +263,28 @@ class _PaymentdetailsState extends State<Paymentdetails> {
style: const TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
overflow:
TextOverflow.ellipsis,
),
))
),
)
.toList(),
value: provider.selectPaymentMode,
onChanged: (PaymentModeList? value) {
if (value != null) {
if (provider.paymentModeDropDown.isNotEmpty) {
if (provider
.paymentModeDropDown
.isNotEmpty) {
provider.selectPaymentMode = value;
print(
"Selected Complaint Type: ${value
.name}, ID: ${value.id}");
"Selected Complaint Type: ${value.name}, ID: ${value.id}",
);
provider.PaymentMode = value?.name;
provider.paymentModeID = value?.id;
print("hfjkshfg" +
provider.paymentModeID.toString());
print(
"hfjkshfg" +
provider.paymentModeID.toString(),
);
}
}
},
......@@ -254,7 +297,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
],
),
),
SizedBox(height: 10,),
SizedBox(height: 10),
Padding(
padding: const EdgeInsets.only(bottom: 5.0),
child: Text("Amount"),
......@@ -265,38 +308,28 @@ class _PaymentdetailsState extends State<Paymentdetails> {
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius:
BorderRadius.circular(14),
borderRadius: BorderRadius.circular(14),
),
child: Padding(
padding:
const EdgeInsets.fromLTRB(
10.0, 0.0, 10, 0),
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 0),
child: TextFormField(
controller:
Amountcontroller,
keyboardType:
TextInputType.text,
controller: provider.Amountcontroller,
keyboardType: TextInputType.text,
decoration: InputDecoration(
hintText:
"Enter Amount",
hintText: "Enter Amount",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14
fontSize: 14,
),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
),
),
),
),
SizedBox(height: 10,),
SizedBox(height: 10),
Padding(
padding: const EdgeInsets.only(bottom: 5.0),
child: Text("Reference Number"),
......@@ -307,38 +340,28 @@ class _PaymentdetailsState extends State<Paymentdetails> {
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius:
BorderRadius.circular(14),
borderRadius: BorderRadius.circular(14),
),
child: Padding(
padding:
const EdgeInsets.fromLTRB(
10.0, 0.0, 10, 0),
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 0),
child: TextFormField(
controller:
Referencecontroller,
keyboardType:
TextInputType.text,
controller: provider.Referencecontroller,
keyboardType: TextInputType.text,
decoration: InputDecoration(
hintText:
"Enter Reference Number",
hintText: "Enter Reference Number",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14
fontSize: 14,
),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
),
),
),
),
SizedBox(height: 10,),
SizedBox(height: 10),
InkResponse(
onTap: () {
_showAttachmentSheet(context);
......@@ -346,58 +369,85 @@ class _PaymentdetailsState extends State<Paymentdetails> {
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 45,
width: MediaQuery
.of(context)
.size
.width,
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)
color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text("Reference Document", style: TextStyle(
child: Text(
"Reference Document",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue
),),
color: AppColors.app_blue,
),
),
),
),
if(provider.imagePicked==1 && provider.imagePath!=null)...[
),
if (provider.imagePicked == 1 &&
provider.imagePath != null) ...[
Padding(
padding: 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,
),
),
],
),
)
),
],
],
),
),
),
),
floatingActionButtonLocation: FloatingActionButtonLocation
.centerFloat,
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkWell(
onTap: () {
print("clicked");
if(provider.contactID==null){
toast(context, "Please Select Contact");
return;
}
if(provider.paymentModeID==null){
toast(context, "Please Select Payment Type");
return;
}
if(provider.image_picked==0){
toast(context, "Please add attachment");
return;
}
provider.PaymentUpdateAPI(
context, Referencecontroller.text, Amountcontroller.text);
context,
provider.Referencecontroller.text,
provider.Amountcontroller.text,
);
if (provider.CollectionId != 0) {
showOTPSheetSheet(context);
}
......@@ -422,14 +472,17 @@ class _PaymentdetailsState extends State<Paymentdetails> {
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white),
color: Colors.white,
),
),
),
),
),
),
),
);
});
},
);
}
Future<void> _showAttachmentSheet(BuildContext context) {
......@@ -448,15 +501,11 @@ class _PaymentdetailsState extends State<Paymentdetails> {
child: Consumer<Paymentdetailsprovider>(
builder: (context, provider, child) {
return Padding(
padding: EdgeInsets.only(
bottom:
MediaQuery
.of(
MediaQuery.of(
context,
)
.viewInsets
.bottom, // This handles keyboard
).viewInsets.bottom, // This handles keyboard
),
child: Container(
margin: EdgeInsets.only(
......@@ -477,17 +526,19 @@ class _PaymentdetailsState extends State<Paymentdetails> {
"Select Source",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 16
fontSize: 16,
),
),
),
SizedBox(height: 15,),
SizedBox(height: 15),
InkWell(
onTap: () {
Navigator.of(context).pop(false);
provider.imgFromGallery(
context, Referencecontroller.text,
Amountcontroller.text);
context,
provider.Referencecontroller.text,
provider.Amountcontroller.text,
);
},
child: Container(
height: 35,
......@@ -499,8 +550,10 @@ class _PaymentdetailsState extends State<Paymentdetails> {
onTap: () {
Navigator.of(context).pop(false);
provider.imgFromCamera(
context, Referencecontroller.text,
Amountcontroller.text);
context,
provider.Referencecontroller.text,
provider.Amountcontroller.text,
);
},
child: Container(
height: 35,
......@@ -521,7 +574,6 @@ class _PaymentdetailsState extends State<Paymentdetails> {
);
}
Future<void> showOTPSheetSheet(BuildContext context) {
return showModalBottomSheet(
useSafeArea: true,
......@@ -538,15 +590,11 @@ class _PaymentdetailsState extends State<Paymentdetails> {
child: Consumer<Paymentdetailsprovider>(
builder: (context, provider, child) {
return Padding(
padding: EdgeInsets.only(
bottom:
MediaQuery
.of(
MediaQuery.of(
context,
)
.viewInsets
.bottom, // This handles keyboard
).viewInsets.bottom, // This handles keyboard
),
child: Container(
margin: EdgeInsets.only(
......@@ -567,11 +615,11 @@ class _PaymentdetailsState extends State<Paymentdetails> {
"Enter OTP",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 16
fontSize: 16,
),
),
),
SizedBox(height: 15,),
SizedBox(height: 15),
Column(
children: [
Container(
......@@ -579,9 +627,10 @@ class _PaymentdetailsState extends State<Paymentdetails> {
height: 50,
margin: EdgeInsets.only(
left: 5.0, right: 5.0),
left: 5.0,
right: 5.0,
),
child: PinCodeTextField(
appContext: context,
pastedTextStyle: TextStyle(
fontWeight: FontWeight.bold,
......@@ -602,14 +651,14 @@ class _PaymentdetailsState extends State<Paymentdetails> {
borderRadius: BorderRadius.circular(16),
fieldHeight: 60,
fieldWidth: 60,
activeFillColor: AppColors
.text_field_color,
activeFillColor:
AppColors.text_field_color,
activeColor: AppColors.app_blue,
selectedColor: AppColors.text_field_color,
selectedFillColor: AppColors
.text_field_color,
inactiveFillColor: AppColors
.text_field_color,
selectedFillColor:
AppColors.text_field_color,
inactiveFillColor:
AppColors.text_field_color,
inactiveColor: AppColors.text_field_color,
fieldOuterPadding: EdgeInsets.only(
left: 5,
......@@ -660,23 +709,25 @@ class _PaymentdetailsState extends State<Paymentdetails> {
),
SizedBox(height: 15),
Container(
width: 110,
alignment: Alignment.center,
height: 45,
margin: EdgeInsets.only(
left: 10.0, right: 10.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TextButton(
onPressed:
() =>
{
child: InkResponse(
onTap: () {
provider.ResendOtpAPI(context);
},
child: Center(
child: Text(
"Resend",
style: TextStyle(
fontWeight: FontWeight.w300),
fontWeight: FontWeight.w300,
),
),
),
),
),
......@@ -706,7 +757,8 @@ class _PaymentdetailsState extends State<Paymentdetails> {
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white),
color: Colors.white,
),
),
),
),
......@@ -728,21 +780,14 @@ class _PaymentdetailsState extends State<Paymentdetails> {
}
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"
"Email ID",
];
final hintTextNames = [
......@@ -751,7 +796,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
"Enter Mobile Number",
"Enter Alternate Mobile Number",
"Enter Telephone Number",
"Enter Email ID"
"Enter Email ID",
];
return showModalBottomSheet(
useSafeArea: true,
......@@ -767,16 +812,20 @@ class _PaymentdetailsState extends State<Paymentdetails> {
return SafeArea(
child: Consumer<Paymentdetailsprovider>(
builder: (context, provider, child) {
final controllers = [
provider.nameController,
provider.designationController,
provider.mobController,
provider.altMobController,
provider.telController,
provider.emailController,
];
return Padding(
padding: EdgeInsets.only(
bottom:
MediaQuery
.of(
MediaQuery.of(
context,
)
.viewInsets
.bottom, // This handles keyboard
).viewInsets.bottom, // This handles keyboard
),
child: Container(
margin: EdgeInsets.only(
......@@ -798,74 +847,86 @@ class _PaymentdetailsState extends State<Paymentdetails> {
"Add Contact",
style: TextStyle(
color: AppColors.app_blue,
fontSize: 16
fontSize: 16,
),
),
),
...List.generate(controllers.length, (index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${controllersNames[index]}",
),
Text("${controllersNames[index]}"),
Container(
height: 50,
margin: EdgeInsets.symmetric(vertical: 5),
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius:
BorderRadius.circular(25),
borderRadius: BorderRadius.circular(14),
),
child: Padding(
padding:
const EdgeInsets.fromLTRB(
10.0, 0.0, 10, 0),
padding: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
0,
),
child: TextFormField(
controller:
controllers[index],
keyboardType:
TextInputType.text,
decoration: InputDecoration(
controller: controllers[index],
focusNode:focusNodes[index],
maxLength:
[
"Mobile Number",
"Alternate Mobile Number",
].contains(
controllersNames[index],
)
? 10
: 998895646546561356,
maxLines: 1,
keyboardType: [
"Mobile Number",
"Alternate Mobile Number",
"Mobile Number",
hintText:
"${hintTextNames[index]}",
].contains(
controllersNames[index],
)?TextInputType.numberWithOptions():TextInputType.text,
textInputAction:index==5?TextInputAction.done: TextInputAction.next,
decoration: InputDecoration(
counterText: "",
hintText: "${hintTextNames[index]}",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14
fontSize: 14,
),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
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);
widget.genId==""? widget.referenceID:widget.genId ,
provider.nameController.text,
provider.designationController.text,
provider.mobController.text,
provider.altMobController.text,
provider.telController.text,
provider.emailController.text,
);
},
child: Container(
alignment: Alignment.center,
......@@ -878,7 +939,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
),
decoration: BoxDecoration(
color: AppColors.app_blue, //1487C9
borderRadius: BorderRadius.circular(30.0),
borderRadius: BorderRadius.circular(14.0),
),
child: Center(
child: Text(
......@@ -900,6 +961,21 @@ class _PaymentdetailsState extends State<Paymentdetails> {
},
);
},
).whenComplete(() {
WidgetsBinding.instance.addPostFrameCallback((_) {
Future.microtask(() {
var provider = Provider.of<Paymentdetailsprovider>(
context,
listen: false,
);
provider.LoadNumbersAPI(
context,
widget.accountName,
widget.referenceID,
widget.genId,
);
});
});
},);
}
}
......@@ -49,7 +49,13 @@ class _VisitdetailsState extends State<Visitdetails> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Customer Details"),
Container(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Text("Customer Details",style: TextStyle(
fontSize: 14,
color: AppColors.grey_thick,
),),
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
......@@ -83,7 +89,9 @@ class _VisitdetailsState extends State<Visitdetails> {
vertical: 6,
horizontal: 0,
),
child: Row(
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
......@@ -92,7 +100,6 @@ class _VisitdetailsState extends State<Visitdetails> {
"assets/svg/se_block_head.svg",
),
SizedBox(width: 5),
],
Expanded(
child: SizedBox(
child: Column(
......@@ -100,7 +107,7 @@ class _VisitdetailsState extends State<Visitdetails> {
CrossAxisAlignment.start,
children: [
Text(
textheads[j].toString(),
"${customerDetails.cname}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
......@@ -114,7 +121,7 @@ class _VisitdetailsState extends State<Visitdetails> {
child: Text(
textSubheads[j] == ""
? "-"
: textSubheads[j],
: customerDetails.aname ?? "-",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
......@@ -126,14 +133,42 @@ class _VisitdetailsState extends State<Visitdetails> {
),
),
),
]else...[
Expanded(
child: Text(textheads[j].toString()),
),
Expanded(
child: SizedBox(
child: Text(
textSubheads[j] == ""
? "-"
: textSubheads[j],
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
),
),
),
),
],
],
),
],
)
);
}),
),
),
Text("Generator Details"),
Container(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Text("Generator Details",style: TextStyle(
fontSize: 14,
color: AppColors.grey_thick,
),),
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
......@@ -149,12 +184,7 @@ class _VisitdetailsState extends State<Visitdetails> {
),
child: Column(
children: [
Row(
children: [
SvgPicture.asset("assetName"),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(6, (j) {
...List.generate(6, (j) {
final textheads = [
"Gen ID",
"Engine Number",
......@@ -173,65 +203,47 @@ class _VisitdetailsState extends State<Visitdetails> {
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 3,
),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Container(
padding: EdgeInsets.symmetric(
vertical: 3,
vertical: 6,
horizontal: 0,
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
textheads[j].toString(),
Expanded(
child: Text(textheads[j].toString()),
),
SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.8,
Expanded(
child: SizedBox(
child: Text(
textSubheads[j] == ""
? "-"
: textSubheads[j],
maxLines: 2,
overflow:
TextOverflow
.ellipsis,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(
0xFF818181,
),
),
),
color: Color(0xFF818181),
),
],
),
),
],
),
],
),
);
}),
),
],
),
],
),
),
Text("Complaint Details"),
Container(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Text(
"Complaint Details",
style: TextStyle(
fontSize: 14,
color: AppColors.grey_thick,
),
),
),
Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
......@@ -247,11 +259,7 @@ class _VisitdetailsState extends State<Visitdetails> {
),
child: Column(
children: [
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(4, (j) {
...List.generate(4, (j) {
final textheads = [
"Complaint ID",
"Complaint Description",
......@@ -265,61 +273,37 @@ class _VisitdetailsState extends State<Visitdetails> {
"${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,
padding: EdgeInsets.symmetric(vertical: 6),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
textheads[j].toString(),
Expanded(
child: Text(textheads[j].toString()),
),
SizedBox(
Expanded(
child: SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.8,
// width:
// MediaQuery.of(
// context,
// ).size.width *
// 0.8,
child: Text(
textSubheads[j] == ""
? "-"
: textSubheads[j],
maxLines: 2,
overflow:
TextOverflow
.ellipsis,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(
0xFF818181,
),
),
),
color: Color(0xFF818181),
),
],
),
),
],
),
],
),
);
}),
),
],
),
],
),
),
......
......@@ -105,6 +105,7 @@ import '../Models/ordersModels/ordersPdiIdByEngNumberResponse.dart';
import '../Models/ordersModels/paymentDetailsByModeFilterResponse.dart';
import '../Models/ordersModels/paymentListByModeFilterResponse.dart';
import '../Models/ordersModels/paymentListByModeResponse.dart';
import '../Models/ordersModels/technicianAddPaymentResendOTPResponse.dart';
import '../Notifiers/financeProvider/approveRejectPaymentRequestResponse.dart';
import '../Utils/commonServices.dart';
......@@ -928,6 +929,7 @@ class ApiCalling {
'gen_id': (gen_id).toString(),
'account_id': (account_id).toString(),
};
print(data);
final res = await post(data, technicianAddPaymentUrl, {});
if (res != null) {
// debugPrint(res.body);
......@@ -986,7 +988,7 @@ class ApiCalling {
// debugPrint("Null Response");
// return null;
// }
print("send otp:${data}");
if (payment_proof != null) {
res = await postImageNew(
data,
......@@ -998,14 +1000,15 @@ class ApiCalling {
print("Add Payment $res");
res = jsonDecode(res);
return TechnicianAddPaymentCollectionResponse.fromJson(res);
} else {
print("Add Payment $res");
res = await post(data, technicianAddPaymentCollectionUrl, {});
res = jsonDecode(res.body);
return TechnicianAddPaymentCollectionResponse.fromJson(res);
// return TechnicianAddPaymentCollectionResponse.fromJson(res);
}
return TechnicianAddPaymentCollectionResponse.fromJson(res);
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
......@@ -1041,6 +1044,33 @@ class ApiCalling {
return null;
}
}
static Future<Technicianaddpaymentresendotpresponse?>
TechnicianPaymentOTPResendAPI(
empId,
session,
payment_collection_id,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_collection_id': (payment_collection_id).toString(),
};
final res = await post(data, technicianAddPaymentResendOTPUrl, {});
if (res != null) {
debugPrint("OTP${res.body}");
return Technicianaddpaymentresendotpresponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
return null;
}
} catch (e) {
debugPrint('hello bev=bug $e ');
return null;
}
}
static Future<PaymentCollectionResponse?> paymentCollectionListAPI(
empId,
......@@ -1165,9 +1195,10 @@ class ApiCalling {
'type': (type).toString(),
'account_id': (account_id).toString(),
};
print(data);
final res = await post(data, technicianAddContactUrl, {});
if (res != null) {
// debugPrint(res.body);
debugPrint(res.body);
return AddContactResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......@@ -2073,7 +2104,7 @@ class ApiCalling {
};
final res = await post(data, commonAccountListUrl, {});
if (res != null) {
debugPrint(res.body);
debugPrint("adad:${res.body}");
return commonAccountlistResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......
......@@ -44,6 +44,7 @@ const technicianMonthlyVisitsUrl= "${baseUrl}home/technician_monthly_visits";
const technicianNearbyGeneratorsUrl= "${baseUrl}home/technician_nearby_generators";
const technicianAddPaymentUrl= "${baseUrl}home/technician_add_payment_det";
const technicianAddPaymentCollectionUrl= "${baseUrl}home/technician_add_payment_collection";
const technicianAddPaymentResendOTPUrl= "${baseUrl}home/technician_add_payment_collection_resend_otp";
const technicianPaymentCollectionOtpUrl= "${baseUrl}home/technician_payment_collection_validate_otp";
const technicianPaymentCollectionUrl= "${baseUrl}home/technician_payment_collection_list";
const technicianWalletCollectionUrl= "${baseUrl}home/technician_payment_collection_wallet";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment