@@ -46,6 +46,8 @@ class _PollWidgetState extends State<PollWidget> {
46
46
47
47
@override
48
48
Widget build (BuildContext context) {
49
+ const verticalPadding = 2.5 ;
50
+
49
51
final zulipLocalizations = ZulipLocalizations .of (context);
50
52
final theme = ContentTheme .of (context);
51
53
final store = PerAccountStoreWidget .of (context);
@@ -73,10 +75,10 @@ class _PollWidgetState extends State<PollWidget> {
73
75
textBaseline: localizedTextBaseline (context),
74
76
children: [
75
77
ConstrainedBox (
76
- constraints: const BoxConstraints (
77
- minWidth: 25 + 5 , minHeight: 25 + 5 ),
78
+ constraints: const BoxConstraints (minWidth: 44 , minHeight: 44 ),
78
79
child: Padding (
79
- padding: const EdgeInsetsDirectional .only (bottom: 5 , end: 5 ),
80
+ padding: const EdgeInsetsDirectional .only (
81
+ end: 5 , top: verticalPadding, bottom: verticalPadding),
80
82
child: Container (
81
83
// Inner padding preserves whitespace even when the text's
82
84
// width approaches the button's min-width (e.g. because
@@ -89,14 +91,14 @@ class _PollWidgetState extends State<PollWidget> {
89
91
child: Center (
90
92
child: Text (option.voters.length.toString (),
91
93
style: textStyleBold.copyWith (
92
- color: theme.colorPollVoteCountText, fontSize: 13 )))))),
94
+ color: theme.colorPollVoteCountText, fontSize: 20 )))))),
93
95
Expanded (
94
96
child: Padding (
95
- // This and the bottom padding on the vote count box both extend
96
- // the row by the same extent. This ensures that there still will
97
- // be consistent spacing between rows when the text takes more
97
+ // This and the padding on the vote count box both extend the row
98
+ // by the same extent. This ensures that there still will be
99
+ // consistent spacing between rows when the text takes more
98
100
// vertical space than the vote count box.
99
- padding: const EdgeInsets .only (bottom : 5 ),
101
+ padding: const EdgeInsets .symmetric (vertical : verticalPadding ),
100
102
child: Wrap (
101
103
spacing: 5 ,
102
104
children: [
@@ -108,18 +110,26 @@ class _PollWidgetState extends State<PollWidget> {
108
110
]);
109
111
}
110
112
111
- return Column (
112
- crossAxisAlignment: CrossAxisAlignment .start,
113
- children: [
114
- Padding (padding: const EdgeInsets .only (bottom: 6 ), child: question),
115
- if (widget.poll.options.isEmpty)
113
+ return Padding (
114
+ // `verticalPadding` out of 5 logical pixels
115
+ // come from the last option row.
116
+ padding: const EdgeInsets .only (bottom: 5 - verticalPadding),
117
+ child: Column (
118
+ crossAxisAlignment: CrossAxisAlignment .start,
119
+ children: [
116
120
Padding (
117
- // This is consistent with the option rows' bottom padding.
118
- padding: const EdgeInsets .only (bottom: 5 ),
119
- child: Text (zulipLocalizations.pollWidgetOptionsMissing,
120
- style: textStyleVoterNames.copyWith (fontStyle: FontStyle .italic))),
121
- for (final option in widget.poll.options)
122
- buildOptionItem (option),
123
- ]);
121
+ // `verticalPadding` out of 6 logical pixels
122
+ // come from the first option row.
123
+ padding: const EdgeInsets .only (bottom: 6 - verticalPadding),
124
+ child: question),
125
+ if (widget.poll.options.isEmpty)
126
+ Padding (
127
+ // This is consistent with the option rows' padding.
128
+ padding: const EdgeInsets .symmetric (vertical: verticalPadding),
129
+ child: Text (zulipLocalizations.pollWidgetOptionsMissing,
130
+ style: textStyleVoterNames.copyWith (fontStyle: FontStyle .italic))),
131
+ for (final option in widget.poll.options)
132
+ buildOptionItem (option),
133
+ ]));
124
134
}
125
135
}
0 commit comments