@@ -132,6 +132,7 @@ class ButtonStyle with Diagnosticable {
132132 this .minimumSize,
133133 this .fixedSize,
134134 this .maximumSize,
135+ this .iconSize,
135136 this .side,
136137 this .shape,
137138 this .mouseCursor,
@@ -210,6 +211,9 @@ class ButtonStyle with Diagnosticable {
210211 /// This value must be greater than or equal to [minimumSize] .
211212 final MaterialStateProperty <Size ?>? maximumSize;
212213
214+ /// The icon's size inside of the button.
215+ final MaterialStateProperty <double ?>? iconSize;
216+
213217 /// The color and weight of the button's outline.
214218 ///
215219 /// This value is combined with [shape] to create a shape decorated
@@ -300,6 +304,7 @@ class ButtonStyle with Diagnosticable {
300304 MaterialStateProperty <Size ?>? minimumSize,
301305 MaterialStateProperty <Size ?>? fixedSize,
302306 MaterialStateProperty <Size ?>? maximumSize,
307+ MaterialStateProperty <double ?>? iconSize,
303308 MaterialStateProperty <BorderSide ?>? side,
304309 MaterialStateProperty <OutlinedBorder ?>? shape,
305310 MaterialStateProperty <MouseCursor ?>? mouseCursor,
@@ -322,6 +327,7 @@ class ButtonStyle with Diagnosticable {
322327 minimumSize: minimumSize ?? this .minimumSize,
323328 fixedSize: fixedSize ?? this .fixedSize,
324329 maximumSize: maximumSize ?? this .maximumSize,
330+ iconSize: iconSize ?? this .iconSize,
325331 side: side ?? this .side,
326332 shape: shape ?? this .shape,
327333 mouseCursor: mouseCursor ?? this .mouseCursor,
@@ -355,6 +361,7 @@ class ButtonStyle with Diagnosticable {
355361 minimumSize: minimumSize ?? style.minimumSize,
356362 fixedSize: fixedSize ?? style.fixedSize,
357363 maximumSize: maximumSize ?? style.maximumSize,
364+ iconSize: iconSize ?? style.iconSize,
358365 side: side ?? style.side,
359366 shape: shape ?? style.shape,
360367 mouseCursor: mouseCursor ?? style.mouseCursor,
@@ -368,28 +375,32 @@ class ButtonStyle with Diagnosticable {
368375 }
369376
370377 @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+ }
393404
394405 @override
395406 bool operator == (Object other) {
@@ -411,6 +422,7 @@ class ButtonStyle with Diagnosticable {
411422 && other.minimumSize == minimumSize
412423 && other.fixedSize == fixedSize
413424 && other.maximumSize == maximumSize
425+ && other.iconSize == iconSize
414426 && other.side == side
415427 && other.shape == shape
416428 && other.mouseCursor == mouseCursor
@@ -436,6 +448,7 @@ class ButtonStyle with Diagnosticable {
436448 properties.add (DiagnosticsProperty <MaterialStateProperty <Size ?>>('minimumSize' , minimumSize, defaultValue: null ));
437449 properties.add (DiagnosticsProperty <MaterialStateProperty <Size ?>>('fixedSize' , fixedSize, defaultValue: null ));
438450 properties.add (DiagnosticsProperty <MaterialStateProperty <Size ?>>('maximumSize' , maximumSize, defaultValue: null ));
451+ properties.add (DiagnosticsProperty <MaterialStateProperty <double ?>>('iconSize' , iconSize, defaultValue: null ));
439452 properties.add (DiagnosticsProperty <MaterialStateProperty <BorderSide ?>>('side' , side, defaultValue: null ));
440453 properties.add (DiagnosticsProperty <MaterialStateProperty <OutlinedBorder ?>>('shape' , shape, defaultValue: null ));
441454 properties.add (DiagnosticsProperty <MaterialStateProperty <MouseCursor ?>>('mouseCursor' , mouseCursor, defaultValue: null ));
@@ -464,6 +477,7 @@ class ButtonStyle with Diagnosticable {
464477 minimumSize: _lerpProperties <Size ?>(a? .minimumSize, b? .minimumSize, t, Size .lerp),
465478 fixedSize: _lerpProperties <Size ?>(a? .fixedSize, b? .fixedSize, t, Size .lerp),
466479 maximumSize: _lerpProperties <Size ?>(a? .maximumSize, b? .maximumSize, t, Size .lerp),
480+ iconSize: _lerpProperties <double ?>(a? .iconSize, b? .iconSize, t, lerpDouble),
467481 side: _lerpSides (a? .side, b? .side, t),
468482 shape: MaterialStateProperty .lerp <OutlinedBorder ?>(a? .shape, b? .shape, t, OutlinedBorder .lerp),
469483 mouseCursor: t < 0.5 ? a? .mouseCursor : b? .mouseCursor,
0 commit comments