💄 Optimize poll submitted view

This commit is contained in:
2025-08-12 22:52:52 +08:00
parent 16987c758e
commit 0239c53c04

View File

@@ -446,21 +446,16 @@ class _PollSubmitState extends ConsumerState<PollSubmit> {
if (widget.initialAnswers != null && !_isModifying && !widget.isReadonly) { if (widget.initialAnswers != null && !_isModifying && !widget.isReadonly) {
// If poll is submitted and not in modification mode, show "Modify" button // If poll is submitted and not in modification mode, show "Modify" button
return Row( return FilledButton.icon(
children: [ icon: const Icon(Icons.edit),
const Spacer(), label: const Text('Modify Answers'),
FilledButton.icon( onPressed: () {
icon: const Icon(Icons.edit), setState(() {
label: const Text('Modify Answers'), _isModifying = true;
onPressed: () { _index = 0; // Reset to first question for modification
setState(() { _loadCurrentIntoLocalState();
_isModifying = true; });
_index = 0; // Reset to first question for modification },
_loadCurrentIntoLocalState();
});
},
),
],
); );
} }
@@ -666,11 +661,7 @@ class _PollSubmitState extends ConsumerState<PollSubmit> {
if (widget.initialAnswers != null && !widget.isReadonly && !_isModifying) { if (widget.initialAnswers != null && !widget.isReadonly && !_isModifying) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [_buildSubmittedView(context), _buildNavBar(context)],
_buildSubmittedView(context),
const SizedBox(height: 16),
_buildNavBar(context),
],
); );
} }