commit | 2be719150ea9a2eea0e7fdad4d3e8b38d71c8140 | [log] [tgz] |
---|---|---|
author | Michael Goderbauer <goderbauer@google.com> | Mon Nov 27 22:33:59 2023 |
committer | GitHub <noreply@github.com> | Mon Nov 27 22:33:59 2023 |
tree | 8abafa120af0f1a87b57e90d614b07d81f5775ae | |
parent | 91c9e2736f1a93c51f8d45a8f104ba7bd441c46d [diff] |
Dynamic view sizing [dart:ui] (#48090) Towards https://github.com/flutter/flutter/issues/134501. This PR makes the following changes to the public dart:ui API: * It adds the `FlutterView.pysicalConstraints` property that describes max and min width and height for a view. The framework is allowed to size the `FlutterView` to any `Size` that meets these constraints. * It adds an optional `size` argument to `FlutterView.render`. The framework provides the chosen `Size` that meets the aforementioned constraints to the `render` method. If the `FlutterView.pysicalConstraints` are tight (minHeight == maxHeight and minWidth == maxWidth) the argument is optional to remain backwards compatible. In all other cases, a `Size` must be provided. * It adds a `ViewConstraints` class, which is basically the `dart:ui` version of `BoxConstraints` (This is similar to how we have `ViewPadding` in dart:ui to mirror `EdgeInsets` from the framework). It describes the constraints of a `FlutterView`, i.e. it powers the `FlutterView.pysicalConstraints` property. This change does not wire anything up to the embedders. For now, `FlutterView.pysicalConstraints` just returns tight constraints for the embedder-provided size of the view (`FlutterView.physicalSize`) and the size provided to `FlutterView.render` is ignored (after it is checked that it meets the constrains). This PR enables the framework to implement the new dynamic view sizing and embedders to separately expose the new functionality to their clients. Presubmits will fail until https://github.com/flutter/flutter/pull/138565 is submitted to the framework. **DO NOT SUBMIT until https://github.com/flutter/flutter/pull/138648 is ready.**
Flutter is Google's SDK for crafting beautiful, fast user experiences for mobile, web, and desktop from a single codebase. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.
The Flutter Engine is a portable runtime for hosting Flutter applications. It implements Flutter's core libraries, including animation and graphics, file and network I/O, accessibility support, plugin architecture, and a Dart runtime and compile toolchain. Most developers will interact with Flutter via the Flutter Framework, which provides a modern, reactive framework, and a rich set of platform, layout and foundation widgets.
If you want to run/contribute to Flutter Web engine, more tooling can be found at felt. This is a tool written to make web engine development experience easy.
If you are new to Flutter, then you will find more general information on the Flutter project, including tutorials and samples, on our Web site at Flutter.dev. For specific information about Flutter's APIs, consider our API reference which can be found at the docs.flutter.dev.
Flutter is a fully open source project, and we welcome contributions. Information on how to get started can be found at our contributor guide.