Unverified Commit 210f4d83 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Convert Diagnosticable to a mixin (#51495)

This converts Diagnosticable to be a mixin instead of an abstract class, so that it can be used to add diagnostics to classes which already have a base class.

It leaves in place the DiagnosticableMixin mixin, since there are some plugins that are still using it, and removing it would mean that those plugins wouldn't work with master branch Flutter anymore. DiagnosticableMixin will be removed once this mixin version of Diagnosticable makes its way to the stable branch.
parent 6804cef5
...@@ -675,7 +675,7 @@ class CupertinoColors { ...@@ -675,7 +675,7 @@ class CupertinoColors {
/// * [CupertinoTheme.of], a static method that retrieves the ambient [CupertinoThemeData], /// * [CupertinoTheme.of], a static method that retrieves the ambient [CupertinoThemeData],
/// and then resolves [CupertinoDynamicColor]s used in the retrieved data. /// and then resolves [CupertinoDynamicColor]s used in the retrieved data.
@immutable @immutable
class CupertinoDynamicColor extends Color with DiagnosticableMixin implements Diagnosticable { class CupertinoDynamicColor extends Color with Diagnosticable {
/// Creates an adaptive [Color] that changes its effective color based on the /// Creates an adaptive [Color] that changes its effective color based on the
/// [BuildContext] given. The default effective color is [color]. /// [BuildContext] given. The default effective color is [color].
/// ///
......
...@@ -8,7 +8,7 @@ import 'colors.dart'; ...@@ -8,7 +8,7 @@ import 'colors.dart';
/// An [IconThemeData] subclass that automatically resolves its [color] when retrieved /// An [IconThemeData] subclass that automatically resolves its [color] when retrieved
/// using [IconTheme.of]. /// using [IconTheme.of].
class CupertinoIconThemeData extends IconThemeData with DiagnosticableMixin implements Diagnosticable { class CupertinoIconThemeData extends IconThemeData with Diagnosticable {
/// Creates a [CupertinoIconThemeData]. /// Creates a [CupertinoIconThemeData].
/// ///
/// The opacity applies to both explicit and default icon colors. The value /// The opacity applies to both explicit and default icon colors. The value
......
...@@ -107,7 +107,7 @@ TextStyle _resolveTextStyle(TextStyle style, BuildContext context, bool nullOk) ...@@ -107,7 +107,7 @@ TextStyle _resolveTextStyle(TextStyle style, BuildContext context, bool nullOk)
/// Cupertino typography theme in a [CupertinoThemeData]. /// Cupertino typography theme in a [CupertinoThemeData].
@immutable @immutable
class CupertinoTextThemeData extends Diagnosticable { class CupertinoTextThemeData with Diagnosticable {
/// Create a [CupertinoTextThemeData]. /// Create a [CupertinoTextThemeData].
/// ///
/// The [primaryColor] is used to derive TextStyle defaults of other attributes /// The [primaryColor] is used to derive TextStyle defaults of other attributes
......
...@@ -143,7 +143,7 @@ class _InheritedCupertinoTheme extends InheritedWidget { ...@@ -143,7 +143,7 @@ class _InheritedCupertinoTheme extends InheritedWidget {
/// * [ThemeData], a Material equivalent that also configures Cupertino /// * [ThemeData], a Material equivalent that also configures Cupertino
/// styling via a [CupertinoThemeData] subclass [MaterialBasedCupertinoThemeData]. /// styling via a [CupertinoThemeData] subclass [MaterialBasedCupertinoThemeData].
@immutable @immutable
class CupertinoThemeData extends Diagnosticable { class CupertinoThemeData with Diagnosticable {
/// Creates a [CupertinoTheme] styling specification. /// Creates a [CupertinoTheme] styling specification.
/// ///
/// Unspecified parameters default to a reasonable iOS default style. /// Unspecified parameters default to a reasonable iOS default style.
......
...@@ -326,7 +326,7 @@ class ErrorSpacer extends DiagnosticsProperty<void> { ...@@ -326,7 +326,7 @@ class ErrorSpacer extends DiagnosticsProperty<void> {
/// Class for information provided to [FlutterExceptionHandler] callbacks. /// Class for information provided to [FlutterExceptionHandler] callbacks.
/// ///
/// See [FlutterError.onError]. /// See [FlutterError.onError].
class FlutterErrorDetails extends Diagnosticable { class FlutterErrorDetails with Diagnosticable {
/// Creates a [FlutterErrorDetails] object with the given arguments setting /// Creates a [FlutterErrorDetails] object with the given arguments setting
/// the object's properties. /// the object's properties.
/// ///
...@@ -478,7 +478,7 @@ class FlutterErrorDetails extends Diagnosticable { ...@@ -478,7 +478,7 @@ class FlutterErrorDetails extends Diagnosticable {
return longMessage; return longMessage;
} }
DiagnosticableMixin _exceptionToDiagnosticable() { Diagnosticable _exceptionToDiagnosticable() {
if (exception is FlutterError) { if (exception is FlutterError) {
return exception as FlutterError; return exception as FlutterError;
} }
...@@ -501,7 +501,7 @@ class FlutterErrorDetails extends Diagnosticable { ...@@ -501,7 +501,7 @@ class FlutterErrorDetails extends Diagnosticable {
if (kReleaseMode) { if (kReleaseMode) {
return DiagnosticsNode.message(formatException()); return DiagnosticsNode.message(formatException());
} }
final DiagnosticableMixin diagnosticable = _exceptionToDiagnosticable(); final Diagnosticable diagnosticable = _exceptionToDiagnosticable();
DiagnosticsNode summary; DiagnosticsNode summary;
if (diagnosticable != null) { if (diagnosticable != null) {
final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder();
...@@ -515,7 +515,7 @@ class FlutterErrorDetails extends Diagnosticable { ...@@ -515,7 +515,7 @@ class FlutterErrorDetails extends Diagnosticable {
void debugFillProperties(DiagnosticPropertiesBuilder properties) { void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties); super.debugFillProperties(properties);
final DiagnosticsNode verb = ErrorDescription('thrown${ context != null ? ErrorDescription(" $context") : ""}'); final DiagnosticsNode verb = ErrorDescription('thrown${ context != null ? ErrorDescription(" $context") : ""}');
final DiagnosticableMixin diagnosticable = _exceptionToDiagnosticable(); final Diagnosticable diagnosticable = _exceptionToDiagnosticable();
if (exception is NullThrownError) { if (exception is NullThrownError) {
properties.add(ErrorDescription('The null value was $verb.')); properties.add(ErrorDescription('The null value was $verb.'));
} else if (exception is num) { } else if (exception is num) {
......
...@@ -2640,7 +2640,7 @@ class DiagnosticsProperty<T> extends DiagnosticsNode { ...@@ -2640,7 +2640,7 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
Map<String, Object> toJsonMap(DiagnosticsSerializationDelegate delegate) { Map<String, Object> toJsonMap(DiagnosticsSerializationDelegate delegate) {
final T v = value; final T v = value;
List<Map<String, Object>> properties; List<Map<String, Object>> properties;
if (delegate.expandPropertyValues && delegate.includeProperties && v is DiagnosticableMixin && getProperties().isEmpty) { if (delegate.expandPropertyValues && delegate.includeProperties && v is Diagnosticable && getProperties().isEmpty) {
// Exclude children for expanded nodes to avoid cycles. // Exclude children for expanded nodes to avoid cycles.
delegate = delegate.copyWith(subtreeDepth: 0, includeProperties: false); delegate = delegate.copyWith(subtreeDepth: 0, includeProperties: false);
properties = DiagnosticsNode.toJsonList( properties = DiagnosticsNode.toJsonList(
...@@ -2666,7 +2666,7 @@ class DiagnosticsProperty<T> extends DiagnosticsNode { ...@@ -2666,7 +2666,7 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
json['exception'] = exception.toString(); json['exception'] = exception.toString();
json['propertyType'] = propertyType.toString(); json['propertyType'] = propertyType.toString();
json['defaultLevel'] = describeEnum(_defaultLevel); json['defaultLevel'] = describeEnum(_defaultLevel);
if (value is DiagnosticableMixin || value is DiagnosticsNode) if (value is Diagnosticable || value is DiagnosticsNode)
json['isDiagnosticableValue'] = true; json['isDiagnosticableValue'] = true;
if (v is num) if (v is num)
// Workaround for https://github.com/flutter/flutter/issues/39937#issuecomment-529558033. // Workaround for https://github.com/flutter/flutter/issues/39937#issuecomment-529558033.
...@@ -2846,7 +2846,7 @@ class DiagnosticsProperty<T> extends DiagnosticsNode { ...@@ -2846,7 +2846,7 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
if (object is DiagnosticsNode) { if (object is DiagnosticsNode) {
return object.getProperties(); return object.getProperties();
} }
if (object is DiagnosticableMixin) { if (object is Diagnosticable) {
return object.toDiagnosticsNode(style: style).getProperties(); return object.toDiagnosticsNode(style: style).getProperties();
} }
} }
...@@ -2860,7 +2860,7 @@ class DiagnosticsProperty<T> extends DiagnosticsNode { ...@@ -2860,7 +2860,7 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
if (object is DiagnosticsNode) { if (object is DiagnosticsNode) {
return object.getChildren(); return object.getChildren();
} }
if (object is DiagnosticableMixin) { if (object is Diagnosticable) {
return object.toDiagnosticsNode(style: style).getChildren(); return object.toDiagnosticsNode(style: style).getChildren();
} }
} }
...@@ -2870,7 +2870,7 @@ class DiagnosticsProperty<T> extends DiagnosticsNode { ...@@ -2870,7 +2870,7 @@ class DiagnosticsProperty<T> extends DiagnosticsNode {
/// [DiagnosticsNode] that lazily calls the associated [Diagnosticable] [value] /// [DiagnosticsNode] that lazily calls the associated [Diagnosticable] [value]
/// to implement [getChildren] and [getProperties]. /// to implement [getChildren] and [getProperties].
class DiagnosticableNode<T extends DiagnosticableMixin> extends DiagnosticsNode { class DiagnosticableNode<T extends Diagnosticable> extends DiagnosticsNode {
/// Create a diagnostics describing a [DiagnosticableMixin] value. /// Create a diagnostics describing a [DiagnosticableMixin] value.
/// ///
/// The [value] argument must not be null. /// The [value] argument must not be null.
...@@ -3017,42 +3017,47 @@ class DiagnosticPropertiesBuilder { ...@@ -3017,42 +3017,47 @@ class DiagnosticPropertiesBuilder {
String emptyBodyDescription; String emptyBodyDescription;
} }
// Examples can assume: // TODO(gspencergoog): Remove DiagnosticableMixin once the mixin Diagnosticable is in stable.
// class ExampleSuperclass extends Diagnosticable { String message; double stepWidth; double scale; double paintExtent; double hitTestExtent; double paintExtend; double maxWidth; bool primary; double progress; int maxLines; Duration duration; int depth; dynamic boxShadow; dynamic style; bool hasSize; Matrix4 transform; Map<Listenable, VoidCallback> handles; Color color; bool obscureText; ImageRepeat repeat; Size size; Widget widget; bool isCurrent; bool keepAlive; TextAlign textAlign; } // https://github.com/flutter/flutter/issues/50498
/// A base class for providing string and [DiagnosticsNode] debug /// A mixin class implementing the [Diagnosticable] interface that provides
/// representations describing the properties of an object. /// string and [DiagnosticsNode] debug representations describing the properties
/// /// of an object.
/// The string debug representation is generated from the intermediate
/// [DiagnosticsNode] representation. The [DiagnosticsNode] representation is
/// also used by debugging tools displaying interactive trees of objects and
/// properties.
///
/// See also:
/// ///
/// * [DiagnosticableTree], which extends this class to also describe the /// _This mixin is exists only to support plugins that require older Flutter
/// children of a tree structured object. /// versions: Use the identical mixin [Diagnosticable] instead for most code._
/// * [DiagnosticableMixin], which provides the implementation for mixin DiagnosticableMixin implements Diagnosticable {
/// [Diagnosticable], and can be used to add diagnostics to classes which @override
/// already have a base class. String toStringShort() => describeIdentity(this);
/// * [DiagnosticableMixin.debugFillProperties], which lists best practices
/// for specifying the properties of a [DiagnosticsNode]. The most common use @override
/// case is to override [debugFillProperties] defining custom properties for String toString({ DiagnosticLevel minLevel = DiagnosticLevel.info }) {
/// a subclass of [DiagnosticableTreeMixin] using the existing String fullString;
/// [DiagnosticsProperty] subclasses. assert(() {
/// * [DiagnosticableTree.debugDescribeChildren], which lists best practices fullString = toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel);
/// for describing the children of a [DiagnosticsNode]. Typically the base return true;
/// class already describes the children of a node properly or a node has }());
/// no children. return fullString ?? toStringShort();
/// * [DiagnosticsProperty], which should be used to create leaf diagnostic }
/// nodes without properties or children. There are many
/// [DiagnosticsProperty] subclasses to handle common use cases. @override
abstract class Diagnosticable with DiagnosticableMixin { DiagnosticsNode toDiagnosticsNode({ String name, DiagnosticsTreeStyle style }) {
/// Abstract const constructor. This constructor enables subclasses to provide return DiagnosticableNode<Diagnosticable>(
/// const constructors so that they can be used in const expressions. name: name,
const Diagnosticable(); value: this,
style: style,
);
}
@override
@protected
@mustCallSuper
void debugFillProperties(DiagnosticPropertiesBuilder properties) { }
} }
// Examples can assume:
// class ExampleSuperclass with Diagnosticable { String message; double stepWidth; double scale; double paintExtent; double hitTestExtent; double paintExtend; double maxWidth; bool primary; double progress; int maxLines; Duration duration; int depth; dynamic boxShadow; dynamic style; bool hasSize; Matrix4 transform; Map<Listenable, VoidCallback> handles; Color color; bool obscureText; ImageRepeat repeat; Size size; Widget widget; bool isCurrent; bool keepAlive; TextAlign textAlign; }
/// A mixin class for providing string and [DiagnosticsNode] debug /// A mixin class for providing string and [DiagnosticsNode] debug
/// representations describing the properties of an object. /// representations describing the properties of an object.
/// ///
...@@ -3077,7 +3082,7 @@ abstract class Diagnosticable with DiagnosticableMixin { ...@@ -3077,7 +3082,7 @@ abstract class Diagnosticable with DiagnosticableMixin {
/// * [DiagnosticsProperty], which should be used to create leaf diagnostic /// * [DiagnosticsProperty], which should be used to create leaf diagnostic
/// nodes without properties or children. There are many /// nodes without properties or children. There are many
/// [DiagnosticsProperty] subclasses to handle common use cases. /// [DiagnosticsProperty] subclasses to handle common use cases.
mixin DiagnosticableMixin { mixin Diagnosticable {
/// A brief description of this object, usually just the [runtimeType] and the /// A brief description of this object, usually just the [runtimeType] and the
/// [hashCode]. /// [hashCode].
/// ///
...@@ -3106,7 +3111,7 @@ mixin DiagnosticableMixin { ...@@ -3106,7 +3111,7 @@ mixin DiagnosticableMixin {
/// relationship between the parent and the node. For example, pass /// relationship between the parent and the node. For example, pass
/// [DiagnosticsTreeStyle.offstage] to indicate that a node is offstage. /// [DiagnosticsTreeStyle.offstage] to indicate that a node is offstage.
DiagnosticsNode toDiagnosticsNode({ String name, DiagnosticsTreeStyle style }) { DiagnosticsNode toDiagnosticsNode({ String name, DiagnosticsTreeStyle style }) {
return DiagnosticableNode<DiagnosticableMixin>( return DiagnosticableNode<Diagnosticable>(
name: name, name: name,
value: this, value: this,
style: style, style: style,
...@@ -3338,7 +3343,7 @@ mixin DiagnosticableMixin { ...@@ -3338,7 +3343,7 @@ mixin DiagnosticableMixin {
/// * [DiagnosticableTreeMixin], a mixin that implements this class. /// * [DiagnosticableTreeMixin], a mixin that implements this class.
/// * [DiagnosticableMixin], which should be used instead of this class to /// * [DiagnosticableMixin], which should be used instead of this class to
/// provide diagnostics for objects without children. /// provide diagnostics for objects without children.
abstract class DiagnosticableTree extends Diagnosticable { abstract class DiagnosticableTree with Diagnosticable {
/// Abstract const constructor. This constructor enables subclasses to provide /// Abstract const constructor. This constructor enables subclasses to provide
/// const constructors so that they can be used in const expressions. /// const constructors so that they can be used in const expressions.
const DiagnosticableTree(); const DiagnosticableTree();
......
...@@ -196,7 +196,7 @@ bool isSingleButton(int buttons) => buttons != 0 && (smallestButton(buttons) == ...@@ -196,7 +196,7 @@ bool isSingleButton(int buttons) => buttons != 0 && (smallestButton(buttons) ==
/// ///
/// * [Window.devicePixelRatio], which defines the device's current resolution. /// * [Window.devicePixelRatio], which defines the device's current resolution.
@immutable @immutable
abstract class PointerEvent extends Diagnosticable { abstract class PointerEvent with Diagnosticable {
/// Abstract const constructor. This constructor enables subclasses to provide /// Abstract const constructor. This constructor enables subclasses to provide
/// const constructors so that they can be used in const expressions. /// const constructors so that they can be used in const expressions.
const PointerEvent({ const PointerEvent({
......
...@@ -30,7 +30,7 @@ typedef PointerHoverEventListener = void Function(PointerHoverEvent event); ...@@ -30,7 +30,7 @@ typedef PointerHoverEventListener = void Function(PointerHoverEvent event);
/// movements. /// movements.
/// ///
/// This is added to a layer and managed by the [MouseRegion] widget. /// This is added to a layer and managed by the [MouseRegion] widget.
class MouseTrackerAnnotation extends Diagnosticable { class MouseTrackerAnnotation with Diagnosticable {
/// Creates an annotation that can be used to find layers interested in mouse /// Creates an annotation that can be used to find layers interested in mouse
/// movements. /// movements.
const MouseTrackerAnnotation({this.onEnter, this.onHover, this.onExit}); const MouseTrackerAnnotation({this.onEnter, this.onHover, this.onExit});
......
...@@ -27,7 +27,7 @@ import 'theme.dart'; ...@@ -27,7 +27,7 @@ import 'theme.dart';
/// ///
/// * [ThemeData], which describes the overall theme information for the /// * [ThemeData], which describes the overall theme information for the
/// application. /// application.
class AppBarTheme extends Diagnosticable { class AppBarTheme with Diagnosticable {
/// Creates a theme that can be used for [ThemeData.AppBarTheme]. /// Creates a theme that can be used for [ThemeData.AppBarTheme].
const AppBarTheme({ const AppBarTheme({
this.brightness, this.brightness,
......
...@@ -23,7 +23,7 @@ import 'theme.dart'; ...@@ -23,7 +23,7 @@ import 'theme.dart';
/// ///
/// * [ThemeData], which describes the overall theme information for the /// * [ThemeData], which describes the overall theme information for the
/// application. /// application.
class MaterialBannerThemeData extends Diagnosticable { class MaterialBannerThemeData with Diagnosticable {
/// Creates a theme that can be used for [MaterialBannerTheme] or /// Creates a theme that can be used for [MaterialBannerTheme] or
/// [ThemeData.bannerTheme]. /// [ThemeData.bannerTheme].
......
...@@ -25,7 +25,7 @@ import 'theme.dart'; ...@@ -25,7 +25,7 @@ import 'theme.dart';
/// ///
/// * [ThemeData], which describes the overall theme information for the /// * [ThemeData], which describes the overall theme information for the
/// application. /// application.
class BottomAppBarTheme extends Diagnosticable { class BottomAppBarTheme with Diagnosticable {
/// Creates a theme that can be used for [ThemeData.BottomAppBarTheme]. /// Creates a theme that can be used for [ThemeData.BottomAppBarTheme].
const BottomAppBarTheme({ const BottomAppBarTheme({
this.color, this.color,
......
...@@ -24,7 +24,7 @@ import 'package:flutter/rendering.dart'; ...@@ -24,7 +24,7 @@ import 'package:flutter/rendering.dart';
/// ///
/// * [ThemeData], which describes the overall theme information for the /// * [ThemeData], which describes the overall theme information for the
/// application. /// application.
class BottomSheetThemeData extends Diagnosticable { class BottomSheetThemeData with Diagnosticable {
/// Creates a theme that can be used for [ThemeData.bottomSheetTheme]. /// Creates a theme that can be used for [ThemeData.bottomSheetTheme].
const BottomSheetThemeData({ const BottomSheetThemeData({
this.backgroundColor, this.backgroundColor,
......
...@@ -24,7 +24,7 @@ import 'theme.dart'; ...@@ -24,7 +24,7 @@ import 'theme.dart';
/// its subtree. /// its subtree.
/// * [ButtonBar], which uses this to configure itself and its children /// * [ButtonBar], which uses this to configure itself and its children
/// button widgets. /// button widgets.
class ButtonBarThemeData extends Diagnosticable { class ButtonBarThemeData with Diagnosticable {
/// Constructs the set of properties used to configure [ButtonBar] widgets. /// Constructs the set of properties used to configure [ButtonBar] widgets.
/// ///
/// Both [buttonMinWidth] and [buttonHeight] must be non-negative if they /// Both [buttonMinWidth] and [buttonHeight] must be non-negative if they
......
...@@ -248,7 +248,7 @@ class ButtonTheme extends InheritedTheme { ...@@ -248,7 +248,7 @@ class ButtonTheme extends InheritedTheme {
/// A button theme can be specified as part of the overall Material theme /// A button theme can be specified as part of the overall Material theme
/// using [ThemeData.buttonTheme]. The Material theme's button theme data /// using [ThemeData.buttonTheme]. The Material theme's button theme data
/// can be overridden with [ButtonTheme]. /// can be overridden with [ButtonTheme].
class ButtonThemeData extends Diagnosticable { class ButtonThemeData with Diagnosticable {
/// Create a button theme object that can be used with [ButtonTheme] /// Create a button theme object that can be used with [ButtonTheme]
/// or [ThemeData]. /// or [ThemeData].
/// ///
......
...@@ -26,7 +26,7 @@ import 'theme.dart'; ...@@ -26,7 +26,7 @@ import 'theme.dart';
/// ///
/// * [ThemeData], which describes the overall theme information for the /// * [ThemeData], which describes the overall theme information for the
/// application. /// application.
class CardTheme extends Diagnosticable { class CardTheme with Diagnosticable {
/// Creates a theme that can be used for [ThemeData.cardTheme]. /// Creates a theme that can be used for [ThemeData.cardTheme].
/// ///
......
...@@ -168,7 +168,7 @@ class ChipTheme extends InheritedTheme { ...@@ -168,7 +168,7 @@ class ChipTheme extends InheritedTheme {
/// * [Theme] widget, which performs a similar function to [ChipTheme], /// * [Theme] widget, which performs a similar function to [ChipTheme],
/// but for overall themes. /// but for overall themes.
/// * [ThemeData], which has a default [ChipThemeData]. /// * [ThemeData], which has a default [ChipThemeData].
class ChipThemeData extends Diagnosticable { class ChipThemeData with Diagnosticable {
/// Create a [ChipThemeData] given a set of exact values. All the values /// Create a [ChipThemeData] given a set of exact values. All the values
/// must be specified except for [shadowColor], [selectedShadowColor], /// must be specified except for [shadowColor], [selectedShadowColor],
/// [elevation], and [pressElevation], which may be null. /// [elevation], and [pressElevation], which may be null.
......
...@@ -16,7 +16,7 @@ import 'theme_data.dart'; ...@@ -16,7 +16,7 @@ import 'theme_data.dart';
/// The [Theme] has a color scheme, [ThemeData.colorScheme], which is constructed /// The [Theme] has a color scheme, [ThemeData.colorScheme], which is constructed
/// with [ColorScheme.fromSwatch]. /// with [ColorScheme.fromSwatch].
@immutable @immutable
class ColorScheme extends Diagnosticable { class ColorScheme with Diagnosticable {
/// Create a ColorScheme instance. /// Create a ColorScheme instance.
const ColorScheme({ const ColorScheme({
@required this.primary, @required this.primary,
......
...@@ -27,7 +27,7 @@ import 'theme.dart'; ...@@ -27,7 +27,7 @@ import 'theme.dart';
/// * [Dialog], a material dialog that can be customized using this [DialogTheme]. /// * [Dialog], a material dialog that can be customized using this [DialogTheme].
/// * [ThemeData], which describes the overall theme information for the /// * [ThemeData], which describes the overall theme information for the
/// application. /// application.
class DialogTheme extends Diagnosticable { class DialogTheme with Diagnosticable {
/// Creates a dialog theme that can be used for [ThemeData.dialogTheme]. /// Creates a dialog theme that can be used for [ThemeData.dialogTheme].
const DialogTheme({ const DialogTheme({
this.backgroundColor, this.backgroundColor,
......
...@@ -26,7 +26,7 @@ import 'theme.dart'; ...@@ -26,7 +26,7 @@ import 'theme.dart';
/// ///
/// * [ThemeData], which describes the overall theme information for the /// * [ThemeData], which describes the overall theme information for the
/// application. /// application.
class DividerThemeData extends Diagnosticable { class DividerThemeData with Diagnosticable {
/// Creates a theme that can be used for [DividerTheme] or /// Creates a theme that can be used for [DividerTheme] or
/// [ThemeData.dividerTheme]. /// [ThemeData.dividerTheme].
......
...@@ -26,7 +26,7 @@ import 'package:flutter/rendering.dart'; ...@@ -26,7 +26,7 @@ import 'package:flutter/rendering.dart';
/// ///
/// * [ThemeData], which describes the overall theme information for the /// * [ThemeData], which describes the overall theme information for the
/// application. /// application.
class FloatingActionButtonThemeData extends Diagnosticable { class FloatingActionButtonThemeData with Diagnosticable {
/// Creates a theme that can be used for /// Creates a theme that can be used for
/// [ThemeData.floatingActionButtonTheme]. /// [ThemeData.floatingActionButtonTheme].
const FloatingActionButtonThemeData({ const FloatingActionButtonThemeData({
......
...@@ -3548,7 +3548,7 @@ class InputDecoration { ...@@ -3548,7 +3548,7 @@ class InputDecoration {
/// The [InputDecoration.applyDefaults] method is used to combine a input /// The [InputDecoration.applyDefaults] method is used to combine a input
/// decoration theme with an [InputDecoration] object. /// decoration theme with an [InputDecoration] object.
@immutable @immutable
class InputDecorationTheme extends Diagnosticable { class InputDecorationTheme with Diagnosticable {
/// Creates a value for [ThemeData.inputDecorationTheme] that /// Creates a value for [ThemeData.inputDecorationTheme] that
/// defines default values for [InputDecorator]. /// defines default values for [InputDecorator].
/// ///
......
...@@ -483,7 +483,7 @@ class CupertinoPageTransitionsBuilder extends PageTransitionsBuilder { ...@@ -483,7 +483,7 @@ class CupertinoPageTransitionsBuilder extends PageTransitionsBuilder {
/// * [CupertinoPageTransitionsBuilder], which defines a horizontal page /// * [CupertinoPageTransitionsBuilder], which defines a horizontal page
/// transition that matches native iOS page transitions. /// transition that matches native iOS page transitions.
@immutable @immutable
class PageTransitionsTheme extends Diagnosticable { class PageTransitionsTheme with Diagnosticable {
/// Construct a PageTransitionsTheme. /// Construct a PageTransitionsTheme.
/// ///
/// By default the list of builders is: [FadeUpwardsPageTransitionsBuilder] /// By default the list of builders is: [FadeUpwardsPageTransitionsBuilder]
......
...@@ -29,7 +29,7 @@ import 'theme.dart'; ...@@ -29,7 +29,7 @@ import 'theme.dart';
/// ///
/// * [ThemeData], which describes the overall theme information for the /// * [ThemeData], which describes the overall theme information for the
/// application. /// application.
class PopupMenuThemeData extends Diagnosticable { class PopupMenuThemeData with Diagnosticable {
/// Creates the set of properties used to configure [PopupMenuTheme]. /// Creates the set of properties used to configure [PopupMenuTheme].
const PopupMenuThemeData({ const PopupMenuThemeData({
this.color, this.color,
......
...@@ -305,7 +305,7 @@ enum Thumb { ...@@ -305,7 +305,7 @@ enum Thumb {
/// {@macro flutter.material.slider.seeAlso.rangeSliderValueIndicatorShape} /// {@macro flutter.material.slider.seeAlso.rangeSliderValueIndicatorShape}
/// {@macro flutter.material.slider.seeAlso.rangeSliderTrackShape} /// {@macro flutter.material.slider.seeAlso.rangeSliderTrackShape}
/// {@macro flutter.material.slider.seeAlso.rangeSliderTickMarkShape} /// {@macro flutter.material.slider.seeAlso.rangeSliderTickMarkShape}
class SliderThemeData extends Diagnosticable { class SliderThemeData with Diagnosticable {
/// Create a [SliderThemeData] given a set of exact values. All the values /// Create a [SliderThemeData] given a set of exact values. All the values
/// must be specified. /// must be specified.
/// ///
......
...@@ -46,7 +46,7 @@ enum SnackBarBehavior { ...@@ -46,7 +46,7 @@ enum SnackBarBehavior {
/// ///
/// * [ThemeData], which describes the overall theme information for the /// * [ThemeData], which describes the overall theme information for the
/// application. /// application.
class SnackBarThemeData extends Diagnosticable { class SnackBarThemeData with Diagnosticable {
/// Creates a theme that can be used for [ThemeData.snackBarTheme]. /// Creates a theme that can be used for [ThemeData.snackBarTheme].
/// ///
......
...@@ -23,7 +23,7 @@ import 'theme.dart'; ...@@ -23,7 +23,7 @@ import 'theme.dart';
/// * [TabBar], a widget that displays a horizontal row of tabs. /// * [TabBar], a widget that displays a horizontal row of tabs.
/// * [ThemeData], which describes the overall theme information for the /// * [ThemeData], which describes the overall theme information for the
/// application. /// application.
class TabBarTheme extends Diagnosticable { class TabBarTheme with Diagnosticable {
/// Creates a tab bar theme that can be used with [ThemeData.tabBarTheme]. /// Creates a tab bar theme that can be used with [ThemeData.tabBarTheme].
const TabBarTheme({ const TabBarTheme({
this.indicator, this.indicator,
......
...@@ -103,7 +103,7 @@ import 'typography.dart'; ...@@ -103,7 +103,7 @@ import 'typography.dart';
/// globally adjusted, such as the color scheme. /// globally adjusted, such as the color scheme.
/// * <https://material.io/design/typography/> /// * <https://material.io/design/typography/>
@immutable @immutable
class TextTheme extends Diagnosticable { class TextTheme with Diagnosticable {
/// Creates a text theme that uses the given values. /// Creates a text theme that uses the given values.
/// ///
/// Rather than creating a new text theme, consider using [Typography.black] /// Rather than creating a new text theme, consider using [Typography.black]
......
...@@ -163,7 +163,7 @@ enum MaterialTapTargetSize { ...@@ -163,7 +163,7 @@ enum MaterialTapTargetSize {
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
@immutable @immutable
class ThemeData extends Diagnosticable { class ThemeData with Diagnosticable {
/// Create a [ThemeData] given a set of preferred values. /// Create a [ThemeData] given a set of preferred values.
/// ///
/// Default values will be derived for arguments that are omitted. /// Default values will be derived for arguments that are omitted.
...@@ -1697,7 +1697,7 @@ class _FifoCache<K, V> { ...@@ -1697,7 +1697,7 @@ class _FifoCache<K, V> {
/// * [ThemeData.visualDensity], where this property is used to specify the base /// * [ThemeData.visualDensity], where this property is used to specify the base
/// horizontal density of Material components. /// horizontal density of Material components.
/// * [Material design guidance on density](https://material.io/design/layout/applying-density.html). /// * [Material design guidance on density](https://material.io/design/layout/applying-density.html).
class VisualDensity extends Diagnosticable { class VisualDensity with Diagnosticable {
/// A const constructor for [VisualDensity]. /// A const constructor for [VisualDensity].
/// ///
/// All of the arguments must be non-null, and [horizontal] and [vertical] /// All of the arguments must be non-null, and [horizontal] and [vertical]
......
...@@ -24,7 +24,7 @@ import 'theme.dart'; ...@@ -24,7 +24,7 @@ import 'theme.dart';
/// ///
/// * [ToggleButtonsTheme], which describes the actual configuration of a /// * [ToggleButtonsTheme], which describes the actual configuration of a
/// toggle buttons theme. /// toggle buttons theme.
class ToggleButtonsThemeData extends Diagnosticable { class ToggleButtonsThemeData with Diagnosticable {
/// Creates the set of color and border properties used to configure /// Creates the set of color and border properties used to configure
/// [ToggleButtons]. /// [ToggleButtons].
const ToggleButtonsThemeData({ const ToggleButtonsThemeData({
......
...@@ -23,7 +23,7 @@ import 'theme.dart'; ...@@ -23,7 +23,7 @@ import 'theme.dart';
/// subtree. /// subtree.
/// * [TooltipThemeData], which describes the actual configuration of a /// * [TooltipThemeData], which describes the actual configuration of a
/// tooltip theme. /// tooltip theme.
class TooltipThemeData extends Diagnosticable { class TooltipThemeData with Diagnosticable {
/// Creates the set of properties used to configure [Tooltip]s. /// Creates the set of properties used to configure [Tooltip]s.
const TooltipThemeData({ const TooltipThemeData({
this.height, this.height,
......
...@@ -82,7 +82,7 @@ enum ScriptCategory { ...@@ -82,7 +82,7 @@ enum ScriptCategory {
/// [ThemeData.primaryTextTheme], [ThemeData.accentTextTheme]. /// [ThemeData.primaryTextTheme], [ThemeData.accentTextTheme].
/// * <https://material.io/design/typography/> /// * <https://material.io/design/typography/>
@immutable @immutable
class Typography extends Diagnosticable { class Typography with Diagnosticable {
/// Creates a typography instance. /// Creates a typography instance.
/// ///
/// This constructor is identical to [Typography.material2014]. It is /// This constructor is identical to [Typography.material2014]. It is
......
...@@ -20,7 +20,7 @@ import 'image_provider.dart'; ...@@ -20,7 +20,7 @@ import 'image_provider.dart';
/// shared between boxes; [BoxPainter] objects can cache resources to /// shared between boxes; [BoxPainter] objects can cache resources to
/// make painting on a particular surface faster. /// make painting on a particular surface faster.
@immutable @immutable
abstract class Decoration extends Diagnosticable { abstract class Decoration with Diagnosticable {
/// Abstract const constructor. This constructor enables subclasses to provide /// Abstract const constructor. This constructor enables subclasses to provide
/// const constructors so that they can be used in const expressions. /// const constructors so that they can be used in const expressions.
const Decoration(); const Decoration();
......
...@@ -159,7 +159,7 @@ typedef ImageErrorListener = void Function(dynamic exception, StackTrace stackTr ...@@ -159,7 +159,7 @@ typedef ImageErrorListener = void Function(dynamic exception, StackTrace stackTr
/// * [ImageChunkListener], the means by which callers get notified of /// * [ImageChunkListener], the means by which callers get notified of
/// these events. /// these events.
@immutable @immutable
class ImageChunkEvent extends Diagnosticable { class ImageChunkEvent with Diagnosticable {
/// Creates a new chunk event. /// Creates a new chunk event.
const ImageChunkEvent({ const ImageChunkEvent({
@required this.cumulativeBytesLoaded, @required this.cumulativeBytesLoaded,
...@@ -212,7 +212,7 @@ class ImageChunkEvent extends Diagnosticable { ...@@ -212,7 +212,7 @@ class ImageChunkEvent extends Diagnosticable {
/// ///
/// * [ImageProvider], which has an example that includes the use of an /// * [ImageProvider], which has an example that includes the use of an
/// [ImageStream] in a [Widget]. /// [ImageStream] in a [Widget].
class ImageStream extends Diagnosticable { class ImageStream with Diagnosticable {
/// Create an initially unbound image stream. /// Create an initially unbound image stream.
/// ///
/// Once an [ImageStreamCompleter] is available, call [setCompleter]. /// Once an [ImageStreamCompleter] is available, call [setCompleter].
...@@ -324,7 +324,7 @@ class ImageStream extends Diagnosticable { ...@@ -324,7 +324,7 @@ class ImageStream extends Diagnosticable {
/// [ImageStreamListener] objects are rarely constructed directly. Generally, an /// [ImageStreamListener] objects are rarely constructed directly. Generally, an
/// [ImageProvider] subclass will return an [ImageStream] and automatically /// [ImageProvider] subclass will return an [ImageStream] and automatically
/// configure it with the right [ImageStreamCompleter] when possible. /// configure it with the right [ImageStreamCompleter] when possible.
abstract class ImageStreamCompleter extends Diagnosticable { abstract class ImageStreamCompleter with Diagnosticable {
final List<ImageStreamListener> _listeners = <ImageStreamListener>[]; final List<ImageStreamListener> _listeners = <ImageStreamListener>[];
ImageInfo _currentImage; ImageInfo _currentImage;
FlutterErrorDetails _currentError; FlutterErrorDetails _currentError;
......
...@@ -285,7 +285,7 @@ import 'text_style.dart'; ...@@ -285,7 +285,7 @@ import 'text_style.dart';
/// {@end-tool} /// {@end-tool}
/// ///
@immutable @immutable
class StrutStyle extends Diagnosticable { class StrutStyle with Diagnosticable {
/// Creates a strut style. /// Creates a strut style.
/// ///
/// The `package` argument must be non-null if the font family is defined in a /// The `package` argument must be non-null if the font family is defined in a
......
...@@ -391,7 +391,7 @@ const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor a ...@@ -391,7 +391,7 @@ const String _kColorBackgroundWarning = 'Cannot provide both a backgroundColor a
/// * [TextStyle](https://api.flutter.dev/flutter/dart-ui/TextStyle-class.html), the class in the [dart:ui] library. /// * [TextStyle](https://api.flutter.dev/flutter/dart-ui/TextStyle-class.html), the class in the [dart:ui] library.
/// ///
@immutable @immutable
class TextStyle extends Diagnosticable { class TextStyle with Diagnosticable {
/// Creates a text style. /// Creates a text style.
/// ///
/// The `package` argument must be non-null if the font family is defined in a /// The `package` argument must be non-null if the font family is defined in a
......
...@@ -525,7 +525,7 @@ class SliverConstraints extends Constraints { ...@@ -525,7 +525,7 @@ class SliverConstraints extends Constraints {
/// A sliver can occupy space in several different ways, which is why this class /// A sliver can occupy space in several different ways, which is why this class
/// contains multiple values. /// contains multiple values.
@immutable @immutable
class SliverGeometry extends Diagnosticable { class SliverGeometry with Diagnosticable {
/// Creates an object that describes the amount of space occupied by a sliver. /// Creates an object that describes the amount of space occupied by a sliver.
/// ///
/// If the [layoutExtent] argument is null, [layoutExtent] defaults to the /// If the [layoutExtent] argument is null, [layoutExtent] defaults to the
......
...@@ -172,7 +172,7 @@ class CustomSemanticsAction { ...@@ -172,7 +172,7 @@ class CustomSemanticsAction {
/// ///
/// Typically obtained from [SemanticsNode.getSemanticsData]. /// Typically obtained from [SemanticsNode.getSemanticsData].
@immutable @immutable
class SemanticsData extends Diagnosticable { class SemanticsData with Diagnosticable {
/// Creates a semantics data object. /// Creates a semantics data object.
/// ///
/// The [flags], [actions], [label], and [Rect] arguments must not be null. /// The [flags], [actions], [label], and [Rect] arguments must not be null.
...@@ -3997,7 +3997,7 @@ String _concatStrings({ ...@@ -3997,7 +3997,7 @@ String _concatStrings({
/// See also: /// See also:
/// ///
/// * [OrdinalSortKey] for a sort key that sorts using an ordinal. /// * [OrdinalSortKey] for a sort key that sorts using an ordinal.
abstract class SemanticsSortKey extends Diagnosticable implements Comparable<SemanticsSortKey> { abstract class SemanticsSortKey with Diagnosticable implements Comparable<SemanticsSortKey> {
/// Abstract const constructor. This constructor enables subclasses to provide /// Abstract const constructor. This constructor enables subclasses to provide
/// const constructors so that they can be used in const expressions. /// const constructors so that they can be used in const expressions.
const SemanticsSortKey({this.name}); const SemanticsSortKey({this.name});
......
...@@ -19,7 +19,7 @@ import 'package:flutter/foundation.dart'; ...@@ -19,7 +19,7 @@ import 'package:flutter/foundation.dart';
/// that are returned from [RawKeyEvent.physicalKey]. /// that are returned from [RawKeyEvent.physicalKey].
/// * [LogicalKeyboardKey], a class with static values that describe the keys /// * [LogicalKeyboardKey], a class with static values that describe the keys
/// that are returned from [RawKeyEvent.logicalKey]. /// that are returned from [RawKeyEvent.logicalKey].
abstract class KeyboardKey extends Diagnosticable { abstract class KeyboardKey with Diagnosticable {
/// A const constructor so that subclasses may be const. /// A const constructor so that subclasses may be const.
const KeyboardKey(); const KeyboardKey();
} }
......
...@@ -236,7 +236,7 @@ abstract class RawKeyEventData { ...@@ -236,7 +236,7 @@ abstract class RawKeyEventData {
/// * [RawKeyboard], which uses this interface to expose key data. /// * [RawKeyboard], which uses this interface to expose key data.
/// * [RawKeyboardListener], a widget that listens for raw key events. /// * [RawKeyboardListener], a widget that listens for raw key events.
@immutable @immutable
abstract class RawKeyEvent extends Diagnosticable { abstract class RawKeyEvent with Diagnosticable {
/// Initializes fields for subclasses, and provides a const constructor for /// Initializes fields for subclasses, and provides a const constructor for
/// const subclasses. /// const subclasses.
const RawKeyEvent({ const RawKeyEvent({
......
...@@ -25,7 +25,7 @@ typedef ActionFactory = Action Function(); ...@@ -25,7 +25,7 @@ typedef ActionFactory = Action Function();
/// ///
/// If this intent returns false from [isEnabled], then its associated action will /// If this intent returns false from [isEnabled], then its associated action will
/// not be invoked if requested. /// not be invoked if requested.
class Intent extends Diagnosticable { class Intent with Diagnosticable {
/// A const constructor for an [Intent]. /// A const constructor for an [Intent].
/// ///
/// The [key] argument must not be null. /// The [key] argument must not be null.
...@@ -73,7 +73,7 @@ class Intent extends Diagnosticable { ...@@ -73,7 +73,7 @@ class Intent extends Diagnosticable {
/// and allows redefining of actions for its descendants. /// and allows redefining of actions for its descendants.
/// * [ActionDispatcher], a class that takes an [Action] and invokes it using a /// * [ActionDispatcher], a class that takes an [Action] and invokes it using a
/// [FocusNode] for context. /// [FocusNode] for context.
abstract class Action extends Diagnosticable { abstract class Action with Diagnosticable {
/// A const constructor for an [Action]. /// A const constructor for an [Action].
/// ///
/// The [intentKey] parameter must not be null. /// The [intentKey] parameter must not be null.
...@@ -140,7 +140,7 @@ class CallbackAction extends Action { ...@@ -140,7 +140,7 @@ class CallbackAction extends Action {
} }
/// An action manager that simply invokes the actions given to it. /// An action manager that simply invokes the actions given to it.
class ActionDispatcher extends Diagnosticable { class ActionDispatcher with Diagnosticable {
/// Const constructor so that subclasses can be const. /// Const constructor so that subclasses can be const.
const ActionDispatcher(); const ActionDispatcher();
......
...@@ -1352,7 +1352,7 @@ enum FocusHighlightStrategy { ...@@ -1352,7 +1352,7 @@ enum FocusHighlightStrategy {
/// subtrees into groups and restrict focus to them. /// subtrees into groups and restrict focus to them.
/// * The [primaryFocus] global accessor, for convenient access from anywhere /// * The [primaryFocus] global accessor, for convenient access from anywhere
/// to the current focus manager state. /// to the current focus manager state.
class FocusManager with DiagnosticableTreeMixin, ChangeNotifier implements Diagnosticable { class FocusManager with DiagnosticableTreeMixin, ChangeNotifier {
/// Creates an object that manages the focus tree. /// Creates an object that manages the focus tree.
/// ///
/// This constructor is rarely called directly. To access the [FocusManager], /// This constructor is rarely called directly. To access the [FocusManager],
......
...@@ -115,7 +115,7 @@ enum TraversalDirection { ...@@ -115,7 +115,7 @@ enum TraversalDirection {
/// * [DirectionalFocusTraversalPolicyMixin] a mixin class that implements /// * [DirectionalFocusTraversalPolicyMixin] a mixin class that implements
/// focus traversal in a direction. /// focus traversal in a direction.
@immutable @immutable
abstract class FocusTraversalPolicy extends Diagnosticable { abstract class FocusTraversalPolicy with Diagnosticable {
/// A const constructor so subclasses can be const. /// A const constructor so subclasses can be const.
const FocusTraversalPolicy(); const FocusTraversalPolicy();
...@@ -806,7 +806,7 @@ class WidgetOrderTraversalPolicy extends FocusTraversalPolicy with DirectionalFo ...@@ -806,7 +806,7 @@ class WidgetOrderTraversalPolicy extends FocusTraversalPolicy with DirectionalFo
// //
// It's also a convenient place to put some utility functions having to do with // It's also a convenient place to put some utility functions having to do with
// the sort data. // the sort data.
class _ReadingOrderSortData extends Diagnosticable { class _ReadingOrderSortData with Diagnosticable {
_ReadingOrderSortData(this.node) _ReadingOrderSortData(this.node)
: assert(node != null), : assert(node != null),
rect = node.rect, rect = node.rect,
...@@ -886,7 +886,7 @@ class _ReadingOrderSortData extends Diagnosticable { ...@@ -886,7 +886,7 @@ class _ReadingOrderSortData extends Diagnosticable {
// A class for containing group data while sorting in reading order while taking // A class for containing group data while sorting in reading order while taking
// into account the ambient directionality. // into account the ambient directionality.
class _ReadingOrderDirectionalGroupData extends Diagnosticable { class _ReadingOrderDirectionalGroupData with Diagnosticable {
_ReadingOrderDirectionalGroupData(this.members); _ReadingOrderDirectionalGroupData(this.members);
final List<_ReadingOrderSortData> members; final List<_ReadingOrderSortData> members;
...@@ -1105,7 +1105,7 @@ class ReadingOrderTraversalPolicy extends FocusTraversalPolicy with DirectionalF ...@@ -1105,7 +1105,7 @@ class ReadingOrderTraversalPolicy extends FocusTraversalPolicy with DirectionalF
/// * [LexicalFocusOrder], a focus order that assigns a string-based lexical /// * [LexicalFocusOrder], a focus order that assigns a string-based lexical
/// traversal order to a [FocusTraversalOrder] widget. /// traversal order to a [FocusTraversalOrder] widget.
@immutable @immutable
abstract class FocusOrder extends Diagnosticable implements Comparable<FocusOrder> { abstract class FocusOrder with Diagnosticable implements Comparable<FocusOrder> {
/// Abstract const constructor. This constructor enables subclasses to provide /// Abstract const constructor. This constructor enables subclasses to provide
/// const constructors so that they can be used in const expressions. /// const constructors so that they can be used in const expressions.
const FocusOrder(); const FocusOrder();
......
...@@ -1026,7 +1026,7 @@ typedef StateSetter = void Function(VoidCallback fn); ...@@ -1026,7 +1026,7 @@ typedef StateSetter = void Function(VoidCallback fn);
/// be read by descendant widgets. /// be read by descendant widgets.
/// * [Widget], for an overview of widgets in general. /// * [Widget], for an overview of widgets in general.
@optionalTypeArgs @optionalTypeArgs
abstract class State<T extends StatefulWidget> extends Diagnosticable { abstract class State<T extends StatefulWidget> with Diagnosticable {
/// The current configuration. /// The current configuration.
/// ///
/// A [State] object's configuration is the corresponding [StatefulWidget] /// A [State] object's configuration is the corresponding [StatefulWidget]
......
...@@ -18,7 +18,7 @@ import 'framework.dart' show BuildContext; ...@@ -18,7 +18,7 @@ import 'framework.dart' show BuildContext;
/// To obtain the current icon theme, use [IconTheme.of]. To convert an icon /// To obtain the current icon theme, use [IconTheme.of]. To convert an icon
/// theme to a version with all the fields filled in, use [new /// theme to a version with all the fields filled in, use [new
/// IconThemeData.fallback]. /// IconThemeData.fallback].
class IconThemeData extends Diagnosticable { class IconThemeData with Diagnosticable {
/// Creates an icon theme data. /// Creates an icon theme data.
/// ///
/// The opacity applies to both explicit and default icon colors. The value /// The opacity applies to both explicit and default icon colors. The value
......
...@@ -110,7 +110,7 @@ class KeySet<T extends KeyboardKey> { ...@@ -110,7 +110,7 @@ class KeySet<T extends KeyboardKey> {
/// This is a thin wrapper around a [Set], but changes the equality comparison /// This is a thin wrapper around a [Set], but changes the equality comparison
/// from an identity comparison to a contents comparison so that non-identical /// from an identity comparison to a contents comparison so that non-identical
/// sets with the same keys in them will compare as equal. /// sets with the same keys in them will compare as equal.
class LogicalKeySet extends KeySet<LogicalKeyboardKey> with DiagnosticableMixin implements Diagnosticable { class LogicalKeySet extends KeySet<LogicalKeyboardKey> with Diagnosticable {
/// A constructor for making a [LogicalKeySet] of up to four keys. /// A constructor for making a [LogicalKeySet] of up to four keys.
/// ///
/// If you need a set of more than four keys, use [LogicalKeySet.fromSet]. /// If you need a set of more than four keys, use [LogicalKeySet.fromSet].
...@@ -201,7 +201,7 @@ class ShortcutMapProperty extends DiagnosticsProperty<Map<LogicalKeySet, Intent> ...@@ -201,7 +201,7 @@ class ShortcutMapProperty extends DiagnosticsProperty<Map<LogicalKeySet, Intent>
/// ///
/// A [ShortcutManager] is obtained by calling [Shortcuts.of] on the context of /// A [ShortcutManager] is obtained by calling [Shortcuts.of] on the context of
/// the widget that you want to find a manager for. /// the widget that you want to find a manager for.
class ShortcutManager extends ChangeNotifier with DiagnosticableMixin implements Diagnosticable { class ShortcutManager extends ChangeNotifier with Diagnosticable {
/// Constructs a [ShortcutManager]. /// Constructs a [ShortcutManager].
/// ///
/// The [shortcuts] argument must not be null. /// The [shortcuts] argument must not be null.
......
...@@ -635,7 +635,7 @@ class _DiagnosticsPathNode { ...@@ -635,7 +635,7 @@ class _DiagnosticsPathNode {
} }
List<_DiagnosticsPathNode> _followDiagnosticableChain( List<_DiagnosticsPathNode> _followDiagnosticableChain(
List<DiagnosticableMixin> chain, { List<Diagnosticable> chain, {
String name, String name,
DiagnosticsTreeStyle style, DiagnosticsTreeStyle style,
}) { }) {
...@@ -644,7 +644,7 @@ List<_DiagnosticsPathNode> _followDiagnosticableChain( ...@@ -644,7 +644,7 @@ List<_DiagnosticsPathNode> _followDiagnosticableChain(
return path; return path;
DiagnosticsNode diagnostic = chain.first.toDiagnosticsNode(name: name, style: style); DiagnosticsNode diagnostic = chain.first.toDiagnosticsNode(name: name, style: style);
for (int i = 1; i < chain.length; i += 1) { for (int i = 1; i < chain.length; i += 1) {
final DiagnosticableMixin target = chain[i]; final Diagnosticable target = chain[i];
bool foundMatch = false; bool foundMatch = false;
final List<DiagnosticsNode> children = diagnostic.getChildren(); final List<DiagnosticsNode> children = diagnostic.getChildren();
for (int j = 0; j < children.length; j += 1) { for (int j = 0; j < children.length; j += 1) {
...@@ -1550,7 +1550,7 @@ mixin WidgetInspectorService { ...@@ -1550,7 +1550,7 @@ mixin WidgetInspectorService {
return true; return true;
} }
final Object value = node.value; final Object value = node.value;
if (value is! DiagnosticableMixin) { if (value is! Diagnosticable) {
return true; return true;
} }
if (value is! Element || !isWidgetCreationTracked()) { if (value is! Element || !isWidgetCreationTracked()) {
......
...@@ -180,7 +180,7 @@ void validatePropertyJsonSerializationHelper(final Map<String, Object> json, Dia ...@@ -180,7 +180,7 @@ void validatePropertyJsonSerializationHelper(final Map<String, Object> json, Dia
} }
expect(json['propertyType'], equals(property.propertyType.toString())); expect(json['propertyType'], equals(property.propertyType.toString()));
expect(json.containsKey('defaultLevel'), isTrue); expect(json.containsKey('defaultLevel'), isTrue);
if (property.value is DiagnosticableMixin) { if (property.value is Diagnosticable) {
expect(json['isDiagnosticableValue'], isTrue); expect(json['isDiagnosticableValue'], isTrue);
} else { } else {
expect(json.containsKey('isDiagnosticableValue'), isFalse); expect(json.containsKey('isDiagnosticableValue'), isFalse);
......
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