fixed finished polls causing errors, made poll list dense

This commit is contained in:
2026-02-01 15:07:48 +01:00
parent 567184bcf9
commit 174e6ac0b7
3 changed files with 8 additions and 12 deletions

View File

@@ -28,7 +28,7 @@ class GetPollStateResponseObject {
int maxVotes;
List<int> votedSelf;
int? numVoters;
List<String>? details;
List<dynamic>? details;
GetPollStateResponseObject(
this.id,

View File

@@ -40,7 +40,7 @@ GetPollStateResponseObject _$GetPollStateResponseObjectFromJson(
(json['maxVotes'] as num).toInt(),
(json['votedSelf'] as List<dynamic>).map((e) => (e as num).toInt()).toList(),
(json['numVoters'] as num?)?.toInt(),
(json['details'] as List<dynamic>?)?.map((e) => e as String).toList(),
json['details'] as List<dynamic>?,
);
Map<String, dynamic> _$GetPollStateResponseObjectToJson(

View File

@@ -15,7 +15,6 @@ class PollOptionsList extends StatefulWidget {
class _PollOptionsListState extends State<PollOptionsList> {
@override
Widget build(BuildContext context) => Column(
mainAxisSize: MainAxisSize.min,
children: [
...widget.pollData.options.map<Widget>((option) {
var optionId = widget.pollData.options.indexOf(option);
@@ -29,6 +28,7 @@ class _PollOptionsListState extends State<PollOptionsList> {
return ListTile(
enabled: false,
isThreeLine: portionsVisible,
dense: true,
title: Text(
option,
style: Theme.of(context).textTheme.bodyLarge,
@@ -36,12 +36,10 @@ class _PollOptionsListState extends State<PollOptionsList> {
trailing: Icon(
votedSelf ? Icons.check_circle_outlined : Icons.circle_outlined,
color: votedSelf
? Theme.of(context).colorScheme.primary.withValues(alpha: 0.8)
: Theme.of(context).colorScheme.onSurfaceVariant.withValues(alpha: 0.8),
? Theme.of(context).colorScheme.primary.withValues(alpha: 0.6)
: Theme.of(context).colorScheme.onSurfaceVariant.withValues(alpha: 0.6),
),
subtitle: Visibility(
visible: portionsVisible,
child: Row(
subtitle: portionsVisible ? Row(
children: [
Expanded(
child: LinearProgressIndicator(value: portion.clamp(0.0, 1.0)),
@@ -51,14 +49,12 @@ class _PollOptionsListState extends State<PollOptionsList> {
child: Text('${(portion * 100).round()}%'),
),
],
)
)
) : null,
);
}),
ListTile(
title: Linkify(
text: 'Zurzeit kann in dieser App leider nicht abgestimmt werden. '
'Verwende dafür die Webversion unter https://cloud.marianum-fulda.de',
text: 'Wenn du abstimmen möchtest, verwende die Webversion unter https://cloud.marianum-fulda.de',
style: Theme.of(context).textTheme.bodySmall,
),
)