Factor out deprecated names in example code (#151374)

This PR contains:
- 3 instances of `colorScheme.background` → `colorScheme.surface`
- and a whole bunch of `MaterialState` → `WidgetState`

As of yet, no changes have been made to example test files or the [examples/api/lib/material/material_state/](0b2a8e589e/examples/api/lib/material/material_state) directory.

(related: #151373)
This commit is contained in:
Nate Wilson
2024-07-08 13:06:54 -06:00
committed by GitHub
parent 0a4f1a7e55
commit b713445298
22 changed files with 80 additions and 80 deletions

View File

@@ -45,9 +45,9 @@ class _DataTableExampleState extends State<DataTableExample> {
rows: List<DataRow>.generate(
numItems,
(int index) => DataRow(
color: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
color: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
// All rows will have the same selected color.
if (states.contains(MaterialState.selected)) {
if (states.contains(WidgetState.selected)) {
return Theme.of(context).colorScheme.primary.withOpacity(0.08);
}
// Even rows will have a grey color.