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_svg/svg.dart';
import 'package:generp/screens/crm/ProspectDetailsByMode.dart';
......@@ -32,12 +34,14 @@ class _UniversalsearchscreenState extends State<Universalsearchscreen> {
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Search"),
body: SafeArea(
child: SingleChildScrollView(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Search"),
body: SingleChildScrollView(
child: Column(
children: [
if (provider.accountsList.length > 0) ...[
......
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
......@@ -59,321 +61,325 @@ class _AllpaymentrequesitionlistsbymodesState
onWillPop: () {
return onBackPressed(context);
},
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetForm,
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.resetForm,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
InkResponse(
onTap: () async {
var cf = Commondaterangefilter();
var result = await cf.showFilterBottomSheet(context);
if (result != null) {
var dateRange = result['dateRange'] as DateTimeRange?;
print("dateRange: $dateRange");
InkResponse(
onTap: () async {
var cf = Commondaterangefilter();
var result = await cf.showFilterBottomSheet(context);
if (result != null) {
var dateRange = result['dateRange'] as DateTimeRange?;
print("dateRange: $dateRange");
var formatted = result['formatted'] as List<String>;
print("formatted: $formatted");
var formatted = result['formatted'] as List<String>;
print("formatted: $formatted");
if (formatted.isNotEmpty) {
var fromDate = formatted[0]; // From date
var toDate = formatted[1]; // To date
print("from_date: $fromDate");
print("to_date: $toDate");
provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
fromDate,
toDate,
);
// You can now use fromDate and toDate as needed
// For example, store them or pass to another function
if (formatted.isNotEmpty) {
var fromDate = formatted[0]; // From date
var toDate = formatted[1]; // To date
print("from_date: $fromDate");
print("to_date: $toDate");
provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
fromDate,
toDate,
);
// You can now use fromDate and toDate as needed
// For example, store them or pass to another function
} else {
print("No valid date range selected");
}
} else {
print("No valid date range selected");
print("Bottom sheet closed without selection");
}
} else {
print("Bottom sheet closed without selection");
}
},
child:SvgPicture.asset("assets/svg/filter_ic.svg",height: 25,),
),
],
},
child:SvgPicture.asset("assets/svg/filter_ic.svg",height: 25,),
),
],
),
),
),
backgroundColor: AppColors.scaffold_bg_color,
body:
SafeArea(child: provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
: requestLists.isNotEmpty?SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (requestLists.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)
))
: requestLists.isNotEmpty?SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (requestLists.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(
requestLists[index]
.accountName!,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors.semi_black,
),
),
Text(
"₹"
"${requestLists[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(
requestLists[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(
requestLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontFamily: "JakartaMedium",
fontSize: 14,
color:
AppColors.semi_black,
color: Color(0xFF0D9C00),
),
),
Text(
"₹"
"${requestLists[index].amount}",
),
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Requesting Propose",
"Attachment",
"Requested Date",
"Note",
];
final subHeadings = [
requestLists[index].requestingPurpose,
"View",
// requestLists[index].attachmentDirFilePath
requestLists[index].date,
requestLists[index].description,
];
if(j==1&&requestLists[index]
.attachmentViewFileName==""){
return SizedBox.shrink();
}
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(
requestLists[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
Expanded(
child: InkResponse(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
),
),
);
},
child: Text(
subHeadings[j]!,
style: TextStyle(
fontSize: 14,
color:
j == 1
? AppColors
.app_blue
: Color(
0xFF818181,
),
decoration:
j == 1
? TextDecoration
.underline
: TextDecoration
.none,
decorationColor:
j == 1
? AppColors
.app_blue
: AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentrequestionlistdetails(
pageName:
widget
.pageTitleName,
mode: widget.mode,
paymentRequestId:
requestLists[index]
.id,
),
),
);
if(res==true){
provider.paymentRequestionListsAPIFunction(context, widget.mode, "","");
}
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
),
...List.generate(4, (j) {
final headings = [
"Requesting Propose",
"Attachment",
"Requested Date",
"Note",
];
final subHeadings = [
requestLists[index].requestingPurpose,
"View",
// requestLists[index].attachmentDirFilePath
requestLists[index].date,
requestLists[index].description,
];
if(j==1&&requestLists[index]
.attachmentViewFileName==""){
return SizedBox.shrink();
}
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(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
),
),
);
},
child: Text(
subHeadings[j]!,
style: TextStyle(
fontSize: 14,
color:
j == 1
? AppColors
.app_blue
: Color(
0xFF818181,
),
decoration:
j == 1
? TextDecoration
.underline
: TextDecoration
.none,
decorationColor:
j == 1
? AppColors
.app_blue
: AppColors.white,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentrequestionlistdetails(
pageName:
widget
.pageTitleName,
mode: widget.mode,
paymentRequestId:
requestLists[index]
.id,
),
],
),
);
if(res==true){
provider.paymentRequestionListsAPIFunction(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)
),
),
);
},
......
......@@ -112,20 +112,26 @@ class _PaymentrequestionlistdetailsState
shouldShowButtons = [
"Level 2 Approved",
"Level 2 approved",
].contains(req_det.status); // Show buttons if Level 2 is approved
].contains(req_det.status);
}else if(widget.mode == "self_apr_lvl2"){
shouldShowButtons = [
"Requested"
].contains(req_det.status);
}
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageName,
provider.resetAll,
SizedBox(width: 0),
),
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,
widget.pageName,
provider.resetAll,
SizedBox(width: 0),
),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
......@@ -315,64 +321,25 @@ class _PaymentrequestionlistdetailsState
),
),
),
),
bottomNavigationBar:
(["admin", "self"].contains(widget.mode) || !shouldShowButtons)
? 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: [
Expanded(
child: InkResponse(
onTap: () {
print(provider.requestsDetails.id);
_showLevelRejectionSheet(
context,
provider.requestsDetails.id,
);
},
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 ([
"apr_lvl1",
"apr_lvl2",
].contains(widget.mode)) ...[
bottomNavigationBar:
(["admin", "self"].contains(widget.mode) || !shouldShowButtons)
? Container(height: 0)
: Container(
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 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(
print(provider.requestsDetails.id);
_showLevelRejectionSheet(
context,
provider.requestsDetails.id,
);
......@@ -380,186 +347,226 @@ class _PaymentrequestionlistdetailsState
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE7FFE5),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFF0D9C00),
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
"Approve",
"Reject",
style: TextStyle(
color: Color(0xFF0D9C00),
color: Color(0xFFED3424),
),
),
),
),
),
),
] else if (widget.mode == "process") ...[
Expanded(
child: InkResponse(
onTap: () {
provider
.approveRejectPaymentRequestAPIFunction(
context,
provider.requestsDetails.id,
);
provider.preValues();
_showAddPaymentSheet(
context,
provider.requestsDetails.id,
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
SizedBox(width: 10),
if ([
"apr_lvl1",
"apr_lvl2",
"self_apr_lvl2"
].contains(widget.mode)) ...[
Expanded(
child: InkResponse(
onTap: () {
provider
.approveRejectPaymentRequestAPIFunction(
context,
provider.requestsDetails.id,
);
_showLevelApprovalSheet(
context,
provider.requestsDetails.id,
);
},
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),
),
),
),
),
child: Center(
child: Text(
"Add Payment",
style: TextStyle(
),
),
] else if (widget.mode == "process") ...[
Expanded(
child: InkResponse(
onTap: () {
provider
.approveRejectPaymentRequestAPIFunction(
context,
provider.requestsDetails.id,
);
provider.preValues();
_showAddPaymentSheet(
context,
provider.requestsDetails.id,
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
),
),
child: Center(
child: Text(
"Add Payment",
style: TextStyle(
color: Color(0xFF0D9C00),
),
),
),
),
),
),
),
],
],
],
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
// bottomNavigationBar:
// (["admin", "self"].contains(widget.mode))
// ? Container(height: 0)
// : ([
// "Level 1 Approved",
// "Level 1 Rejected",
// "Level 1 approved",
// "Level 1 rejected",
// "Level 2 Approved",
// "Level 2 Rejected",
// "Level 2 approved",
// "Level 2 rejected",
// ]).contains(req_det.status)
// ? SizedBox(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: [
// Expanded(
// child: InkResponse(
// onTap: () {
// _showLevelRejectionSheet(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(
// "Reject",
// style: TextStyle(
// color: Color(0xFFED3424),
// ),
// ),
// ),
// ),
// ),
// ),
// SizedBox(width: 10),
// if ([
// "apr_lvl1",
// "apr_lvl2",
// ].contains(widget.mode)) ...[
// 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),
// ),
// ),
// ),
// ),
// ),
// ),
// ] else if (widget.mode == "process") ...[
// Expanded(
// child: InkResponse(
// onTap: () {
// provider
// .approveRejectPaymentRequestAPIFunction(
// context,
// provider.requestsDetails.id,
// );
// _showAddPaymentSheet(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(
// "Add Payment",
// style: TextStyle(
// color: Color(0xFF0D9C00),
// ),
// ),
// ),
// ),
// ),
// ),
// ],
// ],
// ),
// ),
// ),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
// bottomNavigationBar:
// (["admin", "self"].contains(widget.mode))
// ? Container(height: 0)
// : ([
// "Level 1 Approved",
// "Level 1 Rejected",
// "Level 1 approved",
// "Level 1 rejected",
// "Level 2 Approved",
// "Level 2 Rejected",
// "Level 2 approved",
// "Level 2 rejected",
// ]).contains(req_det.status)
// ? SizedBox(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: [
// Expanded(
// child: InkResponse(
// onTap: () {
// _showLevelRejectionSheet(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(
// "Reject",
// style: TextStyle(
// color: Color(0xFFED3424),
// ),
// ),
// ),
// ),
// ),
// ),
// SizedBox(width: 10),
// if ([
// "apr_lvl1",
// "apr_lvl2",
// ].contains(widget.mode)) ...[
// 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),
// ),
// ),
// ),
// ),
// ),
// ),
// ] else if (widget.mode == "process") ...[
// Expanded(
// child: InkResponse(
// onTap: () {
// provider
// .approveRejectPaymentRequestAPIFunction(
// context,
// provider.requestsDetails.id,
// );
// _showAddPaymentSheet(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(
// "Add Payment",
// style: TextStyle(
// color: Color(0xFF0D9C00),
// ),
// ),
// ),
// ),
// ),
// ),
// ],
// ],
// ),
// ),
// ),
),
),
onWillPop: () {
provider.resetAll();
......@@ -644,6 +651,7 @@ class _PaymentrequestionlistdetailsState
focusNodes[1],
TextInputAction.next
),
errorWidget(context, provider.ApprovedAmountError),
textControllerWidget(
context,
remarks,
......@@ -657,6 +665,7 @@ class _PaymentrequestionlistdetailsState
null,
TextInputAction.done
),
errorWidget(context, provider.remarksError),
TextWidget(context, "Proposed Payment Account"),
DropdownButtonHideUnderline(
child: Row(
......@@ -881,6 +890,7 @@ class _PaymentrequestionlistdetailsState
null,
focusNodes[2],null,TextInputAction.done
),
errorWidget(context, provider.remarksError),
InkWell(
onTap: () {
provider
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/cupertino.dart';
......@@ -49,12 +51,14 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
return Consumer<Paymentreceiptsprovider>(
builder: (context, provider, child) {
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white,
appBar: appbar2(context, "${widget.pageTitleName}",provider.resetForm,SizedBox(width: 0,)),
body: SafeArea(
child: Container(
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,)),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
......@@ -537,31 +541,31 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse(
onTap: provider.submitClicked?null: () {
provider.submitClicked = true;
provider.addReceiptPaymentRequestionSubmitAPI(context, provider.formattedDate);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 0),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child: provider.submitClicked?CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(AppColors.white),
): Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
onTap: provider.submitClicked?null: () {
provider.submitClicked = true;
provider.addReceiptPaymentRequestionSubmitAPI(context, provider.formattedDate);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 0),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child: provider.submitClicked?CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(AppColors.white),
): Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
......@@ -56,12 +58,14 @@ class _DirectpaymentrequesitionlistState
return Consumer<Requestionlistprovider>(
builder: (context, provider, child) {
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white,
appBar: appbar(context, "${widget.pageTitleName}"),
body: SafeArea(
child: Container(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white,
appBar: appbar(context, "${widget.pageTitleName}"),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
......@@ -274,7 +278,7 @@ class _DirectpaymentrequesitionlistState
TextInputAction.next
),
errorWidget(context, provider.amountError),
///payment date toBE
TextWidget(context, "Enter Date"),
GestureDetector(
......@@ -326,7 +330,7 @@ class _DirectpaymentrequesitionlistState
color: Color(0xFFB4BEC0),
fontSize: 14,
),
enabledBorder: InputBorder.none,
disabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
......@@ -546,34 +550,34 @@ class _DirectpaymentrequesitionlistState
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
onTap:provider.submitClicked?null: () {
provider.submitClicked = true;
provider.addDirectPaymentRequestionSubmitAPI(
context,
provider.formattedDate,
);
},
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:provider.submitClicked?CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(AppColors.app_blue),
): Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
onTap:provider.submitClicked?null: () {
provider.submitClicked = true;
provider.addDirectPaymentRequestionSubmitAPI(
context,
provider.formattedDate,
);
},
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:provider.submitClicked?CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(AppColors.app_blue),
): 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:generp/Notifiers/financeProvider/DashboardProvider.dart';
......@@ -33,12 +35,14 @@ class _FinancedashboardState extends State<Financedashboard> {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Finance"),
body: SafeArea(
child: SizedBox(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Finance"),
body: SizedBox(
child: SingleChildScrollView(
child: Column(
children: [
......@@ -171,28 +175,28 @@ class _FinancedashboardState extends State<Financedashboard> {
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse(
onTap: () {
_showPaymentOptionsSheet(context);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child: Text(
"Add",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse(
onTap: () {
_showPaymentOptionsSheet(context);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child: Text(
"Add",
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:generp/Utils/app_colors.dart';
......@@ -46,12 +48,14 @@ class _PaymentdetailspaymentrequisitionState
var payment_det = provider.paymentDetails;
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, widget.pageName),
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea(
child: SizedBox(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, widget.pageName),
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
......@@ -201,8 +205,8 @@ class _PaymentdetailspaymentrequisitionState
),
),
),
),
),
),
onWillPop: () {
return onBackPressed(context);
......
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
......@@ -48,287 +50,291 @@ late Commondaterangefilter cf;
onWillPop: () {
return onBackPressed(context);
},
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetForm,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
InkResponse(
onTap: () async {
var cf = Commondaterangefilter();
var result = await cf.showFilterBottomSheet(context);
if (result != null) {
var dateRange = result['dateRange'] as DateTimeRange?;
print("dateRange: $dateRange");
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetForm,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
InkResponse(
onTap: () async {
var cf = Commondaterangefilter();
var result = await cf.showFilterBottomSheet(context);
if (result != null) {
var dateRange = result['dateRange'] as DateTimeRange?;
print("dateRange: $dateRange");
var formatted = result['formatted'] as List<String>;
print("formatted: $formatted");
var formatted = result['formatted'] as List<String>;
print("formatted: $formatted");
if (formatted.isNotEmpty) {
var fromDate = formatted[0]; // From date
var toDate = formatted[1]; // To date
print("from_date: $fromDate");
print("to_date: $toDate");
provider.paymentsListAPI(context,fromDate,toDate);
// You can now use fromDate and toDate as needed
// For example, store them or pass to another function
if (formatted.isNotEmpty) {
var fromDate = formatted[0]; // From date
var toDate = formatted[1]; // To date
print("from_date: $fromDate");
print("to_date: $toDate");
provider.paymentsListAPI(context,fromDate,toDate);
// You can now use fromDate and toDate as needed
// For example, store them or pass to another function
} else {
print("No valid date range selected");
}
} else {
print("No valid date range selected");
print("Bottom sheet closed without selection");
}
} else {
print("Bottom sheet closed without selection");
}
},
child: SvgPicture.asset("assets/svg/filter_ic.svg",height: 25,),
),
],
},
child: SvgPicture.asset("assets/svg/filter_ic.svg",height: 25,),
),
],
),
),
),
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea(child: provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
:requestLists.isNotEmpty?SizedBox(
child: Scrollbar(
thumbVisibility: false,
backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
:requestLists.isNotEmpty?SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
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),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
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),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index].receipientAccount!,
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(
requestLists[index].receipientAccount!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Text(
"₹${requestLists[index].amount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
Text(
"₹${requestLists[index].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(
// requestLists[index].refType!,
// textAlign: TextAlign.center,
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: Color(0xFF0D9C00),
// ),
// ),
// ),
// ),
// ),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(5, (j) {
final headings = [
"To Account",
"Attachment",
"Request Mode",
// Expanded(
// flex: 2,
// child: Container(
// padding: EdgeInsets.symmetric(
// horizontal: 5,
// vertical: 10,
// ),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8),
// color: Color(0xFFE3FFE0),
// ),
// child: Center(
// child: Text(
// requestLists[index].refType!,
// textAlign: TextAlign.center,
// style: TextStyle(
// fontFamily: "JakartaMedium",
// fontSize: 14,
// color: Color(0xFF0D9C00),
// ),
// ),
// ),
// ),
// ),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(5, (j) {
final headings = [
"To Account",
"Attachment",
"Request Mode",
"Payment Date",
"Note",
];
"Payment Date",
"Note",
];
final subHeadings = [
requestLists[index].payAccount,
"View",
requestLists[index].requestMode,
final subHeadings = [
requestLists[index].payAccount,
"View",
requestLists[index].requestMode,
// requestLists[index].attachmentDirFilePath
requestLists[index].paymentDate,
requestLists[index].description,
];
if(headings[j]=="Attachment"&&requestLists[index]
.attachmentViewFileName==""){
return SizedBox.shrink();
}
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(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
),
),
);
},
// requestLists[index].attachmentDirFilePath
requestLists[index].paymentDate,
requestLists[index].description,
];
if(headings[j]=="Attachment"&&requestLists[index]
.attachmentViewFileName==""){
return SizedBox.shrink();
}
return Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
subHeadings[j]==""?"-": subHeadings[j]??"-",
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color:
j == 1
? AppColors.app_blue
: Color(0xFF818181),
decoration:
j == 1
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
j == 1
? AppColors.app_blue
: AppColors.white,
color: AppColors.semi_black,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentdetailspaymentrequisition(
pageName: widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
Expanded(
child: InkResponse(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
),
),
);
},
child: Text(
subHeadings[j]==""?"-": subHeadings[j]??"-",
style: TextStyle(
fontSize: 14,
color:
j == 1
? AppColors.app_blue
: Color(0xFF818181),
decoration:
j == 1
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
j == 1
? AppColors.app_blue
: AppColors.white,
),
),
),
),
],
),
);
if(res==true){
provider.paymentsListAPI(context,'','');
}
},
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",
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentdetailspaymentrequisition(
pageName: widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
),
],
);
if(res==true){
provider.paymentsListAPI(context,'','');
}
},
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/Utils/app_colors.dart';
......@@ -45,12 +47,14 @@ class _PaymentreceiptdetailsState
var payment_det = provider.receiptDetails;
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, widget.pageName),
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, widget.pageName),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
......@@ -103,7 +107,7 @@ class _PaymentreceiptdetailsState
),
),
),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
......@@ -178,8 +182,8 @@ class _PaymentreceiptdetailsState
),
),
),
),
),
),
onWillPop: () {
return onBackPressed(context);
......
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
......@@ -43,261 +45,265 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
onWillPop: () {
return onBackPressed(context);
},
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetForm,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
InkResponse(
onTap: () async {
var cf = Commondaterangefilter();
var result = await cf.showFilterBottomSheet(context);
if (result != null) {
var dateRange = result['dateRange'] as DateTimeRange?;
print("dateRange: $dateRange");
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetForm,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg",),
// ),
InkResponse(
onTap: () async {
var cf = Commondaterangefilter();
var result = await cf.showFilterBottomSheet(context);
if (result != null) {
var dateRange = result['dateRange'] as DateTimeRange?;
print("dateRange: $dateRange");
var formatted = result['formatted'] as List<String>;
print("formatted: $formatted");
var formatted = result['formatted'] as List<String>;
print("formatted: $formatted");
if (formatted.isNotEmpty) {
var fromDate = formatted[0]; // From date
var toDate = formatted[1]; // To date
print("from_date: $fromDate");
print("to_date: $toDate");
provider.paymentsListAPI(context,fromDate,toDate);
// You can now use fromDate and toDate as needed
// For example, store them or pass to another function
if (formatted.isNotEmpty) {
var fromDate = formatted[0]; // From date
var toDate = formatted[1]; // To date
print("from_date: $fromDate");
print("to_date: $toDate");
provider.paymentsListAPI(context,fromDate,toDate);
// You can now use fromDate and toDate as needed
// For example, store them or pass to another function
} else {
print("No valid date range selected");
}
} else {
print("No valid date range selected");
print("Bottom sheet closed without selection");
}
} else {
print("Bottom sheet closed without selection");
}
},
child: SvgPicture.asset("assets/svg/filter_ic.svg",height: 25,),
),
],
},
child: SvgPicture.asset("assets/svg/filter_ic.svg",height: 25,),
),
],
),
),
),
backgroundColor: AppColors.scaffold_bg_color,
body: SafeArea(child: provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
)):requestLists.isNotEmpty?SizedBox(
child: Scrollbar(
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
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),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
)):requestLists.isNotEmpty?SizedBox(
child: Scrollbar(
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
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),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index].receipientAccount!,
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(
requestLists[index].receipientAccount!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Text(
"₹${requestLists[index].amount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
Text(
"₹${requestLists[index].amount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
],
],
),
),
),
),
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(5, (j) {
final headings = [
"Receipt Account",
"Attachment",
"Request Mode",
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(5, (j) {
final headings = [
"Receipt Account",
"Attachment",
"Request Mode",
"Receipt Date",
"Note",
];
"Receipt Date",
"Note",
];
final subHeadings = [
requestLists[index].receipientAccount,
"View",
requestLists[index].requestMode,
final subHeadings = [
requestLists[index].receipientAccount,
"View",
requestLists[index].requestMode,
// requestLists[index].attachmentDirFilePath
requestLists[index].receiptDate,
requestLists[index].description,
];
if(headings[j]=="Attachment"&&requestLists[index]
.attachmentViewFileName==""){
return SizedBox.shrink();
}
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(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
),
),
);
},
// requestLists[index].attachmentDirFilePath
requestLists[index].receiptDate,
requestLists[index].description,
];
if(headings[j]=="Attachment"&&requestLists[index]
.attachmentViewFileName==""){
return SizedBox.shrink();
}
return Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
subHeadings[j]==""?"-":subHeadings[j]??"-",
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color:
j == 1
? AppColors.app_blue
: Color(0xFF818181),
decoration:
j == 1
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
j == 1
? AppColors.app_blue
: AppColors.white,
color: AppColors.semi_black,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentreceiptdetails(
pageName: widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
Expanded(
child: InkResponse(
onTap:
j != 1
? null
: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
requestLists[index]
.attachmentViewFileName!,
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
),
),
);
},
child: Text(
subHeadings[j]==""?"-":subHeadings[j]??"-",
style: TextStyle(
fontSize: 14,
color:
j == 1
? AppColors.app_blue
: Color(0xFF818181),
decoration:
j == 1
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
j == 1
? AppColors.app_blue
: AppColors.white,
),
),
),
),
],
),
);
if(res==true){
provider.paymentsListAPI(context,'','');
}
},
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",
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentreceiptdetails(
pageName: widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
),
],
);
if(res==true){
provider.paymentsListAPI(context,'','');
}
},
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:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
......@@ -122,17 +124,19 @@ class _SubmitpaymentrequestionlistsbymodeState
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white,
appBar: appbar2(
context,
"${widget.pageTitleName}",
provider.resetForm,
SizedBox(width: 0),
),
body: SafeArea(
child: Container(
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),
),
body: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
......@@ -229,7 +233,7 @@ class _SubmitpaymentrequestionlistsbymodeState
) ??
false;
},
// Optional: clear search text when dropdown closes
),
onMenuStateChange: (isOpen) {
......@@ -293,7 +297,7 @@ class _SubmitpaymentrequestionlistsbymodeState
),
),
errorWidget(context, provider.selectAccountError),
if (["self", "admin"].contains(widget.mode)) ...[
TextWidget(context, "Select Requisition Type"),
DropdownButtonHideUnderline(
......@@ -323,14 +327,14 @@ class _SubmitpaymentrequestionlistsbymodeState
)
.toList(),
value: provider.selectReqPurpose,
onChanged: (String? value) {
if (value != null) {
provider.selectReqPurpose = value;
print(
"Selected Complaint Type: ${value},",
);
print(
"hfjkshfg" +
provider.selectReqPurpose
......@@ -363,7 +367,7 @@ class _SubmitpaymentrequestionlistsbymodeState
),
],
errorWidget(context, provider.reqPurposeError),
textControllerWidget(
context,
provider.descController,
......@@ -378,7 +382,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.next,
),
errorWidget(context, provider.descriptionError),
textControllerWidget(
context,
provider.amountController,
......@@ -393,7 +397,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.done,
),
errorWidget(context, provider.amountError),
TextWidget(context, "Select Payment Mode"),
DropdownButtonHideUnderline(
child: Row(
......@@ -450,7 +454,7 @@ class _SubmitpaymentrequestionlistsbymodeState
),
),
errorWidget(context, provider.selectPaymentError),
if(widget.mode=="other")...[
TextWidget(context, "Select Approval Employee"),
DropdownButtonHideUnderline(
......@@ -509,7 +513,7 @@ class _SubmitpaymentrequestionlistsbymodeState
),
errorWidget(context, provider.selectPaymentError),
],
InkResponse(
onTap: () {
_showAttachmentSheet(context);
......@@ -569,7 +573,7 @@ class _SubmitpaymentrequestionlistsbymodeState
),
],
errorWidget(context, provider.FileError),
if ([
"Cheque",
"RTGS",
......@@ -590,7 +594,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.next,
),
errorWidget(context, provider.bankNameError),
textControllerWidget(
context,
provider.bankBranchController,
......@@ -605,7 +609,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.next,
),
errorWidget(context, provider.bankBranchError),
textControllerWidget(
context,
provider.bankAccNumberController,
......@@ -620,7 +624,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.next,
),
errorWidget(context, provider.bankNumberError),
textControllerWidget(
context,
provider.bankIfscController,
......@@ -635,7 +639,7 @@ class _SubmitpaymentrequestionlistsbymodeState
TextInputAction.next,
),
errorWidget(context, provider.bankIFSCError),
],
],
if ([
"Cheque",
"RTGS",
......@@ -677,44 +681,44 @@ class _SubmitpaymentrequestionlistsbymodeState
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
onTap:
provider.submitClicked
? null
: () {
provider.submitClicked = false;
provider.addPaymentRequestionSubmitAPI(
context,
widget.mode,
provider.selectedApprovalEmployeeID
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
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(AppColors.white),
)
: Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
? null
: () {
provider.submitClicked = false;
provider.addPaymentRequestionSubmitAPI(
context,
widget.mode,
provider.selectedApprovalEmployeeID
);
},
child: Container(
height: 45,
alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10,vertical: 10),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(15),
),
child:
provider.submitClicked
? CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(AppColors.white),
)
: Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
),
),
),
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
......@@ -43,12 +45,14 @@ class _ComplainthistoryState extends State<Complainthistory> {
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Complaint History"),
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, "Complaint History"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/commonWidgets.dart';
......@@ -29,12 +31,14 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
];
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Tracker"),
body: SafeArea(
child: Column(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Tracker"),
body: Column(
children: [
Expanded(
flex: 1,
......
......@@ -69,17 +69,19 @@ class _GeneratordetailsState extends State<Generatordetails> {
var sendwidget = SizedBox(width: 0);
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
"Generator Details",
provider.resetForm,
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,
"Generator Details",
provider.resetForm,
sendwidget,
),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -818,45 +820,45 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
),
),
),
floatingActionButton: Align(
alignment: Alignment.bottomCenter,
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Complainthistory(genHashID: provider.genHashID),
floatingActionButton: Align(
alignment: Alignment.bottomCenter,
child: InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Complainthistory(genHashID: provider.genHashID),
),
);
},
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(15.0),
),
);
},
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(15.0),
),
child: Center(
child: Text(
"Complaint History",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 15,
color: Colors.white,
child: Center(
child: Text(
"Complaint History",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 15,
color: Colors.white,
),
),
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
),
);
},
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
......@@ -26,12 +28,14 @@ class _RegistercomplaintState extends State<Registercomplaint> {
builder: (context, provider, homeProvider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Register Complaint"),
body: SafeArea(
child: Container(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Register Complaint"),
body: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -39,7 +43,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
SizedBox(height: 5.0),
Container(
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
......@@ -62,7 +66,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
borderRadius: BorderRadius.circular(16)
),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
......@@ -75,7 +79,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
),
),
SizedBox(width: 10),
Expanded(
flex: 9,
child: SizedBox(
......@@ -152,8 +156,8 @@ class _RegistercomplaintState extends State<Registercomplaint> {
);
}),
SizedBox(height: 10.0),
],
),
),
......@@ -196,7 +200,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
'Select Complaint Type',
style: TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
),
......@@ -323,7 +327,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
],
),
),
SizedBox(height: 10.0),
Padding(
padding: const EdgeInsets.only(bottom: 5.0),
......@@ -393,7 +397,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
],
),
),
SizedBox(height: 10.0),
Padding(
padding: const EdgeInsets.only(bottom: 5.0),
......@@ -403,7 +407,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
),
Container(
height: 50,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
......@@ -420,7 +424,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
keyboardType:
TextInputType.text,
decoration: InputDecoration(
hintText:
"Enter Running Number",
hintStyle: TextStyle(
......@@ -428,13 +432,13 @@ class _RegistercomplaintState extends State<Registercomplaint> {
color: Color(0xFFB4BEC0),
fontSize: 14
),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
),
),
),
),
......@@ -447,7 +451,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
),
Container(
height: 150,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
......@@ -465,7 +469,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
keyboardType:
TextInputType.text,
decoration: InputDecoration(
hintText:
"Enter Message",
hintStyle: TextStyle(
......@@ -473,22 +477,22 @@ class _RegistercomplaintState extends State<Registercomplaint> {
color: Color(0xFFB4BEC0),
fontSize: 14
),
enabledBorder:
InputBorder.none,
focusedBorder:
InputBorder.none,
),
),
),
),
],
),
),
SizedBox(height: 65.0),
],
),
),
......@@ -496,41 +500,41 @@ class _RegistercomplaintState extends State<Registercomplaint> {
),
),
),
),
floatingActionButton: Container(
child: InkWell(
onTap: () {
provider.SubmitComplaintFunction(
context,
homeProvider,
provider.genID,
provider.selectedTypeId,
provider.selectedDescriptionId,
running_hrs.text,
Complaint_Note.text);
},
child: Container(
alignment: Alignment.center,
height: 45,
margin: EdgeInsets.only(left: 15.0, right: 15.0),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(10.0),
),
child: Text(
"Submit Complaint",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 15,
color: Colors.white
floatingActionButton: Container(
child: InkWell(
onTap: () {
provider.SubmitComplaintFunction(
context,
homeProvider,
provider.genID,
provider.selectedTypeId,
provider.selectedDescriptionId,
running_hrs.text,
Complaint_Note.text);
},
child: Container(
alignment: Alignment.center,
height: 45,
margin: EdgeInsets.only(left: 15.0, right: 15.0),
decoration: BoxDecoration(
color: AppColors.app_blue,
borderRadius: BorderRadius.circular(10.0),
),
child: Text(
"Submit Complaint",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 15,
color: Colors.white
),
),
),
),
),
floatingActionButtonLocation: FloatingActionButtonLocation
.centerFloat,
),
floatingActionButtonLocation: FloatingActionButtonLocation
.centerFloat,
),
);
},
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:generp/Notifiers/GeneratorDetailsProvider.dart';
import 'package:generp/Utils/commonServices.dart';
......@@ -59,21 +61,23 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "${widget.from}"),
body: SafeArea(
child: Container(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "${widget.from}"),
body: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
children: [
Spacer(),
SizedBox(
height: 250,
child: QRView(
key: provider.scannerKey,
onQRViewCreated: (p0) {
provider.onQRViewCreated(p0, provider.title, context);
......@@ -81,7 +85,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue,
borderRadius: 20,
borderLength: 60,
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:generp/screens/finance/FileViewer.dart';
import 'package:generp/screens/notifierExports.dart';
......@@ -58,12 +60,14 @@ class _GeneratorPartDetailsScreenState
onRefresh: () async {
initialiseFunction(context, homeProvider);
},
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"),
body: SafeArea(
child: Container(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"),
body: Container(
child: SingleChildScrollView(
child: Column(
children: [
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:generp/screens/notifierExports.dart';
import 'package:generp/Utils/commonWidgets.dart';
......@@ -37,30 +39,32 @@ class _InventoryScreenState extends State<InventoryScreen> {
builder: (context, provider, child) {
return WillPopScope(
onWillPop: () => onBackPressed(context),
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"),
body: SafeArea(
child: Container(
child: SafeArea(
top: false,
bottom: Platform.isIOS?false:true,
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"),
body: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
children: [
Spacer(),
Container(
height: 250,
child: QRView(
key: provider.scannerKey,
onQRViewCreated: (p0) {
provider.onQRViewCreated(p0, "inventory", context);
},
formatsAllowed: [BarcodeFormat.qrcode],
cameraFacing: CameraFacing.back,
overlay: QrScannerOverlayShape(
borderColor: AppColors.app_blue,
borderRadius: 20,
borderLength: 60,
......
import 'dart:io';
import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
......@@ -61,86 +63,44 @@ class _AddorderScreenState extends State<AddorderScreen> {
return Consumer<Addorderprovider>(
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: [
TextWidget(context, "Account"),
InkResponse(
onTap: () {
if (focusNode.hasFocus) {
focusNode.unfocus();
} else {
FocusScope.of(context).requestFocus(focusNode);
}
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14),
),
child: ListTile(
onTap: () {
if (focusNode.hasFocus) {
focusNode.unfocus();
} else {
FocusScope.of(context).requestFocus(focusNode);
}
},
title: TextFormField(
focusNode: focusNode,
onTapUpOutside: (event) {
focusNode.unfocus();
},
controller: provider.dropDownSearchController,
onChanged: (value) async {
Future.delayed(
Duration(milliseconds: 100),
() async {
await provider
.ordersAddOrderSelectAccountAPIFunction(
context,
widget.mode,
provider.selectedAccountID,
value,
);
},
);
},
decoration: InputDecoration(
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 0,
vertical: 8,
),
hintText: 'Select Account Type',
hintStyle: const TextStyle(fontSize: 14),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
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, "Account"),
InkResponse(
onTap: () {
if (focusNode.hasFocus) {
focusNode.unfocus();
} else {
FocusScope.of(context).requestFocus(focusNode);
}
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14),
),
trailing: InkResponse(
child: ListTile(
onTap: () {
if (focusNode.hasFocus) {
focusNode.unfocus();
......@@ -148,97 +108,254 @@ class _AddorderScreenState extends State<AddorderScreen> {
FocusScope.of(context).requestFocus(focusNode);
}
},
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
title: TextFormField(
focusNode: focusNode,
onTapUpOutside: (event) {
focusNode.unfocus();
},
controller: provider.dropDownSearchController,
onChanged: (value) async {
Future.delayed(
Duration(milliseconds: 100),
() async {
await provider
.ordersAddOrderSelectAccountAPIFunction(
context,
widget.mode,
provider.selectedAccountID,
value,
);
},
);
},
decoration: InputDecoration(
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 0,
vertical: 8,
),
hintText: 'Select Account Type',
hintStyle: const TextStyle(fontSize: 14),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
trailing: InkResponse(
onTap: () {
if (focusNode.hasFocus) {
focusNode.unfocus();
} else {
FocusScope.of(context).requestFocus(focusNode);
}
},
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
),
),
),
),
),
),
if (provider.accountList.isNotEmpty &&
focusNode.hasFocus) ...[
Card(
margin: EdgeInsets.symmetric(horizontal: 0),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: widget.mode == "self" ? 50 : 150,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
),
child: Scrollbar(
thickness: 2.5,
radius: Radius.circular(6),
thumbVisibility: true,
child: ListView.builder(
itemCount: provider.accountList.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return InkResponse(
onTap: () async {
if (provider.accountList.isNotEmpty) {
provider.selectedAccountList =
provider.accountList[index];
if (provider.accountList.isNotEmpty &&
focusNode.hasFocus) ...[
Card(
margin: EdgeInsets.symmetric(horizontal: 0),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: widget.mode == "self" ? 50 : 150,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
),
child: Scrollbar(
thickness: 2.5,
radius: Radius.circular(6),
thumbVisibility: true,
child: ListView.builder(
itemCount: provider.accountList.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return InkResponse(
onTap: () async {
if (provider.accountList.isNotEmpty) {
provider.selectedAccountList =
provider.accountList[index];
print(
"Selected Complaint Type: ${provider.accountList[index].text}, ID: ${provider.accountList[index].id}",
);
provider.selectedAccountID =
provider.accountList[index].id!;
provider.selectedAccountName =
provider.accountList[index].text!;
print(
"hfjkshfg" +
provider.selectedAccountID
.toString(),
);
provider.dropDownSearchController.text =
provider.accountList[index].text!;
provider
.ordersAddOrderAccountDetailsAPIFunction(
context,
provider.selectedAccountID,
);
print(
"Selected Complaint Type: ${provider.accountList[index].text}, ID: ${provider.accountList[index].id}",
);
provider.selectedAccountID =
provider.accountList[index].id!;
provider.selectedAccountName =
provider.accountList[index].text!;
print(
"hfjkshfg" +
provider.selectedAccountID
.toString(),
);
provider.dropDownSearchController.text =
provider.accountList[index].text!;
provider
.ordersAddOrderAccountDetailsAPIFunction(
context,
provider.selectedAccountID,
);
}
// provider.ordersAddPaymentSelectOrderAPIFunction(context, provider.selectedAccountID);
provider.accountList = [];
},
child: SizedBox(
height: 45,
child: Align(
alignment: Alignment.centerLeft,
child: Text(
provider.accountList[index].text!,
),
),
),
);
},
),
),
),
),
],
errorWidget(context, provider.selectAccountError),
if (widget.mode == "admin") ...[
TextWidget(context, "Sales Person"),
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<Employees>(
isExpanded: true,
hint: Text(
"Select Sales Person",
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items:
provider.employees
.map(
(e) => DropdownMenuItem<Employees>(
value: e,
child: Text(
e.name!,
style: const TextStyle(
fontSize: 14,
),
),
),
)
.toList(),
value: provider.selectedEmployees,
onChanged: (Employees? value) {
if (provider.employees.isNotEmpty) {
provider.selectedEmployees = value;
provider.selectedEmployeeID = value!.id!;
provider.selectedEmployeeName =
value!.name!;
}
// provider.ordersAddPaymentSelectOrderAPIFunction(context, provider.selectedAccountID);
provider.accountList = [];
},
child: SizedBox(
height: 45,
child: Align(
alignment: Alignment.centerLeft,
child: Text(
provider.accountList[index].text!,
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
),
),
],
TextWidget(context, "Order 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,
),
child: TextFormField(
controller:
provider.orderReceivedDateController,
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,
),
),
);
},
),
),
),
),
],
),
),
],
errorWidget(context, provider.selectAccountError),
if (widget.mode == "admin") ...[
TextWidget(context, "Sales Person"),
errorWidget(context, provider.orderDateError),
textControllerWidget(
context,
provider.billingNameController,
"Billing Name",
"Enter Billing Name",
provider.onChangedBillingName,
TextInputType.text,
false,
null,
focusNodes[0],
null,
TextInputAction.done,
),
errorWidget(context, provider.billingNameError),
TextWidget(context, "Billing State"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<Employees>(
child: DropdownButton2<States>(
isExpanded: true,
hint: Text(
"Select Sales Person",
"Select State",
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items:
provider.employees
provider.billingStates
.map(
(e) => DropdownMenuItem<Employees>(
(e) => DropdownMenuItem<States>(
value: e,
child: Text(
e.name!,
......@@ -249,13 +366,61 @@ class _AddorderScreenState extends State<AddorderScreen> {
),
)
.toList(),
value: provider.selectedEmployees,
onChanged: (Employees? value) {
if (provider.employees.isNotEmpty) {
provider.selectedEmployees = value;
provider.selectedEmployeeID = value!.id!;
provider.selectedEmployeeName =
value: provider.selecetdBillingStates,
onChanged: (States? value) {
if (provider.billingStates.isNotEmpty) {
provider.selecetdBillingStates = value;
provider.selectedBillingStateID = value!.id!;
provider.selectedBillingStateName =
value!.name!;
if (provider.billingDistricts.isNotEmpty) {
provider.billingDistricts.clear();
// provider.selectedBillingDistricts=null;
provider.selectedBillingDistrictId = null;
provider.selectedBillingDistrictValue = "";
}
provider.getDistrictAPI(
context,
provider.selectedBillingStateID,
);
}
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.billingStateSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider.billingStateSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search Sate...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.name
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
},
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.billingStateSearchController.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
......@@ -267,1156 +432,997 @@ class _AddorderScreenState extends State<AddorderScreen> {
],
),
),
],
TextWidget(context, "Order 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,
),
child: TextFormField(
controller:
provider.orderReceivedDateController,
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,
),
errorWidget(context, provider.selectedBillingStateError),
TextWidget(context, "Billing District"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<Districts>(
isExpanded: true,
hint: Text(
"Select District",
style: const TextStyle(fontSize: 14),
),
),
),
),
],
),
),
errorWidget(context, provider.orderDateError),
textControllerWidget(
context,
provider.billingNameController,
"Billing Name",
"Enter Billing Name",
provider.onChangedBillingName,
TextInputType.text,
false,
null,
focusNodes[0],
null,
TextInputAction.done,
),
errorWidget(context, provider.billingNameError),
TextWidget(context, "Billing State"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<States>(
isExpanded: true,
hint: Text(
"Select State",
style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
items:
provider.billingStates
.map(
(e) => DropdownMenuItem<States>(
value: e,
child: Text(
e.name!,
style: const TextStyle(
fontSize: 14,
items:
provider.billingDistricts
.map(
(e) => DropdownMenuItem<Districts>(
value: e,
child: Text(
e.district!,
style: const TextStyle(
fontSize: 14,
),
),
),
),
)
.toList(),
value: provider.selecetdBillingStates,
onChanged: (States? value) {
if (provider.billingStates.isNotEmpty) {
provider.selecetdBillingStates = value;
provider.selectedBillingStateID = value!.id!;
provider.selectedBillingStateName =
value!.name!;
)
.toList(),
value: provider.selectedBillingDistricts,
onChanged: (Districts? value) {
if (provider.billingDistricts.isNotEmpty) {
provider.billingDistricts.clear();
// provider.selectedBillingDistricts=null;
provider.selectedBillingDistrictId = null;
provider.selectedBillingDistrictValue = "";
provider.selectedBillingDistricts = value;
provider.selectedBillingDistrictId =
value!.id!;
provider.selectedBillingDistrictValue =
value!.district!;
if (provider.billingSubLocations.isNotEmpty) {
provider.billingSubLocations.clear();
// provider.selectedBillingSubLocations = null;
provider.selectedBillingSubLocID = null;
provider.selectedBillingSubLocValue = "";
}
provider.getSubLocationAPI(
context,
provider.selectedBillingDistrictId,
);
}
provider.getDistrictAPI(
context,
provider.selectedBillingStateID,
);
}
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.billingStateSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider.billingStateSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search Sate...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.billingDistrictSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider
.billingDistrictSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search District...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.district
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
},
),
searchMatchFn: (item, searchValue) {
return item.value?.name
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.billingDistrictSearchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.billingStateSearchController.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
],
),
),
),
errorWidget(context, provider.selectedBillingStateError),
TextWidget(context, "Billing District"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<Districts>(
isExpanded: true,
hint: Text(
"Select District",
style: const TextStyle(fontSize: 14),
),
items:
provider.billingDistricts
.map(
(e) => DropdownMenuItem<Districts>(
value: e,
child: Text(
e.district!,
style: const TextStyle(
fontSize: 14,
errorWidget(context, provider.selectedBillingDistrictError),
TextWidget(context, "Billing Sub Location"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<SubLocations>(
hint: Text(
"Select Sub Locality",
style: const TextStyle(fontSize: 14),
),
items:
provider.billingSubLocations
.map(
(e) => DropdownMenuItem<SubLocations>(
value: e,
child: Text(
e.subLocality!,
style: const TextStyle(
fontSize: 14,
),
),
),
),
)
.toList(),
value: provider.selectedBillingDistricts,
onChanged: (Districts? value) {
if (provider.billingDistricts.isNotEmpty) {
provider.selectedBillingDistricts = value;
provider.selectedBillingDistrictId =
value!.id!;
provider.selectedBillingDistrictValue =
value!.district!;
)
.toList(),
value: provider.selectedBillingSubLocations,
onChanged: (SubLocations? value) {
if (provider.billingSubLocations.isNotEmpty) {
provider.billingSubLocations.clear();
// provider.selectedBillingSubLocations = null;
provider.selectedBillingSubLocID = null;
provider.selectedBillingSubLocValue = "";
provider.selectedBillingSubLocations = value;
provider.selectedBillingSubLocID = value!.id!;
provider.selectedBillingSubLocValue =
value!.subLocality!;
}
provider.getSubLocationAPI(
context,
provider.selectedBillingDistrictId,
);
}
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.billingDistrictSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider
.billingDistrictSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search District...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.district
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
},
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.billingDistrictSearchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
),
),
errorWidget(context, provider.selectedBillingDistrictError),
TextWidget(context, "Billing Sub Location"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<SubLocations>(
hint: Text(
"Select Sub Locality",
style: const TextStyle(fontSize: 14),
),
items:
provider.billingSubLocations
.map(
(e) => DropdownMenuItem<SubLocations>(
value: e,
child: Text(
e.subLocality!,
style: const TextStyle(
fontSize: 14,
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.billingSubLocSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider.billingSubLocSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
),
hintText: 'Search Sub Location...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
)
.toList(),
value: provider.selectedBillingSubLocations,
onChanged: (SubLocations? value) {
if (provider.billingSubLocations.isNotEmpty) {
provider.selectedBillingSubLocations = value;
provider.selectedBillingSubLocID = value!.id!;
provider.selectedBillingSubLocValue =
value!.subLocality!;
}
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.billingSubLocSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider.billingSubLocSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search Sub Location...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.subLocality
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
},
),
searchMatchFn: (item, searchValue) {
return item.value?.subLocality
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.billingSubLocSearchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.billingSubLocSearchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
],
),
),
),
errorWidget(context, provider.selectedBillingSubLocError),
textControllerWidget(
context,
provider.billingAddressController,
"Billing Address",
"Enter Billing Address",
provider.onChangedBillingAddress,
TextInputType.text,
false,
null,
focusNodes[1],
focusNodes[2],
TextInputAction.next,
),
errorWidget(context, provider.billingAddressError),
errorWidget(context, provider.selectedBillingSubLocError),
textControllerWidget(
context,
provider.billingAddressController,
"Billing Address",
"Enter Billing Address",
provider.onChangedBillingAddress,
TextInputType.text,
false,
null,
focusNodes[1],
focusNodes[2],
TextInputAction.next,
),
errorWidget(context, provider.billingAddressError),
textControllerWidget(
context,
provider.billingPincodeController,
"Billing Pin code",
"Enter Billing Pin code",
provider.onChangedBillingPincode,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[2],
null,
TextInputAction.done,
6,
),
errorWidget(context, provider.billingPincodeError),
textControllerWidget(
context,
provider.billingPincodeController,
"Billing Pin code",
"Enter Billing Pin code",
provider.onChangedBillingPincode,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[2],
null,
TextInputAction.done,
6,
),
errorWidget(context, provider.billingPincodeError),
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,
);
}
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.dispatchStateSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider.dispatchStateSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search Sate...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.dispatchStateSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider.dispatchStateSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search Sate...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.name
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
},
),
searchMatchFn: (item, searchValue) {
return item.value?.name
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.dispatchStateSearchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.dispatchStateSearchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
],
),
),
),
errorWidget(context, provider.selectedDispatchStateError),
//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,
errorWidget(context, provider.selectedDispatchStateError),
//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,
);
}
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.dispatchDistrictSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider
.dispatchDistrictSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search District...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.dispatchDistrictSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider
.dispatchDistrictSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search District...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.district
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
},
),
searchMatchFn: (item, searchValue) {
return item.value?.district
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.dispatchDistrictSearchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.dispatchDistrictSearchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
],
),
),
),
errorWidget(context, provider.selectedDispatchDistrictError),
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,
errorWidget(context, provider.selectedDispatchDistrictError),
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!;
}
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.dispatchSubLocSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider.dispatchSubLocSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search Sub Location...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
)
.toList(),
value: provider.selectedDispatchSubLocations,
onChanged: (SubLocations? value) {
if (provider.dispatchSubLocations.isNotEmpty) {
provider.selectedDispatchSubLocations = value;
provider.selectedDispatchSubLocID =
value!.id!;
provider.selectedDispatchSubLocValue =
value!.subLocality!;
}
},
dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50,
searchController:
provider.dispatchSubLocSearchController,
searchInnerWidget: Padding(
padding: const EdgeInsets.all(8),
child: TextFormField(
controller:
provider.dispatchSubLocSearchController,
decoration: InputDecoration(
isDense: true,
contentPadding:
const EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
hintText: 'Search Sub Location...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
searchMatchFn: (item, searchValue) {
return item.value?.subLocality
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
},
),
searchMatchFn: (item, searchValue) {
return item.value?.subLocality
?.toLowerCase()
.contains(
searchValue.toLowerCase(),
) ??
false;
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.dispatchSubLocSearchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.dispatchSubLocSearchController
.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
],
],
),
),
),
errorWidget(context, provider.selectedDispatchSubLocError),
//dd
textControllerWidget(
context,
provider.dispatchAddressController,
"Dispatch Address",
"Enter Dispatch Address",
provider.onChangedDispatchAddress,
TextInputType.text,
false,
null,
focusNodes[3],
focusNodes[4],
TextInputAction.next,
),
errorWidget(context, provider.dispatchAddressError),
errorWidget(context, provider.selectedDispatchSubLocError),
//dd
textControllerWidget(
context,
provider.dispatchAddressController,
"Dispatch Address",
"Enter Dispatch Address",
provider.onChangedDispatchAddress,
TextInputType.text,
false,
null,
focusNodes[3],
focusNodes[4],
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[4],
focusNodes[5],
TextInputAction.next,
6,
),
errorWidget(context, provider.dispatchPincodeError),
textControllerWidget(
context,
provider.dispatchPincodeController,
"Dispatch Pin code",
"Enter Dispatch Pin code",
provider.onChangedDispatchPincode,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[4],
focusNodes[5],
TextInputAction.next,
6,
),
errorWidget(context, provider.dispatchPincodeError),
textControllerWidget(
context,
provider.gstController,
"GST Number",
"Enter GST Number",
provider.onChangedGst,
TextInputType.text,
false,
null,
focusNodes[5],
null,
TextInputAction.done,
),
errorWidget(context, provider.gstError),
textControllerWidget(
context,
provider.gstController,
"GST Number",
"Enter GST Number",
provider.onChangedGst,
TextInputType.text,
false,
null,
focusNodes[5],
null,
TextInputAction.done,
),
errorWidget(context, provider.gstError),
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,
),
),
iconStyleData: IconStyleData(
icon: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
)
.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,
),
),
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,
),
),
),
],
],
),
),
),
TextWidget(context, "TPC Applicable"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
hint: Text(
"TPC Applicable",
style: const TextStyle(fontSize: 14),
),
items:
provider.tpcApplicable
.map(
(e) => DropdownMenuItem<String>(
value: e!,
child: Text(
e,
style: const TextStyle(
fontSize: 14,
TextWidget(context, "TPC Applicable"),
//dd
DropdownButtonHideUnderline(
child: Row(
children: [
Expanded(
child: DropdownButton2<String>(
hint: Text(
"TPC Applicable",
style: const TextStyle(fontSize: 14),
),
items:
provider.tpcApplicable
.map(
(e) => DropdownMenuItem<String>(
value: e!,
child: Text(
e,
style: const TextStyle(
fontSize: 14,
),
),
),
),
)
.toList(),
value: provider.selectedTpcStatus,
onChanged: (String? value) {
if (provider.tpcApplicable.isNotEmpty) {
provider.selectedTpcStatus = value;
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
)
.toList(),
value: provider.selectedTpcStatus,
onChanged: (String? value) {
if (provider.tpcApplicable.isNotEmpty) {
provider.selectedTpcStatus = value;
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
),
),
),
],
],
),
),
),
if (provider.selectedTpcStatus == "Yes") ...[
TextWidget(context, "TPC Agent"),
if (provider.selectedTpcStatus == "Yes") ...[
TextWidget(context, "TPC Agent"),
//dd
Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14),
),
child: ListTile(
title: TextFormField(
focusNode: focusNodetpc,
onTapUpOutside: (event) {
focusNodetpc.unfocus();
},
controller: provider.dropDownTpcSearchController,
onChanged: (value) async {
Future.delayed(
Duration(milliseconds: 100),
() async {
await provider.ordersAddOrderTPCAgentFunction(
context,
widget.mode,
value,
);
},
);
},
decoration: InputDecoration(
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 0,
vertical: 8,
),
hintText: 'Select TPC Agent',
hintStyle: const TextStyle(fontSize: 14),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
//dd
Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14),
),
child: ListTile(
title: TextFormField(
focusNode: focusNodetpc,
onTapUpOutside: (event) {
focusNodetpc.unfocus();
},
controller: provider.dropDownTpcSearchController,
onChanged: (value) async {
Future.delayed(
Duration(milliseconds: 100),
() async {
await provider.ordersAddOrderTPCAgentFunction(
context,
widget.mode,
value,
);
},
);
},
decoration: InputDecoration(
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 0,
vertical: 8,
),
hintText: 'Select TPC Agent',
hintStyle: const TextStyle(fontSize: 14),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
trailing: InkResponse(
onTap: () {
if (focusNodetpc.hasFocus) {
focusNodetpc.unfocus();
} else {
FocusScope.of(
context,
).requestFocus(focusNodetpc);
}
},
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
trailing: InkResponse(
onTap: () {
if (focusNodetpc.hasFocus) {
focusNodetpc.unfocus();
} else {
FocusScope.of(
context,
).requestFocus(focusNodetpc);
}
},
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
),
),
),
),
),
if (provider.tpcAgent.isNotEmpty &&
focusNodetpc.hasFocus) ...[
Card(
margin: EdgeInsets.symmetric(horizontal: 0),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: 150,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
),
child: Scrollbar(
thickness: 2.5,
radius: Radius.circular(6),
thumbVisibility: true,
child: ListView.builder(
itemCount: provider.tpcAgent.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return InkResponse(
onTap: () async {
if (provider.tpcAgent.isNotEmpty) {
provider.selectedTpcAgent =
provider.tpcAgent[index];
if (provider.tpcAgent.isNotEmpty &&
focusNodetpc.hasFocus) ...[
Card(
margin: EdgeInsets.symmetric(horizontal: 0),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: 150,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
),
child: Scrollbar(
thickness: 2.5,
radius: Radius.circular(6),
thumbVisibility: true,
child: ListView.builder(
itemCount: provider.tpcAgent.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return InkResponse(
onTap: () async {
if (provider.tpcAgent.isNotEmpty) {
provider.selectedTpcAgent =
provider.tpcAgent[index];
print(
"Selected Complaint Type: ${provider.tpcAgent[index].text}, ID: ${provider.tpcAgent[index].id}",
);
provider.selectedTpcAgentID =
provider.tpcAgent[index].id!;
provider.selectedTpcAgentValue =
provider.tpcAgent[index].text!;
print(
"hfjkshfg" +
provider.selectedTpcAgentID
.toString(),
);
provider.dropDownTpcSearchController.text =
provider.tpcAgent[index].text!;
}
// provider.ordersAddPaymentSelectOrderAPIFunction(context, provider.selectedAccountID);
// provider.tpcAgent = [];
},
child: SizedBox(
height: 45,
child: Align(
alignment: Alignment.centerLeft,
child: Text(
provider.tpcAgent[index].text!,
print(
"Selected Complaint Type: ${provider.tpcAgent[index].text}, ID: ${provider.tpcAgent[index].id}",
);
provider.selectedTpcAgentID =
provider.tpcAgent[index].id!;
provider.selectedTpcAgentValue =
provider.tpcAgent[index].text!;
print(
"hfjkshfg" +
provider.selectedTpcAgentID
.toString(),
);
provider.dropDownTpcSearchController.text =
provider.tpcAgent[index].text!;
}
// provider.ordersAddPaymentSelectOrderAPIFunction(context, provider.selectedAccountID);
// provider.tpcAgent = [];
},
child: SizedBox(
height: 45,
child: Align(
alignment: Alignment.centerLeft,
child: Text(
provider.tpcAgent[index].text!,
),
),
),
),
);
},
);
},
),
),
),
),
],
textControllerWidget(
context,
provider.tpcAmountController,
"TPC Amount",
"Enter TPC Amount",
provider.onChangeTpcAmount,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[6],
focusNodes[7],
TextInputAction.next,
),
errorWidget(context, provider.tpcAmountError),
],
textControllerWidget(
context,
provider.tpcAmountController,
"TPC Amount",
"Enter TPC Amount",
provider.onChangeTpcAmount,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[6],
focusNodes[7],
TextInputAction.next,
),
errorWidget(context, provider.tpcAmountError),
///Addorderbutton
OrderForm(),
//dd
],
///Addorderbutton
OrderForm(),
//dd
],
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
onTap:
provider.submitClicked
? null
: () {
provider.submitClicked = true;
var order_prod_data = provider.getFormData();
print(order_prod_data);
print(order_prod_data['orders']);
///[{"product_id":"1","qty":"1","price":"500","cgst_p":"9","sgst_p":"9","igst_p":"0","total_price":"500"},
///{"product_id":"2","qty":"1","price":"1000","cgst_p":"9","sgst_p":"9","igst_p":"0","total_price":"1000"}]
provider.getCurrentLocation();
provider.ordersAddOrderAPISubmitFunction(
context,
widget.mode,
provider.selectedEmployeeID,
provider.selectedAccountID,
provider.selectedDispatchDistrictId,
provider.selectedDispatchSubLocID,
provider.selectedUnloadingScope,
provider.selectedFreightScope,
provider.selectedErectionScope,
provider.selectedTpcStatus,
provider.selectedTpcStatus,
provider.selectedBillingStateID,
provider.selectedBillingDistrictId,
provider.selectedBillingSubLocID,
provider.selectedTpcAgentID,
order_prod_data['orders'],
);
},
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,
),
)
: Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
? null
: () {
provider.submitClicked = true;
var order_prod_data = provider.getFormData();
print(order_prod_data);
print(order_prod_data['orders']);
///[{"product_id":"1","qty":"1","price":"500","cgst_p":"9","sgst_p":"9","igst_p":"0","total_price":"500"},
///{"product_id":"2","qty":"1","price":"1000","cgst_p":"9","sgst_p":"9","igst_p":"0","total_price":"1000"}]
provider.getCurrentLocation();
provider.ordersAddOrderAPISubmitFunction(
context,
widget.mode,
provider.selectedEmployeeID,
provider.selectedAccountID,
provider.selectedDispatchDistrictId,
provider.selectedDispatchSubLocID,
provider.selectedUnloadingScope,
provider.selectedFreightScope,
provider.selectedErectionScope,
provider.selectedTpcStatus,
provider.selectedTpcStatus,
provider.selectedBillingStateID,
provider.selectedBillingDistrictId,
provider.selectedBillingSubLocID,
provider.selectedTpcAgentID,
order_prod_data['orders'],
);
},
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:
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';
......@@ -68,644 +69,648 @@ class _AddpaymentScreenState extends State<AddpaymentScreen> {
return Consumer<Addpaymentprovider>(
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: [
TextWidget(context, "Account"),
Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14),
),
child: ListTile(
title: TextFormField(
focusNode: focusNode,
onTapUpOutside: (event) {
focusNode.unfocus();
},
controller: provider.dropDownSearchController,
onChanged: (value) async {
Future.delayed(
Duration(milliseconds: 100),
() async {
await provider
.ordersAddPaymentSelectAccountAPIFunction(
context,
widget.mode,
provider.selectedAccountID,
value,
);
},
);
},
decoration: InputDecoration(
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 0,
vertical: 8,
),
hintText: 'Select Account Type',
hintStyle: const TextStyle(fontSize: 14),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
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, "Account"),
Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14),
),
child: ListTile(
title: TextFormField(
focusNode: focusNode,
onTapUpOutside: (event) {
focusNode.unfocus();
},
controller: provider.dropDownSearchController,
onChanged: (value) async {
Future.delayed(
Duration(milliseconds: 100),
() async {
await provider
.ordersAddPaymentSelectAccountAPIFunction(
context,
widget.mode,
provider.selectedAccountID,
value,
);
},
);
},
decoration: InputDecoration(
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 0,
vertical: 8,
),
hintText: 'Select Account Type',
hintStyle: const TextStyle(fontSize: 14),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),
trailing: InkResponse(
onTap: () {
if (focusNode.hasFocus) {
focusNode.unfocus();
} else {
FocusScope.of(context).requestFocus(focusNode);
}
},
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
trailing: InkResponse(
onTap: () {
if (focusNode.hasFocus) {
focusNode.unfocus();
} else {
FocusScope.of(context).requestFocus(focusNode);
}
},
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
),
),
),
),
),
if (provider.accountList.isNotEmpty &&
focusNode.hasFocus) ...[
Card(
margin: EdgeInsets.symmetric(horizontal: 0),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: widget.mode=="self"?50:150,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
),
child: Scrollbar(
thickness: 2.5,
radius: Radius.circular(6),
thumbVisibility: true,
child: ListView.builder(
itemCount: provider.accountList.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return InkResponse(
onTap: () async {
if (provider.accountList.isNotEmpty) {
provider.selectedAccountList =
provider.accountList[index];
if (provider.accountList.isNotEmpty &&
focusNode.hasFocus) ...[
Card(
margin: EdgeInsets.symmetric(horizontal: 0),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: widget.mode=="self"?50:150,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
),
child: Scrollbar(
thickness: 2.5,
radius: Radius.circular(6),
thumbVisibility: true,
child: ListView.builder(
itemCount: provider.accountList.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return InkResponse(
onTap: () async {
if (provider.accountList.isNotEmpty) {
provider.selectedAccountList =
provider.accountList[index];
print(
"Selected Complaint Type: ${provider.accountList[index].text}, ID: ${provider.accountList[index].id}",
);
provider.selectedAccountID =
provider.accountList[index].id!;
provider.selectedAccountName =
provider.accountList[index].text!;
print(
"hfjkshfg" +
provider.selectedAccountID
.toString(),
);
provider.dropDownSearchController.text =
provider.accountList[index].text!;
}
provider
.ordersAddPaymentSelectOrderAPIFunction(
context,
provider.selectedAccountID,
print(
"Selected Complaint Type: ${provider.accountList[index].text}, ID: ${provider.accountList[index].id}",
);
provider.accountList = [];
},
child: SizedBox(
height: 45,
child: Align(
alignment: Alignment.centerLeft,
child: Text(
provider.accountList[index].text!,
provider.selectedAccountID =
provider.accountList[index].id!;
provider.selectedAccountName =
provider.accountList[index].text!;
print(
"hfjkshfg" +
provider.selectedAccountID
.toString(),
);
provider.dropDownSearchController.text =
provider.accountList[index].text!;
}
provider
.ordersAddPaymentSelectOrderAPIFunction(
context,
provider.selectedAccountID,
);
provider.accountList = [];
},
child: SizedBox(
height: 45,
child: Align(
alignment: Alignment.centerLeft,
child: Text(
provider.accountList[index].text!,
),
),
),
),
);
},
);
},
),
),
),
),
),
],
///enwewe
errorWidget(context, provider.selectAccountError),
],
///enwewe
errorWidget(context, provider.selectAccountError),
textControllerWidget(
context,
provider.amountController,
"Amount",
"Enter Amount",
provider.onChangeAmount,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[0],
null,
TextInputAction.next
),
errorWidget(context, provider.amountError),
textControllerWidget(
context,
provider.amountController,
"Amount",
"Enter Amount",
provider.onChangeAmount,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[0],
null,
TextInputAction.next
),
errorWidget(context, provider.amountError),
///Addorderbutton
if (provider.selectedAccountID!=null) ...[
InkResponse(
onTap: () {
// if (provider.selectedOrderIds.length < provider.orderList.length) {
provider.addNewRow();
// } 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",
///Addorderbutton
if (provider.selectedAccountID!=null) ...[
InkResponse(
onTap: () {
// if (provider.selectedOrderIds.length < provider.orderList.length) {
provider.addNewRow();
// } 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",
color: AppColors.app_blue,
),
),
),
),
),
),
if (provider.orderAmountControllers.length > 0) ...[
Row(
children: [
Expanded(
child: ListView.builder(
itemCount:
provider.orderAmountControllers.length,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Row(
children: [
Expanded(
flex: 3,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
TextWidget(context, "Order"),
Row(
children: [
Expanded(
child: DropdownButtonHideUnderline(
child: DropdownButton2<
OrderList
>(
isExpanded: true,
hint: Text(
'Select Account Type',
style: TextStyle(
fontSize: 14,
if (provider.orderAmountControllers.length > 0) ...[
Row(
children: [
Expanded(
child: ListView.builder(
itemCount:
provider.orderAmountControllers.length,
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (context, index) {
return Row(
children: [
Expanded(
flex: 3,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
TextWidget(context, "Order"),
Row(
children: [
Expanded(
child: DropdownButtonHideUnderline(
child: DropdownButton2<
OrderList
>(
isExpanded: true,
hint: Text(
'Select Account Type',
style: TextStyle(
fontSize: 14,
),
overflow:
TextOverflow
.ellipsis,
),
overflow:
TextOverflow
.ellipsis,
),
items:
provider.orderList
.map(
(
ord,
) => DropdownMenuItem<
OrderList
>(
value: ord,
child: Text(
"(Order Number: ${ord.orderNumber}) + (Order Amount: ${ord.totalAmount}) + (Balance Amount: ${ord.balanceAmount}) + (Date Time: ${ord.createdDatetime})" ??
'',
style: const TextStyle(
fontSize:
14,
items:
provider.orderList
.map(
(
ord,
) => DropdownMenuItem<
OrderList
>(
value: ord,
child: Text(
"(Order Number: ${ord.orderNumber}) + (Order Amount: ${ord.totalAmount}) + (Balance Amount: ${ord.balanceAmount}) + (Date Time: ${ord.createdDatetime})" ??
'',
style: const TextStyle(
fontSize:
14,
),
overflow:
TextOverflow
.ellipsis,
),
overflow:
TextOverflow
.ellipsis,
),
),
)
.toList(),
// value: provider.selectedOrderLists,
value:provider.selectedOrderIds[index] != null?
provider
.orderList
.firstWhere(
(product) =>
product
.orderId ==
provider
.selectedOrderIds[index],
):null,
onChanged: (
OrderList? value,
) {
if (value != null) {
if (provider
.orderList
.isNotEmpty) {
provider.selectedOrderLists =
value;
print(
"Selected Complaint Type: ${value.orderId}, ID: ${value.orderNumber}",
);
provider.updateSelectedOrderId(
index,
provider
.selectedOrderLists,
);
// provider.selectedOrderIds = value!.orderId!;
// provider.selectedOrderNumbers = value!.orderNumber!;
print(
"hfjkshfg" +
)
.toList(),
// value: provider.selectedOrderLists,
value:provider.selectedOrderIds[index] != null?
provider
.orderList
.firstWhere(
(product) =>
product
.orderId ==
provider
.selectedOrderIds
.toString(),
);
.selectedOrderIds[index],
):null,
onChanged: (
OrderList? value,
) {
if (value != null) {
if (provider
.orderList
.isNotEmpty) {
provider.selectedOrderLists =
value;
print(
"Selected Complaint Type: ${value.orderId}, ID: ${value.orderNumber}",
);
provider.updateSelectedOrderId(
index,
provider
.selectedOrderLists,
);
// 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,
},
buttonStyleData:
ddtheme
.buttonStyleData,
iconStyleData:
ddtheme
.iconStyleData,
menuItemStyleData:
ddtheme
.menuItemStyleData,
dropdownStyleData:
ddtheme
.dropdownStyleData,
),
),
),
),
],
),
],
],
),
],
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 2,
child: textControllerWidget(
context,
provider
.orderAmountControllers[index],
"Order Amount",
"Enter Order Amount",
(p0) {
provider.updateAdjustedAmount();
},
TextInputType.number,
false,
FilteringTextInputFormatter
.digitsOnly,
null,null,TextInputAction.next
SizedBox(width: 10),
Expanded(
flex: 2,
child: textControllerWidget(
context,
provider
.orderAmountControllers[index],
"Order Amount",
"Enter Order Amount",
(p0) {
provider.updateAdjustedAmount();
},
TextInputType.number,
false,
FilteringTextInputFormatter
.digitsOnly,
null,null,TextInputAction.next
),
),
),
// SizedBox(width: 10),
//
// IconButton(
// icon: Icon(Icons.delete),
// onPressed: provider.orderAmountControllers.length > 1
// ? () => provider.removeRow(index)
// : null, // Prevent removing the last row
// ),
],
);
},
// SizedBox(width: 10),
//
// IconButton(
// icon: Icon(Icons.delete),
// onPressed: provider.orderAmountControllers.length > 1
// ? () => provider.removeRow(index)
// : null, // Prevent removing the last row
// ),
],
);
},
),
),
),
],
),
],
],
),
],
],
],
textControllerWidget(
context,
provider.orderAdjustedAmountController,
"Order Adjusted Amount",
"Enter Order Adjusted Amount",
provider.onChangeorderAdjustedAmount,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[1],
null,
TextInputAction.done
),
errorWidget(context, provider.orderAdjustedAmountError),
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,
textControllerWidget(
context,
provider.orderAdjustedAmountController,
"Order Adjusted Amount",
"Enter Order Adjusted Amount",
provider.onChangeorderAdjustedAmount,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[1],
null,
TextInputAction.done
),
errorWidget(context, provider.orderAdjustedAmountError),
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),
errorWidget(context, provider.descriptionError),
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,
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),
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[2],
null,
TextInputAction.done
),
errorWidget(context, provider.paymentRefError),
textControllerWidget(
context,
provider.paymentRefController,
"Payment Reference No",
"Enter Payment Reference No. / Cheque No. / UTR No.",
provider.onChangepaymentRef,
TextInputType.text,
false,
null,
focusNodes[2],
null,
TextInputAction.done
),
errorWidget(context, provider.paymentRefError),
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(
"Payment Reference",
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(
"Payment Reference",
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,
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
),
],
),
),
),
if (provider.imagePicked == 1 &&
provider.imagePath != null) ...[
Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"${provider.imagePath}",
style: TextStyle(
color: AppColors.semi_black,
fontSize: 11,
fontWeight: FontWeight.w600,
),
),
InkResponse(
onTap: () {
provider.imagePicked = 0;
provider.imagePath = null;
provider.imageFilePath = null;
},
child: SvgPicture.asset(
"assets/svg/ic_close.svg",
width: 15,
height: 15,
),
),
],
),
),
],
],
],
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar:
InkResponse(
onTap: provider.submitClicked?null:() {
provider.submitClicked = true;
provider.selectedOrders = provider.getFormData();
provider.ordersAddPaymentAPISubmitFunction(
context,
provider.selectedAccountID,
provider.selectedDescription,
provider.selectedOrders,
provider.selectedPaymentMode,
);
},
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:provider.submitClicked?CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(Colors.white),
): Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar:
InkResponse(
onTap: provider.submitClicked?null:() {
provider.submitClicked = true;
provider.selectedOrders = provider.getFormData();
provider.ordersAddPaymentAPISubmitFunction(
context,
provider.selectedAccountID,
provider.selectedDescription,
provider.selectedOrders,
provider.selectedPaymentMode,
);
},
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:provider.submitClicked?CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(Colors.white),
): Text(
"Submit",
style: TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
),
),
),
),
......
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