Skip to content

Commit

Permalink
Be more consistent about how we mark classes that can't be extended.
Browse files Browse the repository at this point in the history
Fixes #26095
  • Loading branch information
Hixie committed May 11, 2021
1 parent 4a939d7 commit c9d461f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/flutter/lib/src/rendering/layout_helper.dart
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/rendering/viewport.dart
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions packages/flutter/lib/src/services/autofill.dart
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/lib/src/services/mouse_cursor.dart
Expand Up @@ -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:
Expand Down

0 comments on commit c9d461f

Please sign in to comment.