Skip to content

Commit 1201253

Browse files
author
MritunjayTiwari14
committed
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
1 parent 6adc9c3 commit 1201253

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

lib/widgets/poll.dart

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -87,32 +87,32 @@ class _PollWidgetState extends State<PollWidget> {
8787
crossAxisAlignment: CrossAxisAlignment.baseline,
8888
textBaseline: localizedTextBaseline(context),
8989
children: [
90-
GestureDetector(
91-
// TODO: Implement feedback when the user taps the button
92-
onTap: () => _toggleVote(option),
93-
behavior: HitTestBehavior.translucent,
94-
child: ConstrainedBox(
95-
constraints: const BoxConstraints(minWidth: 44, minHeight: 44),
96-
child: Padding(
97-
// For accessibility, the touch target is padded to be larger
98-
// than the vote count box. Still, we avoid padding at the
99-
// start because we want to align all the poll options to the
100-
// surrounding messages.
101-
padding: const EdgeInsetsDirectional.only(
102-
end: 5, top: verticalPadding, bottom: verticalPadding),
103-
child: Container(
104-
// Inner padding preserves whitespace even when the text's
105-
// width approaches the button's min-width (e.g. because
106-
// there are more than three digits).
107-
padding: const EdgeInsets.symmetric(horizontal: 4),
108-
decoration: BoxDecoration(
109-
color: theme.colorPollVoteCountBackground,
110-
border: Border.all(color: theme.colorPollVoteCountBorder),
111-
borderRadius: BorderRadius.circular(3)),
112-
child: Center(
113-
child: Text(option.voters.length.toString(),
114-
style: textStyleBold.copyWith(
115-
color: theme.colorPollVoteCountText, fontSize: 20))))))),
90+
ConstrainedBox(
91+
constraints: const BoxConstraints(minWidth: 44, minHeight: 44),
92+
child: Padding(
93+
// For accessibility, the touch target is padded to be larger
94+
// than the vote count box. Still, we avoid padding at the
95+
// start because we want to align all the poll options to the
96+
// surrounding messages.
97+
padding: const EdgeInsetsDirectional.only(
98+
end: 5, top: verticalPadding, bottom: verticalPadding),
99+
child: Material(
100+
color: Colors.transparent,
101+
child: InkWell(
102+
onTap: () => _toggleVote(option),
103+
child: Ink(
104+
// Inner padding preserves whitespace even when the text's
105+
// width approaches the button's min-width (e.g. because
106+
// there are more than three digits).
107+
padding: const EdgeInsets.symmetric(horizontal: 4),
108+
decoration: BoxDecoration(
109+
color: theme.colorPollVoteCountBackground,
110+
border: Border.all(color: theme.colorPollVoteCountBorder),
111+
borderRadius: BorderRadius.circular(3)),
112+
child: Center(
113+
child: Text(option.voters.length.toString(),
114+
style: textStyleBold.copyWith(
115+
color: theme.colorPollVoteCountText, fontSize: 20)))))))),
116116
Expanded(
117117
child: Padding(
118118
// This and the padding on the vote count box both extend the row

0 commit comments

Comments
 (0)