🐛 Fix poll percentage background
This commit is contained in:
parent
ec7650a920
commit
e5212419ae
@ -80,6 +80,8 @@ class _PostPollState extends State<PostPoll> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return LayoutBuilder(
|
||||||
|
builder: (context, constraints) {
|
||||||
return Card(
|
return Card(
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -91,10 +93,11 @@ class _PostPollState extends State<PostPoll> {
|
|||||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 60,
|
height: 60,
|
||||||
width: MediaQuery.of(context).size.width *
|
width: constraints.maxWidth *
|
||||||
(_poll.metric.byOptionsPercentage[option.id] ?? 0)
|
(_poll.metric.byOptionsPercentage[option.id] ?? 0)
|
||||||
.toDouble(),
|
.toDouble(),
|
||||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
color:
|
||||||
|
Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
@ -114,8 +117,8 @@ class _PostPollState extends State<PostPoll> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'pollVotes'
|
'pollVotes'.plural(
|
||||||
.plural(_poll.metric.byOptions[option.id] ?? 0),
|
_poll.metric.byOptions[option.id] ?? 0),
|
||||||
),
|
),
|
||||||
Text(' · ').padding(horizontal: 4),
|
Text(' · ').padding(horizontal: 4),
|
||||||
Text(
|
Text(
|
||||||
@ -134,5 +137,7 @@ class _PostPollState extends State<PostPoll> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user