diff --git a/examples/flutter_gallery/lib/gallery/icons.dart b/examples/flutter_gallery/lib/gallery/icons.dart index 48b0b69d26..afa94fbc5b 100644 --- a/examples/flutter_gallery/lib/gallery/icons.dart +++ b/examples/flutter_gallery/lib/gallery/icons.dart @@ -5,6 +5,9 @@ import 'package:flutter/material.dart'; class GalleryIcons { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element GalleryIcons._(); static const IconData tooltip = IconData(0xe900, fontFamily: 'GalleryIcons'); diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart index 9dc74b688d..873cb4678f 100644 --- a/packages/flutter/lib/src/animation/curves.dart +++ b/packages/flutter/lib/src/animation/curves.dart @@ -517,6 +517,9 @@ class ElasticInOutCurve extends Curve { /// * [Curve], the interface implemented by the constants available from the /// [Curves] class. class Curves { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element Curves._(); /// A linear animation curve. diff --git a/packages/flutter/lib/src/cupertino/colors.dart b/packages/flutter/lib/src/cupertino/colors.dart index 49d0d2be26..fe2f3fa46d 100644 --- a/packages/flutter/lib/src/cupertino/colors.dart +++ b/packages/flutter/lib/src/cupertino/colors.dart @@ -18,6 +18,9 @@ import 'theme.dart'; /// A palette of [Color] constants that describe colors commonly used when /// matching the iOS platform aesthetics. class CupertinoColors { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element CupertinoColors._(); /// iOS 13's default blue color. Used to indicate active elements such as diff --git a/packages/flutter/lib/src/cupertino/icons.dart b/packages/flutter/lib/src/cupertino/icons.dart index a753de01fd..101e1b60b3 100644 --- a/packages/flutter/lib/src/cupertino/icons.dart +++ b/packages/flutter/lib/src/cupertino/icons.dart @@ -26,6 +26,9 @@ import 'package:flutter/widgets.dart'; /// * [Icon], used to show these icons. /// * , a map of the icons in this icons font. class CupertinoIcons { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element CupertinoIcons._(); /// The icon font used for Cupertino icons. diff --git a/packages/flutter/lib/src/foundation/assertions.dart b/packages/flutter/lib/src/foundation/assertions.dart index 7f4ffed2cb..85c0103cf3 100644 --- a/packages/flutter/lib/src/foundation/assertions.dart +++ b/packages/flutter/lib/src/foundation/assertions.dart @@ -112,6 +112,7 @@ class ErrorDescription extends _ErrorDiagnostic { /// Calls to the default constructor may be rewritten to use this constructor /// in debug mode using a kernel transformer. + // ignore: unused_element ErrorDescription._fromParts(List messageParts) : super._fromParts(messageParts, level: DiagnosticLevel.info); } @@ -146,6 +147,7 @@ class ErrorSummary extends _ErrorDiagnostic { /// Calls to the default constructor may be rewritten to use this constructor /// in debug mode using a kernel transformer. + // ignore: unused_element ErrorSummary._fromParts(List messageParts) : super._fromParts(messageParts, level: DiagnosticLevel.summary); } @@ -176,6 +178,7 @@ class ErrorHint extends _ErrorDiagnostic { /// Calls to the default constructor may be rewritten to use this constructor /// in debug mode using a kernel transformer. + // ignore: unused_element ErrorHint._fromParts(List messageParts) : super._fromParts(messageParts, level:DiagnosticLevel.hint); } diff --git a/packages/flutter/lib/src/foundation/licenses.dart b/packages/flutter/lib/src/foundation/licenses.dart index 084b95440a..5c9cd802ad 100644 --- a/packages/flutter/lib/src/foundation/licenses.dart +++ b/packages/flutter/lib/src/foundation/licenses.dart @@ -288,6 +288,9 @@ class LicenseEntryWithLineBreaks extends LicenseEntry { /// * [AboutListTile], which is a widget that can be added to a [Drawer]. When /// tapped it calls [showAboutDialog]. class LicenseRegistry { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element LicenseRegistry._(); static List _collectors; diff --git a/packages/flutter/lib/src/foundation/unicode.dart b/packages/flutter/lib/src/foundation/unicode.dart index 45447732bc..37af6f162a 100644 --- a/packages/flutter/lib/src/foundation/unicode.dart +++ b/packages/flutter/lib/src/foundation/unicode.dart @@ -11,6 +11,9 @@ /// * , which describes the Unicode /// bidirectional text algorithm. class Unicode { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element Unicode._(); /// U+202A LEFT-TO-RIGHT EMBEDDING /// diff --git a/packages/flutter/lib/src/gestures/converter.dart b/packages/flutter/lib/src/gestures/converter.dart index 0093c26b0b..9f87a2f189 100644 --- a/packages/flutter/lib/src/gestures/converter.dart +++ b/packages/flutter/lib/src/gestures/converter.dart @@ -32,6 +32,9 @@ int _synthesiseDownButtons(int buttons, PointerDeviceKind kind) { /// [dart:ui.Window.onPointerDataPacket], and converts them to [PointerEvent] /// objects. class PointerEventConverter { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element PointerEventConverter._(); /// Expand the given packet of pointer data into a sequence of framework diff --git a/packages/flutter/lib/src/gestures/hit_test.dart b/packages/flutter/lib/src/gestures/hit_test.dart index ef4e1dcc58..d2f95d0519 100644 --- a/packages/flutter/lib/src/gestures/hit_test.dart +++ b/packages/flutter/lib/src/gestures/hit_test.dart @@ -11,8 +11,9 @@ import 'events.dart'; /// An object that can hit-test pointers. abstract class HitTestable { - // This class is intended to be used as an interface with the implements - // keyword, and should not be extended directly. + // This class is intended to be used as an interface, and should not be + // extended directly; this constructor prevents instantiation and extension. + // ignore: unused_element factory HitTestable._() => null; /// Check whether the given position hits this object. @@ -24,8 +25,9 @@ abstract class HitTestable { /// An object that can dispatch events. abstract class HitTestDispatcher { - // This class is intended to be used as an interface with the implements - // keyword, and should not be extended directly. + // This class is intended to be used as an interface, and should not be + // extended directly; this constructor prevents instantiation and extension. + // ignore: unused_element factory HitTestDispatcher._() => null; /// Override this method to dispatch events. @@ -34,8 +36,9 @@ abstract class HitTestDispatcher { /// An object that can handle events. abstract class HitTestTarget { - // This class is intended to be used as an interface with the implements - // keyword, and should not be extended directly. + // This class is intended to be used as an interface, and should not be + // extended directly; this constructor prevents instantiation and extension. + // ignore: unused_element factory HitTestTarget._() => null; /// Override this method to receive events. diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index 9ac390e3ac..cce2ee213d 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -63,7 +63,8 @@ const Icon _kDefaultDeleteIcon = Icon(Icons.cancel, size: _kDeleteIconSize); /// * abstract class ChipAttributes { // This class is intended to be used as an interface, and should not be - // extended directly. + // extended directly; this constructor prevents instantiation and extension. + // ignore: unused_element factory ChipAttributes._() => null; /// The primary content of the chip. @@ -174,7 +175,8 @@ abstract class ChipAttributes { /// * abstract class DeletableChipAttributes { // This class is intended to be used as an interface, and should not be - // extended directly. + // extended directly; this constructor prevents instantiation and extension. + // ignore: unused_element factory DeletableChipAttributes._() => null; /// The icon displayed when [onDeleted] is set. @@ -275,7 +277,8 @@ abstract class DeletableChipAttributes { /// * abstract class CheckmarkableChipAttributes { // This class is intended to be used as an interface, and should not be - // extended directly. + // extended directly; this constructor prevents instantiation and extension. + // ignore: unused_element factory CheckmarkableChipAttributes._() => null; /// Whether or not to show a check mark when [selected] is true. @@ -309,7 +312,8 @@ abstract class CheckmarkableChipAttributes { /// * abstract class SelectableChipAttributes { // This class is intended to be used as an interface, and should not be - // extended directly. + // extended directly; this constructor prevents instantiation and extension. + // ignore: unused_element factory SelectableChipAttributes._() => null; /// Whether or not this chip is selected. @@ -417,7 +421,8 @@ abstract class SelectableChipAttributes { /// * abstract class DisabledChipAttributes { // This class is intended to be used as an interface, and should not be - // extended directly. + // extended directly; this constructor prevents instantiation and extension. + // ignore: unused_element factory DisabledChipAttributes._() => null; /// Whether or not this chip is enabled for input. @@ -464,7 +469,8 @@ abstract class DisabledChipAttributes { /// * abstract class TappableChipAttributes { // This class is intended to be used as an interface, and should not be - // extended directly. + // extended directly; this constructor prevents instantiation and extension. + // ignore: unused_element factory TappableChipAttributes._() => null; /// Called when the user taps the chip. diff --git a/packages/flutter/lib/src/material/colors.dart b/packages/flutter/lib/src/material/colors.dart index 00a5964bf8..bd141a2737 100644 --- a/packages/flutter/lib/src/material/colors.dart +++ b/packages/flutter/lib/src/material/colors.dart @@ -192,6 +192,9 @@ class MaterialAccentColor extends ColorSwatch { /// The [Colors.transparent] color isn't shown here because it is entirely /// invisible! class Colors { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element Colors._(); /// Completely invisible. diff --git a/packages/flutter/lib/src/material/elevation_overlay.dart b/packages/flutter/lib/src/material/elevation_overlay.dart index 9be01f2934..bdd5b1880b 100644 --- a/packages/flutter/lib/src/material/elevation_overlay.dart +++ b/packages/flutter/lib/src/material/elevation_overlay.dart @@ -14,7 +14,9 @@ import 'theme.dart'; /// This is an internal implementation class and should not be exported by /// the material package. class ElevationOverlay { - + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element ElevationOverlay._(); /// Applies an elevation overlay color to a surface color to indicate diff --git a/packages/flutter/lib/src/material/feedback.dart b/packages/flutter/lib/src/material/feedback.dart index 0a3392dab0..c1891a627a 100644 --- a/packages/flutter/lib/src/material/feedback.dart +++ b/packages/flutter/lib/src/material/feedback.dart @@ -80,6 +80,9 @@ import 'theme.dart'; /// ``` /// {@end-tool} class Feedback { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element Feedback._(); /// Provides platform-specific feedback for a tap. diff --git a/packages/flutter/lib/src/material/icons.dart b/packages/flutter/lib/src/material/icons.dart index 6bb2225380..a943d44c51 100644 --- a/packages/flutter/lib/src/material/icons.dart +++ b/packages/flutter/lib/src/material/icons.dart @@ -59,6 +59,9 @@ import 'package:flutter/widgets.dart'; /// * [IconButton] /// * class Icons { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element Icons._(); // Generated code: do not hand-edit. diff --git a/packages/flutter/lib/src/painting/matrix_utils.dart b/packages/flutter/lib/src/painting/matrix_utils.dart index 7f781f23a1..4f2b59b9fb 100644 --- a/packages/flutter/lib/src/painting/matrix_utils.dart +++ b/packages/flutter/lib/src/painting/matrix_utils.dart @@ -11,6 +11,9 @@ import 'basic_types.dart'; /// Utility functions for working with matrices. class MatrixUtils { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element MatrixUtils._(); /// Returns the given [transform] matrix as an [Offset], if the matrix is diff --git a/packages/flutter/lib/src/rendering/viewport.dart b/packages/flutter/lib/src/rendering/viewport.dart index 809b3210d0..5898666023 100644 --- a/packages/flutter/lib/src/rendering/viewport.dart +++ b/packages/flutter/lib/src/rendering/viewport.dart @@ -30,8 +30,9 @@ enum CacheExtentStyle { /// the framework recognize such render objects and interact with them without /// having specific knowledge of all the various types of viewports. abstract class RenderAbstractViewport extends RenderObject { - // This class is intended to be used as an interface with the implements - // keyword, and should not be extended directly. + // This class is intended to be used as an interface, and should not be + // extended directly; this constructor prevents instantiation and extension. + // ignore: unused_element factory RenderAbstractViewport._() => null; /// Returns the [RenderAbstractViewport] that most tightly encloses the given diff --git a/packages/flutter/lib/src/semantics/semantics_service.dart b/packages/flutter/lib/src/semantics/semantics_service.dart index 711241cafd..f893364d6f 100644 --- a/packages/flutter/lib/src/semantics/semantics_service.dart +++ b/packages/flutter/lib/src/semantics/semantics_service.dart @@ -18,6 +18,9 @@ import 'semantics_event.dart' show AnnounceSemanticsEvent, TooltipSemanticsEvent /// When possible, prefer using mechanisms like [Semantics] to implicitly /// trigger announcements over using this event. class SemanticsService { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element SemanticsService._(); /// Sends a semantic announcement. diff --git a/packages/flutter/lib/src/services/clipboard.dart b/packages/flutter/lib/src/services/clipboard.dart index cf720549be..d2fc7d83ab 100644 --- a/packages/flutter/lib/src/services/clipboard.dart +++ b/packages/flutter/lib/src/services/clipboard.dart @@ -23,6 +23,9 @@ class ClipboardData { /// Utility methods for interacting with the system's clipboard. class Clipboard { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element Clipboard._(); // Constants for common [getData] [format] types. diff --git a/packages/flutter/lib/src/services/haptic_feedback.dart b/packages/flutter/lib/src/services/haptic_feedback.dart index de462e9967..278a65e303 100644 --- a/packages/flutter/lib/src/services/haptic_feedback.dart +++ b/packages/flutter/lib/src/services/haptic_feedback.dart @@ -11,6 +11,9 @@ import 'system_channels.dart'; /// This API is intentionally terse since it calls default platform behavior. It /// is not suitable for precise control of the system's haptic feedback module. class HapticFeedback { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element HapticFeedback._(); /// Provides vibration haptic feedback to the user for a short duration. diff --git a/packages/flutter/lib/src/services/platform_messages.dart b/packages/flutter/lib/src/services/platform_messages.dart index 1b4c6430b7..2ec024beba 100644 --- a/packages/flutter/lib/src/services/platform_messages.dart +++ b/packages/flutter/lib/src/services/platform_messages.dart @@ -31,6 +31,9 @@ import 'platform_channel.dart'; 'This feature was deprecated after v1.6.5.' ) class BinaryMessages { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element BinaryMessages._(); /// The messenger which sends the platform messages, not null. diff --git a/packages/flutter/lib/src/services/system_channels.dart b/packages/flutter/lib/src/services/system_channels.dart index 626a48a90d..d1d5bc1868 100644 --- a/packages/flutter/lib/src/services/system_channels.dart +++ b/packages/flutter/lib/src/services/system_channels.dart @@ -9,6 +9,9 @@ import 'platform_channel.dart'; /// Platform channels used by the Flutter system. class SystemChannels { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element SystemChannels._(); /// A JSON [MethodChannel] for navigation. diff --git a/packages/flutter/lib/src/services/system_chrome.dart b/packages/flutter/lib/src/services/system_chrome.dart index ebd7bfe159..85b6bdebad 100644 --- a/packages/flutter/lib/src/services/system_chrome.dart +++ b/packages/flutter/lib/src/services/system_chrome.dart @@ -213,6 +213,9 @@ List _stringify(List list) => [ /// Controls specific aspects of the operating system's graphical interface and /// how it interacts with the application. class SystemChrome { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element SystemChrome._(); /// Specifies the set of orientations the application interface can diff --git a/packages/flutter/lib/src/services/system_navigator.dart b/packages/flutter/lib/src/services/system_navigator.dart index 4e23d0077c..c081525000 100644 --- a/packages/flutter/lib/src/services/system_navigator.dart +++ b/packages/flutter/lib/src/services/system_navigator.dart @@ -8,6 +8,9 @@ import 'system_channels.dart'; /// Controls specific aspects of the system navigation stack. class SystemNavigator { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element SystemNavigator._(); /// Removes the topmost Flutter instance, presenting what was before diff --git a/packages/flutter/lib/src/services/system_sound.dart b/packages/flutter/lib/src/services/system_sound.dart index 6b3e8168dc..4ea6825699 100644 --- a/packages/flutter/lib/src/services/system_sound.dart +++ b/packages/flutter/lib/src/services/system_sound.dart @@ -15,6 +15,9 @@ enum SystemSoundType { /// Provides access to the library of short system specific sounds for common /// tasks. class SystemSound { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element SystemSound._(); /// Play the specified system sound. If that sound is not present on the diff --git a/packages/flutter/lib/src/widgets/route_notification_messages.dart b/packages/flutter/lib/src/widgets/route_notification_messages.dart index 393161ab35..7bc6d6476e 100644 --- a/packages/flutter/lib/src/widgets/route_notification_messages.dart +++ b/packages/flutter/lib/src/widgets/route_notification_messages.dart @@ -9,6 +9,9 @@ import 'navigator.dart'; /// Messages for route change notifications. class RouteNotificationMessages { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element RouteNotificationMessages._(); /// When the engine is Web notify the platform for a route change. diff --git a/packages/flutter_test/lib/src/test_async_utils.dart b/packages/flutter_test/lib/src/test_async_utils.dart index 9f8100e179..cf6f24868e 100644 --- a/packages/flutter_test/lib/src/test_async_utils.dart +++ b/packages/flutter_test/lib/src/test_async_utils.dart @@ -45,6 +45,9 @@ class _AsyncScope { /// }); /// ``` class TestAsyncUtils { + // This class is not meant to be instatiated or extended; this constructor + // prevents instantiation and extension. + // ignore: unused_element TestAsyncUtils._(); static const String _className = 'TestAsyncUtils';