diff --git a/devtools_options.yaml b/devtools_options.yaml index 7e7e7f6..7093540 100644 --- a/devtools_options.yaml +++ b/devtools_options.yaml @@ -1 +1,3 @@ extensions: + - provider: true + - shared_preferences: true \ No newline at end of file diff --git a/lib/view/pages/talk/components/chatBubble.dart b/lib/view/pages/talk/components/chatBubble.dart index e45a5bf..2fd7ef9 100644 --- a/lib/view/pages/talk/components/chatBubble.dart +++ b/lib/view/pages/talk/components/chatBubble.dart @@ -311,7 +311,7 @@ class _ChatBubbleState extends State with SingleTickerProviderStateM content: FutureBuilder( future: pollState, builder: (context, snapshot) { - if(snapshot.connectionState == ConnectionState.waiting) return const LoadingSpinner(); + if(snapshot.connectionState == ConnectionState.waiting) return const Column(mainAxisSize: MainAxisSize.min, children: [LoadingSpinner()]); var pollData = snapshot.data!.data; ownVotes = pollData.votedSelf; @@ -322,14 +322,15 @@ class _ChatBubbleState extends State with SingleTickerProviderStateM } ), actions: [ - TextButton( - onPressed: () async { - Navigator.of(context).pop(); - if(ownVotes == null) return; - VotePoll(pollId: pollId, token: widget.bubbleData.token, params: VotePollParams(optionIds: ownVotes!)).run(); - }, - child: const Text('Stimme abgeben') - ), + FutureBuilder(future: pollState, builder: (context, snapshot) => TextButton( + onPressed: () async { + if(snapshot.connectionState != ConnectionState.done) return; + Navigator.of(context).pop(); + if(ownVotes == null) return; + VotePoll(pollId: pollId, token: widget.bubbleData.token, params: VotePollParams(optionIds: ownVotes!)).run(); + }, + child: const Text('Stimme abgeben') + )), TextButton( onPressed: () => Navigator.of(context).pop(), child: const Text('Abbrechen') diff --git a/lib/view/pages/talk/components/pollOptionsList.dart b/lib/view/pages/talk/components/pollOptionsList.dart index 78175f5..db26406 100644 --- a/lib/view/pages/talk/components/pollOptionsList.dart +++ b/lib/view/pages/talk/components/pollOptionsList.dart @@ -22,11 +22,10 @@ class _PollOptionsListState extends State { } @override - Widget build(BuildContext context) => ListView( - shrinkWrap: true, + Widget build(BuildContext context) => Column( + mainAxisSize: MainAxisSize.min, children: [ - ...widget.pollData.options.map( - (option) => CheckboxListTile( + ...widget.pollData.options.map((option) => CheckboxListTile( value: ownVotes.contains(widget.pollData.options.indexOf(option)), title: Text(option), onChanged: (value) {