- 08 Dec, 2023 1 commit
-
-
Ian Hickson authored
Fixes https://github.com/flutter/flutter/issues/105120 I also exposed the relevant dart:ui types which had the effect of removing a large number of dart:ui imports from examples.
-
- 29 Nov, 2023 1 commit
-
-
Mateus Felipe C. C. Pinto authored
Provide parameter to Icon and IconThemeData for they to consider the context's text scaler (#135708) Provide a parameter `applyTextScaling` to both `Icon` and `IconDataTheme`. When `true`, the context's `TextScaler` will apply it's `scale` method to the icon size. Fixes #115466
-
- 28 Oct, 2023 1 commit
-
-
Kostia Sokolovskyi authored
-
- 20 Sep, 2023 1 commit
-
-
Greg Spencer authored
## Description This removes all of the comments that are of the form "so-and-so (must not be null|can ?not be null|must be non-null)" from the cases where those values are defines as non-nullable values. This PR removes them from the painting and rendering libraries. This was done by hand, since it really didn't lend itself to scripting, so it needs to be more than just spot-checked, I think. I was careful to leave any comment that referred to parameters that were nullable, but I may have missed some. In addition to being no longer relevant after null safety has been made the default, these comments were largely fragile, in that it was easy for them to get out of date, and not be accurate anymore anyhow. This did create a number of constructor comments which basically say "Creates a [Foo].", but I don't really know how to avoid that in a large scale change, since there's not much you can really say in a lot of cases. I think we might consider some leniency for constructors to the "Comment must be meaningful" style guidance (which we de facto have already, since there are a bunch of these). ## Related PRs - https://github.com/flutter/flutter/pull/134984 - https://github.com/flutter/flutter/pull/134991 - https://github.com/flutter/flutter/pull/134992 - https://github.com/flutter/flutter/pull/134994 ## Tests - Documentation only change.
-
- 08 Sep, 2023 1 commit
-
-
LongCatIsLooong authored
The migration flag in `ParagraphBuilder` will be removed next.
-
- 10 Aug, 2023 3 commits
-
-
LongCatIsLooong authored
Undo temporary changes made in #132094
-
LongCatIsLooong authored
## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
-
LongCatIsLooong authored
Migrate tests in flutter/flutter. Once the tests here and in `*_customer_testing` are migrated, the default value of the migration flag will be changed from false to true, making the rounding hack disabled by default.
-
- 17 Jul, 2023 1 commit
-
-
LongCatIsLooong authored
Deprecate `textScaleFactor` in favor of `textScaler`, in preparation for Android 14 [Non-linear font scaling to 200%](https://developer.android.com/about/versions/14/features#non-linear-font-scaling). The `TextScaler` class can be moved to `dart:ui` in the future, if we decide to use the Android platform API or AndroidX to get the scaling curve instead of hard coding the curve in the framework. I haven't put the Flutter version in the deprecation message so the analyzer checks are failing. Will do so after I finish the migration guide. **Why `TextScaler.textScaleFactor`** The author of a `TextScaler` subclass should provide a fallback `textScaleFactor`. By making `TextScaler` also contain the `textScaleFactor` information it also makes it easier to migrate: if a widget overrides `MediaQueryData.textScaler` in the tree, for unmigrated widgets in the subtree it would also have to override `MediaQueryData.textScaleFactor`, and that makes it difficult to remove `MediaQueryData.textScaleFactor` in the future. ## A full list of affected APIs in this PR Deprecated: The method/getter/setter/argument is annotated with a `@Deprecated()` annotation in this PR, and the caller should replace it with `textScaler` instead. Unless otherwise specified there will be a Flutter fix available to help with migration but it's still recommended to migrate case-by-case. **Replaced**: The method this `textScaleFactor` argument belongs to is rarely called directly by user code and is not overridden by any of the registered custom tests, so the argument is directly replaced by `TextScaler`. **To Be Deprecated**: The method/getter/setter/argument can't be deprecated in this PR because a registered customer test depends on it and a Flutter fix isn't available (or the test was run without applying flutter fixes first). This method/getter/setter/argument will be deprecated in a followup PR once the registered test is migrated. ### `Painting` Library | Affected API | State of `textScaleFactor` | Comment | | --- | --- | --- | | `InlineSpan.build({ double textScaleFactor = 1.0 })` argument | **Replaced** | | | `TextStyle.getParagraphStyle({ double TextScaleFactor = 1.0 })` argument | **Replaced** | | | `TextStyle.getTextStyle({ double TextScaleFactor = 1.0 })` argument| Deprecated | Can't replace: https://github.com/superlistapp/super_editor/blob/c47fd38dca4b7f43611690913b551a1773c563d7/super_editor/lib/src/infrastructure/super_textfield/desktop/desktop_textfield.dart#L1903-L1905| | `TextPainter({ double TextScaleFactor = 1.0 })` constructor argument | Deprecated | | | `TextPainter.textScaleFactor` getter and setter | Deprecated | No Flutter Fix, not expressible yet | | `TextPainter.computeWidth({ double TextScaleFactor = 1.0 })` argument | Deprecated | | | `TextPainter.computeMaxIntrinsicWidth({ double TextScaleFactor = 1.0 })` argument | Deprecated | | ### `Rendering` Library | Affected API | State of `textScaleFactor` | Comment | | --- | --- | --- | | `RenderEditable({ double TextScaleFactor = 1.0 })` constructor argument | Deprecated | | | `RenderEditable.textScaleFactor` getter and setter | Deprecated | No Flutter Fix, not expressible yet | | `RenderParagraph({ double TextScaleFactor = 1.0 })` constructor argument | Deprecated | | | `RenderParagraph.textScaleFactor` getter and setter | Deprecated | No Flutter Fix, not expressible yet | ### `Widgets` Library | Affected API | State of `textScaleFactor` | Comment | | --- | --- | --- | | `MediaQueryData({ double TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | https://github.com/flutter/packages/blob/cd7b93532e5cb605a42735e20f1de70fc00adae7/packages/flutter_markdown/test/text_scale_factor_test.dart#LL39C21-L39C35 | | `MediaQueryData.textScaleFactor` getter | Deprecated | | | `MediaQueryData.copyWith({ double? TextScaleFactor })` argument | Deprecated | | | `MediaQuery.maybeTextScaleFactorOf(BuildContext context)` static method | Deprecated | No Flutter Fix, not expressible yet | | `MediaQuery.textScaleFactorOf(BuildContext context)` static method | **To Be Deprecated** | https://github.com/flutter/packages/blob/cd7b93532e5cb605a42735e20f1de70fc00adae7/packages/flutter_markdown/lib/src/_functions_io.dart#L68-L70, No Flutter Fix, not expressible yet | | `RichText({ double TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | https://github.com/flutter/packages/blob/cd7b93532e5cb605a42735e20f1de70fc00adae7/packages/flutter_markdown/lib/src/builder.dart#L829-L843 | | `RichText.textScaleFactor` getter | **To Be Deprecated** | A constructor argument can't be deprecated right away| | `Text({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | https://github.com/flutter/packages/blob/914d120da12fba458c020210727831c31bd71041/packages/rfw/lib/src/flutter/core_widgets.dart#L647 , No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 | | `Text.rich({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | The default constructor has an argument that can't be deprecated right away. No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 | | `Text.textScaleFactor` getter | **To Be Deprecated** | A constructor argument can't be deprecated right away | | `EditableText({ double? TextScaleFactor = 1.0 })` constructor argument | Deprecated | No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 | | `EditableText.textScaleFactor` getter | Deprecated | | ### `Material` Library | Affected API | State of `textScaleFactor` | Comment | | --- | --- | --- | | `SelectableText({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | https://github.com/flutter/packages/blob/cd7b93532e5cb605a42735e20f1de70fc00adae7/packages/flutter_markdown/lib/src/builder.dart#L829-L843, No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 | | `SelectableText.rich({ double? TextScaleFactor = 1.0 })` constructor argument | **To Be Deprecated** | The default constructor has an argument that can't be deprecated right away. No Flutter Fix because of https://github.com/dart-lang/sdk/issues/52664 | | `SelectableText.textScaleFactor` getter | **To Be Deprecated** | A constructor argument can't be deprecated right away | A lot of material widgets (`Slider`, `RangeSlider`, `TimePicker`, and different types of buttons) also change their layout based on `textScaleFactor`. These need to be handled in a case-by-case fashion and will be migrated in follow-up PRs.
-
- 14 Jul, 2023 1 commit
-
-
LongCatIsLooong authored
-
- 06 Jun, 2023 1 commit
-
-
LongCatIsLooong authored
Add the conditional rounding that I forgot to add in https://github.com/flutter/flutter/pull/127099
-
- 31 May, 2023 1 commit
-
-
Tomasz Gucio authored
-
- 26 May, 2023 2 commits
-
-
LongCatIsLooong authored
- Added `InlineWidgetContainerDefaults` for deduping inline widget code - Added a helper function `WidgetSpan.extractFromInlineSpan` for extracting `WidgetSpan`s and automatically applying text scaling (at widget level) - Removed `TextPainter.inlinePlaceholderScales`. I'm going to deprecate the `scale` argument in `TextPainter.addPlaceholder` next, as scaling is now done at the widget level. - Added runtime check and comments to make sure nobody is extending `PlaceholderSpan` directly (unfortunately we can't remove `PlaceholderSpan` without moving RenderEditable and RenderParagraph to the widgets library).
-
LongCatIsLooong authored
To opt-in, run the tests with: `SKPARAGRAPH_REMOVE_ROUNDING_HACK=1 flutter test --dart-define=SKPARAGRAPH_REMOVE_ROUNDING_HACK=1 ` Migration plans: 1. Turn the flags on in CI, migrate customer tests if needed 1. Migrate internal customers 2. Remove the flag from skparagraph. Remove the framework flag with a manual engine roll. Also fixes https://github.com/flutter/flutter/issues/52038
-
- 24 May, 2023 1 commit
-
-
LongCatIsLooong authored
Improves `TextPainter.layout` caching when only the input constraints change: - removes the double layout calls in `TextPainter._layoutParagraph`: now double layout is only needed when `TextAlign` is not left, and the input `maxWidth == double.infinity`. - skip calls to `ui.Paragraph.layout` when it's guaranteed that there's no soft line breaks before/after the layout call. This doesn't introduce new APIs but may slightly shift text rendered on screen. This reduces the number of `layout` calls but since shaping results are already cached so it only skips the relatively cheap line-breaking process when possible. 528 scuba failures but all of them seem reasonable.
-
- 23 May, 2023 1 commit
-
-
Justin McCandless authored
This PR changes the character boundary behavior of obscured fields to be based on code points instead of code units. So it used to be possible to traverse and delete obscured text inside of code points (and breaking a code point like that would cause a crash): ![output2](https://github.com/flutter/flutter/assets/389558/674c89a4-c47d-4cdc-a402-4cadb5d2f73b) But now moving the cursor and deleting is based on code points: ![output1](https://github.com/flutter/flutter/assets/389558/e46301f7-b5af-48d2-812a-0ad649f1383b) ### Native behavior Native iOS deletes part of the emoji, native Mac deletes the whole emoji. See https://github.com/flutter/flutter/issues/122381#issuecomment-1482042620. So it's unclear what the desired behavior should actually be. ### Resources Fixes https://github.com/flutter/flutter/issues/122381 I thought this might not fix the case where a broken emoji is directly pasted into the field, but it seems to work by trying this: �âð
âð¦âð¦ CC @LongCatIsLooong
-
- 15 May, 2023 1 commit
-
-
Tomasz Gucio authored
-
- 03 May, 2023 1 commit
-
-
LongCatIsLooong authored
I'd like to find out the `fontSize` of a `PlaceholderSpan`, and currently there doesn't seem to be a way to do `TextStyle` cascading in the framework: `InlineSpan.visitChildren` traverses the entire `InlineSpan` tree using a preorder traversal, and nodes that don't have "content" will be skipped (https://master-api.flutter.dev/flutter/painting/InlineSpan/visitChildren.html): > Walks this [InlineSpan](https://master-api.flutter.dev/flutter/painting/InlineSpan-class.html) and any descendants in pre-order and calls visitor for each span that has content. which makes it impossible to do `TextStyle` cascading in the framework: - `InlineSpan`s with a non-null `TextStyle` but has no content will be skipped - `visitChildren` doesn't directly expose the hierarchy, it only gives information about the flattened tree. This doesn't look like a breaking change, most internal customers are extending `WidgetSpan` which has a concrete implementation of the new method. Alternatively I could create a fake `ui.ParagraphBuilder` and record the `ui.TextStyle` at the top of the stack when `addPlaceholder` is called. But `ui.TextStyle` properties are not exposed to the framework.
-
- 28 Mar, 2023 1 commit
-
-
Greg Price authored
Fix out-of-bounds and reversed TextBox queries in computing caret metrics
-
- 22 Mar, 2023 1 commit
-
-
Michael Goderbauer authored
Remove 1745 decorative breaks
-
- 13 Mar, 2023 1 commit
-
-
LongCatIsLooong authored
* improve caret caching, fix caret for empty text/line, `getLocalRectForCaret` now reports the real rect that will be painted. move caret x-coordinate clamping to RenderEditable since TextPainter doesn't know about clipping. * comments * review
-
- 21 Jan, 2023 1 commit
-
-
Michael Goderbauer authored
-
- 05 Jan, 2023 1 commit
-
-
LongCatIsLooong authored
* Avoid affinity like the plague * ignore lint * clean up * fix test * review * Move wordboundary to text painter * docs * fix tests
-
- 28 Oct, 2022 1 commit
-
-
Justin McCandless authored
* Can show context menus anywhere in the app, not just on text. * Unifies all desktop/mobile context menus to go through one class (ContextMenuController). * All context menus are now just plain widgets that can be fully customized. * Existing default context menus can be customized and reused.
-
- 25 Oct, 2022 1 commit
-
-
Tomasz Gucio authored
-
- 28 Sep, 2022 1 commit
-
-
LongCatIsLooong authored
-
- 26 Sep, 2022 1 commit
-
-
chunhtai authored
-
- 16 Sep, 2022 1 commit
-
-
chunhtai authored
-
- 14 Sep, 2022 1 commit
-
-
Dan Field authored
-
- 13 Sep, 2022 1 commit
-
-
Dan Field authored
-
- 12 Sep, 2022 1 commit
-
-
Dan Field authored
-
- 06 Sep, 2022 1 commit
-
-
Dan Field authored
-
- 01 Aug, 2022 1 commit
-
-
Tomasz Gucio authored
Override PlaceholderDimensions equality operator to avoid unnecessary TextPainter re-layouts (#108623)
-
- 30 Jul, 2022 1 commit
-
-
LongCatIsLooong authored
-
- 18 Jul, 2022 1 commit
-
-
Alexandre Ardhuin authored
-
- 01 Jul, 2022 1 commit
-
-
Xilai Zhang authored
This reverts commit 3f43d9f3.
-
- 29 Jun, 2022 1 commit
-
-
xubaolin authored
Fixes a text clipping edge case.
-
- 25 May, 2022 1 commit
-
-
Pierre-Louis authored
Use `curly_braces_in_flow_control_structures` for `foundation`, `gestures`, `painting`, `physics` (#104610) * Use `curly_braces_in_flow_control_structures` for `foundation` * Use `curly_braces_in_flow_control_structures` for `gestures` * Use `curly_braces_in_flow_control_structures` for `painting` * Use `curly_braces_in_flow_control_structures` for `physics` * fix comments * remove trailing space * fix TODO style
-
- 24 May, 2022 1 commit
-
-
chunhtai authored
* Support global selection * addressing comments * add new test * Addressing review comments * update * addressing comments * addressing comments * Addressing comments * fix build
-
- 18 May, 2022 1 commit
-
-
gaaclarke authored
-