flutter/examples/api/lib/material/list_tile
Nate Wilson 6ff806d74e
Use .fromMap() constructors in example code (#152535)
Currently, there are 21 `.resolveWith()` calls in example files.

This pull request changes 11 of them to use the new `.fromMap()` constructor. (Seven of them are now `const`!)

```dart
ListTile(
  iconColor: WidgetStateColor.fromMap(<WidgetStatesConstraint, Color>{
    WidgetState.disabled: Colors.red,
    WidgetState.selected: Colors.green,
    WidgetState.any:      Colors.black,
  }),
  // The same can be achieved using the .resolveWith() constructor.
  // The text color will be identical to the icon color above.
  textColor: WidgetStateColor.resolveWith((Set<WidgetState> states) {
    if (states.contains(WidgetState.disabled)) {
      return Colors.red;
    }
    if (states.contains(WidgetState.selected)) {
      return Colors.green;
    }
    return Colors.black;
  }),
),
```
2024-08-01 22:28:22 +00:00
..
custom_list_item.0.dart Rename Sample classes (#124080) 2023-04-04 20:34:29 +00:00
custom_list_item.1.dart Updated custom ListTile examples (#128071) 2023-06-01 16:21:42 -07:00
list_tile.0.dart Fix typos in ListTile examples. (#129606) 2023-06-29 06:29:03 +00:00
list_tile.1.dart Fix typos in ListTile examples. (#129606) 2023-06-29 06:29:03 +00:00
list_tile.2.dart Rename Sample classes (#124080) 2023-04-04 20:34:29 +00:00
list_tile.3.dart Use .fromMap() constructors in example code (#152535) 2024-08-01 22:28:22 +00:00
list_tile.4.dart Rename Sample classes (#124080) 2023-04-04 20:34:29 +00:00
list_tile.selected.0.dart Fix typos in ListTile examples. (#129606) 2023-06-29 06:29:03 +00:00