diff --git a/packages/flutter/lib/src/rendering/layout_helper.dart b/packages/flutter/lib/src/rendering/layout_helper.dart index 6e34236c61..cccc0f66be 100644 --- a/packages/flutter/lib/src/rendering/layout_helper.dart +++ b/packages/flutter/lib/src/rendering/layout_helper.dart @@ -18,6 +18,8 @@ typedef ChildLayouter = Size Function(RenderBox child, BoxConstraints constraint /// /// All of the functions adhere to the [ChildLayouter] signature. class ChildLayoutHelper { + // This class is not meant to be instantiated or extended; this constructor + // prevents instantiation and extension. const ChildLayoutHelper._(); /// Returns the [Size] that the [RenderBox] would have if it were to diff --git a/packages/flutter/lib/src/rendering/viewport.dart b/packages/flutter/lib/src/rendering/viewport.dart index e0100ac508..a7e26c74a8 100644 --- a/packages/flutter/lib/src/rendering/viewport.dart +++ b/packages/flutter/lib/src/rendering/viewport.dart @@ -32,7 +32,7 @@ enum CacheExtentStyle { abstract class RenderAbstractViewport extends RenderObject { // This class is intended to be used as an interface, and should not be // extended directly; this constructor prevents instantiation and extension. - factory RenderAbstractViewport._() => throw Error(); + RenderAbstractViewport._(); /// Returns the [RenderAbstractViewport] that most tightly encloses the given /// render object. diff --git a/packages/flutter/lib/src/services/autofill.dart b/packages/flutter/lib/src/services/autofill.dart index 429c97eeff..4a470154c0 100644 --- a/packages/flutter/lib/src/services/autofill.dart +++ b/packages/flutter/lib/src/services/autofill.dart @@ -12,6 +12,8 @@ import 'text_input.dart'; /// documentation for their availability on each platform, and the platform /// values each autofill hint corresponds to. class AutofillHints { + // This class is not meant to be instantiated or extended; this constructor + // prevents instantiation and extension. AutofillHints._(); /// The input field expects an address locality (city/town). diff --git a/packages/flutter/lib/src/services/mouse_cursor.dart b/packages/flutter/lib/src/services/mouse_cursor.dart index 1dc7da5f26..3f310eba13 100644 --- a/packages/flutter/lib/src/services/mouse_cursor.dart +++ b/packages/flutter/lib/src/services/mouse_cursor.dart @@ -417,7 +417,7 @@ class SystemMouseCursor extends MouseCursor { class SystemMouseCursors { // This class only contains static members, and should not be instantiated or // extended. - factory SystemMouseCursors._() => throw Error(); + SystemMouseCursors._(); // The mapping in this class must be kept in sync with the following files in // the engine: