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

Commit

Permalink
implemented the collapsable table
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldevgarg committed Feb 1, 2024
1 parent d57dfac commit 3b5809b
Showing 1 changed file with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,40 +41,66 @@ class _WaterConnectionCountWidgetState
'${"${ApplicationLocalizations.of(context).translate(i18.common.WS_REPORTS_WATER_CONNECTION_COUNT)}"}'),
Container(
margin: MediaQuery.of(context).size.width > 760
? EdgeInsets.only(top: 5.0, bottom: 5, right: 20, left: 20)
? EdgeInsets.only(
top: 5.0, bottom: 5, right: 20, left: 20)
: EdgeInsets.only(top: 5.0, bottom: 5, right: 8, left: 8),
child: LayoutBuilder(
builder: (context, constraints) {
final provider = Provider.of<ReportsProvider>(context);
final waterConnectionCount = provider.waterConnectionCount;
final waterConnectionCount =
provider.waterConnectionCount;
if (waterConnectionCount == null) {
return SizedBox();
}
return Column(
children: [
if (constraints.maxWidth > 760)
if (waterConnectionCount.waterConnectionsDemandGenerated !=
null &&
waterConnectionCount
.waterConnectionsDemandGenerated
?.length !=
0 &&
constraints.maxWidth > 760)
_buildDataTableRow(
context,
"${ApplicationLocalizations.of(context).translate(i18.common.LAST_BILL_CYCLE_DEMAND_GENERATED)}",
waterConnectionCount
.waterConnectionsDemandGenerated,
),
if (constraints.maxWidth <= 760)
if (waterConnectionCount.waterConnectionsDemandGenerated !=
null &&
waterConnectionCount
.waterConnectionsDemandGenerated
?.length !=
0 &&
constraints.maxWidth <= 760)
_buildDataTableColumn(
context,
"${ApplicationLocalizations.of(context).translate(i18.common.LAST_BILL_CYCLE_DEMAND_GENERATED)}",
waterConnectionCount
.waterConnectionsDemandGenerated,
),
SizedBox(height: 20),
if (constraints.maxWidth > 760)
if (waterConnectionCount.waterConnectionsDemandNotGenerated !=
null &&
waterConnectionCount
.waterConnectionsDemandNotGenerated
?.length !=
0 &&
constraints.maxWidth > 760)
_buildDataTableRow(
context,
"${ApplicationLocalizations.of(context).translate(i18.common.LAST_BILL_CYCLE_DEMAND_NOT_GENERATED)}",
waterConnectionCount
.waterConnectionsDemandNotGenerated,
),
if (constraints.maxWidth <= 760)
if (waterConnectionCount.waterConnectionsDemandNotGenerated !=
null &&
waterConnectionCount
.waterConnectionsDemandNotGenerated
?.length !=
0 &&
constraints.maxWidth <= 760)
_buildDataTableColumn(
context,
"${ApplicationLocalizations.of(context).translate(i18.common.LAST_BILL_CYCLE_DEMAND_NOT_GENERATED)}",
Expand Down

0 comments on commit 3b5809b

Please sign in to comment.