mirror of
https://github.com/flutter/flutter
synced 2024-09-17 23:31:55 +00:00
Use new mixin
syntax for super-mixins (#22870)
This re-lands 3c56e6c
on top of a new Dart SDK that contains new mixin syntax fixes.
This commit is contained in:
parent
b95b67a66b
commit
3fbd140e77
|
@ -19,8 +19,6 @@
|
||||||
# Android Studio, and the `flutter analyze` command.
|
# Android Studio, and the `flutter analyze` command.
|
||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
language:
|
|
||||||
enableSuperMixins: true
|
|
||||||
strong-mode:
|
strong-mode:
|
||||||
implicit-dynamic: false
|
implicit-dynamic: false
|
||||||
errors:
|
errors:
|
||||||
|
@ -134,6 +132,7 @@ linter:
|
||||||
- prefer_is_empty
|
- prefer_is_empty
|
||||||
- prefer_is_not_empty
|
- prefer_is_not_empty
|
||||||
- prefer_iterable_whereType
|
- prefer_iterable_whereType
|
||||||
|
# - prefer_mixin # https://github.com/dart-lang/language/issues/32
|
||||||
- prefer_single_quotes
|
- prefer_single_quotes
|
||||||
- prefer_typing_uninitialized_variables
|
- prefer_typing_uninitialized_variables
|
||||||
- prefer_void_to_null
|
- prefer_void_to_null
|
||||||
|
|
|
@ -12,7 +12,7 @@ dependencies:
|
||||||
intl: 0.15.7
|
intl: 0.15.7
|
||||||
connectivity: 0.3.2
|
connectivity: 0.3.2
|
||||||
string_scanner: 1.0.4
|
string_scanner: 1.0.4
|
||||||
url_launcher: 4.0.0
|
url_launcher: 3.0.3
|
||||||
cupertino_icons: 0.1.2
|
cupertino_icons: 0.1.2
|
||||||
video_player: 0.6.5
|
video_player: 0.6.5
|
||||||
|
|
||||||
|
@ -196,4 +196,4 @@ flutter:
|
||||||
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-Regular.ttf
|
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-Regular.ttf
|
||||||
weight: 400
|
weight: 400
|
||||||
|
|
||||||
# PUBSPEC CHECKSUM: 46d3
|
# PUBSPEC CHECKSUM: 3ed5
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
# When editing, make sure you keep this and /analysis_options.yaml consistent.
|
# When editing, make sure you keep this and /analysis_options.yaml consistent.
|
||||||
|
|
||||||
analyzer:
|
analyzer:
|
||||||
language:
|
|
||||||
enableSuperMixins: true
|
|
||||||
errors:
|
errors:
|
||||||
# treat missing required parameters as a warning (not a hint)
|
# treat missing required parameters as a warning (not a hint)
|
||||||
missing_required_param: warning
|
missing_required_param: warning
|
||||||
|
@ -66,6 +64,7 @@ linter:
|
||||||
- package_names
|
- package_names
|
||||||
- package_prefixed_library_names
|
- package_prefixed_library_names
|
||||||
- prefer_is_not_empty
|
- prefer_is_not_empty
|
||||||
|
# - prefer_mixin # https://github.com/dart-lang/language/issues/32
|
||||||
# - public_member_api_docs
|
# - public_member_api_docs
|
||||||
- slash_for_doc_comments
|
- slash_for_doc_comments
|
||||||
# - sort_constructors_first
|
# - sort_constructors_first
|
||||||
|
|
|
@ -120,11 +120,7 @@ class AlwaysStoppedAnimation<T> extends Animation<T> {
|
||||||
///
|
///
|
||||||
/// To define a mapping from values in the range 0..1, consider subclassing
|
/// To define a mapping from values in the range 0..1, consider subclassing
|
||||||
/// [Tween] instead.
|
/// [Tween] instead.
|
||||||
abstract class AnimationWithParentMixin<T> {
|
mixin AnimationWithParentMixin<T> {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory AnimationWithParentMixin._() => null;
|
|
||||||
|
|
||||||
/// The animation whose value this animation will proxy.
|
/// The animation whose value this animation will proxy.
|
||||||
///
|
///
|
||||||
/// This animation must remain the same for the lifetime of this object. If
|
/// This animation must remain the same for the lifetime of this object. If
|
||||||
|
|
|
@ -13,11 +13,7 @@ import 'animation.dart';
|
||||||
/// This mixin provides implementations of [didRegisterListener] and [didUnregisterListener],
|
/// This mixin provides implementations of [didRegisterListener] and [didUnregisterListener],
|
||||||
/// and therefore can be used in conjunction with mixins that require these methods,
|
/// and therefore can be used in conjunction with mixins that require these methods,
|
||||||
/// [AnimationLocalListenersMixin] and [AnimationLocalStatusListenersMixin].
|
/// [AnimationLocalListenersMixin] and [AnimationLocalStatusListenersMixin].
|
||||||
abstract class AnimationLazyListenerMixin {
|
mixin AnimationLazyListenerMixin {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory AnimationLazyListenerMixin._() => null;
|
|
||||||
|
|
||||||
int _listenerCounter = 0;
|
int _listenerCounter = 0;
|
||||||
|
|
||||||
/// Calls [didStartListening] every time a registration of a listener causes
|
/// Calls [didStartListening] every time a registration of a listener causes
|
||||||
|
@ -66,11 +62,7 @@ abstract class AnimationLazyListenerMixin {
|
||||||
/// This mixin provides implementations of [didRegisterListener] and [didUnregisterListener],
|
/// This mixin provides implementations of [didRegisterListener] and [didUnregisterListener],
|
||||||
/// and therefore can be used in conjunction with mixins that require these methods,
|
/// and therefore can be used in conjunction with mixins that require these methods,
|
||||||
/// [AnimationLocalListenersMixin] and [AnimationLocalStatusListenersMixin].
|
/// [AnimationLocalListenersMixin] and [AnimationLocalStatusListenersMixin].
|
||||||
abstract class AnimationEagerListenerMixin {
|
mixin AnimationEagerListenerMixin {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory AnimationEagerListenerMixin._() => null;
|
|
||||||
|
|
||||||
/// This implementation ignores listener registrations.
|
/// This implementation ignores listener registrations.
|
||||||
void didRegisterListener() { }
|
void didRegisterListener() { }
|
||||||
|
|
||||||
|
@ -89,11 +81,7 @@ abstract class AnimationEagerListenerMixin {
|
||||||
/// This mixin requires that the mixing class provide methods [didRegisterListener]
|
/// This mixin requires that the mixing class provide methods [didRegisterListener]
|
||||||
/// and [didUnregisterListener]. Implementations of these methods can be obtained
|
/// and [didUnregisterListener]. Implementations of these methods can be obtained
|
||||||
/// by mixing in another mixin from this library, such as [AnimationLazyListenerMixin].
|
/// by mixing in another mixin from this library, such as [AnimationLazyListenerMixin].
|
||||||
abstract class AnimationLocalListenersMixin {
|
mixin AnimationLocalListenersMixin {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory AnimationLocalListenersMixin._() => null;
|
|
||||||
|
|
||||||
final ObserverList<VoidCallback> _listeners = ObserverList<VoidCallback>();
|
final ObserverList<VoidCallback> _listeners = ObserverList<VoidCallback>();
|
||||||
|
|
||||||
/// Called immediately before a listener is added via [addListener].
|
/// Called immediately before a listener is added via [addListener].
|
||||||
|
@ -157,11 +145,7 @@ abstract class AnimationLocalListenersMixin {
|
||||||
/// This mixin requires that the mixing class provide methods [didRegisterListener]
|
/// This mixin requires that the mixing class provide methods [didRegisterListener]
|
||||||
/// and [didUnregisterListener]. Implementations of these methods can be obtained
|
/// and [didUnregisterListener]. Implementations of these methods can be obtained
|
||||||
/// by mixing in another mixin from this library, such as [AnimationLazyListenerMixin].
|
/// by mixing in another mixin from this library, such as [AnimationLazyListenerMixin].
|
||||||
abstract class AnimationLocalStatusListenersMixin {
|
mixin AnimationLocalStatusListenersMixin {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory AnimationLocalStatusListenersMixin._() => null;
|
|
||||||
|
|
||||||
final ObserverList<AnimationStatusListener> _statusListeners = ObserverList<AnimationStatusListener>();
|
final ObserverList<AnimationStatusListener> _statusListeners = ObserverList<AnimationStatusListener>();
|
||||||
|
|
||||||
/// Called immediately before a status listener is added via [addStatusListener].
|
/// Called immediately before a status listener is added via [addStatusListener].
|
||||||
|
|
|
@ -27,7 +27,7 @@ typedef ServiceExtensionCallback = Future<Map<String, dynamic>> Function(Map<Str
|
||||||
/// Base class for mixins that provide singleton services (also known as
|
/// Base class for mixins that provide singleton services (also known as
|
||||||
/// "bindings").
|
/// "bindings").
|
||||||
///
|
///
|
||||||
/// To use this class in a mixin, inherit from it and implement
|
/// To use this class in an `on` clause of a mixin, inherit from it and implement
|
||||||
/// [initInstances()]. The mixin is guaranteed to only be constructed once in
|
/// [initInstances()]. The mixin is guaranteed to only be constructed once in
|
||||||
/// the lifetime of the app (more precisely, it will assert if constructed twice
|
/// the lifetime of the app (more precisely, it will assert if constructed twice
|
||||||
/// in checked mode).
|
/// in checked mode).
|
||||||
|
|
|
@ -2355,8 +2355,7 @@ abstract class Diagnosticable {
|
||||||
///
|
///
|
||||||
/// See also:
|
/// See also:
|
||||||
///
|
///
|
||||||
/// * [DiagnosticableTreeMixin], which provides a mixin that implements this
|
/// * [DiagnosticableTreeMixin], a mixin that implements this class.
|
||||||
/// class.
|
|
||||||
/// * [Diagnosticable], which should be used instead of this class to provide
|
/// * [Diagnosticable], which should be used instead of this class to provide
|
||||||
/// diagnostics for objects without children.
|
/// diagnostics for objects without children.
|
||||||
abstract class DiagnosticableTree extends Diagnosticable {
|
abstract class DiagnosticableTree extends Diagnosticable {
|
||||||
|
@ -2455,16 +2454,10 @@ abstract class DiagnosticableTree extends Diagnosticable {
|
||||||
List<DiagnosticsNode> debugDescribeChildren() => const <DiagnosticsNode>[];
|
List<DiagnosticsNode> debugDescribeChildren() => const <DiagnosticsNode>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A class that can be used as a mixin that helps dump string and
|
/// A mixin that helps dump string and [DiagnosticsNode] representations of trees.
|
||||||
/// [DiagnosticsNode] representations of trees.
|
|
||||||
///
|
///
|
||||||
/// This class is identical to DiagnosticableTree except that it can be used as
|
/// This mixin is identical to class [DiagnosticableTree].
|
||||||
/// a mixin.
|
mixin DiagnosticableTreeMixin implements DiagnosticableTree {
|
||||||
abstract class DiagnosticableTreeMixin implements DiagnosticableTree {
|
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory DiagnosticableTreeMixin._() => null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) {
|
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) {
|
||||||
return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel);
|
return toDiagnosticsNode(style: DiagnosticsTreeStyle.singleLine).toString(minLevel: minLevel);
|
||||||
|
|
|
@ -16,11 +16,7 @@ import 'hit_test.dart';
|
||||||
import 'pointer_router.dart';
|
import 'pointer_router.dart';
|
||||||
|
|
||||||
/// A binding for the gesture subsystem.
|
/// A binding for the gesture subsystem.
|
||||||
abstract class GestureBinding extends BindingBase with HitTestable, HitTestDispatcher, HitTestTarget {
|
mixin GestureBinding on BindingBase implements HitTestable, HitTestDispatcher, HitTestTarget {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory GestureBinding._() => null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initInstances() {
|
void initInstances() {
|
||||||
super.initInstances();
|
super.initInstances();
|
||||||
|
|
|
@ -16,11 +16,7 @@ const double _kDefaultDecodedCacheRatioCap = 25.0;
|
||||||
/// Hooks into the cache eviction logic to clear the image cache.
|
/// Hooks into the cache eviction logic to clear the image cache.
|
||||||
///
|
///
|
||||||
/// Requires the [ServicesBinding] to be mixed in earlier.
|
/// Requires the [ServicesBinding] to be mixed in earlier.
|
||||||
abstract class PaintingBinding extends BindingBase with ServicesBinding {
|
mixin PaintingBinding on BindingBase, ServicesBinding {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory PaintingBinding._() => null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initInstances() {
|
void initInstances() {
|
||||||
super.initInstances();
|
super.initInstances();
|
||||||
|
|
|
@ -21,11 +21,7 @@ import 'view.dart';
|
||||||
export 'package:flutter/gestures.dart' show HitTestResult;
|
export 'package:flutter/gestures.dart' show HitTestResult;
|
||||||
|
|
||||||
/// The glue between the render tree and the Flutter engine.
|
/// The glue between the render tree and the Flutter engine.
|
||||||
abstract class RendererBinding extends BindingBase with ServicesBinding, SchedulerBinding, SemanticsBinding, HitTestable {
|
mixin RendererBinding on BindingBase, ServicesBinding, SchedulerBinding, SemanticsBinding, HitTestable {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory RendererBinding._() => null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initInstances() {
|
void initInstances() {
|
||||||
super.initInstances();
|
super.initInstances();
|
||||||
|
|
|
@ -2178,11 +2178,7 @@ abstract class RenderBox extends RenderObject {
|
||||||
/// By convention, this class doesn't override any members of the superclass.
|
/// By convention, this class doesn't override any members of the superclass.
|
||||||
/// Instead, it provides helpful functions that subclasses can call as
|
/// Instead, it provides helpful functions that subclasses can call as
|
||||||
/// appropriate.
|
/// appropriate.
|
||||||
abstract class RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, ParentDataType extends ContainerBoxParentData<ChildType>> implements ContainerRenderObjectMixin<ChildType, ParentDataType> {
|
mixin RenderBoxContainerDefaultsMixin<ChildType extends RenderBox, ParentDataType extends ContainerBoxParentData<ChildType>> implements ContainerRenderObjectMixin<ChildType, ParentDataType> {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory RenderBoxContainerDefaultsMixin._() => null;
|
|
||||||
|
|
||||||
/// Returns the baseline of the first child with a baseline.
|
/// Returns the baseline of the first child with a baseline.
|
||||||
///
|
///
|
||||||
/// Useful when the children are displayed vertically in the same order they
|
/// Useful when the children are displayed vertically in the same order they
|
||||||
|
|
|
@ -86,11 +86,7 @@ class _OverflowRegionData {
|
||||||
///
|
///
|
||||||
/// * The code for [RenderUnconstrainedBox] and [RenderFlex] for examples of
|
/// * The code for [RenderUnconstrainedBox] and [RenderFlex] for examples of
|
||||||
/// classes that use this indicator mixin.
|
/// classes that use this indicator mixin.
|
||||||
abstract class DebugOverflowIndicatorMixin extends RenderObject {
|
mixin DebugOverflowIndicatorMixin on RenderObject {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory DebugOverflowIndicatorMixin._() => null;
|
|
||||||
|
|
||||||
static const Color _black = Color(0xBF000000);
|
static const Color _black = Color(0xBF000000);
|
||||||
static const Color _yellow = Color(0xBFFFFF00);
|
static const Color _yellow = Color(0xBFFFFF00);
|
||||||
// The fraction of the container that the indicator covers.
|
// The fraction of the container that the indicator covers.
|
||||||
|
|
|
@ -2670,10 +2670,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im
|
||||||
/// Generic mixin for render objects with one child.
|
/// Generic mixin for render objects with one child.
|
||||||
///
|
///
|
||||||
/// Provides a child model for a render object subclass that has a unique child.
|
/// Provides a child model for a render object subclass that has a unique child.
|
||||||
abstract class RenderObjectWithChildMixin<ChildType extends RenderObject> extends RenderObject {
|
mixin RenderObjectWithChildMixin<ChildType extends RenderObject> on RenderObject {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory RenderObjectWithChildMixin._() => null;
|
|
||||||
|
|
||||||
/// Checks whether the given render object has the correct [runtimeType] to be
|
/// Checks whether the given render object has the correct [runtimeType] to be
|
||||||
/// a child of this render object.
|
/// a child of this render object.
|
||||||
|
@ -2749,11 +2746,7 @@ abstract class RenderObjectWithChildMixin<ChildType extends RenderObject> extend
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parent data to support a doubly-linked list of children.
|
/// Parent data to support a doubly-linked list of children.
|
||||||
abstract class ContainerParentDataMixin<ChildType extends RenderObject> extends ParentData {
|
mixin ContainerParentDataMixin<ChildType extends RenderObject> on ParentData {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory ContainerParentDataMixin._() => null;
|
|
||||||
|
|
||||||
/// The previous sibling in the parent's child list.
|
/// The previous sibling in the parent's child list.
|
||||||
ChildType previousSibling;
|
ChildType previousSibling;
|
||||||
/// The next sibling in the parent's child list.
|
/// The next sibling in the parent's child list.
|
||||||
|
@ -2784,11 +2777,7 @@ abstract class ContainerParentDataMixin<ChildType extends RenderObject> extends
|
||||||
///
|
///
|
||||||
/// Provides a child model for a render object subclass that has a doubly-linked
|
/// Provides a child model for a render object subclass that has a doubly-linked
|
||||||
/// list of children.
|
/// list of children.
|
||||||
abstract class ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType extends ContainerParentDataMixin<ChildType>> extends RenderObject {
|
mixin ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType extends ContainerParentDataMixin<ChildType>> on RenderObject {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory ContainerRenderObjectMixin._() => null;
|
|
||||||
|
|
||||||
bool _debugUltimatePreviousSiblingOf(ChildType child, { ChildType equals }) {
|
bool _debugUltimatePreviousSiblingOf(ChildType child, { ChildType equals }) {
|
||||||
ParentDataType childParentData = child.parentData;
|
ParentDataType childParentData = child.parentData;
|
||||||
while (childParentData.previousSibling != null) {
|
while (childParentData.previousSibling != null) {
|
||||||
|
|
|
@ -49,16 +49,12 @@ class RenderProxyBox extends RenderBox with RenderObjectWithChildMixin<RenderBox
|
||||||
|
|
||||||
/// Implementation of [RenderProxyBox].
|
/// Implementation of [RenderProxyBox].
|
||||||
///
|
///
|
||||||
/// This class can be used as a mixin for situations where the proxying behavior
|
/// Use this mixin in situations where the proxying behavior
|
||||||
/// of [RenderProxyBox] is desired but inheriting from [RenderProxyBox] is
|
/// of [RenderProxyBox] is desired but inheriting from [RenderProxyBox] is
|
||||||
/// impractical (e.g. because you want to mix in other classes as well).
|
/// impractical (e.g. because you want to mix in other classes as well).
|
||||||
// TODO(ianh): Remove this class once https://github.com/dart-lang/sdk/issues/31543 is fixed
|
// TODO(ianh): Remove this class once https://github.com/dart-lang/sdk/issues/31543 is fixed
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
abstract class RenderProxyBoxMixin<T extends RenderBox> extends RenderBox with RenderObjectWithChildMixin<T> {
|
mixin RenderProxyBoxMixin<T extends RenderBox> on RenderBox, RenderObjectWithChildMixin<T> {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory RenderProxyBoxMixin._() => null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void setupParentData(RenderObject child) {
|
void setupParentData(RenderObject child) {
|
||||||
// We don't actually use the offset argument in BoxParentData, so let's
|
// We don't actually use the offset argument in BoxParentData, so let's
|
||||||
|
|
|
@ -186,11 +186,7 @@ enum SchedulerPhase {
|
||||||
/// * Non-rendering tasks, to be run between frames. These are given a
|
/// * Non-rendering tasks, to be run between frames. These are given a
|
||||||
/// priority and are executed in priority order according to a
|
/// priority and are executed in priority order according to a
|
||||||
/// [schedulingStrategy].
|
/// [schedulingStrategy].
|
||||||
abstract class SchedulerBinding extends BindingBase with ServicesBinding {
|
mixin SchedulerBinding on BindingBase, ServicesBinding {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory SchedulerBinding._() => null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initInstances() {
|
void initInstances() {
|
||||||
super.initInstances();
|
super.initInstances();
|
||||||
|
|
|
@ -12,11 +12,7 @@ export 'dart:ui' show AccessibilityFeatures;
|
||||||
|
|
||||||
/// The glue between the semantics layer and the Flutter engine.
|
/// The glue between the semantics layer and the Flutter engine.
|
||||||
// TODO(jonahwilliams): move the remaining semantic related bindings here.
|
// TODO(jonahwilliams): move the remaining semantic related bindings here.
|
||||||
class SemanticsBinding extends BindingBase {
|
mixin SemanticsBinding on BindingBase {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory SemanticsBinding._() => null;
|
|
||||||
|
|
||||||
/// The current [SemanticsBinding], if one has been created.
|
/// The current [SemanticsBinding], if one has been created.
|
||||||
static SemanticsBinding get instance => _instance;
|
static SemanticsBinding get instance => _instance;
|
||||||
static SemanticsBinding _instance;
|
static SemanticsBinding _instance;
|
||||||
|
|
|
@ -16,11 +16,7 @@ import 'platform_messages.dart';
|
||||||
/// the licenses found in the `LICENSE` file stored at the root of the asset
|
/// the licenses found in the `LICENSE` file stored at the root of the asset
|
||||||
/// bundle, and implements the `ext.flutter.evict` service extension (see
|
/// bundle, and implements the `ext.flutter.evict` service extension (see
|
||||||
/// [evict]).
|
/// [evict]).
|
||||||
abstract class ServicesBinding extends BindingBase {
|
mixin ServicesBinding on BindingBase {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory ServicesBinding._() => null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initInstances() {
|
void initInstances() {
|
||||||
super.initInstances();
|
super.initInstances();
|
||||||
|
|
|
@ -341,11 +341,7 @@ class KeepAliveHandle extends ChangeNotifier {
|
||||||
/// * [AutomaticKeepAlive], which listens to messages from this mixin.
|
/// * [AutomaticKeepAlive], which listens to messages from this mixin.
|
||||||
/// * [KeepAliveNotification], the notifications sent by this mixin.
|
/// * [KeepAliveNotification], the notifications sent by this mixin.
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
abstract class AutomaticKeepAliveClientMixin<T extends StatefulWidget> extends State<T> {
|
mixin AutomaticKeepAliveClientMixin<T extends StatefulWidget> on State<T> {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory AutomaticKeepAliveClientMixin._() => null;
|
|
||||||
|
|
||||||
KeepAliveHandle _keepAliveHandle;
|
KeepAliveHandle _keepAliveHandle;
|
||||||
|
|
||||||
void _ensureKeepAlive() {
|
void _ensureKeepAlive() {
|
||||||
|
|
|
@ -23,6 +23,8 @@ export 'dart:ui' show AppLifecycleState, Locale;
|
||||||
|
|
||||||
/// Interface for classes that register with the Widgets layer binding.
|
/// Interface for classes that register with the Widgets layer binding.
|
||||||
///
|
///
|
||||||
|
/// When used as a mixin, provides noop method implementations.
|
||||||
|
///
|
||||||
/// See [WidgetsBinding.addObserver] and [WidgetsBinding.removeObserver].
|
/// See [WidgetsBinding.addObserver] and [WidgetsBinding.removeObserver].
|
||||||
///
|
///
|
||||||
/// This class can be extended directly, to get default behaviors for all of the
|
/// This class can be extended directly, to get default behaviors for all of the
|
||||||
|
@ -239,11 +241,7 @@ abstract class WidgetsBindingObserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The glue between the widgets layer and the Flutter engine.
|
/// The glue between the widgets layer and the Flutter engine.
|
||||||
abstract class WidgetsBinding extends BindingBase with SchedulerBinding, GestureBinding, RendererBinding {
|
mixin WidgetsBinding on BindingBase, SchedulerBinding, GestureBinding, RendererBinding, SemanticsBinding {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory WidgetsBinding._() => null;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initInstances() {
|
void initInstances() {
|
||||||
super.initInstances();
|
super.initInstances();
|
||||||
|
@ -925,6 +923,7 @@ class RenderObjectToWidgetElement<T extends RenderObject> extends RootRenderObje
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A concrete binding for applications based on the Widgets framework.
|
/// A concrete binding for applications based on the Widgets framework.
|
||||||
|
///
|
||||||
/// This is the glue that binds the framework to the Flutter engine.
|
/// This is the glue that binds the framework to the Flutter engine.
|
||||||
class WidgetsFlutterBinding extends BindingBase with GestureBinding, ServicesBinding, SchedulerBinding, PaintingBinding, SemanticsBinding, RendererBinding, WidgetsBinding {
|
class WidgetsFlutterBinding extends BindingBase with GestureBinding, ServicesBinding, SchedulerBinding, PaintingBinding, SemanticsBinding, RendererBinding, WidgetsBinding {
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,7 @@ import 'scroll_metrics.dart';
|
||||||
/// have bubbled through.
|
/// have bubbled through.
|
||||||
///
|
///
|
||||||
/// This is used by [ScrollNotification] and [OverscrollIndicatorNotification].
|
/// This is used by [ScrollNotification] and [OverscrollIndicatorNotification].
|
||||||
abstract class ViewportNotificationMixin extends Notification {
|
mixin ViewportNotificationMixin on Notification {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory ViewportNotificationMixin._() => null;
|
|
||||||
|
|
||||||
/// The number of viewports that this notification has bubbled through.
|
/// The number of viewports that this notification has bubbled through.
|
||||||
///
|
///
|
||||||
/// Typically listeners only respond to notifications with a [depth] of zero.
|
/// Typically listeners only respond to notifications with a [depth] of zero.
|
||||||
|
|
|
@ -251,11 +251,7 @@ abstract class _SliverPersistentHeaderRenderObjectWidget extends RenderObjectWid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class _RenderSliverPersistentHeaderForWidgetsMixin extends RenderSliverPersistentHeader {
|
mixin _RenderSliverPersistentHeaderForWidgetsMixin on RenderSliverPersistentHeader {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory _RenderSliverPersistentHeaderForWidgetsMixin._() => null;
|
|
||||||
|
|
||||||
_SliverPersistentHeaderElement _element;
|
_SliverPersistentHeaderElement _element;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -74,11 +74,7 @@ class TickerMode extends InheritedWidget {
|
||||||
/// [AnimationController] objects over the lifetime of the [State], use a full
|
/// [AnimationController] objects over the lifetime of the [State], use a full
|
||||||
/// [TickerProviderStateMixin] instead.
|
/// [TickerProviderStateMixin] instead.
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
abstract class SingleTickerProviderStateMixin<T extends StatefulWidget> extends State<T> implements TickerProvider {
|
mixin SingleTickerProviderStateMixin<T extends StatefulWidget> on State<T> implements TickerProvider {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory SingleTickerProviderStateMixin._() => null;
|
|
||||||
|
|
||||||
Ticker _ticker;
|
Ticker _ticker;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -156,11 +152,7 @@ abstract class SingleTickerProviderStateMixin<T extends StatefulWidget> extends
|
||||||
/// [AnimationController]) for the lifetime of your [State], then using a
|
/// [AnimationController]) for the lifetime of your [State], then using a
|
||||||
/// [SingleTickerProviderStateMixin] is more efficient. This is the common case.
|
/// [SingleTickerProviderStateMixin] is more efficient. This is the common case.
|
||||||
@optionalTypeArgs
|
@optionalTypeArgs
|
||||||
abstract class TickerProviderStateMixin<T extends StatefulWidget> extends State<T> implements TickerProvider {
|
mixin TickerProviderStateMixin<T extends StatefulWidget> on State<T> implements TickerProvider {
|
||||||
// This class is intended to be used as a mixin, and should not be
|
|
||||||
// extended directly.
|
|
||||||
factory TickerProviderStateMixin._() => null;
|
|
||||||
|
|
||||||
Set<Ticker> _tickers;
|
Set<Ticker> _tickers;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -712,8 +712,8 @@ class _SerializeConfig {
|
||||||
final bool expandPropertyValues;
|
final bool expandPropertyValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _WidgetInspectorService extends Object with WidgetInspectorService {
|
// Production implementation of [WidgetInspectorService].
|
||||||
}
|
class _WidgetInspectorService = Object with WidgetInspectorService;
|
||||||
|
|
||||||
/// Service used by GUI tools to interact with the [WidgetInspector].
|
/// Service used by GUI tools to interact with the [WidgetInspector].
|
||||||
///
|
///
|
||||||
|
@ -735,11 +735,7 @@ class _WidgetInspectorService extends Object with WidgetInspectorService {
|
||||||
/// widget inspector support still works with the changes.
|
/// widget inspector support still works with the changes.
|
||||||
///
|
///
|
||||||
/// All methods returning String values return JSON.
|
/// All methods returning String values return JSON.
|
||||||
class WidgetInspectorService {
|
mixin WidgetInspectorService {
|
||||||
// This class is usable as a mixin for test purposes and as a singleton
|
|
||||||
// [instance] for production purposes.
|
|
||||||
factory WidgetInspectorService._() => _WidgetInspectorService();
|
|
||||||
|
|
||||||
/// Ring of cached JSON values to prevent json from being garbage
|
/// Ring of cached JSON values to prevent json from being garbage
|
||||||
/// collected before it can be requested over the Observatory protocol.
|
/// collected before it can be requested over the Observatory protocol.
|
||||||
final List<String> _serializeRing = List<String>(20);
|
final List<String> _serializeRing = List<String>(20);
|
||||||
|
@ -747,7 +743,7 @@ class WidgetInspectorService {
|
||||||
|
|
||||||
/// The current [WidgetInspectorService].
|
/// The current [WidgetInspectorService].
|
||||||
static WidgetInspectorService get instance => _instance;
|
static WidgetInspectorService get instance => _instance;
|
||||||
static WidgetInspectorService _instance = WidgetInspectorService._();
|
static WidgetInspectorService _instance = _WidgetInspectorService();
|
||||||
@protected
|
@protected
|
||||||
static set instance(WidgetInspectorService instance) {
|
static set instance(WidgetInspectorService instance) {
|
||||||
_instance = instance;
|
_instance = instance;
|
||||||
|
|
|
@ -5,10 +5,11 @@ import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
import '../painting/image_data.dart';
|
import '../painting/image_data.dart';
|
||||||
|
|
||||||
class PaintingBindingSpy extends BindingBase with PaintingBinding {
|
class PaintingBindingSpy extends BindingBase with ServicesBinding, PaintingBinding {
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
int get instantiateImageCodecCalledCount => counter;
|
int get instantiateImageCodecCalledCount => counter;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
class MemoryPressureObserver extends WidgetsBindingObserver {
|
class MemoryPressureObserver with WidgetsBindingObserver {
|
||||||
bool sawMemoryPressure = false;
|
bool sawMemoryPressure = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -17,7 +17,7 @@ class MemoryPressureObserver extends WidgetsBindingObserver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AppLifecycleStateObserver extends WidgetsBindingObserver {
|
class AppLifecycleStateObserver with WidgetsBindingObserver {
|
||||||
AppLifecycleState lifecycleState;
|
AppLifecycleState lifecycleState;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -26,7 +26,7 @@ class AppLifecycleStateObserver extends WidgetsBindingObserver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PushRouteObserver extends WidgetsBindingObserver {
|
class PushRouteObserver with WidgetsBindingObserver {
|
||||||
String pushedRoute;
|
String pushedRoute;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -84,11 +84,11 @@ const Size _kDefaultTestViewportSize = Size(800.0, 600.0);
|
||||||
/// When using these bindings, certain features are disabled. For
|
/// When using these bindings, certain features are disabled. For
|
||||||
/// example, [timeDilation] is reset to 1.0 on initialization.
|
/// example, [timeDilation] is reset to 1.0 on initialization.
|
||||||
abstract class TestWidgetsFlutterBinding extends BindingBase
|
abstract class TestWidgetsFlutterBinding extends BindingBase
|
||||||
with SchedulerBinding,
|
with ServicesBinding,
|
||||||
|
SchedulerBinding,
|
||||||
GestureBinding,
|
GestureBinding,
|
||||||
SemanticsBinding,
|
SemanticsBinding,
|
||||||
RendererBinding,
|
RendererBinding,
|
||||||
ServicesBinding,
|
|
||||||
PaintingBinding,
|
PaintingBinding,
|
||||||
WidgetsBinding {
|
WidgetsBinding {
|
||||||
|
|
||||||
|
|
|
@ -52,13 +52,6 @@ class AnalysisServer {
|
||||||
_process.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter());
|
_process.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter());
|
||||||
inStream.listen(_handleServerResponse);
|
inStream.listen(_handleServerResponse);
|
||||||
|
|
||||||
// Available options (many of these are obsolete):
|
|
||||||
// enableAsync, enableDeferredLoading, enableEnums, enableNullAwareOperators,
|
|
||||||
// enableSuperMixins, generateDart2jsHints, generateHints, generateLints
|
|
||||||
_sendCommand('analysis.updateOptions', <String, dynamic>{
|
|
||||||
'options': <String, dynamic>{'enableSuperMixins': true}
|
|
||||||
});
|
|
||||||
|
|
||||||
_sendCommand('server.setSubscriptions', <String, dynamic>{
|
_sendCommand('server.setSubscriptions', <String, dynamic>{
|
||||||
'subscriptions': <String>['STATUS']
|
'subscriptions': <String>['STATUS']
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,7 +21,7 @@ dependencies:
|
||||||
intl: 0.15.7
|
intl: 0.15.7
|
||||||
json_rpc_2: 2.0.9
|
json_rpc_2: 2.0.9
|
||||||
json_schema: 1.0.10
|
json_schema: 1.0.10
|
||||||
linter: 0.1.65
|
linter: 0.1.68
|
||||||
meta: 1.1.6
|
meta: 1.1.6
|
||||||
mustache: 1.0.2
|
mustache: 1.0.2
|
||||||
package_config: 1.0.5
|
package_config: 1.0.5
|
||||||
|
@ -90,4 +90,4 @@ dartdoc:
|
||||||
# Exclude this package from the hosted API docs.
|
# Exclude this package from the hosted API docs.
|
||||||
nodoc: true
|
nodoc: true
|
||||||
|
|
||||||
# PUBSPEC CHECKSUM: 39f9
|
# PUBSPEC CHECKSUM: d5fc
|
||||||
|
|
Loading…
Reference in a new issue