Skip to content

Conversation

ValentinVignal
Copy link
Contributor

Another batch of files migrated to use WidgetStateProperty

Follow up of #174176

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Aug 22, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request continues the migration from MaterialStateProperty to WidgetStateProperty across various files. The changes are mostly correct and align with the goal of the PR. I've added a few suggestions to also replace the deprecated MaterialStatePropertyAll with its successor WidgetStatePropertyAll for consistency. This will help complete the migration in the touched files.

@@ -229,18 +229,18 @@ class TextButton extends ButtonStyleButton {
ButtonLayerBuilder? backgroundBuilder,
ButtonLayerBuilder? foregroundBuilder,
}) {
final MaterialStateProperty<Color?>? backgroundColorProp = switch ((
final WidgetStateProperty<Color?>? backgroundColorProp = switch ((
backgroundColor,
disabledBackgroundColor,
)) {
(_?, null) => MaterialStatePropertyAll<Color?>(backgroundColor),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While migrating to WidgetStateProperty, it's a good practice to also replace the deprecated MaterialStatePropertyAll with WidgetStatePropertyAll for consistency.

      (_?, null) => WidgetStatePropertyAll<Color?>(backgroundColor),

backgroundColor,
disabledBackgroundColor,
)) {
(_?, null) => MaterialStatePropertyAll<Color?>(backgroundColor),
(_, _) => ButtonStyleButton.defaultColor(backgroundColor, disabledBackgroundColor),
};
final MaterialStateProperty<Color?>? iconColorProp = switch ((iconColor, disabledIconColor)) {
final WidgetStateProperty<Color?>? iconColorProp = switch ((iconColor, disabledIconColor)) {
(_?, null) => MaterialStatePropertyAll<Color?>(iconColor),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the migration to WidgetStateProperty, please use WidgetStatePropertyAll instead of the deprecated MaterialStatePropertyAll.

      (_?, null) => WidgetStatePropertyAll<Color?>(iconColor),

Comment on lines 113 to 146
const WidgetStateProperty<TextStyle> textStyle = MaterialStatePropertyAll<TextStyle>(
TextStyle(fontSize: 10),
);
const MaterialStateProperty<Color> backgroundColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> backgroundColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff1),
);
const MaterialStateProperty<Color> foregroundColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> foregroundColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff2),
);
const MaterialStateProperty<Color> overlayColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> overlayColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff3),
);
const MaterialStateProperty<Color> shadowColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> shadowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff4),
);
const MaterialStateProperty<Color> surfaceTintColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> surfaceTintColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff5),
);
const MaterialStateProperty<double> elevation = MaterialStatePropertyAll<double>(1);
const MaterialStateProperty<EdgeInsets> padding = MaterialStatePropertyAll<EdgeInsets>(
const WidgetStateProperty<double> elevation = MaterialStatePropertyAll<double>(1);
const WidgetStateProperty<EdgeInsets> padding = MaterialStatePropertyAll<EdgeInsets>(
EdgeInsets.all(1),
);
const MaterialStateProperty<Size> minimumSize = MaterialStatePropertyAll<Size>(Size(1, 2));
const MaterialStateProperty<Size> fixedSize = MaterialStatePropertyAll<Size>(Size(3, 4));
const MaterialStateProperty<Size> maximumSize = MaterialStatePropertyAll<Size>(Size(5, 6));
const MaterialStateProperty<Color> iconColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Size> minimumSize = MaterialStatePropertyAll<Size>(Size(1, 2));
const WidgetStateProperty<Size> fixedSize = MaterialStatePropertyAll<Size>(Size(3, 4));
const WidgetStateProperty<Size> maximumSize = MaterialStatePropertyAll<Size>(Size(5, 6));
const WidgetStateProperty<Color> iconColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff6),
);
const MaterialStateProperty<double> iconSize = MaterialStatePropertyAll<double>(48.0);
const MaterialStateProperty<BorderSide> side = MaterialStatePropertyAll<BorderSide>(
const WidgetStateProperty<double> iconSize = MaterialStatePropertyAll<double>(48.0);
const WidgetStateProperty<BorderSide> side = MaterialStatePropertyAll<BorderSide>(
BorderSide(),
);
const MaterialStateProperty<OutlinedBorder> shape = MaterialStatePropertyAll<OutlinedBorder>(
const WidgetStateProperty<OutlinedBorder> shape = MaterialStatePropertyAll<OutlinedBorder>(
StadiumBorder(),
);
const MaterialStateProperty<MouseCursor> mouseCursor = MaterialStatePropertyAll<MouseCursor>(
const WidgetStateProperty<MouseCursor> mouseCursor = MaterialStatePropertyAll<MouseCursor>(
SystemMouseCursors.forbidden,
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

As part of the migration to WidgetStateProperty, please also replace the deprecated MaterialStatePropertyAll with WidgetStatePropertyAll for consistency.

    const WidgetStateProperty<TextStyle> textStyle = WidgetStatePropertyAll<TextStyle>(
      TextStyle(fontSize: 10),
    );
    const WidgetStateProperty<Color> backgroundColor = WidgetStatePropertyAll<Color>(
      Color(0xfffffff1),
    );
    const WidgetStateProperty<Color> foregroundColor = WidgetStatePropertyAll<Color>(
      Color(0xfffffff2),
    );
    const WidgetStateProperty<Color> overlayColor = WidgetStatePropertyAll<Color>(
      Color(0xfffffff3),
    );
    const WidgetStateProperty<Color> shadowColor = WidgetStatePropertyAll<Color>(
      Color(0xfffffff4),
    );
    const WidgetStateProperty<Color> surfaceTintColor = WidgetStatePropertyAll<Color>(
      Color(0xfffffff5),
    );
    const WidgetStateProperty<double> elevation = WidgetStatePropertyAll<double>(1);
    const WidgetStateProperty<EdgeInsets> padding = WidgetStatePropertyAll<EdgeInsets>(
      EdgeInsets.all(1),
    );
    const WidgetStateProperty<Size> minimumSize = WidgetStatePropertyAll<Size>(Size(1, 2));
    const WidgetStateProperty<Size> fixedSize = WidgetStatePropertyAll<Size>(Size(3, 4));
    const WidgetStateProperty<Size> maximumSize = WidgetStatePropertyAll<Size>(Size(5, 6));
    const WidgetStateProperty<Color> iconColor = WidgetStatePropertyAll<Color>(
      Color(0xfffffff6),
    );
    const WidgetStateProperty<double> iconSize = WidgetStatePropertyAll<double>(48.0);
    const WidgetStateProperty<BorderSide> side = WidgetStatePropertyAll<BorderSide>(
      BorderSide(),
    );
    const WidgetStateProperty<OutlinedBorder> shape = WidgetStatePropertyAll<OutlinedBorder>(
      StadiumBorder(),
    );
    const WidgetStateProperty<MouseCursor> mouseCursor = WidgetStatePropertyAll<MouseCursor>(
      SystemMouseCursors.forbidden,
    );

Comment on lines +131 to 148
const WidgetStateProperty<Color> dataRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double minMaxDataRowHeight = 41.0;
const TextStyle dataTextStyle = TextStyle(fontSize: 12.5);
const MaterialStateProperty<Color> headingRowColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> headingRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff2),
);
const double headingRowHeight = 52.0;
const TextStyle headingTextStyle = TextStyle(fontSize: 14.5);
const double horizontalMargin = 3.0;
const double columnSpacing = 4.0;
const double dividerThickness = 5.0;
const MaterialStateProperty<MouseCursor> headingCellCursor =
const WidgetStateProperty<MouseCursor> headingCellCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.grab);
const MaterialStateProperty<MouseCursor> dataRowCursor = MaterialStatePropertyAll<MouseCursor>(
const WidgetStateProperty<MouseCursor> dataRowCursor = MaterialStatePropertyAll<MouseCursor>(
SystemMouseCursors.forbidden,
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the migration to WidgetStateProperty, please also replace the deprecated MaterialStatePropertyAll with WidgetStatePropertyAll.

Suggested change
const WidgetStateProperty<Color> dataRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double minMaxDataRowHeight = 41.0;
const TextStyle dataTextStyle = TextStyle(fontSize: 12.5);
const MaterialStateProperty<Color> headingRowColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> headingRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff2),
);
const double headingRowHeight = 52.0;
const TextStyle headingTextStyle = TextStyle(fontSize: 14.5);
const double horizontalMargin = 3.0;
const double columnSpacing = 4.0;
const double dividerThickness = 5.0;
const MaterialStateProperty<MouseCursor> headingCellCursor =
const WidgetStateProperty<MouseCursor> headingCellCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.grab);
const MaterialStateProperty<MouseCursor> dataRowCursor = MaterialStatePropertyAll<MouseCursor>(
const WidgetStateProperty<MouseCursor> dataRowCursor = MaterialStatePropertyAll<MouseCursor>(
SystemMouseCursors.forbidden,
);
const WidgetStateProperty<Color> dataRowColor = WidgetStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double minMaxDataRowHeight = 41.0;
const TextStyle dataTextStyle = TextStyle(fontSize: 12.5);
const WidgetStateProperty<Color> headingRowColor = WidgetStatePropertyAll<Color>(
Color(0xfffffff2),
);
const double headingRowHeight = 52.0;
const TextStyle headingTextStyle = TextStyle(fontSize: 14.5);
const double horizontalMargin = 3.0;
const double columnSpacing = 4.0;
const double dividerThickness = 5.0;
const WidgetStateProperty<MouseCursor> headingCellCursor =
WidgetStatePropertyAll<MouseCursor>(SystemMouseCursors.grab);
const WidgetStateProperty<MouseCursor> dataRowCursor = WidgetStatePropertyAll<MouseCursor>(
SystemMouseCursors.forbidden,
);

Comment on lines +272 to 288
const WidgetStateProperty<Color> themeDataRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff0),
);
const double minMaxThemeDataRowHeight = 50.0;
const TextStyle themeDataTextStyle = TextStyle(fontSize: 11.5);
const MaterialStateProperty<Color> themeHeadingRowColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> themeHeadingRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double themeHeadingRowHeight = 51.0;
const TextStyle themeHeadingTextStyle = TextStyle(fontSize: 13.5);
const double themeHorizontalMargin = 2.0;
const double themeColumnSpacing = 3.0;
const double themeDividerThickness = 4.0;
const MaterialStateProperty<MouseCursor> themeHeadingCellCursor =
const WidgetStateProperty<MouseCursor> themeHeadingCellCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.copy);
const MaterialStateProperty<MouseCursor> themeDataRowCursor =
const WidgetStateProperty<MouseCursor> themeDataRowCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.copy);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the migration to WidgetStateProperty, please also replace the deprecated MaterialStatePropertyAll with WidgetStatePropertyAll.

