@@ -132,6 +132,7 @@ class ButtonStyle with Diagnosticable {
132
132
this .minimumSize,
133
133
this .fixedSize,
134
134
this .maximumSize,
135
+ this .iconSize,
135
136
this .side,
136
137
this .shape,
137
138
this .mouseCursor,
@@ -210,6 +211,9 @@ class ButtonStyle with Diagnosticable {
210
211
/// This value must be greater than or equal to [minimumSize] .
211
212
final MaterialStateProperty <Size ?>? maximumSize;
212
213
214
+ /// The icon's size inside of the button.
215
+ final MaterialStateProperty <double ?>? iconSize;
216
+
213
217
/// The color and weight of the button's outline.
214
218
///
215
219
/// This value is combined with [shape] to create a shape decorated
@@ -300,6 +304,7 @@ class ButtonStyle with Diagnosticable {
300
304
MaterialStateProperty <Size ?>? minimumSize,
301
305
MaterialStateProperty <Size ?>? fixedSize,
302
306
MaterialStateProperty <Size ?>? maximumSize,
307
+ MaterialStateProperty <double ?>? iconSize,
303
308
MaterialStateProperty <BorderSide ?>? side,
304
309
MaterialStateProperty <OutlinedBorder ?>? shape,
305
310
MaterialStateProperty <MouseCursor ?>? mouseCursor,
@@ -322,6 +327,7 @@ class ButtonStyle with Diagnosticable {
322
327
minimumSize: minimumSize ?? this .minimumSize,
323
328
fixedSize: fixedSize ?? this .fixedSize,
324
329
maximumSize: maximumSize ?? this .maximumSize,
330
+ iconSize: iconSize ?? this .iconSize,
325
331
side: side ?? this .side,
326
332
shape: shape ?? this .shape,
327
333
mouseCursor: mouseCursor ?? this .mouseCursor,
@@ -355,6 +361,7 @@ class ButtonStyle with Diagnosticable {
355
361
minimumSize: minimumSize ?? style.minimumSize,
356
362
fixedSize: fixedSize ?? style.fixedSize,
357
363
maximumSize: maximumSize ?? style.maximumSize,
364
+ iconSize: iconSize ?? style.iconSize,
358
365
side: side ?? style.side,
359
366
shape: shape ?? style.shape,
360
367
mouseCursor: mouseCursor ?? style.mouseCursor,
@@ -368,28 +375,32 @@ class ButtonStyle with Diagnosticable {
368
375
}
369
376
370
377
@override
371
- int get hashCode => Object .hash (
372
- textStyle,
373
- backgroundColor,
374
- foregroundColor,
375
- overlayColor,
376
- shadowColor,
377
- surfaceTintColor,
378
- elevation,
379
- padding,
380
- minimumSize,
381
- fixedSize,
382
- maximumSize,
383
- side,
384
- shape,
385
- mouseCursor,
386
- visualDensity,
387
- tapTargetSize,
388
- animationDuration,
389
- enableFeedback,
390
- alignment,
391
- splashFactory,
392
- );
378
+ int get hashCode {
379
+ final List <Object ?> values = < Object ? > [
380
+ textStyle,
381
+ backgroundColor,
382
+ foregroundColor,
383
+ overlayColor,
384
+ shadowColor,
385
+ surfaceTintColor,
386
+ elevation,
387
+ padding,
388
+ minimumSize,
389
+ fixedSize,
390
+ maximumSize,
391
+ iconSize,
392
+ side,
393
+ shape,
394
+ mouseCursor,
395
+ visualDensity,
396
+ tapTargetSize,
397
+ animationDuration,
398
+ enableFeedback,
399
+ alignment,
400
+ splashFactory,
401
+ ];
402
+ return Object .hashAll (values);
403
+ }
393
404
394
405
@override
395
406
bool operator == (Object other) {
@@ -411,6 +422,7 @@ class ButtonStyle with Diagnosticable {
411
422
&& other.minimumSize == minimumSize
412
423
&& other.fixedSize == fixedSize
413
424
&& other.maximumSize == maximumSize
425
+ && other.iconSize == iconSize
414
426
&& other.side == side
415
427
&& other.shape == shape
416
428
&& other.mouseCursor == mouseCursor
@@ -436,6 +448,7 @@ class ButtonStyle with Diagnosticable {
436
448
properties.add (DiagnosticsProperty <MaterialStateProperty <Size ?>>('minimumSize' , minimumSize, defaultValue: null ));
437
449
properties.add (DiagnosticsProperty <MaterialStateProperty <Size ?>>('fixedSize' , fixedSize, defaultValue: null ));
438
450
properties.add (DiagnosticsProperty <MaterialStateProperty <Size ?>>('maximumSize' , maximumSize, defaultValue: null ));
451
+ properties.add (DiagnosticsProperty <MaterialStateProperty <double ?>>('iconSize' , iconSize, defaultValue: null ));
439
452
properties.add (DiagnosticsProperty <MaterialStateProperty <BorderSide ?>>('side' , side, defaultValue: null ));
440
453
properties.add (DiagnosticsProperty <MaterialStateProperty <OutlinedBorder ?>>('shape' , shape, defaultValue: null ));
441
454
properties.add (DiagnosticsProperty <MaterialStateProperty <MouseCursor ?>>('mouseCursor' , mouseCursor, defaultValue: null ));
@@ -464,6 +477,7 @@ class ButtonStyle with Diagnosticable {
464
477
minimumSize: _lerpProperties <Size ?>(a? .minimumSize, b? .minimumSize, t, Size .lerp),
465
478
fixedSize: _lerpProperties <Size ?>(a? .fixedSize, b? .fixedSize, t, Size .lerp),
466
479
maximumSize: _lerpProperties <Size ?>(a? .maximumSize, b? .maximumSize, t, Size .lerp),
480
+ iconSize: _lerpProperties <double ?>(a? .iconSize, b? .iconSize, t, lerpDouble),
467
481
side: _lerpSides (a? .side, b? .side, t),
468
482
shape: MaterialStateProperty .lerp <OutlinedBorder ?>(a? .shape, b? .shape, t, OutlinedBorder .lerp),
469
483
mouseCursor: t < 0.5 ? a? .mouseCursor : b? .mouseCursor,
0 commit comments