Commit ecd8fcd1 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

07-07-2025 By Sai Srinivas

Pubspec and Safe Area.
parent 67ab0f3e
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
......@@ -33,247 +35,251 @@ class _AddtpcagentScreenState extends State<AddtpcagentScreen> {
return Consumer<Tpcagentsprovider>(
builder: (context, provider, child) {
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
"Add TPC Agent",
provider.resetAll,
SizedBox(width: 0),
),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
textControllerWidget(
context,
provider.tpcNameController,
"Name",
"Enter Name",
provider.onChangetpcName,
TextInputType.text,
false,
null,
focusNodes[0],
focusNodes[1],
TextInputAction.next
),
if (provider.tpcNameError != null) ...[
errorWidget(context, provider.tpcNameError),
],
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
"Add TPC Agent",
provider.resetAll,
SizedBox(width: 0),
),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
textControllerWidget(
context,
provider.tpcNameController,
"Name",
"Enter Name",
provider.onChangetpcName,
TextInputType.text,
false,
null,
focusNodes[0],
focusNodes[1],
TextInputAction.next
),
if (provider.tpcNameError != null) ...[
errorWidget(context, provider.tpcNameError),
],
textControllerWidget(
context,
provider.tpcMobileNumberController,
"Mobile Number",
"Enter Mobile Number",
provider.onChangetpcMobileNumber,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[1],
focusNodes[2],TextInputAction.next,10
),
if (provider.tpcMobileNumberError != null) ...[
errorWidget(context, provider.tpcMobileNumberError),
],
textControllerWidget(
context,
provider.tpcMobileNumberController,
"Mobile Number",
"Enter Mobile Number",
provider.onChangetpcMobileNumber,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[1],
focusNodes[2],TextInputAction.next,10
),
if (provider.tpcMobileNumberError != null) ...[
errorWidget(context, provider.tpcMobileNumberError),
],
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(
"ID Proof",
style: TextStyle(
fontFamily: "JakartaMedium",
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,
),
),
),
),
),
if (provider.imagePicked == 1 &&
provider.imagePath != null) ...[
Padding(
padding: const EdgeInsets.symmetric(
vertical: 4.0,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
"${provider.imagePath}",
child: Center(
child: Text(
"ID Proof",
style: TextStyle(
color: AppColors.semi_black,
fontSize: 11,
fontWeight: FontWeight.w600,
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
),
InkResponse(
onTap: () {
provider.imagePicked = 0;
provider.imagePath = null;
provider.imageFilePath = null;
},
child: SvgPicture.asset(
"assets/svg/ic_close.svg",
width: 15,
height: 15,
),
),
],
),
),
),
],
errorWidget(context, provider.imageError),
if (provider.imagePicked == 1 &&
provider.imagePath != null) ...[
Padding(
padding: const EdgeInsets.symmetric(
vertical: 4.0,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
"${provider.imagePath}",
style: TextStyle(
color: AppColors.semi_black,
fontSize: 11,
fontWeight: FontWeight.w600,
),
),
InkResponse(
onTap: () {
provider.imagePicked = 0;
provider.imagePath = null;
provider.imageFilePath = null;
},
child: SvgPicture.asset(
"assets/svg/ic_close.svg",
width: 15,
height: 15,
),
),
],
),
),
],
errorWidget(context, provider.imageError),
textControllerWidget(
context,
provider.tpcBankNameController,
"Bank Name",
"Enter Bank Name",
provider.onChangetpcBankName,
TextInputType.text,
false,
null,
focusNodes[2],focusNodes[3],TextInputAction.next
),
if (provider.tpcBankNameError != null) ...[
errorWidget(context, provider.tpcBankNameError),
],
textControllerWidget(
context,
provider.tpcBankNameController,
"Bank Name",
"Enter Bank Name",
provider.onChangetpcBankName,
TextInputType.text,
false,
null,
focusNodes[2],focusNodes[3],TextInputAction.next
),
if (provider.tpcBankNameError != null) ...[
errorWidget(context, provider.tpcBankNameError),
],
textControllerWidget(
context,
provider.tpcBankBeneficiaryNameController,
"Bank Beneficiary Name",
"Enter Bank Beneficiary Name",
provider.onChangetpcBankBeneficiaryName,
TextInputType.text,
false,
null,
focusNodes[3],focusNodes[4],TextInputAction.next
),
if (provider.tpcBankBeneficiaryNameError != null) ...[
errorWidget(
textControllerWidget(
context,
provider.tpcBankBeneficiaryNameError,
provider.tpcBankBeneficiaryNameController,
"Bank Beneficiary Name",
"Enter Bank Beneficiary Name",
provider.onChangetpcBankBeneficiaryName,
TextInputType.text,
false,
null,
focusNodes[3],focusNodes[4],TextInputAction.next
),
],
if (provider.tpcBankBeneficiaryNameError != null) ...[
errorWidget(
context,
provider.tpcBankBeneficiaryNameError,
),
],
textControllerWidget(
context,
provider.tpcBankAccountNumberController,
"Bank Account Number",
"Enter Bank Account Number",
provider.onChangetpcBankAccountNumber,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[4],focusNodes[5],TextInputAction.next
),
if (provider.tpcBankAccountNumberError != null) ...[
errorWidget(
textControllerWidget(
context,
provider.tpcBankAccountNumberError,
provider.tpcBankAccountNumberController,
"Bank Account Number",
"Enter Bank Account Number",
provider.onChangetpcBankAccountNumber,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[4],focusNodes[5],TextInputAction.next
),
],
if (provider.tpcBankAccountNumberError != null) ...[
errorWidget(
context,
provider.tpcBankAccountNumberError,
),
],
textControllerWidget(
context,
provider.tpcBankIFSCController,
"Bank IFSC",
"Enter Bank IFSC",
provider.onChangetpcBankIFSC,
TextInputType.text,
false,
null,
focusNodes[5],focusNodes[6],
TextInputAction.next
),
if (provider.tpcBankIFSCError != null) ...[
errorWidget(context, provider.tpcBankIFSCError),
],
textControllerWidget(
context,
provider.tpcBankIFSCController,
"Bank IFSC",
"Enter Bank IFSC",
provider.onChangetpcBankIFSC,
TextInputType.text,
false,
null,
focusNodes[5],focusNodes[6],
TextInputAction.next
),
if (provider.tpcBankIFSCError != null) ...[
errorWidget(context, provider.tpcBankIFSCError),
],
textControllerWidget(
context,
provider.tpcNoteController,
"Description",
"Enter Description",
provider.onChangetpcNote,
TextInputType.text,
false,
null,
focusNodes[6],focusNodes[7],TextInputAction.next
),
if (provider.tpcNoteError != null) ...[
errorWidget(context, provider.tpcNoteError),
],
InkWell(
onTap:provider.submitClicked?null: () {
provider.submitClicked = true;
provider.addTPCAgentAPIFunction(context);
},
textControllerWidget(
context,
provider.tpcNoteController,
"Description",
"Enter Description",
provider.onChangetpcNote,
TextInputType.text,
false,
null,
focusNodes[6],focusNodes[7],TextInputAction.next
),
if (provider.tpcNoteError != null) ...[
errorWidget(context, provider.tpcNoteError),
],
InkWell(
onTap:provider.submitClicked?null: () {
provider.submitClicked = true;
provider.addTPCAgentAPIFunction(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(14.0),
),
child: Center(
child:provider.submitClicked?CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(Colors.white),
): Text(
"Submit",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white),
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(14.0),
),
child: Center(
child:provider.submitClicked?CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(Colors.white),
): Text(
"Submit",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white),
),
),
),
),
),
],
],
),
),
),
],
],
),
),
),
),
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
......@@ -85,268 +87,78 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
return Consumer<Editpaymentprovider>(
builder: (context, editProvider, child) {
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar2(
context,
"${widget.pageTitleName}",
editProvider.resetForm,
SizedBox(width: 0),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(20),
// ),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (editProvider.editOrderList!.isNotEmpty) ...[
InkResponse(
onTap: () {
// if (provider.selectedOrderIds.length < provider.orderList.length) {
editProvider.editAddNewRow2();
// } else {
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// content: Text('No more unique order IDs or statuses available'),
// ),
// );
// }
},
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 45,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"+ Add Order",
style: TextStyle(
fontFamily: "JakartaMedium",
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar2(
context,
"${widget.pageTitleName}",
editProvider.resetForm,
SizedBox(width: 0),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(20),
// ),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (editProvider.editOrderList!.isNotEmpty) ...[
InkResponse(
onTap: () {
// if (provider.selectedOrderIds.length < provider.orderList.length) {
editProvider.editAddNewRow2();
// } else {
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(
// content: Text('No more unique order IDs or statuses available'),
// ),
// );
// }
},
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,
),
),
),
),
),
if (editProvider.paidList.length > 0) ...[
Row(
children: [
Expanded(
child: ListView.builder(
itemCount: editProvider.paidList.length,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
),
margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 3,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
TextWidget(
context,
"Order",
),
Row(
children: [
Expanded(
child: DropdownButtonHideUnderline(
child: DropdownButton2<
PaidList
>(
isExpanded: true,
hint: Text(
'Select Account Type',
style:
TextStyle(
fontSize:
14,
),
overflow:
TextOverflow
.ellipsis,
),
items:
editProvider
.paidList
.map(
(
ord,
) => DropdownMenuItem<
PaidList
>(
value:
ord,
child: Text(
"(Order Number: ${ord.orderNumber}) + (Order Amount: ${ord.orderAmount}) + (Balance Amount: ${ord.balanceAmount})" ??
'',
style: const TextStyle(
fontSize:
14,
),
overflow:
TextOverflow.ellipsis,
),
),
)
.toList(),
// value:
// editProvider
// .selectedPaidList,
value: editProvider
.paidList
.firstWhere(
(product) =>
product
.orderId ==
editProvider
.selectedPaidOrderIDs[index],
),
// value:editProvider.paidList.firstWhere(
// (
// ord,
// ) =>
// ord.orderId ==
// editProvider.selectedPaidOrderIDs[index],
// orElse:
// () =>
// editProvider.paidList[0],
// ),
onChanged: (
PaidList? value,
) {
if (value !=
null) {
if (editProvider
.paidList
.isNotEmpty) {
editProvider
.selectedPaidList =
value;
print(
"Selected Complaint Type: ${value.orderId}, ID: ${value.orderNumber}",
);
editProvider.updateSelectedPaidOrderId(
index,
editProvider
.selectedPaidList,
);
// provider.selectedOrderIds = value!.orderId!;
// provider.selectedOrderNumbers = value!.orderNumber!;
// print(
// "hfjkshfg" +
// provider.selectedOrderIds.toString(),
}
}
},
buttonStyleData:
ddtheme
.buttonStyleData,
iconStyleData:
ddtheme
.iconStyleData,
menuItemStyleData:
ddtheme
.menuItemStyleData,
dropdownStyleData:
ddtheme
.dropdownStyleData,
),
),
),
],
),
],
),
),
),
],
),
SizedBox(width: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
editProvider
.editOrderAmountControllers[index],
"Order Amount",
"Enter Order Amount",
(p0) {},
TextInputType.number,
false,
FilteringTextInputFormatter
.digitsOnly,
focusNodes[0],
focusNodes[1],
TextInputAction.next
),
),
],
),
SizedBox(height: 10),
// SizedBox(width: 10),
//
// IconButton(
// icon: Icon(Icons.delete),
// onPressed: provider.orderAmountControllers.length > 1
// ? () => provider.removeRow(index)
// : null, // Prevent removing the last row
// ),
],
),
);
},
child: Center(
child: Text(
"+ Add Order",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
),
),
],
),
),
],
if (editProvider.editOrderList.length > 0) ...[
if (editProvider.editOrderAmountControllers2.length > 0)
if (editProvider.paidList.length > 0) ...[
Row(
children: [
Expanded(
child: ListView.builder(
itemCount: editProvider.editOrderList.length,
itemCount: editProvider.paidList.length,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, j) {
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
),
margin: EdgeInsets.symmetric(
vertical: 10,
),
margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
......@@ -360,8 +172,7 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
CrossAxisAlignment.start,
children: [
TextWidget(
context,
......@@ -372,10 +183,9 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
Expanded(
child: DropdownButtonHideUnderline(
child: DropdownButton2<
EditOrderList
PaidList
>(
isExpanded:
true,
isExpanded: true,
hint: Text(
'Select Account Type',
style:
......@@ -389,17 +199,17 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
),
items:
editProvider
.editOrderList
.paidList
.map(
(
ord,
) => DropdownMenuItem<
EditOrderList
PaidList
>(
value:
ord,
child: Text(
"(Order Number: ${ord.orderNumber}) + (Order Amount: ${ord.totalAmount}) + (Balance Amount: ${ord.balanceAmount})" ??
"(Order Number: ${ord.orderNumber}) + (Order Amount: ${ord.orderAmount}) + (Balance Amount: ${ord.balanceAmount})" ??
'',
style: const TextStyle(
fontSize:
......@@ -411,40 +221,46 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
),
)
.toList(),
value:
editProvider.selectedOrderIDs[j] !=
null &&
editProvider.editOrderList.isNotEmpty
? editProvider.editOrderList.firstWhere(
(
ord,
) =>
ord.orderId ==
editProvider.selectedOrderIDs[j],
orElse:
() =>
editProvider.editOrderList[0],
)
: null,
// value:
// editProvider
// .selectedPaidList,
value: editProvider
.paidList
.firstWhere(
(product) =>
product
.orderId ==
editProvider
.selectedPaidOrderIDs[index],
),
// value:editProvider.paidList.firstWhere(
// (
// ord,
// ) =>
// ord.orderId ==
// editProvider.selectedPaidOrderIDs[index],
// orElse:
// () =>
// editProvider.paidList[0],
// ),
onChanged: (
EditOrderList?
value,
PaidList? value,
) {
if (value !=
null) {
if (editProvider
.editOrderList
.paidList
.isNotEmpty) {
editProvider
.selectedOrderList =
.selectedPaidList =
value;
print(
"Selected Complaint Type: ${value.orderId}, ID: ${value.orderNumber}",
);
editProvider.updateSelectedOrderId(
j,
editProvider.updateSelectedPaidOrderId(
index,
editProvider
.selectedOrderList,
.selectedPaidList,
);
// provider.selectedOrderIds = value!.orderId!;
// provider.selectedOrderNumbers = value!.orderNumber!;
......@@ -486,7 +302,7 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
child: textControllerWidget(
context,
editProvider
.editOrderAmountControllers2[j],
.editOrderAmountControllers[index],
"Order Amount",
"Enter Order Amount",
(p0) {},
......@@ -494,9 +310,9 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
false,
FilteringTextInputFormatter
.digitsOnly,
null,
null,
TextInputAction.done
focusNodes[0],
focusNodes[1],
TextInputAction.next
),
),
],
......@@ -518,56 +334,246 @@ class _EditadjustedorderlistState extends State<Editadjustedorderlist> {
),
],
),
],
if (editProvider.editOrderList.length > 0) ...[
if (editProvider.editOrderAmountControllers2.length > 0)
Row(
children: [
Expanded(
child: ListView.builder(
itemCount: editProvider.editOrderList.length,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, j) {
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
),
margin: EdgeInsets.symmetric(
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 3,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
TextWidget(
context,
"Order",
),
Row(
children: [
Expanded(
child: DropdownButtonHideUnderline(
child: DropdownButton2<
EditOrderList
>(
isExpanded:
true,
hint: Text(
'Select Account Type',
style:
TextStyle(
fontSize:
14,
),
overflow:
TextOverflow
.ellipsis,
),
items:
editProvider
.editOrderList
.map(
(
ord,
) => DropdownMenuItem<
EditOrderList
>(
value:
ord,
child: Text(
"(Order Number: ${ord.orderNumber}) + (Order Amount: ${ord.totalAmount}) + (Balance Amount: ${ord.balanceAmount})" ??
'',
style: const TextStyle(
fontSize:
14,
),
overflow:
TextOverflow.ellipsis,
),
),
)
.toList(),
value:
editProvider.selectedOrderIDs[j] !=
null &&
editProvider.editOrderList.isNotEmpty
? editProvider.editOrderList.firstWhere(
(
ord,
) =>
ord.orderId ==
editProvider.selectedOrderIDs[j],
orElse:
() =>
editProvider.editOrderList[0],
)
: null,
onChanged: (
EditOrderList?
value,
) {
if (value !=
null) {
if (editProvider
.editOrderList
.isNotEmpty) {
editProvider
.selectedOrderList =
value;
print(
"Selected Complaint Type: ${value.orderId}, ID: ${value.orderNumber}",
);
editProvider.updateSelectedOrderId(
j,
editProvider
.selectedOrderList,
);
// provider.selectedOrderIds = value!.orderId!;
// provider.selectedOrderNumbers = value!.orderNumber!;
// print(
// "hfjkshfg" +
// provider.selectedOrderIds.toString(),
}
}
},
buttonStyleData:
ddtheme
.buttonStyleData,
iconStyleData:
ddtheme
.iconStyleData,
menuItemStyleData:
ddtheme
.menuItemStyleData,
dropdownStyleData:
ddtheme
.dropdownStyleData,
),
),
),
],
),
],
),
),
),
],
),
SizedBox(width: 10),
Row(
children: [
Expanded(
flex: 2,
child: textControllerWidget(
context,
editProvider
.editOrderAmountControllers2[j],
"Order Amount",
"Enter Order Amount",
(p0) {},
TextInputType.number,
false,
FilteringTextInputFormatter
.digitsOnly,
null,
null,
TextInputAction.done
),
),
],
),
SizedBox(height: 10),
// SizedBox(width: 10),
//
// IconButton(
// icon: Icon(Icons.delete),
// onPressed: provider.orderAmountControllers.length > 1
// ? () => provider.removeRow(index)
// : null, // Prevent removing the last row
// ),
],
),
);
},
),
),
],
),
],
],
],
],
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
onTap:
editProvider.submitLoading
? null
: () {
editProvider.submitLoading = true;
final updatedData = editProvider.getFormDataUpdate();
print(updatedData);
final insertedData = editProvider.getFormData();
print(insertedData);
editProvider
.editPaymentDetailsAdjustedOrdersUpdateAPIFunction(
context,
widget.values["payment_id"],
updatedData,
insertedData,
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child:
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
onTap:
editProvider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(
AppColors.app_blue,
),
)
: Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
? null
: () {
editProvider.submitLoading = true;
final updatedData = editProvider.getFormDataUpdate();
print(updatedData);
final insertedData = editProvider.getFormData();
print(insertedData);
editProvider
.editPaymentDetailsAdjustedOrdersUpdateAPIFunction(
context,
widget.values["payment_id"],
updatedData,
insertedData,
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child:
editProvider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(
AppColors.app_blue,
),
)
: Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
),
),
),
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
......@@ -55,477 +57,481 @@ class _EditorderaccountdetailsState extends State<Editorderaccountdetails> {
return Consumer<Editorderprovider>(
builder: (context, provider, child) {
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white,
appBar: appbar2(
context,
"${widget.pageTitleName}",
provider.resetForm,
SizedBox(width: 0),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white,
appBar: appbar2(
context,
"${widget.pageTitleName}",
provider.resetForm,
SizedBox(width: 0),
),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(context, "Dispatch State"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<States>(
isExpanded: true,
hint: Text(
"Select State",
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items:
provider.dispatchStates
.map(
(e) => DropdownMenuItem<States>(
value: e,
child: Text(
e.name!,
style: const TextStyle(
fontSize: 14,
TextWidget(context, "Dispatch State"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<States>(
isExpanded: true,
hint: Text(
"Select State",
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items:
provider.dispatchStates
.map(
(e) => DropdownMenuItem<States>(
value: e,
child: Text(
e.name!,
style: const TextStyle(
fontSize: 14,
),
),
),
),
)
.toList(),
value: provider.selecetdDispatchStates,
onChanged: (States? value) {
if (provider.dispatchStates.isNotEmpty) {
provider.selecetdDispatchStates = value;
provider.selectedDispatchStateID = value!.id!;
provider.selectedDispatchStateName =
value!.name!;
if (provider.dispatchDistricts.isNotEmpty) {
provider.dispatchDistricts.clear();
// provider.selectedDispatchDistricts = null;
provider.selectedDispatchDistrictId = null;
provider.selectedDispatchDistrictValue = "";
)
.toList(),
value: provider.selecetdDispatchStates,
onChanged: (States? value) {
if (provider.dispatchStates.isNotEmpty) {
provider.selecetdDispatchStates = value;
provider.selectedDispatchStateID = value!.id!;
provider.selectedDispatchStateName =
value!.name!;
if (provider.dispatchDistricts.isNotEmpty) {
provider.dispatchDistricts.clear();
// provider.selectedDispatchDistricts = null;
provider.selectedDispatchDistrictId = null;
provider.selectedDispatchDistrictValue = "";
}
provider.getDispatchDistrictAPI(
context,
provider.selectedDispatchStateID,
);
}
provider.getDispatchDistrictAPI(
context,
provider.selectedDispatchStateID,
);
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
),
],
],
),
),
),
//dd
TextWidget(context, "Dispatch District"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<Districts>(
isExpanded: true,
hint: Text(
"Select District",
style: const TextStyle(fontSize: 14),
),
items:
provider.dispatchDistricts
.map(
(e) => DropdownMenuItem<Districts>(
value: e,
child: Text(
e.district!,
style: const TextStyle(
fontSize: 14,
//dd
TextWidget(context, "Dispatch District"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<Districts>(
isExpanded: true,
hint: Text(
"Select District",
style: const TextStyle(fontSize: 14),
),
items:
provider.dispatchDistricts
.map(
(e) => DropdownMenuItem<Districts>(
value: e,
child: Text(
e.district!,
style: const TextStyle(
fontSize: 14,
),
),
),
),
)
.toList(),
value: provider.selectedDispatchDistricts,
onChanged: (Districts? value) {
if (provider.dispatchDistricts.isNotEmpty) {
provider.selectedDispatchDistricts = value;
provider.selectedDispatchDistrictId =
value!.id!;
provider.selectedDispatchDistrictValue =
value!.district!;
if (provider
.dispatchSubLocations
.isNotEmpty) {
provider.dispatchSubLocations.clear();
// provider.selectedDispatchSubLocations =
// null;
provider.selectedDispatchSubLocID = null;
provider.selectedDispatchSubLocValue = "";
)
.toList(),
value: provider.selectedDispatchDistricts,
onChanged: (Districts? value) {
if (provider.dispatchDistricts.isNotEmpty) {
provider.selectedDispatchDistricts = value;
provider.selectedDispatchDistrictId =
value!.id!;
provider.selectedDispatchDistrictValue =
value!.district!;
if (provider
.dispatchSubLocations
.isNotEmpty) {
provider.dispatchSubLocations.clear();
// provider.selectedDispatchSubLocations =
// null;
provider.selectedDispatchSubLocID = null;
provider.selectedDispatchSubLocValue = "";
}
provider.getDispatchSubLocationAPI(
context,
provider.selectedDispatchDistrictId,
);
}
provider.getDispatchSubLocationAPI(
context,
provider.selectedDispatchDistrictId,
);
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
),
],
],
),
),
),
TextWidget(context, "Dispatch Sub Location"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<SubLocations>(
hint: Text(
"Select Sub Locality",
style: const TextStyle(fontSize: 14),
),
items:
provider.dispatchSubLocations
.map(
(e) => DropdownMenuItem<SubLocations>(
value: e,
child: Text(
e.subLocality!,
style: const TextStyle(
fontSize: 14,
TextWidget(context, "Dispatch Sub Location"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<SubLocations>(
hint: Text(
"Select Sub Locality",
style: const TextStyle(fontSize: 14),
),
items:
provider.dispatchSubLocations
.map(
(e) => DropdownMenuItem<SubLocations>(
value: e,
child: Text(
e.subLocality!,
style: const TextStyle(
fontSize: 14,
),
),
),
),
)
.toList(),
value: provider.selectedDispatchSubLocations,
onChanged: (SubLocations? value) {
if (provider.dispatchSubLocations.isNotEmpty) {
provider.selectedDispatchSubLocations = value;
provider.selectedDispatchSubLocID =
value!.id!;
provider.selectedDispatchSubLocValue =
value!.subLocality!;
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
)
.toList(),
value: provider.selectedDispatchSubLocations,
onChanged: (SubLocations? value) {
if (provider.dispatchSubLocations.isNotEmpty) {
provider.selectedDispatchSubLocations = value;
provider.selectedDispatchSubLocID =
value!.id!;
provider.selectedDispatchSubLocValue =
value!.subLocality!;
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
),
],
],
),
),
),
//dd
textControllerWidget(
context,
provider.dispatchAddressController,
"Dispatch Address",
"Enter Dispatch Address",
provider.onChangedDispatchAddress,
TextInputType.text,
false,
null,
focusNodes[0],focusNodes[1],TextInputAction.next
),
errorWidget(context, provider.dispatchAddressError),
//dd
textControllerWidget(
context,
provider.dispatchAddressController,
"Dispatch Address",
"Enter Dispatch Address",
provider.onChangedDispatchAddress,
TextInputType.text,
false,
null,
focusNodes[0],focusNodes[1],TextInputAction.next
),
errorWidget(context, provider.dispatchAddressError),
textControllerWidget(
context,
provider.dispatchPincodeController,
"Dispatch Pin code",
"Enter Dispatch Pin code",
provider.onChangedDispatchPincode,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[1],focusNodes[2],TextInputAction.next
),
errorWidget(context, provider.dispatchPincodeError),
textControllerWidget(
context,
provider.noteController,
"Note",
"Enter Note",
provider.onChangedNote,
TextInputType.text,
false,
null,
focusNodes[2],focusNodes[3],TextInputAction.done
),
errorWidget(context, provider.noteError),
textControllerWidget(
context,
provider.dispatchPincodeController,
"Dispatch Pin code",
"Enter Dispatch Pin code",
provider.onChangedDispatchPincode,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[1],focusNodes[2],TextInputAction.next
),
errorWidget(context, provider.dispatchPincodeError),
textControllerWidget(
context,
provider.noteController,
"Note",
"Enter Note",
provider.onChangedNote,
TextInputType.text,
false,
null,
focusNodes[2],focusNodes[3],TextInputAction.done
),
errorWidget(context, provider.noteError),
InkResponse(
onTap: () {
_showAttachmentSheet(context);
},
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 45,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"Upload Purchase Order",
style: TextStyle(
fontFamily: "JakartaMedium",
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,
),
),
),
),
),
if (provider.imagePicked == 1 &&
provider.imagePath != null) ...[
Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"${provider.imagePath}",
child: Center(
child: Text(
"Upload Purchase Order",
style: TextStyle(
color: AppColors.semi_black,
fontSize: 11,
fontWeight: FontWeight.w600,
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
),
InkResponse(
onTap: () {
provider.imagePicked = 0;
provider.imagePath = null;
provider.imageFilePath = null;
},
child: SvgPicture.asset(
"assets/svg/ic_close.svg",
width: 15,
height: 15,
),
),
],
),
),
),
],
TextWidget(context, "Unloading Scope"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
hint: Text(
"Select Unloading Scope",
style: const TextStyle(fontSize: 14),
if (provider.imagePicked == 1 &&
provider.imagePath != null) ...[
Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"${provider.imagePath}",
style: TextStyle(
color: AppColors.semi_black,
fontSize: 11,
fontWeight: FontWeight.w600,
),
),
items:
provider.unloadingScope
.map(
(e) => DropdownMenuItem<String>(
value: e!,
child: Text(
e,
style: const TextStyle(
fontSize: 14,
InkResponse(
onTap: () {
provider.imagePicked = 0;
provider.imagePath = null;
provider.imageFilePath = null;
},
child: SvgPicture.asset(
"assets/svg/ic_close.svg",
width: 15,
height: 15,
),
),
],
),
),
],
TextWidget(context, "Unloading Scope"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
hint: Text(
"Select Unloading Scope",
style: const TextStyle(fontSize: 14),
),
items:
provider.unloadingScope
.map(
(e) => DropdownMenuItem<String>(
value: e!,
child: Text(
e,
style: const TextStyle(
fontSize: 14,
),
),
),
),
)
.toList(),
value: provider.selectedUnloadingScope,
onChanged: (String? value) {
if (provider.unloadingScope.isNotEmpty) {
provider.selectedUnloadingScope = value;
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
)
.toList(),
value: provider.selectedUnloadingScope,
onChanged: (String? value) {
if (provider.unloadingScope.isNotEmpty) {
provider.selectedUnloadingScope = value;
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
),
],
],
),
),
),
TextWidget(context, "Freight Scope"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
hint: Text(
"Select Freight Scope",
style: const TextStyle(fontSize: 14),
),
items:
provider.freightScope
.map(
(e) => DropdownMenuItem<String>(
value: e!,
child: Text(
e,
style: const TextStyle(
fontSize: 14,
TextWidget(context, "Freight Scope"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
hint: Text(
"Select Freight Scope",
style: const TextStyle(fontSize: 14),
),
items:
provider.freightScope
.map(
(e) => DropdownMenuItem<String>(
value: e!,
child: Text(
e,
style: const TextStyle(
fontSize: 14,
),
),
),
)
.toList(),
value:provider.selectedFreightScope,
onChanged: (String? value) {
if (provider.freightScope.isNotEmpty) {
provider.selectedFreightScope = value;
}
},
buttonStyleData: ButtonStyleData(
height: 50,
width: 160,
padding: const EdgeInsets.only(
left: 14,
right: 14,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14),
color: AppColors.text_field_color,
),
),
)
.toList(),
value:provider.selectedFreightScope,
onChanged: (String? value) {
if (provider.freightScope.isNotEmpty) {
provider.selectedFreightScope = value;
}
},
buttonStyleData: ButtonStyleData(
height: 50,
width: 160,
padding: const EdgeInsets.only(
left: 14,
right: 14,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14),
color: AppColors.text_field_color,
),
),
iconStyleData: IconStyleData(
icon: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
),
iconSize: 12,
iconEnabledColor: Color(0xFF2D2D2D),
iconDisabledColor: Colors.grey,
),
dropdownStyleData: DropdownStyleData(
maxHeight: 200,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14),
color: AppColors.text_field_color,
iconStyleData: IconStyleData(
icon: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
),
iconSize: 12,
iconEnabledColor: Color(0xFF2D2D2D),
iconDisabledColor: Colors.grey,
),
scrollbarTheme: ScrollbarThemeData(
radius: const Radius.circular(15),
thickness: MaterialStateProperty.all<double>(
6,
dropdownStyleData: DropdownStyleData(
maxHeight: 200,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14),
color: AppColors.text_field_color,
),
scrollbarTheme: ScrollbarThemeData(
radius: const Radius.circular(15),
thickness: MaterialStateProperty.all<double>(
6,
),
thumbVisibility:
MaterialStateProperty.all<bool>(true),
),
thumbVisibility:
MaterialStateProperty.all<bool>(true),
),
),
menuItemStyleData: const MenuItemStyleData(
height: 40,
padding: EdgeInsets.only(left: 14, right: 14),
menuItemStyleData: const MenuItemStyleData(
height: 40,
padding: EdgeInsets.only(left: 14, right: 14),
),
),
),
),
],
],
),
),
),
TextWidget(context, "Erection Scope"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
hint: Text(
"Select Erection Scope",
style: const TextStyle(fontSize: 14),
),
items:
provider.erectionScope
.map(
(e) => DropdownMenuItem<String>(
value: e!,
child: Text(
e,
style: const TextStyle(
fontSize: 14,
TextWidget(context, "Erection Scope"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
hint: Text(
"Select Erection Scope",
style: const TextStyle(fontSize: 14),
),
items:
provider.erectionScope
.map(
(e) => DropdownMenuItem<String>(
value: e!,
child: Text(
e,
style: const TextStyle(
fontSize: 14,
),
),
),
),
)
.toList(),
value:provider.selectedErectionScope,
onChanged: (String? value) {
if (provider.erectionScope.isNotEmpty) {
provider.selectedErectionScope = value;
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
)
.toList(),
value:provider.selectedErectionScope,
onChanged: (String? value) {
if (provider.erectionScope.isNotEmpty) {
provider.selectedErectionScope = value;
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
),
],
],
),
),
),
],
],
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
onTap:
provider.submitClicked
? null
: () {
provider.submitClicked = true;
provider.ordersEditOrderAPISubmitFunction(context, widget.orderID, provider.selectedDispatchStateID, provider.selectedDispatchDistrictId, provider.selectedDispatchSubLocID,
provider.selectedUnloadingScope, provider.selectedFreightScope, provider.selectedErectionScope);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child:
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
onTap:
provider.submitClicked
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.white,
? null
: () {
provider.submitClicked = true;
provider.ordersEditOrderAPISubmitFunction(context, widget.orderID, provider.selectedDispatchStateID, provider.selectedDispatchDistrictId, provider.selectedDispatchSubLocID,
provider.selectedUnloadingScope, provider.selectedFreightScope, provider.selectedErectionScope);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
)
: Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
child:
provider.submitClicked
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.white,
),
)
: Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
......
import 'dart:async';
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
......@@ -85,256 +86,260 @@ class _EditpaymentdetailsbymodeState extends State<Editpaymentdetailsbymode> {
return Consumer2<Addpaymentprovider, Editpaymentprovider>(
builder: (context, provider, editProvider, child) {
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white,
appBar: appbar2(
context,
"${widget.pageTitleName}",
provider.resetForm,
SizedBox(width: 0),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white,
appBar: appbar2(
context,
"${widget.pageTitleName}",
provider.resetForm,
SizedBox(width: 0),
),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(context, "Description"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
isExpanded: true,
hint: const Row(
children: [
Expanded(
child: Text(
'Select Advance Payment',
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextWidget(context, "Description"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
isExpanded: true,
hint: const Row(
children: [
Expanded(
child: Text(
'Select Advance Payment',
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
),
),
],
),
items:
provider.description
.map(
(pm) => DropdownMenuItem<String>(
value: pm,
child: Text(
pm,
style: const TextStyle(
fontSize: 14,
],
),
items:
provider.description
.map(
(pm) => DropdownMenuItem<String>(
value: pm,
child: Text(
pm,
style: const TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
),
overflow: TextOverflow.ellipsis,
),
),
)
.toList(),
value: provider.selectedDescription,
onChanged: (value) {
if (value != null) {
provider.selectedDescription = value;
print(
"statusId:${provider.selectedDescription}",
);
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
)
.toList(),
value: provider.selectedDescription,
onChanged: (value) {
if (value != null) {
provider.selectedDescription = value;
print(
"statusId:${provider.selectedDescription}",
);
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
),
],
],
),
),
),
errorWidget(context, provider.descriptionError),
textControllerWidget(
context,
provider.amountController,
"Amount",
"Enter Amount",
provider.onChangeAmount,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[0],
null,
TextInputAction.done
),
errorWidget(context, provider.amountError),
errorWidget(context, provider.descriptionError),
textControllerWidget(
context,
provider.amountController,
"Amount",
"Enter Amount",
provider.onChangeAmount,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[0],
null,
TextInputAction.done
),
errorWidget(context, provider.amountError),
TextWidget(context, "Select Payment Mode"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
isExpanded: true,
hint: const Row(
children: [
Expanded(
child: Text(
'Select Payment Mode',
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
TextWidget(context, "Select Payment Mode"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
isExpanded: true,
hint: const Row(
children: [
Expanded(
child: Text(
'Select Payment Mode',
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
),
),
],
),
items:
provider.paymentMode
.map(
(pm) => DropdownMenuItem<String>(
value: pm,
child: Text(
pm,
style: const TextStyle(
fontSize: 14,
],
),
items:
provider.paymentMode
.map(
(pm) => DropdownMenuItem<String>(
value: pm,
child: Text(
pm,
style: const TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
),
overflow: TextOverflow.ellipsis,
),
),
)
.toList(),
value: provider.selectedPaymentMode,
onChanged: (value) {
if (value != null) {
provider.selectedPaymentMode = value;
print(
"statusId:${provider.selectedPaymentMode}",
);
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
)
.toList(),
value: provider.selectedPaymentMode,
onChanged: (value) {
if (value != null) {
provider.selectedPaymentMode = value;
print(
"statusId:${provider.selectedPaymentMode}",
);
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
),
],
],
),
),
),
errorWidget(context, provider.paymentModeError),
errorWidget(context, provider.paymentModeError),
textControllerWidget(
context,
provider.paymentRefController,
"Payment Reference No.",
"Enter Payment Reference No. / Cheque No. / UTR No.",
provider.onChangepaymentRef,
TextInputType.text,
false,
null,
focusNodes[1],
textControllerWidget(
context,
provider.paymentRefController,
"Payment Reference No.",
"Enter Payment Reference No. / Cheque No. / UTR No.",
provider.onChangepaymentRef,
TextInputType.text,
false,
null,
TextInputAction.done
),
errorWidget(context, provider.paymentRefError),
TextWidget(context, "Payment Received Date"),
GestureDetector(
onTap: () {
provider.showDatePickerDialog(context);
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
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,
focusNodes[1],
null,
TextInputAction.done
),
errorWidget(context, provider.paymentRefError),
TextWidget(context, "Payment Received Date"),
GestureDetector(
onTap: () {
provider.showDatePickerDialog(context);
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
height: 50,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14),
),
child: TextFormField(
controller:
provider.paymentReceivedDateController,
keyboardType: TextInputType.text,
enabled: false,
maxLines: 1,
readOnly: true,
onChanged: (value) {},
decoration: InputDecoration(
hintText: "Enter Date",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14,
),
child: Padding(
padding: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
0,
),
child: TextFormField(
controller:
provider.paymentReceivedDateController,
keyboardType: TextInputType.text,
enabled: false,
maxLines: 1,
readOnly: true,
onChanged: (value) {},
decoration: InputDecoration(
hintText: "Enter Date",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14,
),
enabledBorder: InputBorder.none,
disabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
disabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
),
),
),
),
),
),
],
],
),
),
),
errorWidget(context, provider.dateError),
],
errorWidget(context, provider.dateError),
],
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse(
onTap:
editProvider.submitLoading
? null
: () {
editProvider.submitLoading = true;
editProvider.editPaymentDetailsAPIFunction(
context,
widget.values["payment_id"],
provider.selectedDescription,
provider.selectedPaymentMode,
provider.paymentRefController.text,
provider.paymentReceivedDateController.text,
provider.amountController.text,
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child:
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse(
onTap:
editProvider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.white,
),
)
: Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
? null
: () {
editProvider.submitLoading = true;
editProvider.editPaymentDetailsAPIFunction(
context,
widget.values["payment_id"],
provider.selectedDescription,
provider.selectedPaymentMode,
provider.paymentRefController.text,
provider.paymentReceivedDateController.text,
provider.amountController.text,
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 15),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child:
editProvider.submitLoading
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.white,
),
)
: Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
),
),
),
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
......@@ -35,116 +37,120 @@ class _OrderdetailsfeedbackhistoryState extends State<Orderdetailsfeedbackhistor
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Feedback History"),
backgroundColor: AppColors.scaffold_bg_color,
body: feedbackHistory.isNotEmpty?Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: feedbackHistory.length,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Feedback History"),
backgroundColor: AppColors.scaffold_bg_color,
body: feedbackHistory.isNotEmpty?Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: feedbackHistory.length,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(6, (j) {
final textheads = [
"<th>Employee</th>",
"<th>Feedback</th>",
"<th>Attachment</th>",
"<th>Status</th>",
"<th>Date</th>",
];
final textSubheads = [
"${feedbackHistory[index].employeNaem}",
"${feedbackHistory[index].feedback}",
"${feedbackHistory[index].attachmentDirFilePath}",
"${feedbackHistory[index].status}",
"${feedbackHistory[index].createdDatetime}",
];
return Container(
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(6, (j) {
final textheads = [
"<th>Employee</th>",
"<th>Feedback</th>",
"<th>Attachment</th>",
"<th>Status</th>",
"<th>Date</th>",
];
final textSubheads = [
"${feedbackHistory[index].employeNaem}",
"${feedbackHistory[index].feedback}",
"${feedbackHistory[index].attachmentDirFilePath}",
"${feedbackHistory[index].status}",
"${feedbackHistory[index].createdDatetime}",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(textheads[j].toString(),
maxLines: 2,
overflow: TextOverflow.ellipsis,),
),
Expanded(
child: SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.75,
child: Text(
textSubheads[j],
Expanded(
child: Text(textheads[j].toString(),
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
overflow: TextOverflow.ellipsis,),
),
Expanded(
child: 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),
),
),
),
),
),
],
),
);
}),
],
),
);
}),
),
);
}
),
):Emptywidget(context),
floatingActionButton: Align(
alignment: Alignment.bottomCenter,
child: InkWell(
onTap: () {
_showFeedbackSheet(context);
},
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(14.0),
),
child: Center(
child: Text(
"Feedback Update",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white,
fontFamily: "JakartaMedium"),
),
);
}
),
):Emptywidget(context),
floatingActionButton: Align(
alignment: Alignment.bottomCenter,
child: InkWell(
onTap: () {
_showFeedbackSheet(context);
},
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(14.0),
),
child: Center(
child: Text(
"Feedback Update",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white,
fontFamily: "JakartaMedium"),
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
),
);
},
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/ordersProvider/pagesDashboardProvider.dart';
......@@ -35,93 +37,97 @@ class _OrderdetailspaymenthistoryState extends State<Orderdetailspaymenthistory>
final paymentHistory = provider.paymentHistory;
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Payment History"),
backgroundColor: AppColors.scaffold_bg_color,
body: paymentHistory.isNotEmpty?Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: paymentHistory.length,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Payment History"),
backgroundColor: AppColors.scaffold_bg_color,
body: paymentHistory.isNotEmpty?Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: paymentHistory.length,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(7, (j) {
final textheads = [
"Mode of Payment",
"Payment Reference",
"Payment Amount",
"Adjusted Amount",
"Entered By Employee",
"Payment Received Date",
"Action",
];
final textSubheads = [
"${paymentHistory[index].paymentType}",
"${paymentHistory[index].refNo}",
"${paymentHistory[index].amount}",
"${paymentHistory[index].adjustedAmount}",
"${paymentHistory[index].enteredEmployee}",
"${paymentHistory[index].paymentDate}",
"${paymentHistory[index].approvalStatus}",
];
return Container(
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(7, (j) {
final textheads = [
"Mode of Payment",
"Payment Reference",
"Payment Amount",
"Adjusted Amount",
"Entered By Employee",
"Payment Received Date",
"Action",
];
final textSubheads = [
"${paymentHistory[index].paymentType}",
"${paymentHistory[index].refNo}",
"${paymentHistory[index].amount}",
"${paymentHistory[index].adjustedAmount}",
"${paymentHistory[index].enteredEmployee}",
"${paymentHistory[index].paymentDate}",
"${paymentHistory[index].approvalStatus}",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(textheads[j].toString(),
maxLines: 2,
overflow: TextOverflow.ellipsis,),
),
Expanded(
child: SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.75,
child: Text(
textSubheads[j],
Expanded(
child: Text(textheads[j].toString(),
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
overflow: TextOverflow.ellipsis,),
),
Expanded(
child: 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),
),
),
),
),
),
],
),
);
}),
),
);
}
),
):Emptywidget(context),
],
),
);
}),
),
);
}
),
):Emptywidget(context),
),
),
);
},
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
......@@ -33,93 +35,97 @@ class _OrderdetailsproductshistoryState extends State<Orderdetailsproductshistor
final productsHistory = provider.productsHistory;
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Products"),
backgroundColor: AppColors.scaffold_bg_color,
body: productsHistory.isNotEmpty?Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: productsHistory.length,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Products"),
backgroundColor: AppColors.scaffold_bg_color,
body: productsHistory.isNotEmpty?Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: productsHistory.length,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(7, (j) {
final textheads = [
"Product Name",
"Product Price",
"Quantity",
"CGST %",
"SGST %",
"IGST %",
"Total Price",
];
final textSubheads = [
"${productsHistory[index].productName}",
"${productsHistory[index].unitPrice}",
"${productsHistory[index].qty}",
"${productsHistory[index].cgstPercentage}",
"${productsHistory[index].sgstPercentage}",
"${productsHistory[index].igstPercentage}",
"${productsHistory[index].totalPrice}",
];
return Container(
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(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(7, (j) {
final textheads = [
"Product Name",
"Product Price",
"Quantity",
"CGST %",
"SGST %",
"IGST %",
"Total Price",
];
final textSubheads = [
"${productsHistory[index].productName}",
"${productsHistory[index].unitPrice}",
"${productsHistory[index].qty}",
"${productsHistory[index].cgstPercentage}",
"${productsHistory[index].sgstPercentage}",
"${productsHistory[index].igstPercentage}",
"${productsHistory[index].totalPrice}",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(textheads[j].toString(),
maxLines: 2,
overflow: TextOverflow.ellipsis,),
),
Expanded(
child: SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.75,
child: Text(
textSubheads[j],
Expanded(
child: Text(textheads[j].toString(),
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xFF818181),
overflow: TextOverflow.ellipsis,),
),
Expanded(
child: 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),
),
),
),
),
),
],
),
);
}),
),
);
}
),
):Emptywidget(context),
],
),
);
}),
),
);
}
),
):Emptywidget(context),
),
),
);
},
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
......@@ -33,100 +35,221 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
final pages = provider.ordersAccessiblePagesList;
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Orders"),
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
margin: EdgeInsets.symmetric(horizontal: 0,vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16)
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Orders"),
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 10,vertical: 5),
margin: EdgeInsets.symmetric(horizontal: 0,vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16)
),
height: MediaQuery.of(context).size.height * 0.28,
child: GridView.builder(
padding: EdgeInsets.symmetric(horizontal: 0,vertical: 5),
itemCount: provider.ordersgain.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
physics: AlwaysScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 0.65
),
itemBuilder: (context, jndex) {
final icons = ["comm_ic_1", "comm_ic_2"];
final leadTitles = [
'Order Gain',
'Dispatched',
'Pending Tasks',
'Quote',
];
final colors = [
0xFFE7FFE5,
0xFFF3EDFF,
0xFFFFFCD5,
0xFFFFF6F0,
];
final textcolors = [
0xFF0D9C00,
0xFF493272,
0xFF605C00,
0xFF91481B,
];
return InkResponse(
onTap: () async {
if (provider.ordersgain[jndex].filter!.pageName !=
"") {
if (provider.ordersgain[jndex].filter!.pageName!
.contains("Order List")) {
// await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => OrderslistbyModes(
// pageTitleName:
// provider
// .ordersgain[jndex]
// .filter!
// .pageName!,
// mode:
// provider.ordersgain[jndex].filter!.mode,
// filter: provider.ordersgain[jndex].filter!,
// ),
// ),
// );
}
}
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 13),
decoration: BoxDecoration(
color: Color(colors[jndex]),
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
provider.ordersgain[jndex].count!,
style: TextStyle(
fontSize: 30,
fontFamily: "JakartaMedium",
color: Color(textcolors[jndex]),
),
),
Text(
leadTitles[jndex],
style: TextStyle(color: Color(0xFF818181)),
),
],
),
),
);
},
),
),
height: MediaQuery.of(context).size.height * 0.28,
child: GridView.builder(
padding: EdgeInsets.symmetric(horizontal: 0,vertical: 5),
itemCount: provider.ordersgain.length,
ListView.builder(
itemCount: pages.length,
shrinkWrap: true,
scrollDirection: Axis.horizontal,
physics: AlwaysScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 10,
mainAxisSpacing: 10,
childAspectRatio: 0.65
),
itemBuilder: (context, jndex) {
final icons = ["comm_ic_1", "comm_ic_2"];
final leadTitles = [
'Order Gain',
'Dispatched',
'Pending Tasks',
'Quote',
];
final colors = [
0xFFE7FFE5,
0xFFF3EDFF,
0xFFFFFCD5,
0xFFFFF6F0,
];
final textcolors = [
0xFF0D9C00,
0xFF493272,
0xFF605C00,
0xFF91481B,
];
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
Widget? SvgIcon;
switch (pages[index].mode) {
case "level_one_approval":
SvgIcon = SvgPicture.asset(
"assets/svg/fin_lv1.svg",
);
break;
case "level_two_approval":
case "level_two_rejected":
SvgIcon = SvgPicture.asset(
"assets/svg/fin_lv2.svg",
);
break;
default:
SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
break;
};
return InkResponse(
onTap: () async {
if (provider.ordersgain[jndex].filter!.pageName !=
"") {
if (provider.ordersgain[jndex].filter!.pageName!
.contains("Order List")) {
// await Navigator.push(
// context,
// MaterialPageRoute(
// builder:
// (context) => OrderslistbyModes(
// pageTitleName:
// provider
// .ordersgain[jndex]
// .filter!
// .pageName!,
// mode:
// provider.ordersgain[jndex].filter!.mode,
// filter: provider.ordersgain[jndex].filter!,
// ),
// ),
// );
}
var navigate;
if (pages[index].pageName!.contains("Add Order") ) {
navigate = AddorderScreen(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
}if (pages[index].pageName!.contains("Add Payment") ) {
("navigate to Add Payment");
navigate = AddpaymentScreen(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
}
else if (pages[index].pageName!.contains("Payments List")) {
navigate = Paymentlistsbymode(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
} else if (pages[index].pageName!.contains("Order List")){
navigate = OrderslistbyModes(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
}else if(pages[index].pageName=="Add TPC Agent"){
navigate = AddtpcagentScreen();
}else if(pages[index].pageName=="TPC Agent List (Admin)"){
navigate = Tpcagentlistbymode(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
}else if(pages[index].pageName=="Pending TPC Issue List"){
navigate = Tpcagentissuelist(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
}
if(navigate!=null){
await Navigator.push(
context,
MaterialPageRoute(builder: (context) => navigate),
);
}
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 13),
margin: EdgeInsets.symmetric(
horizontal: 5,
vertical: 5,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
decoration: BoxDecoration(
color: Color(colors[jndex]),
borderRadius: BorderRadius.circular(12),
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
child: Row(
children: [
Text(
provider.ordersgain[jndex].count!,
style: TextStyle(
fontSize: 30,
fontFamily: "JakartaMedium",
color: Color(textcolors[jndex]),
Expanded(flex: 1, child: SvgIcon),
Expanded(
flex: 5,
child: Text(
"${pages[index].pageName}",
),
),
Text(
leadTitles[jndex],
style: TextStyle(color: Color(0xFF818181)),
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
),
],
),
......@@ -134,125 +257,8 @@ class _OrdermoduledashboardState extends State<Ordermoduledashboard> {
);
},
),
),
ListView.builder(
itemCount: pages.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
Widget? SvgIcon;
switch (pages[index].mode) {
case "level_one_approval":
SvgIcon = SvgPicture.asset(
"assets/svg/fin_lv1.svg",
);
break;
case "level_two_approval":
case "level_two_rejected":
SvgIcon = SvgPicture.asset(
"assets/svg/fin_lv2.svg",
);
break;
default:
SvgIcon = SvgPicture.asset("assets/svg/fin_ic.svg");
break;
};
return InkResponse(
onTap: () async {
var navigate;
if (pages[index].pageName!.contains("Add Order") ) {
navigate = AddorderScreen(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
}if (pages[index].pageName!.contains("Add Payment") ) {
("navigate to Add Payment");
navigate = AddpaymentScreen(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
}
else if (pages[index].pageName!.contains("Payments List")) {
navigate = Paymentlistsbymode(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
} else if (pages[index].pageName!.contains("Order List")){
navigate = OrderslistbyModes(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
}else if(pages[index].pageName=="Add TPC Agent"){
navigate = AddtpcagentScreen();
}else if(pages[index].pageName=="TPC Agent List (Admin)"){
navigate = Tpcagentlistbymode(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
}else if(pages[index].pageName=="Pending TPC Issue List"){
navigate = Tpcagentissuelist(
mode: pages[index].mode!,
pageTitleName:
pages[index]
.pageName!,
);
}
if(navigate!=null){
await Navigator.push(
context,
MaterialPageRoute(builder: (context) => navigate),
);
}
},
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 5,
vertical: 5,
),
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 15,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(14),
),
child: Row(
children: [
Expanded(flex: 1, child: SvgIcon),
Expanded(
flex: 5,
child: Text(
"${pages[index].pageName}",
),
),
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
),
],
),
),
);
},
),
],
],
),
),
),
),
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
......@@ -185,348 +187,352 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
subHeadings = [...subHeadings1,...subHeadings2];
}
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.mode!=""?"Order Details": "Order Details (${widget.mode})",
provider.resetAll,
InkResponse(
onTap: () {
_showOptionsSheet(context);
},
child: SvgPicture.asset("assets/svg/ic_more.svg", height: 30),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.mode!=""?"Order Details": "Order Details (${widget.mode})",
provider.resetAll,
InkResponse(
onTap: () {
_showOptionsSheet(context);
},
child: SvgPicture.asset("assets/svg/ic_more.svg", height: 30),
),
),
),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(8),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset("assets/svg/fin_ic.svg"),
),
child: SvgPicture.asset("assets/svg/fin_ic.svg"),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
orderDetails.accountName ?? "-",
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
orderDetails.accountName ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"₹${orderDetails.balanceAmount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
orderDetails.status ?? "-",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
color: Color(0xFF0D9C00),
),
),
Text(
"₹${orderDetails.balanceAmount}",
),
),
),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(subHeadings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
Headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
color: AppColors.semi_black,
),
),
],
),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
orderDetails.status ?? "-",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
Expanded(
child: InkResponse(
onTap: () {
if (Headings[j] ==
"Purchase Order") {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Fileviewer(
fileName:
orderDetails
.tpcPaymentAttachementViewFileName!,
fileUrl:
orderDetails
.tpcPaymentAttachmentDirFilePath!,
),
),
);
}
},
child: Text(
Headings[j] == "Purchase Order"
? "View"
:subHeadings[j]==""?"-":"${subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color:
Headings[j] ==
"Purchase Order"
? AppColors.app_blue
: Color(0xFF818181),
decoration:
Headings[j] ==
"Purchase Order"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
Headings[j] ==
"Purchase Order"
? AppColors.app_blue
: AppColors.white,
),
),
),
),
),
],
),
),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(subHeadings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
Headings[j],
);
}),
InkResponse(
onTap: () async {
provider.showMoreDetails = !provider.showMoreDetails;
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
provider.showMoreDetails?"- Show Less": "+ More Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
onTap: () {
if (Headings[j] ==
"Purchase Order") {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Fileviewer(
fileName:
orderDetails
.tpcPaymentAttachementViewFileName!,
fileUrl:
orderDetails
.tpcPaymentAttachmentDirFilePath!,
),
),
);
}
},
child: Text(
Headings[j] == "Purchase Order"
? "View"
:subHeadings[j]==""?"-":"${subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color:
Headings[j] ==
"Purchase Order"
? AppColors.app_blue
: Color(0xFF818181),
decoration:
Headings[j] ==
"Purchase Order"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
Headings[j] ==
"Purchase Order"
? AppColors.app_blue
: AppColors.white,
),
color: AppColors.app_blue,
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
provider.showMoreDetails = !provider.showMoreDetails;
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
provider.showMoreDetails?"- Show Less": "+ More Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
],
),
),
),
),
],
],
),
),
),
),
),
bottomNavigationBar:
["self", "pending_approval"].contains(widget.mode)
? Container(height: 0)
: Container(
margin: EdgeInsets.symmetric(horizontal: 10),
alignment: Alignment.bottomCenter,
height: 60,
child: Container(
margin: EdgeInsets.only(bottom: 10),
alignment: Alignment.center,
height: 45,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if ([
"level_one_approval",
"level_two_approval",
"level_two_rejected",
].contains(widget.mode)) ...[
Expanded(
child: InkResponse(
onTap: () {
_showLevelApprovalRejectionSheet(
context,
"Reject",
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
bottomNavigationBar:
["self", "pending_approval"].contains(widget.mode)
? Container(height: 0)
: Container(
margin: EdgeInsets.symmetric(horizontal: 10),
alignment: Alignment.bottomCenter,
height: 60,
child: Container(
margin: EdgeInsets.only(bottom: 10),
alignment: Alignment.center,
height: 45,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if ([
"level_one_approval",
"level_two_approval",
"level_two_rejected",
].contains(widget.mode)) ...[
Expanded(
child: InkResponse(
onTap: () {
_showLevelApprovalRejectionSheet(
context,
"Reject",
style: TextStyle(
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
"Reject",
style: TextStyle(
color: Color(0xFFED3424),
),
),
),
),
),
),
),
],
SizedBox(width: 10),
if ([
"level_one_approval",
"level_two_approval",
"level_two_rejected",
"sales_order_registered",
].contains(widget.mode)) ...[
Expanded(
child: InkResponse(
onTap: () {
// provider
// .approveRejectPaymentRequestAPIFunction(
// context,
// provider.requestsDetails.id,
// );
_showLevelApprovalRejectionSheet(
context,
"Approve",
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
),
),
child: Center(
child: Text(
],
SizedBox(width: 10),
if ([
"level_one_approval",
"level_two_approval",
"level_two_rejected",
"sales_order_registered",
].contains(widget.mode)) ...[
Expanded(
child: InkResponse(
onTap: () {
// provider
// .approveRejectPaymentRequestAPIFunction(
// context,
// provider.requestsDetails.id,
// );
_showLevelApprovalRejectionSheet(
context,
"Approve",
style: TextStyle(
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
),
),
child: Center(
child: Text(
"Approve",
style: TextStyle(
color: Color(0xFF0D9C00),
),
),
),
),
),
),
),
],
],
if (["admin"].contains(widget.mode)) ...[
Expanded(
child: InkResponse(
onTap: () {
_showLevelDeletionSheet(context);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
"Delete",
style: TextStyle(
if (["admin"].contains(widget.mode)) ...[
Expanded(
child: InkResponse(
onTap: () {
_showLevelDeletionSheet(context);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
"Delete",
style: TextStyle(
color: Color(0xFFED3424),
),
),
),
),
),
),
),
],
if (widget.mode == "dispatched") ...[
Expanded(
child: InkResponse(
onTap: () {
disProvider.initializeForm(context);
disProvider.ordersDetailsDispatchOrderViewFunction(context,widget.orderId);
_showDispatchSheet(context, "Dispatch");
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
"Dispatch",
style: TextStyle(
],
if (widget.mode == "dispatched") ...[
Expanded(
child: InkResponse(
onTap: () {
disProvider.initializeForm(context);
disProvider.ordersDetailsDispatchOrderViewFunction(context,widget.orderId);
_showDispatchSheet(context, "Dispatch");
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
"Dispatch",
style: TextStyle(
color: Color(0xFFED3424),
),
),
),
),
),
),
),
],
],
],
),
),
),
),
),
),
onWillPop: () {
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
......@@ -52,266 +54,270 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
provider.resetAll();
return onBackPressed(context);
},
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg"),
// ),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg"),
// ),
InkResponse(
onTap: () async {
_showFilterSheet(context);
},
child: SvgPicture.asset(
"assets/svg/filter_ic.svg",
height: 25,
InkResponse(
onTap: () async {
_showFilterSheet(context);
},
child: SvgPicture.asset(
"assets/svg/filter_ic.svg",
height: 25,
),
),
),
],
],
),
),
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
),
),
)
: ordersList.isNotEmpty
? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: ordersList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (ordersList.isEmpty) {
return SizedBox(
child: Center(
child: Text("No Data Available"),
)
: ordersList.isNotEmpty
? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: ordersList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (ordersList.isEmpty) {
return SizedBox(
child: Center(
child: Text("No Data Available"),
),
);
}
if(ordersList[index].orderNumber=="GP20252605448")
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
);
}
if(ordersList[index].orderNumber=="GP20252605448")
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius:
BorderRadius.circular(8),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius:
BorderRadius.circular(8),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
ordersList[index]
.accountName!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"₹"
"${ordersList[index].balanceAmount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
ordersList[index]
.accountName!,
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
ordersList[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
color: Color(0xFF0D9C00),
),
),
Text(
"₹"
"${ordersList[index].balanceAmount}",
),
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(5, (j) {
final headings = [
"Order Number",
"Entered Employee",
"Sales Person",
// "Date",
"Paid Amount",
"Balance Amount",
];
final subHeadings = [
ordersList[index].orderNumber,
ordersList[index].enteredEmpName,
ordersList[index].salesPersonEmpName,
// ordersList[index].createdDatetime,
ordersList[index].paidAmount,
ordersList[index].balanceAmount,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
color: AppColors.semi_black,
),
),
],
),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
ordersList[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
Expanded(
child: InkResponse(
child: Text(
subHeadings[j]!,
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
decoration:
TextDecoration.none,
decorationColor:
AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Ordersdetailsbymodes(
pageTitleName:
widget.pageTitleName,
orderId:
ordersList[index]
.orderId,
mode: widget.mode,
),
),
);
if(res==true){
provider.ordersListByModeFilterAPIFunction(context, widget.mode);
provider.ordersListByModeAPIFunction(context, widget.mode, "", "");
}
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(5, (j) {
final headings = [
"Order Number",
"Entered Employee",
"Sales Person",
// "Date",
"Paid Amount",
"Balance Amount",
];
final subHeadings = [
ordersList[index].orderNumber,
ordersList[index].enteredEmpName,
ordersList[index].salesPersonEmpName,
// ordersList[index].createdDatetime,
ordersList[index].paidAmount,
ordersList[index].balanceAmount,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
color: AppColors.app_blue,
),
),
),
Expanded(
child: InkResponse(
child: Text(
subHeadings[j]!,
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
decoration:
TextDecoration.none,
decorationColor:
AppColors.white,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Ordersdetailsbymodes(
pageTitleName:
widget.pageTitleName,
orderId:
ordersList[index]
.orderId,
mode: widget.mode,
),
],
),
);
if(res==true){
provider.ordersListByModeFilterAPIFunction(context, widget.mode);
provider.ordersListByModeAPIFunction(context, widget.mode, "", "");
}
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
],
),
);
},
),
],
),
)
: Emptywidget(context),
],
),
);
},
),
],
),
)
: Emptywidget(context),
),
),
);
},
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/ordersProvider/paymentsProvider.dart';
......@@ -48,304 +50,177 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
var paymentDetails = provider.paymentDetails;
var adjustList = provider.paidLists;
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
paymentDetails.status == "Registered"
? InkResponse(
onTap: () {
_showOptionsSheet(context);
},
child: SvgPicture.asset(
"assets/svg/ic_more.svg",
height: 30,
),
)
: SizedBox(width: 0),
),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
paymentDetails.status == "Registered"
? InkResponse(
onTap: () {
_showOptionsSheet(context);
},
child: SvgPicture.asset(
"assets/svg/ic_more.svg",
height: 30,
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
)
: SizedBox(width: 0),
),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
padding: EdgeInsets.symmetric(
vertical: 10,
horizontal: 10,
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
paymentDetails.accountName ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
paymentDetails.accountName ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Text(
"₹${paymentDetails.amount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
Text(
"₹${paymentDetails.amount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
],
),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
paymentDetails.status ?? "-",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
],
),
),
),
),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(provider.subHeadings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
provider.Headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
),
Expanded(
child: InkResponse(
onTap: () {
if (provider.Headings[j] ==
"Attachment") {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Fileviewer(
fileName:
paymentDetails
.attachmentViewFileName!,
fileUrl:
paymentDetails
.attachmentDirFilePath!,
),
),
);
}
},
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
provider.Headings[j] == "Attachment"
? "View"
: "${provider.subHeadings[j]}",
paymentDetails.status ?? "-",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color:
provider.Headings[j] ==
"Attachment"
? AppColors.app_blue
: Color(0xFF818181),
decoration:
provider.Headings[j] ==
"Attachment"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
provider.Headings[j] ==
"Attachment"
? AppColors.app_blue
: AppColors.white,
color: Color(0xFF0D9C00),
),
),
),
),
],
),
);
}),
],
),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(
vertical: 5,
horizontal: 10,
),
child: Text(
"Adjusted Order List",
style: TextStyle(
fontSize: 14,
color: AppColors.grey_thick,
),
),
),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: adjustList.length,
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.symmetric(vertical: 5),
padding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(7, (j) {
final textheads = [
"Order Number",
"Order Amount",
"Paid Amount",
"Balance Amount",
"Adjusted Amount",
"DateTime",
"Actions",
];
final textSubheads = [
"${adjustList[index].orderNumber}",
"${adjustList[index].totalAmount}",
"${adjustList[index].paidAmount}",
"${adjustList[index].balanceAmount}",
"${adjustList[index].adjustedAmount}",
"${adjustList[index].datetime}",
"View",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(provider.subHeadings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
textheads[j].toString(),
maxLines: 2,
overflow: TextOverflow.ellipsis,
provider.Headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
onTap: () {
if (textheads[j] == "Actions") {
if (provider.Headings[j] ==
"Attachment") {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Ordersdetailsbymodes(
pageTitleName:
"CRM Order Details",
mode: widget.mode,
orderId:
adjustList[index].id,
(context) => Fileviewer(
fileName:
paymentDetails
.attachmentViewFileName!,
fileUrl:
paymentDetails
.attachmentDirFilePath!,
),
),
);
}
},
child: SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.75,
child: Text(
textSubheads[j],
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color:
textheads[j] == "Actions"
? AppColors.app_blue
: Color(0xFF818181),
decoration:
textheads[j] == "Actions"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
textheads[j] == "Actions"
? AppColors.app_blue
: AppColors.white,
),
child: Text(
provider.Headings[j] == "Attachment"
? "View"
: "${provider.subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color:
provider.Headings[j] ==
"Attachment"
? AppColors.app_blue
: Color(0xFF818181),
decoration:
provider.Headings[j] ==
"Attachment"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
provider.Headings[j] ==
"Attachment"
? AppColors.app_blue
: AppColors.white,
),
),
),
......@@ -354,124 +229,255 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
),
);
}),
],
),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(
vertical: 5,
horizontal: 10,
),
child: Text(
"Adjusted Order List",
style: TextStyle(
fontSize: 14,
color: AppColors.grey_thick,
),
);
},
),
],
),
),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: adjustList.length,
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.symmetric(vertical: 5),
padding: EdgeInsets.symmetric(
horizontal: 15,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(7, (j) {
final textheads = [
"Order Number",
"Order Amount",
"Paid Amount",
"Balance Amount",
"Adjusted Amount",
"DateTime",
"Actions",
];
final textSubheads = [
"${adjustList[index].orderNumber}",
"${adjustList[index].totalAmount}",
"${adjustList[index].paidAmount}",
"${adjustList[index].balanceAmount}",
"${adjustList[index].adjustedAmount}",
"${adjustList[index].datetime}",
"View",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
textheads[j].toString(),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
),
Expanded(
child: InkResponse(
onTap: () {
if (textheads[j] == "Actions") {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Ordersdetailsbymodes(
pageTitleName:
"CRM Order Details",
mode: widget.mode,
orderId:
adjustList[index].id,
),
),
);
}
},
child: SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.75,
child: Text(
textSubheads[j],
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color:
textheads[j] == "Actions"
? AppColors.app_blue
: Color(0xFF818181),
decoration:
textheads[j] == "Actions"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
textheads[j] == "Actions"
? AppColors.app_blue
: AppColors.white,
),
),
),
),
),
],
),
);
}),
),
);
},
),
],
),
),
),
),
bottomNavigationBar:
widget.mode == "self"
? Container(height: 0)
: Container(
margin: EdgeInsets.symmetric(horizontal: 10),
alignment: Alignment.bottomCenter,
height: 60,
child: Container(
margin: EdgeInsets.only(bottom: 10),
alignment: Alignment.center,
height: 45,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (!["self", "admin"].contains(widget.mode)) ...[
Expanded(
child: InkResponse(
onTap: () {
_showLevelApprovalRejectionSheet(
context,
"Reject",
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
bottomNavigationBar:
widget.mode == "self"
? Container(height: 0)
: Container(
margin: EdgeInsets.symmetric(horizontal: 10),
alignment: Alignment.bottomCenter,
height: 60,
child: Container(
margin: EdgeInsets.only(bottom: 10),
alignment: Alignment.center,
height: 45,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (!["self", "admin"].contains(widget.mode)) ...[
Expanded(
child: InkResponse(
onTap: () {
_showLevelApprovalRejectionSheet(
context,
"Reject",
style: TextStyle(
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
"Reject",
style: TextStyle(
color: Color(0xFFED3424),
),
),
),
),
),
),
),
SizedBox(width: 10),
SizedBox(width: 10),
Expanded(
child: InkResponse(
onTap: () {
// provider
// .approveRejectPaymentRequestAPIFunction(
// context,
// provider.requestsDetails.id,
// );
_showLevelApprovalRejectionSheet(
context,
"Approve",
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
),
),
child: Center(
child: Text(
Expanded(
child: InkResponse(
onTap: () {
// provider
// .approveRejectPaymentRequestAPIFunction(
// context,
// provider.requestsDetails.id,
// );
_showLevelApprovalRejectionSheet(
context,
"Approve",
style: TextStyle(
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
),
),
child: Center(
child: Text(
"Approve",
style: TextStyle(
color: Color(0xFF0D9C00),
),
),
),
),
),
),
),
] else if (widget.mode == "admin") ...[
Expanded(
child: InkResponse(
onTap: () {
_showLevelDeletionSheet(context);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
"Delete",
style: TextStyle(
] else if (widget.mode == "admin") ...[
Expanded(
child: InkResponse(
onTap: () {
_showLevelDeletionSheet(context);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
"Delete",
style: TextStyle(
color: Color(0xFFED3424),
),
),
),
),
),
),
),
],
],
],
),
),
),
),
),
),
onWillPop: () {
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
......@@ -48,245 +50,249 @@ class _PaymentlistsbymodeState extends State<Paymentlistsbymode> {
provider.resetAll();
return onBackPressed(context);
},
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
InkResponse(
onTap: () async {
_showFilterSheet(context);
},
child: SvgPicture.asset(
"assets/svg/filter_ic.svg", height: 25,),
),
],
InkResponse(
onTap: () async {
_showFilterSheet(context);
},
child: SvgPicture.asset(
"assets/svg/filter_ic.svg", height: 25,),
),
],
),
),
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
: paymentLists.isNotEmpty ? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: paymentLists.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (paymentLists.isEmpty) {
return SizedBox(
child: Center(
child: Text("No Data Available"),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
: paymentLists.isNotEmpty ? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: paymentLists.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (paymentLists.isEmpty) {
return SizedBox(
child: Center(
child: Text("No Data Available"),
),
);
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
);
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius:
BorderRadius.circular(8),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius:
BorderRadius.circular(8),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
paymentLists[index].ename!,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors.semi_black,
),
),
Text(
"₹"
"${paymentLists[index].amount}",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
paymentLists[index].ename!,
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
paymentLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontFamily: "JakartaMedium",
fontSize: 14,
color:
AppColors.semi_black,
color: Color(0xFF0D9C00),
),
),
Text(
"₹"
"${paymentLists[index].amount}",
),
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Customer Name",
"Order Number",
"Date",
"Description",
];
final subHeadings = [
paymentLists[index].aname,
paymentLists[index].orderNumber,
paymentLists[index].datetime,
paymentLists[index].description,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily:
"JakartaMedium",
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
color: AppColors.semi_black,
),
),
],
),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
paymentLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
Expanded(
child: InkResponse(
child: Text(
"${subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color: Color(
0xFF818181,
),
decoration: TextDecoration
.none,
decorationColor: AppColors.white,
),
),
),
),
),
],
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Customer Name",
"Order Number",
"Date",
"Description",
];
final subHeadings = [
paymentLists[index].aname,
paymentLists[index].orderNumber,
paymentLists[index].datetime,
paymentLists[index].description,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
);
}),
InkResponse(
onTap: () async {
Navigator.push(context, MaterialPageRoute(
builder: (context) =>
Paymentdetailsbymode(mode: widget.mode,
pageTitleName: widget.pageTitleName,
paymentId: paymentLists[index].paymentId,
),));
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
color: AppColors.app_blue,
),
),
),
Expanded(
child: InkResponse(
child: Text(
"${subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color: Color(
0xFF818181,
),
decoration: TextDecoration
.none,
decorationColor: AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
Navigator.push(context, MaterialPageRoute(
builder: (context) =>
Paymentdetailsbymode(mode: widget.mode,
pageTitleName: widget.pageTitleName,
paymentId: paymentLists[index].paymentId,
),));
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
],
),
),
),
),
],
),
);
},
),
],
),
) : Emptywidget(context),
],
),
);
},
),
],
),
) : Emptywidget(context),
),
),
);
},
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/ordersProvider/tpcAgentsProvider.dart';
......@@ -41,255 +43,259 @@ class _TpcagentdetailsbymodeState extends State<Tpcagentdetailsbymode> {
var tpcAgentDetails = provider.TPCAgentsDetails;
var tpcReqAmt = provider.TPCRequestedAmounts;
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(context, widget.pageTitleName, provider.resetAll,
SizedBox(width: 0,),),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(8),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(context, widget.pageTitleName, provider.resetAll,
SizedBox(width: 0,),),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset("assets/svg/fin_ic.svg"),
),
child: SvgPicture.asset("assets/svg/fin_ic.svg"),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
tpcAgentDetails.name ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
tpcAgentDetails.name ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Text(
"${tpcAgentDetails.mobileNumber}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
Text(
"${tpcAgentDetails.mobileNumber}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
],
],
),
),
),
),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(provider.subHeadings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
provider.Headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
onTap: () {
if (provider.Headings[j] ==
"ID Proof") {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Fileviewer(
fileName:
tpcAgentDetails
.idProofViewFileName!,
fileUrl:
tpcAgentDetails
.idProofDirFilePath!,
),
),
);
}
},
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(provider.subHeadings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
"${provider.subHeadings[j]}",
provider.Headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color:
provider.Headings[j] == "ID Proof"
? AppColors.app_blue
: Color(0xFF818181),
decoration:
provider.Headings[j] == "ID Proof"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
provider.Headings[j] == "ID Proof"
? AppColors.app_blue
: AppColors.white,
color: AppColors.semi_black,
),
),
),
),
],
),
);
}),
],
Expanded(
child: InkResponse(
onTap: () {
if (provider.Headings[j] ==
"ID Proof") {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Fileviewer(
fileName:
tpcAgentDetails
.idProofViewFileName!,
fileUrl:
tpcAgentDetails
.idProofDirFilePath!,
),
),
);
}
},
child: Text(
"${provider.subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color:
provider.Headings[j] == "ID Proof"
? AppColors.app_blue
: Color(0xFF818181),
decoration:
provider.Headings[j] == "ID Proof"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
provider.Headings[j] == "ID Proof"
? AppColors.app_blue
: AppColors.white,
),
),
),
),
],
),
);
}),
],
),
),
),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(vertical: 5,horizontal: 10),
child: Text("TPC Amounts Requested",
style: TextStyle(
fontSize: 14,
color: AppColors.grey_thick
),)),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: tpcReqAmt.length,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
Container(
alignment: Alignment.topLeft,
padding: EdgeInsets.symmetric(vertical: 5,horizontal: 10),
child: Text("TPC Amounts Requested",
style: TextStyle(
fontSize: 14,
color: AppColors.grey_thick
),)),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: tpcReqAmt.length,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.symmetric(vertical: 5),
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(6, (j) {
final textheads = [
"Customer Name",
"Order Number",
"Order Amount",
"Level 2 Approved Amount",
"Status",
"Action",
];
final textSubheads = [
"${tpcReqAmt[index].customerName}",
"${tpcReqAmt[index].orderNumber}",
"${tpcReqAmt[index].totalAmount}",
"${tpcReqAmt[index].level2TpcApprovedAmount}",
"${tpcReqAmt[index].tpcStatus}",
"View",
];
return Container(
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.symmetric(vertical: 5),
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(6, (j) {
final textheads = [
"Customer Name",
"Order Number",
"Order Amount",
"Level 2 Approved Amount",
"Status",
"Action",
];
final textSubheads = [
"${tpcReqAmt[index].customerName}",
"${tpcReqAmt[index].orderNumber}",
"${tpcReqAmt[index].totalAmount}",
"${tpcReqAmt[index].level2TpcApprovedAmount}",
"${tpcReqAmt[index].tpcStatus}",
"View",
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
padding: EdgeInsets.symmetric(
vertical: 6,
horizontal: 0,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(textheads[j].toString(),
maxLines: 2,
overflow: TextOverflow.ellipsis,),
),
Expanded(
child: InkResponse(
onTap: () {
if (textheads[j] == "Action") {
Navigator.push(
Expanded(
child: Text(textheads[j].toString(),
maxLines: 2,
overflow: TextOverflow.ellipsis,),
),
Expanded(
child: InkResponse(
onTap: () {
if (textheads[j] == "Action") {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Ordersdetailsbymodes(
pageTitleName: "CRM Order Details",
mode: widget.mode,
orderId: tpcReqAmt[index].orderId,
),
),
);
}
},
child: SizedBox(
// height:45,
width:
MediaQuery.of(
context,
MaterialPageRoute(
builder:
(context) =>
Ordersdetailsbymodes(
pageTitleName: "CRM Order Details",
mode: widget.mode,
orderId: tpcReqAmt[index].orderId,
),
).size.width *
0.75,
child: Text(
textSubheads[j],
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color:textheads[j] == "Action"? AppColors.app_blue:
Color(0xFF818181),
decoration:
textheads[j] == "Action"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
textheads[j] == "Action"
? AppColors.app_blue
: AppColors.white,
),
);
}
},
child: SizedBox(
// height:45,
width:
MediaQuery.of(
context,
).size.width *
0.75,
child: Text(
textSubheads[j],
maxLines: 2,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color:textheads[j] == "Action"? AppColors.app_blue:
Color(0xFF818181),
decoration:
textheads[j] == "Action"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
textheads[j] == "Action"
? AppColors.app_blue
: AppColors.white,
),
),
),
),
),
],
),
);
}),
),
);
}
),
],
],
),
);
}),
),
);
}
),
],
),
),
),
),
),
),
onWillPop: () {
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/screens/order/tpcAgentIssueListDetails.dart';
......@@ -43,223 +45,227 @@ class _TpcagentissuelistState extends State<Tpcagentissuelist> {
provider.resetAll();
return onBackPressed(context);
},
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
Row(
children: [
// InkResponse(
// onTap: () {
// // _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
Row(
children: [
// InkResponse(
// onTap: () {
// // _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
],
],
),
),
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
: tpcAgentsIssueList.isNotEmpty ? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: tpcAgentsIssueList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (tpcAgentsIssueList.isEmpty) {
return SizedBox(
child: Center(
child: Text("No Data Available"),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
: tpcAgentsIssueList.isNotEmpty ? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: tpcAgentsIssueList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (tpcAgentsIssueList.isEmpty) {
return SizedBox(
child: Center(
child: Text("No Data Available"),
),
);
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
);
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
decoration: BoxDecoration(
color: Color(0xFFEAF7FF),
borderRadius:
BorderRadius.circular(8),
),
child: SvgPicture.asset(
"assets/svg/tpc_ic.svg",
decoration: BoxDecoration(
color: Color(0xFFEAF7FF),
borderRadius:
BorderRadius.circular(8),
),
child: SvgPicture.asset(
"assets/svg/tpc_ic.svg",
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
tpcAgentsIssueList[index].name!,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors.semi_black,
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
tpcAgentsIssueList[index].name!,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors.semi_black,
),
),
),
Text(
Text(
"${tpcAgentsIssueList[index].aname}",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
"${tpcAgentsIssueList[index].aname}",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
],
],
),
),
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Sales Person",
"Order Number",
"Order Amount",
"Order Status",
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Sales Person",
"Order Number",
"Order Amount",
"Order Status",
];
final subHeadings = [
tpcAgentsIssueList[index].ename,
tpcAgentsIssueList[index].orderNumber,
tpcAgentsIssueList[index].totalAmount,
tpcAgentsIssueList[index].status,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
];
final subHeadings = [
tpcAgentsIssueList[index].ename,
tpcAgentsIssueList[index].orderNumber,
tpcAgentsIssueList[index].totalAmount,
tpcAgentsIssueList[index].status,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
"${subHeadings[j]}",
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(
0xFF818181,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
child: Text(
"${subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color: Color(
0xFF818181,
),
decoration: TextDecoration
.none,
decorationColor: AppColors.white,
),
decoration: TextDecoration
.none,
decorationColor: AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Tpcagentissuelistdetails(
pageTitleName: "CRM Order Details",
mode: widget.mode,
orderId: tpcAgentsIssueList[index].orderId,
),
),
],
),
);
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
}),
InkResponse(
onTap: () async {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Tpcagentissuelistdetails(
pageTitleName: "CRM Order Details",
mode: widget.mode,
orderId: tpcAgentsIssueList[index].orderId,
),
),
);
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
),
],
),
);
},
),
],
),
) : Emptywidget(context),
],
),
);
},
),
],
),
) : Emptywidget(context),
),
),
);
},
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/screens/screensExports.dart';
......@@ -172,248 +174,252 @@ class _TpcagentissuelistdetailsState extends State<Tpcagentissuelistdetails> {
subHeadings = [...subHeadings1,...subHeadings2];
}
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(context, widget.pageTitleName, provider.resetAll,
InkResponse(
onTap: () {
_showOptionsSheet(
context
);
},
child: SvgPicture.asset("assets/svg/ic_more.svg", height: 30,),
),),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(8),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(context, widget.pageTitleName, provider.resetAll,
InkResponse(
onTap: () {
_showOptionsSheet(
context
);
},
child: SvgPicture.asset("assets/svg/ic_more.svg", height: 30,),
),),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset("assets/svg/fin_ic.svg"),
),
child: SvgPicture.asset("assets/svg/fin_ic.svg"),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
orderDetails.accountName ?? "-",
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
orderDetails.accountName ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"₹${orderDetails.balanceAmount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
orderDetails.status ?? "-",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
color: Color(0xFF0D9C00),
),
),
Text(
"₹${orderDetails.balanceAmount}",
),
),
),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(subHeadings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
Headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
color: AppColors.semi_black,
),
),
],
),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
orderDetails.status ?? "-",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
Expanded(
child: InkResponse(
onTap: () {
if (Headings[j] ==
"Purchase Order") {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Fileviewer(
fileName:
orderDetails
.tpcPaymentAttachementViewFileName!,
fileUrl:
orderDetails
.tpcPaymentAttachmentDirFilePath!,
),
),
);
}
},
child: Text(
Headings[j] == "Purchase Order"
? "View"
: "${subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color:
Headings[j] == "Purchase Order"
? AppColors.app_blue
: Color(0xFF818181),
decoration:
Headings[j] == "Purchase Order"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
Headings[j] == "Purchase Order"
? AppColors.app_blue
: AppColors.white,
),
),
),
),
),
],
),
),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(subHeadings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
Headings[j],
);
}),
InkResponse(
onTap: () async {
provider.showMoreDetails = !provider.showMoreDetails;
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
provider.showMoreDetails?"- Show Less": "+ More Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
onTap: () {
if (Headings[j] ==
"Purchase Order") {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Fileviewer(
fileName:
orderDetails
.tpcPaymentAttachementViewFileName!,
fileUrl:
orderDetails
.tpcPaymentAttachmentDirFilePath!,
),
),
);
}
},
child: Text(
Headings[j] == "Purchase Order"
? "View"
: "${subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color:
Headings[j] == "Purchase Order"
? AppColors.app_blue
: Color(0xFF818181),
decoration:
Headings[j] == "Purchase Order"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
Headings[j] == "Purchase Order"
? AppColors.app_blue
: AppColors.white,
),
color: AppColors.app_blue,
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
provider.showMoreDetails = !provider.showMoreDetails;
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
provider.showMoreDetails?"- Show Less": "+ More Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
],
),
),
),
),
],
],
),
),
),
),
),
bottomNavigationBar:
Container(
margin: EdgeInsets.symmetric(horizontal: 10),
alignment: Alignment.bottomCenter,
height: 60,
child: Container(
margin: EdgeInsets.only(bottom: 10),
alignment: Alignment.center,
height: 45,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: InkResponse(
onTap: () {
// provider
// .approveRejectPaymentRequestAPIFunction(
// context,
// provider.requestsDetails.id,
// );
_showLevelApprovalSheet(
context);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
),
),
child: Center(
child: Text(
"Approve",
style: TextStyle(
bottomNavigationBar:
Container(
margin: EdgeInsets.symmetric(horizontal: 10),
alignment: Alignment.bottomCenter,
height: 60,
child: Container(
margin: EdgeInsets.only(bottom: 10),
alignment: Alignment.center,
height: 45,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: InkResponse(
onTap: () {
// provider
// .approveRejectPaymentRequestAPIFunction(
// context,
// provider.requestsDetails.id,
// );
_showLevelApprovalSheet(
context);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
),
),
child: Center(
child: Text(
"Approve",
style: TextStyle(
color: Color(0xFF0D9C00),
),
),
),
),
),
),
),
],
],
),
),
),
),
),
),
onWillPop: () {
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/ordersProvider/tpcAgentsProvider.dart';
......@@ -45,249 +47,253 @@ class _TpcagentlistbymodeState extends State<Tpcagentlistbymode> {
provider.resetAll();
return onBackPressed(context);
},
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
Row(
children: [
// InkResponse(
// onTap: () {
// // _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
Row(
children: [
// InkResponse(
// onTap: () {
// // _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
],
],
),
),
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
: tpcAgentsLists.isNotEmpty ? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: tpcAgentsLists.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (tpcAgentsLists.isEmpty) {
return SizedBox(
child: Center(
child: Text("No Data Available"),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
: tpcAgentsLists.isNotEmpty ? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: tpcAgentsLists.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (tpcAgentsLists.isEmpty) {
return SizedBox(
child: Center(
child: Text("No Data Available"),
),
);
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
);
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
decoration: BoxDecoration(
color: Color(0xFFEAF7FF),
borderRadius:
BorderRadius.circular(8),
),
child: SvgPicture.asset(
"assets/svg/tpc_ic.svg",
decoration: BoxDecoration(
color: Color(0xFFEAF7FF),
borderRadius:
BorderRadius.circular(8),
),
child: SvgPicture.asset(
"assets/svg/tpc_ic.svg",
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
tpcAgentsLists[index].name!,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors.semi_black,
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
tpcAgentsLists[index].name!,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors.semi_black,
),
),
),
Text(
Text(
"${tpcAgentsLists[index]
.mobileNumber}",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
"${tpcAgentsLists[index]
.mobileNumber}",
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
],
],
),
),
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Entered Employee",
"Issued Amount",
"ID Proof",
"Description",
];
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Entered Employee",
"Issued Amount",
"ID Proof",
"Description",
];
final subHeadings = [
tpcAgentsLists[index].enteredEmpName,
tpcAgentsLists[index].issuedAmount,
"View",
tpcAgentsLists[index].note,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
if(subHeadings[j] == "View")...[
final subHeadings = [
tpcAgentsLists[index].enteredEmpName,
tpcAgentsLists[index].issuedAmount,
"View",
tpcAgentsLists[index].note,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: InkResponse(
onTap: () {
Navigator.push(context,
MaterialPageRoute(
builder: (context) =>
Fileviewer(
fileName: tpcAgentsLists[index]
.idProofViewFileName ??
"-",
fileUrl: tpcAgentsLists[index]
.idProofDirFilePath ??
"-"),));
},
child: Text(
"${subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color:AppColors.app_blue,
decoration: TextDecoration
.underline,
decorationColor: AppColors.app_blue,
),
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
] else
...[
if(subHeadings[j] == "View")...[
Expanded(
child: InkResponse(
onTap: () {
Navigator.push(context,
MaterialPageRoute(
builder: (context) =>
Fileviewer(
fileName: tpcAgentsLists[index]
.idProofViewFileName ??
"-",
fileUrl: tpcAgentsLists[index]
.idProofDirFilePath ??
"-"),));
},
child: Text(
"${subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color: Color(
0xFF818181,
),
color:AppColors.app_blue,
decoration: TextDecoration
.none,
decorationColor: AppColors
.white,
.underline,
decorationColor: AppColors.app_blue,
),
),
),
),
]
] else
...[
Expanded(
child: InkResponse(
],
),
);
}),
InkResponse(
onTap: () async {
Navigator.push(context, MaterialPageRoute(
builder: (context) =>
Tpcagentdetailsbymode(mode: widget.mode,
pageTitleName: widget.pageTitleName,
tpcAgentId: tpcAgentsLists[index]
.tpcAgentId,
),));
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
child: Text(
"${subHeadings[j]}",
style: TextStyle(
fontSize: 14,
color: Color(
0xFF818181,
),
decoration: TextDecoration
.none,
decorationColor: AppColors
.white,
),
),
),
),
]
],
),
);
}),
InkResponse(
onTap: () async {
Navigator.push(context, MaterialPageRoute(
builder: (context) =>
Tpcagentdetailsbymode(mode: widget.mode,
pageTitleName: widget.pageTitleName,
tpcAgentId: tpcAgentsLists[index]
.tpcAgentId,
),));
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
),
),
),
],
),
);
},
),
],
),
) : Emptywidget(context),
],
),
);
},
),
],
),
) : Emptywidget(context),
),
),
);
},
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/PaymentCollectionProvider.dart';
......@@ -23,12 +25,14 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Accounts"),
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea(
child: Container(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Accounts"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
decoration: BoxDecoration(color: Colors.white),
child: Column(
children: [
......@@ -62,7 +66,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
keyboardType: TextInputType.text,
focusNode: searchFocusNode,
textCapitalization: TextCapitalization.characters,
style: TextStyle(fontSize: 14),
onChanged: (value) {
if (value.length >= 3) {
......@@ -96,14 +100,14 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
style: TextStyle(fontWeight: FontWeight.w300),
),
),
Expanded(
child: SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(),
child: Container(
child: ListView.builder(
itemCount: provider.accountList!.length,
padding: const EdgeInsets.all(5),
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:generp/screens/finance/FileViewer.dart';
import 'package:provider/provider.dart';
......@@ -36,12 +38,14 @@ class _FollowupdetailsState extends State<Followupdetails> {
var followups = provider.followUpList;
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Follow Up Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea(
child: Container(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Follow Up Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: ListView.builder(
itemCount: provider.followUpList.length,
itemBuilder: (context, index) {
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Notifiers/PaymentCollectionProvider.dart';
......@@ -52,187 +54,191 @@ class _MonthlycollectionState extends State<Monthlycollection> {
);
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar2(context, "Payment Collection",provider.resetAll, sendWidget),
body: SafeArea(child: provider.paymenCollectionList.isNotEmpty?Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: provider.paymenCollectionList.length,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar2(context, "Payment Collection",provider.resetAll, sendWidget),
body: provider.paymenCollectionList.isNotEmpty?Container(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemCount: provider.paymenCollectionList.length,
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
itemBuilder: (context, index) {
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: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset(
width: 30,
height: 30,
"assets/svg/se_block_head.svg",
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: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset(
width: 30,
height: 30,
"assets/svg/se_block_head.svg",
),
),
),
),
SizedBox(width: 10),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${provider.paymenCollectionList[index].accountName}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaMedium"
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${provider.paymenCollectionList[index].accountName}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaMedium"
),
),
Text(
"₹${provider.paymenCollectionList[index].amount}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: AppColors.app_blue),
),
),
Text(
"₹${provider.paymenCollectionList[index].amount}",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: AppColors.app_blue),
),
// Text("Gen Pvt. Ltd"),
],
// Text("Gen Pvt. Ltd"),
],
),
),
),
),
Container(
height: 35,
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Color(0xFFE3FFE0),
borderRadius: BorderRadius.circular(8),
),
child: Center(
child: Text(
"${provider.paymenCollectionList[index].approvalStatus}",
style: TextStyle(
fontSize: 13,
color: Color(0xFF0D9C00)),
Container(
height: 35,
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Color(0xFFE3FFE0),
borderRadius: BorderRadius.circular(8),
),
child: Center(
child: Text(
"${provider.paymenCollectionList[index].approvalStatus}",
style: TextStyle(
fontSize: 13,
color: Color(0xFF0D9C00)),
),
),
),
// Expanded(
// flex: 1,
// child: InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: Icon(Icons.more_vert),
// ),
// ),
],
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
// Expanded(
// flex: 1,
// child: InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: Icon(Icons.more_vert),
// ),
// ),
],
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
),
SizedBox(height: 5),
...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(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(textheads[j].toString(),style: TextStyle(
fontFamily: "JakartaMedium"
),),
),
SizedBox(width: 5),
Expanded(
flex: 2,
child: Text(
textSubheads[j].toString(),
style: TextStyle(
color: Color(0xFF818181),
SizedBox(height: 5),
...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(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Text(textheads[j].toString(),style: TextStyle(
fontFamily: "JakartaMedium"
),),
),
SizedBox(width: 5),
Expanded(
flex: 2,
child: Text(
textSubheads[j].toString(),
style: TextStyle(
color: Color(0xFF818181),
),
),
),
),
],
),
],
),
);
}),
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,fontFamily: "JakartaMedium"),
}),
SizedBox(height: 10),
InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => WebErpScreen(
erp_url:
provider
.paymenCollectionList[index]
.paymentProofFilePath ??
"",
),
),
SizedBox(width: 5),
SvgPicture.asset("assets/svg/next_button.svg"),
],
);
},
child: SizedBox(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"View Attachment",
style: TextStyle(color: AppColors.app_blue,fontFamily: "JakartaMedium"),
),
SizedBox(width: 5),
SvgPicture.asset("assets/svg/next_button.svg"),
],
),
),
),
),
],
),
);
},
),
):Emptywidget(context),)
],
),
);
},
),
):Emptywidget(context)
),
),
);
},
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
......@@ -214,12 +216,14 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(context, "Nearby Generators",provider.resetAll,sendWidget),
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea(
child: Container(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(context, "Nearby Generators",provider.resetAll,sendWidget),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child:Column(
children: [
......@@ -234,6 +238,9 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
height: MediaQuery.of(context).size.height,
child: Stack(children: [
GoogleMap(
scrollGesturesEnabled: true,
rotateGesturesEnabled: true,
myLocationEnabled: true,
zoomGesturesEnabled: true,
zoomControlsEnabled: true,
......@@ -371,6 +378,7 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
],
),
),
SizedBox(height: 10,),
Row(
children: [
Text(
......@@ -391,8 +399,9 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
],
),
InteractiveSlider(
padding: EdgeInsets.symmetric(horizontal: 4,vertical: 0),
min: 1.0,
max: 100.0,
max: 50.0,
enabled: true,
// backgroundColor: AppColors.app_blue,
......@@ -400,9 +409,9 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
segmentDividerColor:Color(0xFFF6F6F8),
onChanged: (value) {
provider.currentValue = value;
provider.debounce(() {
provider.LoadNearbyGeneratorsAPI(context);
}, Duration(milliseconds: 200));
// provider.debounce(() {
// provider.LoadNearbyGeneratorsAPI(context);
// }, Duration(milliseconds: 200));
},
),
// Slider(
......@@ -425,7 +434,7 @@ class _NearbygeneratorsState extends State<Nearbygenerators> {
child: InkWell(
onTap: () {
provider.debounce(() {
provider.LoadNearbyGeneratorsAPI(context);
provider.LoadNearbyGeneratorsAPI(context,provider.currentValue);
Navigator.pop(context);
}, Duration(milliseconds: 500));
},
......
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