fixed finished polls causing errors, made poll list dense
This commit is contained in:
@@ -28,7 +28,7 @@ class GetPollStateResponseObject {
|
|||||||
int maxVotes;
|
int maxVotes;
|
||||||
List<int> votedSelf;
|
List<int> votedSelf;
|
||||||
int? numVoters;
|
int? numVoters;
|
||||||
List<String>? details;
|
List<dynamic>? details;
|
||||||
|
|
||||||
GetPollStateResponseObject(
|
GetPollStateResponseObject(
|
||||||
this.id,
|
this.id,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ GetPollStateResponseObject _$GetPollStateResponseObjectFromJson(
|
|||||||
(json['maxVotes'] as num).toInt(),
|
(json['maxVotes'] as num).toInt(),
|
||||||
(json['votedSelf'] as List<dynamic>).map((e) => (e as num).toInt()).toList(),
|
(json['votedSelf'] as List<dynamic>).map((e) => (e as num).toInt()).toList(),
|
||||||
(json['numVoters'] as num?)?.toInt(),
|
(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(
|
Map<String, dynamic> _$GetPollStateResponseObjectToJson(
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ class PollOptionsList extends StatefulWidget {
|
|||||||
class _PollOptionsListState extends State<PollOptionsList> {
|
class _PollOptionsListState extends State<PollOptionsList> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => Column(
|
Widget build(BuildContext context) => Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
children: [
|
||||||
...widget.pollData.options.map<Widget>((option) {
|
...widget.pollData.options.map<Widget>((option) {
|
||||||
var optionId = widget.pollData.options.indexOf(option);
|
var optionId = widget.pollData.options.indexOf(option);
|
||||||
@@ -29,6 +28,7 @@ class _PollOptionsListState extends State<PollOptionsList> {
|
|||||||
return ListTile(
|
return ListTile(
|
||||||
enabled: false,
|
enabled: false,
|
||||||
isThreeLine: portionsVisible,
|
isThreeLine: portionsVisible,
|
||||||
|
dense: true,
|
||||||
title: Text(
|
title: Text(
|
||||||
option,
|
option,
|
||||||
style: Theme.of(context).textTheme.bodyLarge,
|
style: Theme.of(context).textTheme.bodyLarge,
|
||||||
@@ -36,12 +36,10 @@ class _PollOptionsListState extends State<PollOptionsList> {
|
|||||||
trailing: Icon(
|
trailing: Icon(
|
||||||
votedSelf ? Icons.check_circle_outlined : Icons.circle_outlined,
|
votedSelf ? Icons.check_circle_outlined : Icons.circle_outlined,
|
||||||
color: votedSelf
|
color: votedSelf
|
||||||
? Theme.of(context).colorScheme.primary.withValues(alpha: 0.8)
|
? Theme.of(context).colorScheme.primary.withValues(alpha: 0.6)
|
||||||
: Theme.of(context).colorScheme.onSurfaceVariant.withValues(alpha: 0.8),
|
: Theme.of(context).colorScheme.onSurfaceVariant.withValues(alpha: 0.6),
|
||||||
),
|
),
|
||||||
subtitle: Visibility(
|
subtitle: portionsVisible ? Row(
|
||||||
visible: portionsVisible,
|
|
||||||
child: Row(
|
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: LinearProgressIndicator(value: portion.clamp(0.0, 1.0)),
|
child: LinearProgressIndicator(value: portion.clamp(0.0, 1.0)),
|
||||||
@@ -51,14 +49,12 @@ class _PollOptionsListState extends State<PollOptionsList> {
|
|||||||
child: Text('${(portion * 100).round()}%'),
|
child: Text('${(portion * 100).round()}%'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
) : null,
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Linkify(
|
title: Linkify(
|
||||||
text: 'Zurzeit kann in dieser App leider nicht abgestimmt werden. '
|
text: 'Wenn du abstimmen möchtest, verwende die Webversion unter https://cloud.marianum-fulda.de',
|
||||||
'Verwende dafür die Webversion unter https://cloud.marianum-fulda.de',
|
|
||||||
style: Theme.of(context).textTheme.bodySmall,
|
style: Theme.of(context).textTheme.bodySmall,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user