Suggested change
const WidgetStateProperty<Color> themeDataRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff0),
);
const double minMaxThemeDataRowHeight = 50.0;
const TextStyle themeDataTextStyle = TextStyle(fontSize: 11.5);
const MaterialStateProperty<Color> themeHeadingRowColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> themeHeadingRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double themeHeadingRowHeight = 51.0;
const TextStyle themeHeadingTextStyle = TextStyle(fontSize: 13.5);
const double themeHorizontalMargin = 2.0;
const double themeColumnSpacing = 3.0;
const double themeDividerThickness = 4.0;
const MaterialStateProperty<MouseCursor> themeHeadingCellCursor =
const WidgetStateProperty<MouseCursor> themeHeadingCellCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.copy);
const MaterialStateProperty<MouseCursor> themeDataRowCursor =
const WidgetStateProperty<MouseCursor> themeDataRowCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.copy);
const WidgetStateProperty<Color> themeDataRowColor = WidgetStatePropertyAll<Color>(
Color(0xfffffff0),
);
const double minMaxThemeDataRowHeight = 50.0;
const TextStyle themeDataTextStyle = TextStyle(fontSize: 11.5);
const WidgetStateProperty<Color> themeHeadingRowColor = WidgetStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double themeHeadingRowHeight = 51.0;
const TextStyle themeHeadingTextStyle = TextStyle(fontSize: 13.5);
const double themeHorizontalMargin = 2.0;
const double themeColumnSpacing = 3.0;
const double themeDividerThickness = 4.0;
const WidgetStateProperty<MouseCursor> themeHeadingCellCursor =
WidgetStatePropertyAll<MouseCursor>(SystemMouseCursors.copy);
const WidgetStateProperty<MouseCursor> themeDataRowCursor =
WidgetStatePropertyAll<MouseCursor>(SystemMouseCursors.copy);

