diff --git a/packages/flutter/lib/src/rendering/viewport.dart b/packages/flutter/lib/src/rendering/viewport.dart index 7511e770a9..c48466b916 100644 --- a/packages/flutter/lib/src/rendering/viewport.dart +++ b/packages/flutter/lib/src/rendering/viewport.dart @@ -751,8 +751,8 @@ abstract class RenderViewportBase regExp.hasMatch(newValue.text) ? newValue : oldValue) +/// ``` +/// for accepting/rejecting new input based on a predicate on the full string. +/// As an example, [FilteringTextInputFormatter] typically shouldn't be used +/// with [RegExp]s that contain positional matchers (`^` or `$`) since these +/// patterns are usually meant for matching the whole string. class FilteringTextInputFormatter extends TextInputFormatter { - /// Creates a formatter that prevents the insertion of characters - /// based on a filter pattern. + /// Creates a formatter that replaces banned patterns with the given + /// [replacementString]. /// /// If [allow] is true, then the filter pattern is an allow list, /// and characters must match the pattern to be accepted. See also diff --git a/packages/flutter/lib/src/widgets/slotted_render_object_widget.dart b/packages/flutter/lib/src/widgets/slotted_render_object_widget.dart index 8bbf6a56ef..7a942aafb7 100644 --- a/packages/flutter/lib/src/widgets/slotted_render_object_widget.dart +++ b/packages/flutter/lib/src/widgets/slotted_render_object_widget.dart @@ -299,7 +299,7 @@ class SlottedRenderObjectElement extends RenderObjectElement { throw FlutterError.fromParts([ ErrorSummary('Multiple widgets used the same key in ${widget.runtimeType}.'), ErrorDescription( - 'The key ${duplicateKey.key} was used by multiple widgets. The parents of those widgets were:\n' + 'The key ${duplicateKey.key} was used by multiple widgets. The offending widgets were:\n' ), for (final Element element in duplicateKey.value) ErrorDescription(' - $element\n'), ErrorDescription( diff --git a/packages/flutter/test/widgets/slotted_render_object_widget_test.dart b/packages/flutter/test/widgets/slotted_render_object_widget_test.dart index 7fc1a9ba62..5e48a3ad68 100644 --- a/packages/flutter/test/widgets/slotted_render_object_widget_test.dart +++ b/packages/flutter/test/widgets/slotted_render_object_widget_test.dart @@ -197,7 +197,7 @@ void main() { expect((tester.takeException() as FlutterError).toString(), equalsIgnoringHashCodes( 'Multiple widgets used the same key in _Diagonal.\n' - "The key [<'widget 1'>] was used by multiple widgets. The parents of those widgets were:\n" + "The key [<'widget 1'>] was used by multiple widgets. The offending widgets were:\n" " - SizedBox-[<'widget 1'>](width: 50.0, height: 50.0, renderObject: RenderConstrainedBox#00000 NEEDS-LAYOUT NEEDS-PAINT)\n" " - SizedBox-[<'widget 1'>](width: 10.0, height: 10.0, renderObject: RenderConstrainedBox#00000 NEEDS-LAYOUT NEEDS-PAINT)\n" " - SizedBox-[<'widget 1'>](width: 100.0, height: 100.0, renderObject: RenderConstrainedBox#a4685 NEEDS-LAYOUT NEEDS-PAINT)\n"