mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
![]() 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; }), ), ``` |
||
---|---|---|
.. | ||
custom_list_item.0.dart | ||
custom_list_item.1.dart | ||
list_tile.0.dart | ||
list_tile.1.dart | ||
list_tile.2.dart | ||
list_tile.3.dart | ||
list_tile.4.dart | ||
list_tile.selected.0.dart |