Comment on lines +291 to 308
const WidgetStateProperty<Color> dataRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double minMaxDataRowHeight = 51.0;
const TextStyle dataTextStyle = TextStyle(fontSize: 12.5);
const MaterialStateProperty<Color> headingRowColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> headingRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff2),
);
const double headingRowHeight = 52.0;
const TextStyle headingTextStyle = TextStyle(fontSize: 14.5);
const double horizontalMargin = 3.0;
const double columnSpacing = 4.0;
const double dividerThickness = 5.0;
const MaterialStateProperty<MouseCursor> headingCellCursor =
const WidgetStateProperty<MouseCursor> headingCellCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.forbidden);
const MaterialStateProperty<MouseCursor> dataRowCursor = MaterialStatePropertyAll<MouseCursor>(
const WidgetStateProperty<MouseCursor> dataRowCursor = MaterialStatePropertyAll<MouseCursor>(
SystemMouseCursors.forbidden,
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the migration to WidgetStateProperty, please also replace the deprecated MaterialStatePropertyAll with WidgetStatePropertyAll.

Suggested change
const WidgetStateProperty<Color> dataRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double minMaxDataRowHeight = 51.0;
const TextStyle dataTextStyle = TextStyle(fontSize: 12.5);
const MaterialStateProperty<Color> headingRowColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> headingRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff2),
);
const double headingRowHeight = 52.0;
const TextStyle headingTextStyle = TextStyle(fontSize: 14.5);
const double horizontalMargin = 3.0;
const double columnSpacing = 4.0;
const double dividerThickness = 5.0;
const MaterialStateProperty<MouseCursor> headingCellCursor =
const WidgetStateProperty<MouseCursor> headingCellCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.forbidden);
const MaterialStateProperty<MouseCursor> dataRowCursor = MaterialStatePropertyAll<MouseCursor>(
const WidgetStateProperty<MouseCursor> dataRowCursor = MaterialStatePropertyAll<MouseCursor>(
SystemMouseCursors.forbidden,
);
const WidgetStateProperty<Color> dataRowColor = WidgetStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double minMaxDataRowHeight = 51.0;
const TextStyle dataTextStyle = TextStyle(fontSize: 12.5);
const WidgetStateProperty<Color> headingRowColor = WidgetStatePropertyAll<Color>(
Color(0xfffffff2),
);
const double headingRowHeight = 52.0;
const TextStyle headingTextStyle = TextStyle(fontSize: 14.5);
const double horizontalMargin = 3.0;
const double columnSpacing = 4.0;
const double dividerThickness = 5.0;
const WidgetStateProperty<MouseCursor> headingCellCursor =
WidgetStatePropertyAll<MouseCursor>(SystemMouseCursors.forbidden);
const WidgetStateProperty<MouseCursor> dataRowCursor = WidgetStatePropertyAll<MouseCursor>(
SystemMouseCursors.forbidden,
);

Comment on lines +455 to 471
const WidgetStateProperty<Color> globalThemeDataRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff0),
);
const double minMaxGlobalThemeDataRowHeight = 50.0;
const TextStyle globalThemeDataTextStyle = TextStyle(fontSize: 11.5);
const MaterialStateProperty<Color> globalThemeHeadingRowColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> globalThemeHeadingRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double globalThemeHeadingRowHeight = 51.0;
const TextStyle globalThemeHeadingTextStyle = TextStyle(fontSize: 13.5);
const double globalThemeHorizontalMargin = 2.0;
const double globalThemeColumnSpacing = 3.0;
const double globalThemeDividerThickness = 4.0;
const MaterialStateProperty<MouseCursor> globalHeadingCellCursor =
const WidgetStateProperty<MouseCursor> globalHeadingCellCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.allScroll);
const MaterialStateProperty<MouseCursor> globalDataRowCursor =
const WidgetStateProperty<MouseCursor> globalDataRowCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.allScroll);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the migration to WidgetStateProperty, please also replace the deprecated MaterialStatePropertyAll with WidgetStatePropertyAll.

