@@ -163,8 +163,20 @@ class CheckboxListTile extends StatelessWidget {
163
163
super .key,
164
164
required this .value,
165
165
required this .onChanged,
166
+ this .mouseCursor,
166
167
this .activeColor,
168
+ this .fillColor,
167
169
this .checkColor,
170
+ this .hoverColor,
171
+ this .overlayColor,
172
+ this .splashRadius,
173
+ this .materialTapTargetSize,
174
+ this .visualDensity,
175
+ this .focusNode,
176
+ this .autofocus = false ,
177
+ this .shape,
178
+ this .side,
179
+ this .isError = false ,
168
180
this .enabled,
169
181
this .tileColor,
170
182
this .title,
@@ -174,15 +186,10 @@ class CheckboxListTile extends StatelessWidget {
174
186
this .secondary,
175
187
this .selected = false ,
176
188
this .controlAffinity = ListTileControlAffinity .platform,
177
- this .autofocus = false ,
178
189
this .contentPadding,
179
190
this .tristate = false ,
180
- this .shape,
181
191
this .checkboxShape,
182
192
this .selectedTileColor,
183
- this .side,
184
- this .visualDensity,
185
- this .focusNode,
186
193
this .onFocusChange,
187
194
this .enableFeedback,
188
195
}) : assert (tristate || value != null ),
@@ -219,16 +226,98 @@ class CheckboxListTile extends StatelessWidget {
219
226
/// {@end-tool}
220
227
final ValueChanged <bool ?>? onChanged;
221
228
229
+ /// The cursor for a mouse pointer when it enters or is hovering over the
230
+ /// widget.
231
+ ///
232
+ /// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>] ,
233
+ /// [MaterialStateProperty.resolve] is used for the following [MaterialState] s:
234
+ ///
235
+ /// * [MaterialState.selected] .
236
+ /// * [MaterialState.hovered] .
237
+ /// * [MaterialState.disabled] .
238
+ ///
239
+ /// If null, then the value of [CheckboxThemeData.mouseCursor] is used. If
240
+ /// that is also null, then [MaterialStateMouseCursor.clickable] is used.
241
+ final MouseCursor ? mouseCursor;
242
+
222
243
/// The color to use when this checkbox is checked.
223
244
///
224
245
/// Defaults to [ColorScheme.secondary] of the current [Theme] .
225
246
final Color ? activeColor;
226
247
248
+ /// The color that fills the checkbox.
249
+ ///
250
+ /// Resolves in the following states:
251
+ /// * [MaterialState.selected] .
252
+ /// * [MaterialState.hovered] .
253
+ /// * [MaterialState.disabled] .
254
+ ///
255
+ /// If null, then the value of [activeColor] is used in the selected
256
+ /// state. If that is also null, the value of [CheckboxThemeData.fillColor]
257
+ /// is used. If that is also null, then the default value is used.
258
+ final MaterialStateProperty <Color ?>? fillColor;
259
+
227
260
/// The color to use for the check icon when this checkbox is checked.
228
261
///
229
262
/// Defaults to Color(0xFFFFFFFF).
230
263
final Color ? checkColor;
231
264
265
+ /// {@macro flutter.material.checkbox.hoverColor}
266
+ final Color ? hoverColor;
267
+
268
+ /// The color for the checkbox's [Material] .
269
+ ///
270
+ /// Resolves in the following states:
271
+ /// * [MaterialState.pressed] .
272
+ /// * [MaterialState.selected] .
273
+ /// * [MaterialState.hovered] .
274
+ ///
275
+ /// If null, then the value of [activeColor] with alpha [kRadialReactionAlpha]
276
+ /// and [hoverColor] is used in the pressed and hovered state. If that is also null,
277
+ /// the value of [CheckboxThemeData.overlayColor] is used. If that is also null,
278
+ /// then the the default value is used in the pressed and hovered state.
279
+ final MaterialStateProperty <Color ?>? overlayColor;
280
+
281
+ /// {@macro flutter.material.checkbox.splashRadius}
282
+ ///
283
+ /// If null, then the value of [CheckboxThemeData.splashRadius] is used. If
284
+ /// that is also null, then [kRadialReactionRadius] is used.
285
+ final double ? splashRadius;
286
+
287
+ /// {@macro flutter.material.checkbox.materialTapTargetSize}
288
+ ///
289
+ /// Defaults to [MaterialTapTargetSize.shrinkWrap] .
290
+ final MaterialTapTargetSize ? materialTapTargetSize;
291
+
292
+ /// Defines how compact the list tile's layout will be.
293
+ ///
294
+ /// {@macro flutter.material.themedata.visualDensity}
295
+ final VisualDensity ? visualDensity;
296
+
297
+
298
+ /// {@macro flutter.widgets.Focus.focusNode}
299
+ final FocusNode ? focusNode;
300
+
301
+ /// {@macro flutter.widgets.Focus.autofocus}
302
+ final bool autofocus;
303
+
304
+ /// {@macro flutter.material.ListTile.shape}
305
+ final ShapeBorder ? shape;
306
+
307
+ /// {@macro flutter.material.checkbox.side}
308
+ ///
309
+ /// The given value is passed directly to [Checkbox.side] .
310
+ ///
311
+ /// If this property is null, then [CheckboxThemeData.side] of
312
+ /// [ThemeData.checkboxTheme] is used. If that is also null, then the side
313
+ /// will be width 2.
314
+ final BorderSide ? side;
315
+
316
+ /// {@macro flutter.material.checkbox.isError}
317
+ ///
318
+ /// Defaults to false.
319
+ final bool isError;
320
+
232
321
/// {@macro flutter.material.ListTile.tileColor}
233
322
final Color ? tileColor;
234
323
@@ -270,9 +359,6 @@ class CheckboxListTile extends StatelessWidget {
270
359
/// Where to place the control relative to the text.
271
360
final ListTileControlAffinity controlAffinity;
272
361
273
- /// {@macro flutter.widgets.Focus.autofocus}
274
- final bool autofocus;
275
-
276
362
/// Defines insets surrounding the tile's contents.
277
363
///
278
364
/// This value will surround the [Checkbox] , [title] , [subtitle] , and [secondary]
@@ -293,9 +379,6 @@ class CheckboxListTile extends StatelessWidget {
293
379
/// If tristate is false (the default), [value] must not be null.
294
380
final bool tristate;
295
381
296
- /// {@macro flutter.material.ListTile.shape}
297
- final ShapeBorder ? shape;
298
-
299
382
/// {@macro flutter.material.checkbox.shape}
300
383
///
301
384
/// If this property is null then [CheckboxThemeData.shape] of [ThemeData.checkboxTheme]
@@ -306,23 +389,6 @@ class CheckboxListTile extends StatelessWidget {
306
389
/// If non-null, defines the background color when [CheckboxListTile.selected] is true.
307
390
final Color ? selectedTileColor;
308
391
309
- /// {@macro flutter.material.checkbox.side}
310
- ///
311
- /// The given value is passed directly to [Checkbox.side] .
312
- ///
313
- /// If this property is null, then [CheckboxThemeData.side] of
314
- /// [ThemeData.checkboxTheme] is used. If that is also null, then the side
315
- /// will be width 2.
316
- final BorderSide ? side;
317
-
318
- /// Defines how compact the list tile's layout will be.
319
- ///
320
- /// {@macro flutter.material.themedata.visualDensity}
321
- final VisualDensity ? visualDensity;
322
-
323
- /// {@macro flutter.widgets.Focus.focusNode}
324
- final FocusNode ? focusNode;
325
-
326
392
/// {@macro flutter.material.inkwell.onFocusChange}
327
393
final ValueChanged <bool >? onFocusChange;
328
394
@@ -359,14 +425,20 @@ class CheckboxListTile extends StatelessWidget {
359
425
Widget build (BuildContext context) {
360
426
final Widget control = Checkbox (
361
427
value: value,
362
- onChanged: enabled ?? true ? onChanged : null ,
428
+ onChanged: enabled ?? true ? onChanged : null ,
429
+ mouseCursor: mouseCursor,
363
430
activeColor: activeColor,
431
+ fillColor: fillColor,
364
432
checkColor: checkColor,
365
- materialTapTargetSize: MaterialTapTargetSize .shrinkWrap,
433
+ hoverColor: hoverColor,
434
+ overlayColor: overlayColor,
435
+ splashRadius: splashRadius,
436
+ materialTapTargetSize: materialTapTargetSize ?? MaterialTapTargetSize .shrinkWrap,
366
437
autofocus: autofocus,
367
438
tristate: tristate,
368
439
shape: checkboxShape,
369
440
side: side,
441
+ isError: isError,
370
442
);
371
443
Widget ? leading, trailing;
372
444
switch (controlAffinity) {
0 commit comments