- 11 Aug, 2023 1 commit
-
-
Renzo Olivares authored
Adds double click to select a word. Adds double click + drag to select word by word. https://user-images.githubusercontent.com/948037/234363577-941c36bc-ac42-4b7f-84aa-26b106c9ff05.mov Partially fixes #104552
-
- 09 Aug, 2023 1 commit
- 19 Jul, 2023 1 commit
-
-
Ian Hickson authored
Fixes https://github.com/flutter/flutter/issues/56500
-
- 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.
-
- 27 Jun, 2023 1 commit
-
-
hangyu authored
issue:#126652 in Chinese text, word length is 1 and (position.offset == word.end) happens a lot. Update if (position.offset >= word.end) to if (position.offset > word.end) to resolve the issue that Chinese characters are not selected.
-
- 21 Jun, 2023 1 commit
-
-
Renzo Olivares authored
This change updates `SelectableRegion`s right-click gesture to match native platform behavior. Before: Right-click gesture selects word at position and opens context menu (All Platforms) After: - Linux, toggles context menu on/off, and collapses selection when click was not on an active selection (uncollapsed). - Windows, Android, Fuchsia, shows context menu at right-clicked position (unless the click is at an active selection). - macOS, toggles the context menu if right click was at the same position as the previous / or selects word at position and opens context menu. - iOS, selects word at position and opens context menu. This change also prevents the `copy` menu button from being shown when there is a collapsed selection (nothing to copy). Fixes #117561
-
- 09 Jun, 2023 1 commit
-
-
hangyu authored
fixes: #104703
-
- 06 Jun, 2023 1 commit
-
-
Renzo Olivares authored
handleSelectWord in MultiSelectableSelectionContainerDelegate should handle rects inside of rects (#127478) Fixes #127076 Sometimes a `Selectable`s rect may contain another `Selectable`s rect within it. In the case of `handleSelectWord` when choosing which `Selectable` to dispatch the `SelectionEvent` to, the event would be dispatched to the wrong `Selectable` causing an assertion error to be thrown. <img width="577" alt="Screenshot 2023-05-24 at 2 46 13 AM" src="https://github.com/flutter/flutter/assets/948037/bb246966-acad-4d81-bd87-758c3ea6ea39"> In the picture above the red outline shows the rect of a two-line piece of text. And the blue rect shows the rect of a piece of text that is on the second line of the two-line piece of text, but has been separated into its own rect for some case, for example when `TextSpan`s are separated by a `WidgetSpan`. We should check if the text layout of the selectable that has been dispatched the SelectionEvent contains the word, if not then return `SelectionResult.next`, and continue to look through the list of selectables.
-
- 26 May, 2023 1 commit
-
-
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).
-
- 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.
-
- 22 Mar, 2023 1 commit
-
-
Michael Goderbauer authored
Remove 1745 decorative breaks
-
- 01 Mar, 2023 1 commit
-
- 27 Feb, 2023 1 commit
-
- 23 Feb, 2023 1 commit
-
-
chunhtai authored
* Fix text.rich to merge widget span * migrate to new API * update * addressing comment * addressing comments * update * addressing comment * Update
-
- 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
-
- 16 Dec, 2022 2 commits
-
-
LongCatIsLooong authored
* Always defer systemFontsDidChange to transientCallbacks phase * unnecessary import
-
Lucas.Xu authored
-
- 04 Nov, 2022 1 commit
-
-
chunhtai authored
* Support keyboard selection in selectable region * fix some comments * addressing comments
-
- 06 Sep, 2022 1 commit
-
-
Dan Field authored
-
- 11 Aug, 2022 1 commit
-
-
Ian Hickson authored
-
- 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.
-
- 17 Jun, 2022 1 commit
-
-
Alexandre Ardhuin authored
-
- 25 May, 2022 1 commit
-
-
Pierre-Louis authored
* Use `curly_braces_in_flow_control_structures` for `rendering` * fix comments * fix dangling
-
- 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 Apr, 2022 1 commit
-
-
Justin McCandless authored
This reverts commit 08e467dd (Google test failures after merge).
-
- 14 Apr, 2022 1 commit
-
-
xubaolin authored
-
- 24 Mar, 2022 1 commit
-
-
chunhtai authored
-
- 01 Mar, 2022 1 commit
-
-
Viren Khatri authored
* migrates lib/foundation and lib/widgets * migrates lib/painting and lib/material * migrates lib/cupertino, lib/gestures, lib/services, lib/semantics and lib/rendering * fixes failing tests * migrates test/ * improves hashing of lists
-
- 22 Feb, 2022 1 commit
-
-
Tomasz Gucio authored
-
- 01 Dec, 2021 1 commit
-
-
Greg Spencer authored
-
- 11 Oct, 2021 1 commit
-
-
Ian Hickson authored
-
- 08 Oct, 2021 3 commits
-
-
Ian Hickson authored
-
Zachary Anderson authored
This reverts commit 5fd259be.
-
Ian Hickson authored
-
- 27 Sep, 2021 1 commit
-
-
nt4f04uNd authored
-