Suggested change
const WidgetStateProperty<Color> globalThemeDataRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff0),
);
const double minMaxGlobalThemeDataRowHeight = 50.0;
const TextStyle globalThemeDataTextStyle = TextStyle(fontSize: 11.5);
const MaterialStateProperty<Color> globalThemeHeadingRowColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> globalThemeHeadingRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double globalThemeHeadingRowHeight = 51.0;
const TextStyle globalThemeHeadingTextStyle = TextStyle(fontSize: 13.5);
const double globalThemeHorizontalMargin = 2.0;
const double globalThemeColumnSpacing = 3.0;
const double globalThemeDividerThickness = 4.0;
const MaterialStateProperty<MouseCursor> globalHeadingCellCursor =
const WidgetStateProperty<MouseCursor> globalHeadingCellCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.allScroll);
const MaterialStateProperty<MouseCursor> globalDataRowCursor =
const WidgetStateProperty<MouseCursor> globalDataRowCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.allScroll);
const WidgetStateProperty<Color> globalThemeDataRowColor = WidgetStatePropertyAll<Color>(
Color(0xfffffff0),
);
const double minMaxGlobalThemeDataRowHeight = 50.0;
const TextStyle globalThemeDataTextStyle = TextStyle(fontSize: 11.5);
const WidgetStateProperty<Color> globalThemeHeadingRowColor = WidgetStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double globalThemeHeadingRowHeight = 51.0;
const TextStyle globalThemeHeadingTextStyle = TextStyle(fontSize: 13.5);
const double globalThemeHorizontalMargin = 2.0;
const double globalThemeColumnSpacing = 3.0;
const double globalThemeDividerThickness = 4.0;
const WidgetStateProperty<MouseCursor> globalHeadingCellCursor =
WidgetStatePropertyAll<MouseCursor>(SystemMouseCursors.allScroll);
const WidgetStateProperty<MouseCursor> globalDataRowCursor =
WidgetStatePropertyAll<MouseCursor>(SystemMouseCursors.allScroll);

