Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
cosmetic changes in ui PFM-5044
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldevgarg committed Dec 14, 2023
1 parent e1d365d commit 5f3f114
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 97 deletions.
3 changes: 2 additions & 1 deletion frontend/mgramseva/lib/screeens/home/home_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ class _HomeCard extends State<HomeCard> {
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,
Expand Down
41 changes: 26 additions & 15 deletions frontend/mgramseva/lib/screeens/reports/bill_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ class _BillReport extends State<BillReport>
@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<ReportsProvider>(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: [
Expand All @@ -40,24 +42,33 @@ class _BillReport extends State<BillReport>
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(
Expand Down
41 changes: 26 additions & 15 deletions frontend/mgramseva/lib/screeens/reports/collection_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ class _CollectionReport extends State<CollectionReport>
@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<ReportsProvider>(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: [
Expand All @@ -40,24 +42,33 @@ class _CollectionReport extends State<CollectionReport>
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(
Expand Down
134 changes: 70 additions & 64 deletions frontend/mgramseva/lib/screeens/reports/inactive_consumer_report.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -25,77 +23,85 @@ class _CollectionReport extends State<InactiveConsumerReport>
with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
final reportProvider = Provider.of<ReportsProvider>(context);

return LayoutBuilder(builder: (context, constraints) {
return Consumer<ReportsProvider>(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)),
),
],
),
],
),
],
),
);
});
}
}
2 changes: 1 addition & 1 deletion frontend/mgramseva/lib/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion frontend/mgramseva/lib/widgets/confirmation_pop_up.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class _ConfirmationPopUpState extends State<ConfirmationPopUp> {
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),
Expand Down

0 comments on commit 5f3f114

Please sign in to comment.