In "build tests", the `properties` of the build specify the
configuration of the coordinator, and the `drone_dimensions` specify the
configuration of the devicelab bot. This PR should therefore fix the
infra errors on the `Linux_build_test` tests caused by my last PR at
https://github.com/flutter/flutter/pull/152756. (Unfortunately, a simple
revert won't work since the MotoG4s have already been removed from the
Linux hosts.)
## Description
Adds defaults that use tokens to define default `iconSize` and `iconColor` values. Previously, the Material 3 token values for button icon sizes and colors were not being used as defaults when the `ButtonStyleButton.defaultStyleOf` function returned the default values.
Adds tests to make sure appropriate `ButtonStyle` fields are populated when defaultStyle is called on buttons.
Updated documentation for `defaultStyleOf` to indicated that not _all_ fields need to be non-null, since some fields make sense to be null (e.g. `fixedSize`) because they would otherwise override the behavior of other fields in the same `ButtonStyle`.
## Tests
- Added tests to make sure that the appropriate fields are non-null in the default button styles for each type of button.
A few days ago I started reading up on how animations work, in
preparation for starting to use them in a more complex way than
I'd done before. I found it a bit difficult to get my head around;
in particular the many different classes involved, how they relate
to each other, and how to fit them together.
So once I had worked that out, I sat down to express it in the form
of documentation.
The largest change here is an expansion of the docs on [Animation]
itself, including a new section "Using animations" with several
paragraphs laying out how one typically fits together
AnimationController, TickerProvider, CurvedAnimation and/or Tween,
and AnimatedWidget subclasses. [Animation] also gets an expanded
"See also" list, a revised conceptual intro, and a new summary line.
There are also revisions on [TickerProvider], [AnimatedController],
and elsewhere; some new exposition, some revisions for clarity, and
various small fixes.
Title (in web) results in updating the [title element][1] which is a global property. This is problematic in embedded and multiview modes as title should be managed by host apps. This PR makes the title optional, hence if not provided it won't result in the website title being updated.
Contributes to https://github.com/flutter/flutter/issues/130459
It adds a test for
- `examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart`
- `examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart`
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;
}),
),
```
Nullable types for values in map patterns require the key to be present.
Since the 'uri' key is not always present in DDS exception responses,
this was causing us to fall back to throwing a StateError.
Fixes https://github.com/flutter/flutter/issues/152684
This PR:
* Improves doc for `scrollController` parameters, replacing the unclear "typically unneeded" with better reasons.
* Makes `scrollController` non-nullable on private classes, since they're always provided by their parents.
* Remove a redundant parameter from a private class.