Comment on lines +474 to 490
const WidgetStateProperty<Color> localThemeDataRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double minMaxLocalThemeDataRowHeight = 51.0;
const TextStyle localThemeDataTextStyle = TextStyle(fontSize: 12.5);
const MaterialStateProperty<Color> localThemeHeadingRowColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> localThemeHeadingRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff2),
);
const double localThemeHeadingRowHeight = 52.0;
const TextStyle localThemeHeadingTextStyle = TextStyle(fontSize: 14.5);
const double localThemeHorizontalMargin = 3.0;
const double localThemeColumnSpacing = 4.0;
const double localThemeDividerThickness = 5.0;
const MaterialStateProperty<MouseCursor> localHeadingCellCursor =
const WidgetStateProperty<MouseCursor> localHeadingCellCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.move);
const MaterialStateProperty<MouseCursor> localDataRowCursor =
const WidgetStateProperty<MouseCursor> localDataRowCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.move);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the migration to WidgetStateProperty, please also replace the deprecated MaterialStatePropertyAll with WidgetStatePropertyAll.

Suggested change
const WidgetStateProperty<Color> localThemeDataRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double minMaxLocalThemeDataRowHeight = 51.0;
const TextStyle localThemeDataTextStyle = TextStyle(fontSize: 12.5);
const MaterialStateProperty<Color> localThemeHeadingRowColor = MaterialStatePropertyAll<Color>(
const WidgetStateProperty<Color> localThemeHeadingRowColor = MaterialStatePropertyAll<Color>(
Color(0xfffffff2),
);
const double localThemeHeadingRowHeight = 52.0;
const TextStyle localThemeHeadingTextStyle = TextStyle(fontSize: 14.5);
const double localThemeHorizontalMargin = 3.0;
const double localThemeColumnSpacing = 4.0;
const double localThemeDividerThickness = 5.0;
const MaterialStateProperty<MouseCursor> localHeadingCellCursor =
const WidgetStateProperty<MouseCursor> localHeadingCellCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.move);
const MaterialStateProperty<MouseCursor> localDataRowCursor =
const WidgetStateProperty<MouseCursor> localDataRowCursor =
MaterialStatePropertyAll<MouseCursor>(SystemMouseCursors.move);
const WidgetStateProperty<Color> localThemeDataRowColor = WidgetStatePropertyAll<Color>(
Color(0xfffffff1),
);
const double minMaxLocalThemeDataRowHeight = 51.0;
const TextStyle localThemeDataTextStyle = TextStyle(fontSize: 12.5);
const WidgetStateProperty<Color> localThemeHeadingRowColor = WidgetStatePropertyAll<Color>(
Color(0xfffffff2),
);
const double localThemeHeadingRowHeight = 52.0;
const TextStyle localThemeHeadingTextStyle = TextStyle(fontSize: 14.5);
const double localThemeHorizontalMargin = 3.0;
const double localThemeColumnSpacing = 4.0;
const double localThemeDividerThickness = 5.0;
const WidgetStateProperty<MouseCursor> localHeadingCellCursor =
WidgetStatePropertyAll<MouseCursor>(SystemMouseCursors.move);
const WidgetStateProperty<MouseCursor> localDataRowCursor =
WidgetStatePropertyAll<MouseCursor>(SystemMouseCursors.move);

