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; }), ), ``` |
||
---|---|---|
.. | ||
focus_traversal_group.0.dart | ||
ordered_traversal_policy.0.dart |