@@ -92,22 +92,30 @@ class _PollWidgetState extends State<PollWidget> {
92
92
crossAxisAlignment: CrossAxisAlignment .baseline,
93
93
textBaseline: localizedTextBaseline (context),
94
94
children: [
95
- ConstrainedBox (
96
- constraints: const BoxConstraints (minWidth: 44 ),
97
- child: Container (
98
- height: 44 ,
95
+ OutlinedButton (
96
+ style: OutlinedButton .styleFrom (
97
+ minimumSize: const Size .square (44 ),
98
+ // The default visual density is platform dependent.
99
+ // For those whose density defaults to [VisualDensity.compact],
100
+ // this button would be 8px smaller if we do not override it.
101
+ //
102
+ // See also:
103
+ // * [ThemeData.visualDensity], which provides the default.
104
+ visualDensity: VisualDensity .standard,
99
105
// This padding is only in effect
100
106
// when the vote count has more than one digit.
101
107
padding: const EdgeInsets .symmetric (horizontal: 15 ),
102
- decoration: BoxDecoration (
103
- color: theme.colorPollVoteCountBackground,
104
- border: Border .all (color: theme.colorPollVoteCountBorder),
108
+ shape: RoundedRectangleBorder (
105
109
borderRadius: BorderRadius .circular (3 )),
106
- child: Center (
107
- child: Text (option.voters.length.toString (),
108
- textAlign: TextAlign .center,
109
- style: textStyleBold.copyWith (
110
- color: theme.colorPollVoteCountText, fontSize: 16 ))))),
110
+ backgroundColor: theme.colorPollVoteCountBackground,
111
+ side: BorderSide (color: theme.colorPollVoteCountBorder),
112
+ splashFactory: NoSplash .splashFactory,
113
+ ),
114
+ onPressed: () => toggleVote (option),
115
+ child: Text (option.voters.length.toString (),
116
+ textAlign: TextAlign .center,
117
+ style: textStyleBold.copyWith (fontSize: 16 ,
118
+ color: theme.colorPollVoteCountText))),
111
119
Expanded (
112
120
child: Wrap (
113
121
spacing: 5 ,
0 commit comments