Commit 50058247 authored by Sam Rawlins's avatar Sam Rawlins Committed by Flutter GitHub Bot

Mark unused but desired private constructors as such (#46200)

parent f974c295
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class GalleryIcons { class GalleryIcons {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
GalleryIcons._(); GalleryIcons._();
static const IconData tooltip = IconData(0xe900, fontFamily: 'GalleryIcons'); static const IconData tooltip = IconData(0xe900, fontFamily: 'GalleryIcons');
......
...@@ -517,6 +517,9 @@ class ElasticInOutCurve extends Curve { ...@@ -517,6 +517,9 @@ class ElasticInOutCurve extends Curve {
/// * [Curve], the interface implemented by the constants available from the /// * [Curve], the interface implemented by the constants available from the
/// [Curves] class. /// [Curves] class.
class Curves { class Curves {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
Curves._(); Curves._();
/// A linear animation curve. /// A linear animation curve.
......
...@@ -18,6 +18,9 @@ import 'theme.dart'; ...@@ -18,6 +18,9 @@ import 'theme.dart';
/// A palette of [Color] constants that describe colors commonly used when /// A palette of [Color] constants that describe colors commonly used when
/// matching the iOS platform aesthetics. /// matching the iOS platform aesthetics.
class CupertinoColors { class CupertinoColors {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
CupertinoColors._(); CupertinoColors._();
/// iOS 13's default blue color. Used to indicate active elements such as /// iOS 13's default blue color. Used to indicate active elements such as
......
...@@ -26,6 +26,9 @@ import 'package:flutter/widgets.dart'; ...@@ -26,6 +26,9 @@ import 'package:flutter/widgets.dart';
/// * [Icon], used to show these icons. /// * [Icon], used to show these icons.
/// * <https://github.com/flutter/cupertino_icons/blob/master/map.png>, a map of the icons in this icons font. /// * <https://github.com/flutter/cupertino_icons/blob/master/map.png>, a map of the icons in this icons font.
class CupertinoIcons { class CupertinoIcons {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
CupertinoIcons._(); CupertinoIcons._();
/// The icon font used for Cupertino icons. /// The icon font used for Cupertino icons.
......
...@@ -112,6 +112,7 @@ class ErrorDescription extends _ErrorDiagnostic { ...@@ -112,6 +112,7 @@ class ErrorDescription extends _ErrorDiagnostic {
/// Calls to the default constructor may be rewritten to use this constructor /// Calls to the default constructor may be rewritten to use this constructor
/// in debug mode using a kernel transformer. /// in debug mode using a kernel transformer.
// ignore: unused_element
ErrorDescription._fromParts(List<Object> messageParts) : super._fromParts(messageParts, level: DiagnosticLevel.info); ErrorDescription._fromParts(List<Object> messageParts) : super._fromParts(messageParts, level: DiagnosticLevel.info);
} }
...@@ -146,6 +147,7 @@ class ErrorSummary extends _ErrorDiagnostic { ...@@ -146,6 +147,7 @@ class ErrorSummary extends _ErrorDiagnostic {
/// Calls to the default constructor may be rewritten to use this constructor /// Calls to the default constructor may be rewritten to use this constructor
/// in debug mode using a kernel transformer. /// in debug mode using a kernel transformer.
// ignore: unused_element
ErrorSummary._fromParts(List<Object> messageParts) : super._fromParts(messageParts, level: DiagnosticLevel.summary); ErrorSummary._fromParts(List<Object> messageParts) : super._fromParts(messageParts, level: DiagnosticLevel.summary);
} }
...@@ -176,6 +178,7 @@ class ErrorHint extends _ErrorDiagnostic { ...@@ -176,6 +178,7 @@ class ErrorHint extends _ErrorDiagnostic {
/// Calls to the default constructor may be rewritten to use this constructor /// Calls to the default constructor may be rewritten to use this constructor
/// in debug mode using a kernel transformer. /// in debug mode using a kernel transformer.
// ignore: unused_element
ErrorHint._fromParts(List<Object> messageParts) : super._fromParts(messageParts, level:DiagnosticLevel.hint); ErrorHint._fromParts(List<Object> messageParts) : super._fromParts(messageParts, level:DiagnosticLevel.hint);
} }
......
...@@ -288,6 +288,9 @@ class LicenseEntryWithLineBreaks extends LicenseEntry { ...@@ -288,6 +288,9 @@ class LicenseEntryWithLineBreaks extends LicenseEntry {
/// * [AboutListTile], which is a widget that can be added to a [Drawer]. When /// * [AboutListTile], which is a widget that can be added to a [Drawer]. When
/// tapped it calls [showAboutDialog]. /// tapped it calls [showAboutDialog].
class LicenseRegistry { class LicenseRegistry {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
LicenseRegistry._(); LicenseRegistry._();
static List<LicenseEntryCollector> _collectors; static List<LicenseEntryCollector> _collectors;
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
/// * <http://unicode.org/reports/tr9/>, which describes the Unicode /// * <http://unicode.org/reports/tr9/>, which describes the Unicode
/// bidirectional text algorithm. /// bidirectional text algorithm.
class Unicode { class Unicode {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
Unicode._(); Unicode._();
/// U+202A LEFT-TO-RIGHT EMBEDDING /// U+202A LEFT-TO-RIGHT EMBEDDING
/// ///
......
...@@ -32,6 +32,9 @@ int _synthesiseDownButtons(int buttons, PointerDeviceKind kind) { ...@@ -32,6 +32,9 @@ int _synthesiseDownButtons(int buttons, PointerDeviceKind kind) {
/// [dart:ui.Window.onPointerDataPacket], and converts them to [PointerEvent] /// [dart:ui.Window.onPointerDataPacket], and converts them to [PointerEvent]
/// objects. /// objects.
class PointerEventConverter { class PointerEventConverter {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
PointerEventConverter._(); PointerEventConverter._();
/// Expand the given packet of pointer data into a sequence of framework /// Expand the given packet of pointer data into a sequence of framework
......
...@@ -11,8 +11,9 @@ import 'events.dart'; ...@@ -11,8 +11,9 @@ import 'events.dart';
/// An object that can hit-test pointers. /// An object that can hit-test pointers.
abstract class HitTestable { abstract class HitTestable {
// This class is intended to be used as an interface with the implements // This class is intended to be used as an interface, and should not be
// keyword, and should not be extended directly. // extended directly; this constructor prevents instantiation and extension.
// ignore: unused_element
factory HitTestable._() => null; factory HitTestable._() => null;
/// Check whether the given position hits this object. /// Check whether the given position hits this object.
...@@ -24,8 +25,9 @@ abstract class HitTestable { ...@@ -24,8 +25,9 @@ abstract class HitTestable {
/// An object that can dispatch events. /// An object that can dispatch events.
abstract class HitTestDispatcher { abstract class HitTestDispatcher {
// This class is intended to be used as an interface with the implements // This class is intended to be used as an interface, and should not be
// keyword, and should not be extended directly. // extended directly; this constructor prevents instantiation and extension.
// ignore: unused_element
factory HitTestDispatcher._() => null; factory HitTestDispatcher._() => null;
/// Override this method to dispatch events. /// Override this method to dispatch events.
...@@ -34,8 +36,9 @@ abstract class HitTestDispatcher { ...@@ -34,8 +36,9 @@ abstract class HitTestDispatcher {
/// An object that can handle events. /// An object that can handle events.
abstract class HitTestTarget { abstract class HitTestTarget {
// This class is intended to be used as an interface with the implements // This class is intended to be used as an interface, and should not be
// keyword, and should not be extended directly. // extended directly; this constructor prevents instantiation and extension.
// ignore: unused_element
factory HitTestTarget._() => null; factory HitTestTarget._() => null;
/// Override this method to receive events. /// Override this method to receive events.
......
...@@ -63,7 +63,8 @@ const Icon _kDefaultDeleteIcon = Icon(Icons.cancel, size: _kDeleteIconSize); ...@@ -63,7 +63,8 @@ const Icon _kDefaultDeleteIcon = Icon(Icons.cancel, size: _kDeleteIconSize);
/// * <https://material.io/design/components/chips.html> /// * <https://material.io/design/components/chips.html>
abstract class ChipAttributes { abstract class ChipAttributes {
// This class is intended to be used as an interface, and should not be // 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; factory ChipAttributes._() => null;
/// The primary content of the chip. /// The primary content of the chip.
...@@ -174,7 +175,8 @@ abstract class ChipAttributes { ...@@ -174,7 +175,8 @@ abstract class ChipAttributes {
/// * <https://material.io/design/components/chips.html> /// * <https://material.io/design/components/chips.html>
abstract class DeletableChipAttributes { abstract class DeletableChipAttributes {
// This class is intended to be used as an interface, and should not be // 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; factory DeletableChipAttributes._() => null;
/// The icon displayed when [onDeleted] is set. /// The icon displayed when [onDeleted] is set.
...@@ -275,7 +277,8 @@ abstract class DeletableChipAttributes { ...@@ -275,7 +277,8 @@ abstract class DeletableChipAttributes {
/// * <https://material.io/design/components/chips.html> /// * <https://material.io/design/components/chips.html>
abstract class CheckmarkableChipAttributes { abstract class CheckmarkableChipAttributes {
// This class is intended to be used as an interface, and should not be // 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; factory CheckmarkableChipAttributes._() => null;
/// Whether or not to show a check mark when [selected] is true. /// Whether or not to show a check mark when [selected] is true.
...@@ -309,7 +312,8 @@ abstract class CheckmarkableChipAttributes { ...@@ -309,7 +312,8 @@ abstract class CheckmarkableChipAttributes {
/// * <https://material.io/design/components/chips.html> /// * <https://material.io/design/components/chips.html>
abstract class SelectableChipAttributes { abstract class SelectableChipAttributes {
// This class is intended to be used as an interface, and should not be // 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; factory SelectableChipAttributes._() => null;
/// Whether or not this chip is selected. /// Whether or not this chip is selected.
...@@ -417,7 +421,8 @@ abstract class SelectableChipAttributes { ...@@ -417,7 +421,8 @@ abstract class SelectableChipAttributes {
/// * <https://material.io/design/components/chips.html> /// * <https://material.io/design/components/chips.html>
abstract class DisabledChipAttributes { abstract class DisabledChipAttributes {
// This class is intended to be used as an interface, and should not be // 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; factory DisabledChipAttributes._() => null;
/// Whether or not this chip is enabled for input. /// Whether or not this chip is enabled for input.
...@@ -464,7 +469,8 @@ abstract class DisabledChipAttributes { ...@@ -464,7 +469,8 @@ abstract class DisabledChipAttributes {
/// * <https://material.io/design/components/chips.html> /// * <https://material.io/design/components/chips.html>
abstract class TappableChipAttributes { abstract class TappableChipAttributes {
// This class is intended to be used as an interface, and should not be // 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; factory TappableChipAttributes._() => null;
/// Called when the user taps the chip. /// Called when the user taps the chip.
......
...@@ -192,6 +192,9 @@ class MaterialAccentColor extends ColorSwatch<int> { ...@@ -192,6 +192,9 @@ class MaterialAccentColor extends ColorSwatch<int> {
/// The [Colors.transparent] color isn't shown here because it is entirely /// The [Colors.transparent] color isn't shown here because it is entirely
/// invisible! /// invisible!
class Colors { class Colors {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
Colors._(); Colors._();
/// Completely invisible. /// Completely invisible.
......
...@@ -14,7 +14,9 @@ import 'theme.dart'; ...@@ -14,7 +14,9 @@ import 'theme.dart';
/// This is an internal implementation class and should not be exported by /// This is an internal implementation class and should not be exported by
/// the material package. /// the material package.
class ElevationOverlay { class ElevationOverlay {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
ElevationOverlay._(); ElevationOverlay._();
/// Applies an elevation overlay color to a surface color to indicate /// Applies an elevation overlay color to a surface color to indicate
......
...@@ -80,6 +80,9 @@ import 'theme.dart'; ...@@ -80,6 +80,9 @@ import 'theme.dart';
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
class Feedback { class Feedback {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
Feedback._(); Feedback._();
/// Provides platform-specific feedback for a tap. /// Provides platform-specific feedback for a tap.
......
...@@ -59,6 +59,9 @@ import 'package:flutter/widgets.dart'; ...@@ -59,6 +59,9 @@ import 'package:flutter/widgets.dart';
/// * [IconButton] /// * [IconButton]
/// * <https://design.google.com/icons/> /// * <https://design.google.com/icons/>
class Icons { class Icons {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
Icons._(); Icons._();
// Generated code: do not hand-edit. // Generated code: do not hand-edit.
......
...@@ -11,6 +11,9 @@ import 'basic_types.dart'; ...@@ -11,6 +11,9 @@ import 'basic_types.dart';
/// Utility functions for working with matrices. /// Utility functions for working with matrices.
class MatrixUtils { class MatrixUtils {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
MatrixUtils._(); MatrixUtils._();
/// Returns the given [transform] matrix as an [Offset], if the matrix is /// Returns the given [transform] matrix as an [Offset], if the matrix is
......
...@@ -30,8 +30,9 @@ enum CacheExtentStyle { ...@@ -30,8 +30,9 @@ enum CacheExtentStyle {
/// the framework recognize such render objects and interact with them without /// the framework recognize such render objects and interact with them without
/// having specific knowledge of all the various types of viewports. /// having specific knowledge of all the various types of viewports.
abstract class RenderAbstractViewport extends RenderObject { abstract class RenderAbstractViewport extends RenderObject {
// This class is intended to be used as an interface with the implements // This class is intended to be used as an interface, and should not be
// keyword, and should not be extended directly. // extended directly; this constructor prevents instantiation and extension.
// ignore: unused_element
factory RenderAbstractViewport._() => null; factory RenderAbstractViewport._() => null;
/// Returns the [RenderAbstractViewport] that most tightly encloses the given /// Returns the [RenderAbstractViewport] that most tightly encloses the given
......
...@@ -18,6 +18,9 @@ import 'semantics_event.dart' show AnnounceSemanticsEvent, TooltipSemanticsEvent ...@@ -18,6 +18,9 @@ import 'semantics_event.dart' show AnnounceSemanticsEvent, TooltipSemanticsEvent
/// When possible, prefer using mechanisms like [Semantics] to implicitly /// When possible, prefer using mechanisms like [Semantics] to implicitly
/// trigger announcements over using this event. /// trigger announcements over using this event.
class SemanticsService { class SemanticsService {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
SemanticsService._(); SemanticsService._();
/// Sends a semantic announcement. /// Sends a semantic announcement.
......
...@@ -23,6 +23,9 @@ class ClipboardData { ...@@ -23,6 +23,9 @@ class ClipboardData {
/// Utility methods for interacting with the system's clipboard. /// Utility methods for interacting with the system's clipboard.
class Clipboard { class Clipboard {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
Clipboard._(); Clipboard._();
// Constants for common [getData] [format] types. // Constants for common [getData] [format] types.
......
...@@ -11,6 +11,9 @@ import 'system_channels.dart'; ...@@ -11,6 +11,9 @@ import 'system_channels.dart';
/// This API is intentionally terse since it calls default platform behavior. It /// 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. /// is not suitable for precise control of the system's haptic feedback module.
class HapticFeedback { class HapticFeedback {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
HapticFeedback._(); HapticFeedback._();
/// Provides vibration haptic feedback to the user for a short duration. /// Provides vibration haptic feedback to the user for a short duration.
......
...@@ -31,6 +31,9 @@ import 'platform_channel.dart'; ...@@ -31,6 +31,9 @@ import 'platform_channel.dart';
'This feature was deprecated after v1.6.5.' 'This feature was deprecated after v1.6.5.'
) )
class BinaryMessages { class BinaryMessages {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
BinaryMessages._(); BinaryMessages._();
/// The messenger which sends the platform messages, not null. /// The messenger which sends the platform messages, not null.
......
...@@ -9,6 +9,9 @@ import 'platform_channel.dart'; ...@@ -9,6 +9,9 @@ import 'platform_channel.dart';
/// Platform channels used by the Flutter system. /// Platform channels used by the Flutter system.
class SystemChannels { class SystemChannels {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
SystemChannels._(); SystemChannels._();
/// A JSON [MethodChannel] for navigation. /// A JSON [MethodChannel] for navigation.
......
...@@ -213,6 +213,9 @@ List<String> _stringify(List<dynamic> list) => <String>[ ...@@ -213,6 +213,9 @@ List<String> _stringify(List<dynamic> list) => <String>[
/// Controls specific aspects of the operating system's graphical interface and /// Controls specific aspects of the operating system's graphical interface and
/// how it interacts with the application. /// how it interacts with the application.
class SystemChrome { class SystemChrome {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
SystemChrome._(); SystemChrome._();
/// Specifies the set of orientations the application interface can /// Specifies the set of orientations the application interface can
......
...@@ -8,6 +8,9 @@ import 'system_channels.dart'; ...@@ -8,6 +8,9 @@ import 'system_channels.dart';
/// Controls specific aspects of the system navigation stack. /// Controls specific aspects of the system navigation stack.
class SystemNavigator { class SystemNavigator {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
SystemNavigator._(); SystemNavigator._();
/// Removes the topmost Flutter instance, presenting what was before /// Removes the topmost Flutter instance, presenting what was before
......
...@@ -15,6 +15,9 @@ enum SystemSoundType { ...@@ -15,6 +15,9 @@ enum SystemSoundType {
/// Provides access to the library of short system specific sounds for common /// Provides access to the library of short system specific sounds for common
/// tasks. /// tasks.
class SystemSound { class SystemSound {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
SystemSound._(); SystemSound._();
/// Play the specified system sound. If that sound is not present on the /// Play the specified system sound. If that sound is not present on the
......
...@@ -9,6 +9,9 @@ import 'navigator.dart'; ...@@ -9,6 +9,9 @@ import 'navigator.dart';
/// Messages for route change notifications. /// Messages for route change notifications.
class RouteNotificationMessages { class RouteNotificationMessages {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
RouteNotificationMessages._(); RouteNotificationMessages._();
/// When the engine is Web notify the platform for a route change. /// When the engine is Web notify the platform for a route change.
......
...@@ -45,6 +45,9 @@ class _AsyncScope { ...@@ -45,6 +45,9 @@ class _AsyncScope {
/// }); /// });
/// ``` /// ```
class TestAsyncUtils { class TestAsyncUtils {
// This class is not meant to be instatiated or extended; this constructor
// prevents instantiation and extension.
// ignore: unused_element
TestAsyncUtils._(); TestAsyncUtils._();
static const String _className = 'TestAsyncUtils'; static const String _className = 'TestAsyncUtils';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment