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

19-06-2025 By Sai Srinivas

Finance Module Test cases & Safe Area
parent 4807bee4
......@@ -28,16 +28,25 @@ class Allpaymentrequesitionlistsbymodes extends StatefulWidget {
class _AllpaymentrequesitionlistsbymodesState
extends State<Allpaymentrequesitionlistsbymodes> {
late Commondaterangefilter cf;
@override
void initState() {
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
cf = Commondaterangefilter();
var provider = Provider.of<Requestionlistprovider>(
context,
listen: false,
);
provider.paymentRequestionListsAPIFunction(context, widget.mode, '', '');
final now = DateTime.now();
final range = DateTimeRange(
start: DateTime(now.year, now.month, now.day),
end: DateTime(now.year, now.month, now.day),
);
final dateRange = cf.getFormattedDateRange(range);
// print(dateRange);
provider.paymentRequestionListsAPIFunction(context, widget.mode, dateRange[0], dateRange[1]);
});
}
......@@ -103,18 +112,18 @@ class _AllpaymentrequesitionlistsbymodesState
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
SafeArea(child: provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
: requestLists.isNotEmpty?SingleChildScrollView(
child: Column(
children: [
ListView.builder(
: requestLists.isNotEmpty?SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (requestLists.isEmpty) {
return SizedBox(
......@@ -356,9 +365,8 @@ class _AllpaymentrequesitionlistsbymodesState
);
},
),
],
),
):Emptywidget(context),
):Emptywidget(context),)
),
);
},
......
......@@ -80,7 +80,7 @@ class _FileviewerState extends State<Fileviewer> {
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "File Viewer"),
body: fileWidget(context),
body: SafeArea(child: fileWidget(context)),
);
}
......
......@@ -64,33 +64,15 @@ class _PaymentrequestionlistdetailsState
Widget build(BuildContext context) {
return Consumer<Requesitionlidtdetailsprovider>(
builder: (context, provider, child) {
var payment_det = provider.paymentsDetails;
var req_det = provider.requestsDetails;
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
provider.subHeadings = [
req_det.accountName ?? "-",
req_det.proposedAccount ?? "-",
req_det.branch ?? "-",
req_det.requestingPurpose ?? "-",
req_det.requestMode ?? "-",
req_det.createdEmployee ?? "-",
req_det.attachmentViewFileName ?? "-",
req_det.date ?? "-",
req_det.description ?? "-",
req_det.level1ApprovalRemarks ?? "-",
req_det.level1Employee ?? "-",
req_det.level2ApprovalRemarks ?? "-",
req_det.level2Employee ?? "-",
req_det.createdDatetime ?? "-",
req_det.updatedDatetime ?? "-",
];
});
return WillPopScope(
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, widget.pageName),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
body: SafeArea(
child: Container(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
......@@ -124,7 +106,7 @@ class _PaymentrequestionlistdetailsState
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
req_det.accountName ?? "-",
req_det.accountName==""?"-":req_det.accountName ?? "-",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
......@@ -132,7 +114,7 @@ class _PaymentrequestionlistdetailsState
),
),
Text(
"₹${req_det.amount}",
req_det.amount==""?"-":"₹${req_det.amount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
......@@ -197,10 +179,10 @@ class _PaymentrequestionlistdetailsState
(context) => Fileviewer(
fileName:
req_det
.attachmentViewFileName!,
.attachmentViewFileName??"",
fileUrl:
req_det
.attachmentDirFilePath!,
.attachmentDirFilePath??"",
),
),
);
......@@ -223,7 +205,7 @@ class _PaymentrequestionlistdetailsState
"Attachment",
].contains(provider.Headings[j])
? "View"
: "${provider.subHeadings[j]}",
: provider.subHeadings[j]==""?"-":provider.subHeadings[j],
style: TextStyle(
fontSize: 14,
color:
......@@ -260,6 +242,7 @@ class _PaymentrequestionlistdetailsState
),
),
),
),
bottomNavigationBar:
(["admin", "self"].contains(widget.mode))
? Container(height: 0)
......
......@@ -51,7 +51,8 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white,
appBar: appbar(context, "${widget.pageTitleName}"),
body: Container(
body: SafeArea(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
......@@ -513,6 +514,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
......
......@@ -55,7 +55,8 @@ class _DirectpaymentrequesitionlistState
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white,
appBar: appbar(context, "${widget.pageTitleName}"),
body: Container(
body: SafeArea(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
......@@ -530,6 +531,7 @@ class _DirectpaymentrequesitionlistState
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
......
......@@ -35,7 +35,8 @@ class _FinancedashboardState extends State<Financedashboard> {
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Finance"),
body: Container(
body: SafeArea(
child: SizedBox(
child: SingleChildScrollView(
child: Column(
children: [
......@@ -134,6 +135,7 @@ class _FinancedashboardState extends State<Financedashboard> {
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
floatingActionButton: InkResponse(
......
......@@ -50,7 +50,8 @@ class _PaymentdetailspaymentrequisitionState
resizeToAvoidBottomInset: true,
appBar: appbar(context, widget.pageName),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
body: SafeArea(
child: SizedBox(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
......@@ -169,7 +170,7 @@ class _PaymentdetailspaymentrequisitionState
child: Text(
provider.Headings[j] == "Attachment"
? "View"
: "${provider.subHeadings[j]}",
:provider.subHeadings[j]==""?"-":provider.subHeadings[j]??"-",
style: TextStyle(
fontSize: 14,
color:
......@@ -197,6 +198,7 @@ class _PaymentdetailspaymentrequisitionState
),
),
),
),
),
onWillPop: () {
......
......@@ -18,16 +18,23 @@ class Paymentlistpaymentrequisition extends StatefulWidget {
}
class _PaymentlistpaymentrequisitionState extends State<Paymentlistpaymentrequisition> {
late Commondaterangefilter cf;
@override
void initState() {
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
cf = Commondaterangefilter();
var provider = Provider.of<Paymentrequisitionpaymentslistprovider>(
context,
listen: false,
);
final now = DateTime.now();
final range = DateTimeRange(
start: DateTime(now.year, now.month, now.day),
end: DateTime(now.year, now.month, now.day),
);
final dateRange = cf.getFormattedDateRange(range);
provider.paymentsListAPI(context,'','');
});
}
......@@ -87,19 +94,19 @@ class _PaymentlistpaymentrequisitionState extends State<Paymentlistpaymentrequis
),
),
backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading
body: SafeArea(child: provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
:requestLists.isNotEmpty?Container(
child: SingleChildScrollView(
child: Column(
children: [
ListView.builder(
:requestLists.isNotEmpty?SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.symmetric(
......@@ -188,8 +195,9 @@ class _PaymentlistpaymentrequisitionState extends State<Paymentlistpaymentrequis
],
),
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(4, (j) {
...List.generate(5, (j) {
final headings = [
"To Account",
"Request Mode",
"Attachment",
"Payment Date",
......@@ -197,6 +205,7 @@ class _PaymentlistpaymentrequisitionState extends State<Paymentlistpaymentrequis
];
final subHeadings = [
requestLists[index].payAccount,
requestLists[index].requestMode,
"View",
// requestLists[index].attachmentDirFilePath
......@@ -243,7 +252,7 @@ class _PaymentlistpaymentrequisitionState extends State<Paymentlistpaymentrequis
);
},
child: Text(
subHeadings[j]!,
subHeadings[j]==""?"-": subHeadings[j]??"-",
style: TextStyle(
fontSize: 14,
color:
......@@ -309,10 +318,8 @@ class _PaymentlistpaymentrequisitionState extends State<Paymentlistpaymentrequis
);
},
),
],
),
),
):Emptywidget(context),
):Emptywidget(context),)
),
);
},
......
......@@ -49,7 +49,8 @@ class _PaymentreceiptdetailsState
resizeToAvoidBottomInset: true,
appBar: appbar(context, widget.pageName),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
body: SafeArea(
child: Container(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
......@@ -145,7 +146,7 @@ class _PaymentreceiptdetailsState
child: Text(
provider.Headings[j] == "Attachment"
? "View"
: "${provider.subHeadings[j]}",
: provider.subHeadings[j]==""?"-":provider.subHeadings[j]??"-",
style: TextStyle(
fontSize: 14,
color:
......@@ -173,6 +174,7 @@ class _PaymentreceiptdetailsState
),
),
),
),
),
onWillPop: () {
......
......@@ -89,17 +89,16 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
),
),
backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading
body: SafeArea(child: provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
)):requestLists.isNotEmpty?SingleChildScrollView(
child: Column(
children: [
ListView.builder(
)):requestLists.isNotEmpty?SizedBox(
child: Scrollbar(
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return Container(
padding: EdgeInsets.symmetric(
......@@ -167,6 +166,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
Divider(thickness: 0.5, color: Color(0xFFD7D7D7)),
...List.generate(4, (j) {
final headings = [
"Receipt Account",
"Request Mode",
"Attachment",
"Receipt Date",
......@@ -174,6 +174,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
];
final subHeadings = [
requestLists[index].receipientAccount,
requestLists[index].requestMode,
"View",
// requestLists[index].attachmentDirFilePath
......@@ -220,7 +221,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
);
},
child: Text(
subHeadings[j]!,
subHeadings[j]==""?"-":subHeadings[j]??"-",
style: TextStyle(
fontSize: 14,
color:
......@@ -286,9 +287,8 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
);
},
),
],
),
):Emptywidget(context),
):Emptywidget(context),)
),
);
},
......
......@@ -56,8 +56,9 @@ class _SubmitpaymentrequestionlistsbymodeState
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white,
appBar: appbar(context, "${widget.pageTitleName}"),
body: Container(
appBar: appbar2(context, "${widget.pageTitleName}",provider.resetForm,SizedBox(width: 0,)),
body: SafeArea(
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
......@@ -464,6 +465,7 @@ class _SubmitpaymentrequestionlistsbymodeState
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
......
......@@ -39,7 +39,8 @@ class _ComplainthistoryState extends State<Complainthistory> {
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Complaint History"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
body: SafeArea(
child: Container(
child: SingleChildScrollView(
child: Column(
......@@ -129,6 +130,7 @@ class _ComplainthistoryState extends State<Complainthistory> {
),
),
),
),
),
);
......
......@@ -20,7 +20,8 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Tracker"),
body: GridView.builder(
body: SafeArea(
child: GridView.builder(
padding: EdgeInsets.symmetric(vertical: 10,horizontal: 10),
itemCount: 4,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
......@@ -84,6 +85,7 @@ class _GentrackerdashboardState extends State<Gentrackerdashboard> {
},
),
),
),
);
}
}
......@@ -98,7 +98,8 @@ class _GeneratordetailsState extends State<Generatordetails> {
? appbar2(context, "Generator Details",provider.resetForm, sendwidget)
: appbar(context, "Generator Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
body: SafeArea(
child: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -333,6 +334,7 @@ class _GeneratordetailsState extends State<Generatordetails> {
),
),
),
),
floatingActionButton: Align(
alignment: Alignment.bottomCenter,
child: InkWell(
......
......@@ -29,7 +29,8 @@ class _RegistercomplaintState extends State<Registercomplaint> {
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Register Complaint"),
body: Container(
body: SafeArea(
child: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -608,6 +609,7 @@ class _RegistercomplaintState extends State<Registercomplaint> {
),
),
),
),
floatingActionButton: Container(
child: InkWell(
onTap: () {
......
......@@ -52,7 +52,8 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "${widget.from}"),
body: Container(
body: SafeArea(
child: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
children: [
......@@ -113,6 +114,7 @@ class _ScanentergeneratoridscreenState extends State<Scanentergeneratoridscreen>
),
),
),
),
);
},
);
......
......@@ -57,7 +57,8 @@ class _GeneratorPartDetailsScreenState
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"),
body: Container(
body: SafeArea(
child: Container(
child: SingleChildScrollView(
child: Column(
children: [
......@@ -473,6 +474,7 @@ class _GeneratorPartDetailsScreenState
),
),
),
),
);
},
);
......
......@@ -41,7 +41,8 @@ class _InventoryScreenState extends State<InventoryScreen> {
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Gen Inventory"),
body: Container(
body: SafeArea(
child: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
children: [
......@@ -103,6 +104,7 @@ class _InventoryScreenState extends State<InventoryScreen> {
),
),
),
),
);
},
);
......
......@@ -27,7 +27,8 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Accounts"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
body: SafeArea(
child: Container(
decoration: BoxDecoration(color: Colors.white),
child: Column(
children: [
......@@ -218,6 +219,7 @@ class _AccountsuggestionsState extends State<Accountsuggestions> {
),
),
),
),
);
},
);
......
......@@ -40,7 +40,8 @@ class _FollowupdetailsState extends State<Followupdetails> {
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Follow Up Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
body: SafeArea(
child: Container(
child: ListView.builder(
itemCount: provider.followUpList.length,
itemBuilder: (context, index) {
......@@ -126,6 +127,7 @@ class _FollowupdetailsState extends State<Followupdetails> {
),
),
),
),
);
},
);
......
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