@ValentinVignal
Copy link
Contributor Author

ValentinVignal commented Aug 22, 2025

About gemini's comments, packages/flutter/lib/src/material/material_state.dart contains a bunch of deprecated elements (ex: MaterialState, MaterialPropertyResolver, MaterialStateColor, WidgetStatePropertyAll etc)

I was planning to tackle them 1 by 1. Right now, I'm working on MaterialStateProperty, later I'll move on to MaterialState or WidgetStatePropertyAll .

What do you think about that plan?

@ValentinVignal ValentinVignal force-pushed the flutter/Migrate-to-widget-state-property/3 branch from 7e4466c to 3f3a26a Compare August 22, 2025 15:19
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 . I'm on board with your plan, so you can ignore Gemini's comments for now. Thanks for doing all of this migration!

@ValentinVignal ValentinVignal added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 22, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Aug 22, 2025
Merged via the queue into flutter:master with commit f0f208d Aug 22, 2025
77 of 78 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 22, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 23, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 23, 2025
flutter/flutter@26bb33b...edd434a

2025-08-23 engine-flutter-autoroll@skia.org Roll Skia from 6f710e0b38f7 to 61169c1f6f7c (1 revision) (flutter/flutter#174325)
2025-08-23 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from Z-ZaFQ7jAqJ1OrIBf... to XLSNQCsY1VkIthSjt... (flutter/flutter#174318)
2025-08-23 engine-flutter-autoroll@skia.org Roll Skia from ebb6051e8bb1 to 6f710e0b38f7 (1 revision) (flutter/flutter#174317)
2025-08-22 1961493+harryterkelsen@users.noreply.github.com [web] Expose rasterizers in Renderer (flutter/flutter#174308)
2025-08-22 jhy03261997@gmail.com Update some semantics flags updated to use enum (engine, framework, web) (flutter/flutter#170696)
2025-08-22 bkonyi@google.com [ Tool ] Don't emit artifact downloading messages when --machine is provided (flutter/flutter#174301)
2025-08-22 engine-flutter-autoroll@skia.org Roll Skia from cb15e1452399 to ebb6051e8bb1 (5 revisions) (flutter/flutter#174296)
2025-08-22 matanlurey@users.noreply.github.com `_downloadArtifacts` (Web SDK) uses content-aware hashing in post-submit (flutter/flutter#174236)
2025-08-22 jacksongardner@google.com Refactor text and runtime effect to separate skia and impeller implementations. (flutter/flutter#174219)
2025-08-22 engine-flutter-autoroll@skia.org Roll Packages from 58c02e0 to 092d832 (4 revisions) (flutter/flutter#174295)
2025-08-22 bkonyi@google.com [ Widget Preview ] Add support for DevTools configuration (flutter/flutter#174272)
2025-08-22 32538273+ValentinVignal@users.noreply.github.com Migrate more files to `WidgetStateProperty` (flutter/flutter#174268)
2025-08-22 bkonyi@google.com [ Tool ] Ensure `--dds-port=<port>` is respected when targeting web devices (flutter/flutter#174278)
2025-08-22 fluttergithubbot@gmail.com Marks Mac_ios ios_debug_workflow to be unflaky (flutter/flutter#174104)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
github-merge-queue bot pushed a commit that referenced this pull request Aug 26, 2025
Follow up of #174268

Final PR to migrate the usages of `MaterialStateProperty` to
`WidgetStateProperty`

I'll work on the other elements of
`packages/flutter/lib/src/material/material_state.dart` into other PRs

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants