diff --git a/lib/scripts/patch.ps1 b/lib/scripts/patch.ps1 index f72c1d29f..8a00e90aa 100644 --- a/lib/scripts/patch.ps1 +++ b/lib/scripts/patch.ps1 @@ -33,6 +33,8 @@ $PopupMenuPatch = "lib/scripts/popup_menu.patch" $FABPatch = "lib/scripts/fab.patch" +$SelectableRegionSelectionPatch = "lib/scripts/selectable_region.patch" + # TODO: remove # https://github.com/flutter/flutter/pull/183261 $SelectableRegionPatch = "lib/scripts/null_safety_for_selectable_region.patch" @@ -64,7 +66,7 @@ $picks = @() $reverts = @() $patches = @($ModalBarrierPatch, $TextSelectionPatch, $MouseCursorPatch, $ImageAnimPatch, $LayoutBuilderPatch, $NavigationDrawerPatch, - $PopupMenuPatch, $FABPatch, $SelectableRegionPatch) + $PopupMenuPatch, $FABPatch, $SelectableRegionPatch, $SelectableRegionSelectionPatch) switch ($platform.ToLower()) { "android" { diff --git a/lib/scripts/selectable_region.patch b/lib/scripts/selectable_region.patch new file mode 100644 index 000000000..1204ae150 --- /dev/null +++ b/lib/scripts/selectable_region.patch @@ -0,0 +1,16 @@ +diff --git a/packages/flutter/lib/src/widgets/selectable_region.dart b/packages/flutter/lib/src/widgets/selectable_region.dart +index 59de8bae20b..07ac6981c78 100644 +--- a/packages/flutter/lib/src/widgets/selectable_region.dart ++++ b/packages/flutter/lib/src/widgets/selectable_region.dart +@@ -2822,7 +2822,10 @@ abstract class MultiSelectableSelectionContainerDelegate extends SelectionContai + return null; + } + final buffer = StringBuffer(); +- for (final selection in selections) { ++ for (final (i, selection) in selections.indexed) { ++ if (i != 0) { ++ buffer.write('\n'); ++ } + buffer.write(selection.plainText); + } + return SelectedContent(plainText: buffer.toString());