From 5f3f114c196d4809900b9e2663c8e1e50a3f6f89 Mon Sep 17 00:00:00 2001 From: Rahul Dev Garg <34365102+rahuldevgarg@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:31:35 +0530 Subject: [PATCH] cosmetic changes in ui PFM-5044 --- .../lib/screeens/home/home_card.dart | 3 +- .../lib/screeens/reports/bill_report.dart | 41 ++++-- .../screeens/reports/collection_report.dart | 41 ++++-- .../reports/inactive_consumer_report.dart | 134 +++++++++--------- frontend/mgramseva/lib/theme.dart | 2 +- .../utils/constants/i18_key_constants.dart | 1 + .../lib/widgets/confirmation_pop_up.dart | 2 +- 7 files changed, 127 insertions(+), 97 deletions(-) diff --git a/frontend/mgramseva/lib/screeens/home/home_card.dart b/frontend/mgramseva/lib/screeens/home/home_card.dart index 3b8c9e17e..78bc8a9ec 100644 --- a/frontend/mgramseva/lib/screeens/home/home_card.dart +++ b/frontend/mgramseva/lib/screeens/home/home_card.dart @@ -40,13 +40,14 @@ class _HomeCard extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Icon(item.iconData, size: 35), + Icon(item.iconData, size: 30), Container( margin: EdgeInsets.all(10), child: Center( child: new Text( ApplicationLocalizations.of(context) .translate(item.label), + textScaleFactor: MediaQuery.of(context).size.width<400 ? 0.90 : 1, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w400), textAlign: TextAlign.center, diff --git a/frontend/mgramseva/lib/screeens/reports/bill_report.dart b/frontend/mgramseva/lib/screeens/reports/bill_report.dart index f3f202f49..5359d4159 100644 --- a/frontend/mgramseva/lib/screeens/reports/bill_report.dart +++ b/frontend/mgramseva/lib/screeens/reports/bill_report.dart @@ -26,11 +26,13 @@ class _BillReport extends State @override Widget build(BuildContext context) { return LayoutBuilder(builder: (context, constraints) { + final isWideScreen = constraints.maxWidth > 700; + final containerMargin = isWideScreen + ? const EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 10) + : const EdgeInsets.symmetric(vertical: 5.0, horizontal: 8); return Consumer(builder: (_, reportProvider, child) { return Container( - margin: constraints.maxWidth > 700 - ? const EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 10) - : const EdgeInsets.only(top: 5.0, bottom: 5, right: 8, left: 8), + margin: containerMargin, child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -40,24 +42,33 @@ class _BillReport extends State Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - children: [ - Text("1. ", - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), - Text( - ApplicationLocalizations.of(context) - .translate(i18.dashboard.BILL_REPORT), - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), - ], + Container( + width: constraints.maxWidth > 344?constraints.maxWidth / 2.5:constraints.maxWidth / 3, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "1. ", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + Expanded( + child: Text( + ApplicationLocalizations.of(context) + .translate(i18.dashboard.BILL_REPORT), + maxLines: 3, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + ), + ], + ), ), Row( children: [ Container( width: 50, child: Button( - "View", + ApplicationLocalizations.of(context) + .translate(i18.common.VIEW), () { if (reportProvider.selectedBillPeriod == null) { Notifiers.getToastMessage( diff --git a/frontend/mgramseva/lib/screeens/reports/collection_report.dart b/frontend/mgramseva/lib/screeens/reports/collection_report.dart index dbae58d3c..066fcebff 100644 --- a/frontend/mgramseva/lib/screeens/reports/collection_report.dart +++ b/frontend/mgramseva/lib/screeens/reports/collection_report.dart @@ -26,11 +26,13 @@ class _CollectionReport extends State @override Widget build(BuildContext context) { return LayoutBuilder(builder: (context, constraints) { + final isWideScreen = constraints.maxWidth > 700; + final containerMargin = isWideScreen + ? const EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 10) + : const EdgeInsets.symmetric(vertical: 5.0, horizontal: 8); return Consumer(builder: (_, reportProvider, child) { return Container( - margin: constraints.maxWidth > 700 - ? const EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 10) - : const EdgeInsets.only(top: 5.0, bottom: 5, right: 8, left: 8), + margin: containerMargin, child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -40,24 +42,33 @@ class _CollectionReport extends State Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - children: [ - Text("2. ", - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), - Text( - ApplicationLocalizations.of(context) - .translate(i18.dashboard.COLLECTION_REPORT), - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), - ], + Container( + width: constraints.maxWidth > 344?constraints.maxWidth / 2.5:constraints.maxWidth / 3, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "2. ", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + Expanded( + child: Text( + ApplicationLocalizations.of(context) + .translate(i18.dashboard.COLLECTION_REPORT), + maxLines: 3, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + ), + ], + ), ), Row( children: [ Container( width: 50, child: Button( - "View", + ApplicationLocalizations.of(context) + .translate(i18.common.VIEW), () { if (reportProvider.selectedBillPeriod == null) { Notifiers.getToastMessage( diff --git a/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart b/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart index bce975982..72a59f1d8 100644 --- a/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart +++ b/frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart @@ -3,9 +3,7 @@ import 'package:provider/provider.dart'; import '../../providers/reports_provider.dart'; import '../../utils/localization/application_localizations.dart'; - import 'package:mgramseva/utils/constants/i18_key_constants.dart'; - import '../../utils/notifiers.dart'; import '../../utils/testing_keys/testing_keys.dart'; import '../../widgets/button.dart'; @@ -25,77 +23,85 @@ class _CollectionReport extends State with SingleTickerProviderStateMixin { @override Widget build(BuildContext context) { + final reportProvider = Provider.of(context); + return LayoutBuilder(builder: (context, constraints) { - return Consumer(builder: (_, reportProvider, child) { - return Container( - margin: constraints.maxWidth > 700 - ? const EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 10) - : const EdgeInsets.only(top: 5.0, bottom: 5, right: 8, left: 8), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( + final isWideScreen = constraints.maxWidth > 700; + final containerMargin = isWideScreen + ? const EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 10) + : const EdgeInsets.symmetric(vertical: 5.0, horizontal: 8); + + return Container( + margin: containerMargin, + width: constraints.maxWidth, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox(height: 30), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: constraints.maxWidth > 344?constraints.maxWidth / 2.5:constraints.maxWidth / 3, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("3. ", - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), Text( + "3. ", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), + ), + Expanded( + child: Text( ApplicationLocalizations.of(context) .translate(i18.dashboard.INACTIVE_CONSUMER_REPORT), - style: TextStyle( - fontSize: 16, fontWeight: FontWeight.w700)), - ], - ), - Row( - children: [ - Container( - width: 50, - child: Button( - "View", - () { - if (reportProvider.selectedBillPeriod == null) { - Notifiers.getToastMessage( - context, 'Select Billing Cycle', 'ERROR'); - } else { - reportProvider.clearTableData(); - reportProvider.getInactiveConsumerReport(); - widget.onViewClick( - true, i18.dashboard.INACTIVE_CONSUMER_REPORT); - } - }, - key: Keys.billReport.INACTIVE_CONSUMER_REPORT_VIEW_BUTTON, + maxLines: 3, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w700), ), ), - SizedBox( - width: 10, - ), - TextButton.icon( - onPressed: () { - if (reportProvider.selectedBillPeriod == null) { - Notifiers.getToastMessage( - context, 'Select Billing Cycle', 'ERROR'); - } else { - reportProvider.getInactiveConsumerReport( - download: true); - } - }, - icon: Icon(Icons.download_sharp), - label: Text(ApplicationLocalizations.of(context) - .translate(i18.common.CORE_DOWNLOAD))), ], ), - ], - ), - ], - ), - ); - }); + ), + + Row( + children: [ + Container( + width: 50, + child: Button( + ApplicationLocalizations.of(context) + .translate(i18.common.VIEW), + () { + if (reportProvider.selectedBillPeriod == null) { + Notifiers.getToastMessage(context, 'Select Billing Cycle', 'ERROR'); + } else { + reportProvider.clearTableData(); + reportProvider.getInactiveConsumerReport(); + widget.onViewClick( + true, i18.dashboard.INACTIVE_CONSUMER_REPORT); + } + }, + key: Keys.billReport.INACTIVE_CONSUMER_REPORT_VIEW_BUTTON, + ), + ), + SizedBox(width: 10), + TextButton.icon( + onPressed: () { + if (reportProvider.selectedBillPeriod == null) { + Notifiers.getToastMessage(context, 'Select Billing Cycle', 'ERROR'); + } else { + reportProvider.getInactiveConsumerReport(download: true); + } + }, + icon: Icon(Icons.download_sharp), + label: Text(ApplicationLocalizations.of(context) + .translate(i18.common.CORE_DOWNLOAD)), + ), + ], + ), + ], + ), + ], + ), + ); }); } } diff --git a/frontend/mgramseva/lib/theme.dart b/frontend/mgramseva/lib/theme.dart index eb312864f..b03d3ffe5 100644 --- a/frontend/mgramseva/lib/theme.dart +++ b/frontend/mgramseva/lib/theme.dart @@ -8,7 +8,7 @@ ThemeData get theme => ThemeData( primaryColorLight: Color.fromRGBO(80, 90, 95, 1), primaryColor: Color.fromRGBO(244, 119, 56, 1), disabledColor: Colors.grey, - cardTheme: CardTheme(surfaceTintColor: Colors.white), + cardTheme: CardTheme(surfaceTintColor: Colors.white,shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(3))), datePickerTheme: DatePickerThemeData( surfaceTintColor: Colors.white ), diff --git a/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart b/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart index cb186d523..ec4a240b3 100644 --- a/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart +++ b/frontend/mgramseva/lib/utils/constants/i18_key_constants.dart @@ -68,6 +68,7 @@ class Common { String get BACK => 'BACK'; String get DEAR => 'DEAR'; String get VIEW_ALL => 'VIEW_ALL'; + String get VIEW => 'VIEW'; String get ALL_NOTIFICATIONS => 'ALL_NOTIFICATIONS'; String get CORE_FATHER_NAME => 'CORE_FATHER_NAME'; diff --git a/frontend/mgramseva/lib/widgets/confirmation_pop_up.dart b/frontend/mgramseva/lib/widgets/confirmation_pop_up.dart index 923bd22eb..18ab5a56c 100644 --- a/frontend/mgramseva/lib/widgets/confirmation_pop_up.dart +++ b/frontend/mgramseva/lib/widgets/confirmation_pop_up.dart @@ -39,7 +39,7 @@ class _ConfirmationPopUpState extends State { alignment: Alignment.center, constraints: BoxConstraints( minHeight: 160, - maxHeight: 180 + maxHeight: 190 ), width: MediaQuery.of(context).size.width > 720 ? MediaQuery.of(context).size.width / 3.5 : MediaQuery.of(context).size.width , padding: EdgeInsets.only(right: 8.0, left: 8.0),