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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user