From ce79d54681a45e600183daa8db0c647eb2c317fd Mon Sep 17 00:00:00 2001 From: MritunjayTiwari14 Date: Sun, 21 Sep 2025 17:48:11 +0530 Subject: [PATCH 1/2] poll: Display UI feedback on poll delay. In this commit, we added Material, InkWell and Ink Widget to account for the Ink Splash effect for UI feedback. Fixes: #1808 --- lib/widgets/poll.dart | 48 ++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/lib/widgets/poll.dart b/lib/widgets/poll.dart index b851c55525..3f19c905d6 100644 --- a/lib/widgets/poll.dart +++ b/lib/widgets/poll.dart @@ -87,32 +87,28 @@ class _PollWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.baseline, textBaseline: localizedTextBaseline(context), children: [ - GestureDetector( - // TODO: Implement feedback when the user taps the button - onTap: () => _toggleVote(option), - behavior: HitTestBehavior.translucent, - child: ConstrainedBox( - constraints: const BoxConstraints(minWidth: 44, minHeight: 44), - child: Padding( - // For accessibility, the touch target is padded to be larger - // than the vote count box. Still, we avoid padding at the - // start because we want to align all the poll options to the - // surrounding messages. - padding: const EdgeInsetsDirectional.only( - end: 5, top: verticalPadding, bottom: verticalPadding), - child: Container( - // Inner padding preserves whitespace even when the text's - // width approaches the button's min-width (e.g. because - // there are more than three digits). - padding: const EdgeInsets.symmetric(horizontal: 4), - decoration: BoxDecoration( - color: theme.colorPollVoteCountBackground, - border: Border.all(color: theme.colorPollVoteCountBorder), - borderRadius: BorderRadius.circular(3)), - child: Center( - child: Text(option.voters.length.toString(), - style: textStyleBold.copyWith( - color: theme.colorPollVoteCountText, fontSize: 20))))))), + ConstrainedBox( + constraints: const BoxConstraints(minWidth: 44, minHeight: 44), + child: Padding( + padding: const EdgeInsetsDirectional.only( + end: 5, top: verticalPadding, bottom: verticalPadding), + child: Material( + color: Colors.transparent, + child: InkWell( + onTap: () => _toggleVote(option), + child: Ink( + // Inner padding preserves whitespace even when the text's + // width approaches the button's min-width (e.g. because + // there are more than three digits). + padding: const EdgeInsets.symmetric(horizontal: 4), + decoration: BoxDecoration( + color: theme.colorPollVoteCountBackground, + border: Border.all(color: theme.colorPollVoteCountBorder), + borderRadius: BorderRadius.circular(3)), + child: Center( + child: Text(option.voters.length.toString(), + style: textStyleBold.copyWith( + color: theme.colorPollVoteCountText, fontSize: 20)))))))), Expanded( child: Padding( // This and the padding on the vote count box both extend the row From 3a47c2e3cbec7a8529f2aa94ec9c69de283ac612 Mon Sep 17 00:00:00 2001 From: MritunjayTiwari14 Date: Wed, 24 Sep 2025 17:45:29 +0530 Subject: [PATCH 2/2] poll: Display UI feedback on poll delay. Added Accidentally Deleted Comments by Android Studio IDE, replaced Ink Widget with Container Widget to match Zulip Codebase Style. Fixes: #1808 --- lib/widgets/poll.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/widgets/poll.dart b/lib/widgets/poll.dart index 3f19c905d6..916fb645df 100644 --- a/lib/widgets/poll.dart +++ b/lib/widgets/poll.dart @@ -90,13 +90,17 @@ class _PollWidgetState extends State { ConstrainedBox( constraints: const BoxConstraints(minWidth: 44, minHeight: 44), child: Padding( + // For accessibility, the touch target is padded to be larger + // than the vote count box. Still, we avoid padding at the + // start because we want to align all the poll options to the + // surrounding messages. padding: const EdgeInsetsDirectional.only( end: 5, top: verticalPadding, bottom: verticalPadding), child: Material( color: Colors.transparent, child: InkWell( onTap: () => _toggleVote(option), - child: Ink( + child: Container( // Inner padding preserves whitespace even when the text's // width approaches the button's min-width (e.g. because // there are more than three digits).