From 337ad9dc9e26179f7ba0ee6a84993fcb70c7f400 Mon Sep 17 00:00:00 2001 From: Siva Annamalai Date: Wed, 31 Jan 2018 17:20:46 -0800 Subject: [PATCH] Add meta tag @optionalTypeArgs to the mixin classes where we don't expect a generic type to be specified at the points where the mixin is applied. This suppresses the analyzer warnings. --- packages/flutter/lib/src/rendering/proxy_box.dart | 3 ++- packages/flutter/lib/src/widgets/automatic_keep_alive.dart | 1 + packages/flutter/lib/src/widgets/ticker_provider.dart | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index 3b801955d4..7ec86bbc1f 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -51,7 +51,8 @@ class RenderProxyBox extends RenderBox with RenderObjectWithChildMixin extends RenderBox with RenderObjectWithChildMixin { // This class is intended to be used as a mixin, and should not be // extended directly. diff --git a/packages/flutter/lib/src/widgets/automatic_keep_alive.dart b/packages/flutter/lib/src/widgets/automatic_keep_alive.dart index ad264d8aa1..4f70895dbc 100644 --- a/packages/flutter/lib/src/widgets/automatic_keep_alive.dart +++ b/packages/flutter/lib/src/widgets/automatic_keep_alive.dart @@ -299,6 +299,7 @@ class KeepAliveHandle extends ChangeNotifier { /// /// * [AutomaticKeepAlive], which listens to messages from this mixin. /// * [KeepAliveNotification], the notifications sent by this mixin. +@optionalTypeArgs abstract class AutomaticKeepAliveClientMixin extends State { // This class is intended to be used as a mixin, and should not be // extended directly. diff --git a/packages/flutter/lib/src/widgets/ticker_provider.dart b/packages/flutter/lib/src/widgets/ticker_provider.dart index 5449e8f908..0248589922 100644 --- a/packages/flutter/lib/src/widgets/ticker_provider.dart +++ b/packages/flutter/lib/src/widgets/ticker_provider.dart @@ -73,6 +73,7 @@ class TickerMode extends InheritedWidget { /// This mixin only supports vending a single ticker. If you might have multiple /// [AnimationController] objects over the lifetime of the [State], use a full /// [TickerProviderStateMixin] instead. +@optionalTypeArgs abstract class SingleTickerProviderStateMixin extends State implements TickerProvider { // ignore: TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, https://github.com/dart-lang/sdk/issues/25232 // This class is intended to be used as a mixin, and should not be // extended directly. @@ -155,6 +156,7 @@ abstract class SingleTickerProviderStateMixin extends /// If you only have a single [Ticker] (for example only a single /// [AnimationController]) for the lifetime of your [State], then using a /// [SingleTickerProviderStateMixin] is more efficient. This is the common case. +@optionalTypeArgs abstract class TickerProviderStateMixin extends State implements TickerProvider { // ignore: TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, https://github.com/dart-lang/sdk/issues/25232 // This class is intended to be used as a mixin, and should not be // extended directly.