fixes [The image for the indicator of the TabBar does not auto-adapt to different resolutions](https://github.com/flutter/flutter/issues/145204)
### Description
This PR provides device pixel ratio to the tab indicator painter.
`RendererBinding.renderView` is deprecated. The doc should link to `RendererBinding.renderViews`, which also matches the context since the sentence is talking about multiple `RenderView`s and not just the legacy singleton.
This tweaks the Flutter doctor messages for CocoaPods.
This also switches the "unknown version" error to link to the update instructions instead of the installation instructions; the user has already installed CocoaPods in this scenario.
Example error before:
```
â CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
```
Example error after:
```
â CocoaPods not installed.
CocoaPods is a package manager for iOS or macOS platform code.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
For installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation
```
This pull request aims for improved readability, based on issue #146600.
```dart
// before
Set<Color> _distinctVisibleColors() {
final Set<Color> distinctVisibleColors = <Color>{};
if (top.style != BorderStyle.none) {
distinctVisibleColors.add(top.color);
}
if (right.style != BorderStyle.none) {
distinctVisibleColors.add(right.color);
}
if (bottom.style != BorderStyle.none) {
distinctVisibleColors.add(bottom.color);
}
if (left.style != BorderStyle.none) {
distinctVisibleColors.add(left.color);
}
return distinctVisibleColors;
}
// after
Set<Color> _distinctVisibleColors() {
return <Color>{
if (top.style != BorderStyle.none) top.color,
if (right.style != BorderStyle.none) right.color,
if (bottom.style != BorderStyle.none) bottom.color,
if (left.style != BorderStyle.none) left.color,
};
}
```
Most of the repo should be covered in this PR (aside from `flutter_tools/`, since there was a lot going on in there).
In a ProxiedDevicePortForwarder, there might be a race condition where the local socket has been disconnected, but the remote end was still sending new data. In this case, avoid forwarding new data to the socket.
The interface for `ArgResults` from `package:args` has added new fields. Change the implementations of these in the conductor to extend `Fake` so that these aren't analyzer errors.
This broke the pub roll here: https://github.com/flutter/flutter/pull/146642#issuecomment-2050169629
This cleans up a few sliver classes, like moving RenderSliverVariedExtentList to the rendering layer (it was in the widgets layer), and moving SliverVariedExtentList to live with its sibling subclasses, SliverFixedExtentList, SliverList, and so on.
I moved these while working on SliverTree, so figure I should break out into a separate change.
SliverTree and SliverCarousel (both inbound in separate changes) will also be subclasses of RenderSliverFixedExtentBoxAdaptor, organizing them together felt easier to work with.
Related to https://github.com/flutter/flutter/issues/114299 and https://github.com/flutter/flutter/issues/125980
This adds support for adding the `--wasm` flag to `flutter run` and `flutter drive`
* Emits errors if you attempt to use the skwasm renderer without the `--wasm` flag
* Emits errors if you try to use `--wasm` when not using a web device
* Uses the skwasm renderer by default if you pass `--wasm` and no `--web-renderer`
It looks like the formatter was updated.
We have a test running on the FFIgen repo that checks that rerunning the generated bindings with FFIgen generates identical bindings.
Closes:
* https://github.com/dart-lang/native/issues/1072
fixes [DropdownMenu TrailingIcon can't be styled through providing an IconButtonTheme](https://github.com/flutter/flutter/issues/145081) (second PR)
### Description
This PR replaces `IconButton.style` with `ButtonStyle` when merging parent `IconButtonTheme` as `styleFrom` returns defaults for some properties.
https://github.com/flutter/engine/pull/51229 blocked [the roll](https://github.com/flutter/flutter/pull/146522) and had to be reverted, which is a shame, but on the bright side it made it possible to point the framework at my removal pr, at the point of its merging the first time
This fixes all errors that are fixable in the framework that would have blocked the roll. There are some that aren't fixable here (they need to be fixed in the engine)*, so I'll fix those in the engine but unfortunately I can't pick up another version here to re-test until I try to roll again ð¢
*This category is: uses of plugins that in turn have a `registerWith`, that references the v1 embedding. The plan to fix these cases is to leave the interface that that method relies on around for now. See https://github.com/flutter/packages/pull/6494#issuecomment-2046010323 for details
Convert `ProjectMigration.run()` and `ProjectMigrator.migrate()` to be async.
Needed for Swift Package Manager migration, which requires some async processes: https://github.com/flutter/flutter/pull/146256
Also move the vm service discovery logic into platform-specific implementation of `Device`s. This is to avoid having platform-specific code in attach.dart.
Fixes bugs in the text selection positioning calculations so that they work even when the field is scaled. In many cases, we were simply translating things around without applying the proper localToGlobal (or vice versa) transform.
| Before | After |
| --- | --- |
| <img src="https://github.com/flutter/flutter/assets/389558/a5a45472-98c5-4cdf-b382-218971fd9404" /> | <img src="https://github.com/flutter/flutter/assets/389558/f396a1af-2546-4e38-a9d9-6c6edfa38d94" /> |
Partial fix for: https://github.com/flutter/flutter/issues/144685
It looks like there are other problems where transforms aren't applied properly. Putting a transform at the root of the application, above MaterialApp, will expose more problems.
<details>
<summary>Sample code</summary>
```dart
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
void main() => runApp(const _App());
class _App extends StatelessWidget {
const _App();
@override
Widget build(BuildContext context) {
return const MaterialApp(home: _Home());
}
}
class _Home extends StatefulWidget {
const _Home();
@override
State<_Home> createState() => _HomeState();
}
class _HomeState extends State<_Home> {
final _controller = WebViewController();
final TextEditingController textEditingController = TextEditingController(
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
);
final OverlayPortalController overlayPortalController = OverlayPortalController();
@override
void initState() {
super.initState();
_controller
..setJavaScriptMode(JavaScriptMode.unrestricted)
..loadRequest(Uri.https('api.flutter.dev'));
}
@override
Widget build(BuildContext context) {
overlayPortalController.show();
return Scaffold(
appBar: AppBar(
title: const Text('Scaled WebView Tester'),
),
body: Stack(
children: <Widget>[
Transform.scale(
alignment: Alignment.topLeft,
scale: 0.5,
child: TextField(
controller: textEditingController,
maxLines: null,
),
),
OverlayPortal(
controller: overlayPortalController,
overlayChildBuilder: (BuildContext context) {
return Positioned(
top: 0.0,
left: 0.0,
child: SizedBox(
height: 1000,
width: 1000,
child: Stack(
children: <Widget>[
Positioned(
top: 90.0,
left: 0.0,
child: Container(
height: 1.0,
width: 1000,
color: Colors.blue,
),
),
Positioned(
top: 102.0,
left: 0.0,
child: Container(
height: 1.0,
width: 1000,
color: Colors.blue,
),
),
],
),
),
);
},
),
],
),
);
}
}
```
</details>
## Description
This PRs fixes a null pointer exception thrown when reset is called on a `DropdownButtonFormField` whose `onChange` callback is null.
## Related Issue
Fixes https://github.com/flutter/flutter/issues/146335
## Tests
Adds 1 tests.