Skip to content

Commit 2e238dc

Browse files
committed
[Democracy] hide misleading texts in case there is no turnout yet
1 parent 413b441 commit 2e238dc

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

app/lib/page-encointer/democracy/widgets/proposal_tile.dart

+11-6
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,17 @@ class _ProposalTileState extends State<ProposalTile> {
8080
ListTile(
8181
contentPadding: const EdgeInsets.symmetric(),
8282
leading: Text(widget.proposalId.toString(), style: titleSmall),
83-
subtitle: Column(
84-
crossAxisAlignment: CrossAxisAlignment.start,
85-
children: [
86-
Text('${l10n.proposalTurnout}: $turnout / $electorateSize'),
87-
Text(l10n.proposalApprovalThreshold((threshold * 100).toStringAsFixed(2))),
88-
passingOrFailingText(context, proposal, tally, widget.params)
83+
subtitle: SizedBox(
84+
// ensure constant height even for missing texts without turnout.
85+
height: 60,
86+
child: Column(
87+
crossAxisAlignment: CrossAxisAlignment.start,
88+
children: [
89+
Text('${l10n.proposalTurnout}: $turnout / $electorateSize'),
90+
if (threshold != 0) Text(l10n.proposalApprovalThreshold((threshold * 100).toStringAsFixed(2))),
91+
if (threshold != 0) passingOrFailingText(context, proposal, tally, widget.params),
92+
],
93+
),
8994
),
9095
trailing: voteButtonOrProposalStatus(context),
9196
),

0 commit comments

Comments
 (0)