mirror of
https://github.com/flutter/flutter
synced 2024-09-13 13:21:36 +00:00
Enable avoid_setters_without_getters (#91067)
This commit is contained in:
parent
50604c614e
commit
989f864497
|
@ -81,11 +81,11 @@ linter:
|
||||||
- avoid_relative_lib_imports
|
- avoid_relative_lib_imports
|
||||||
- avoid_renaming_method_parameters
|
- avoid_renaming_method_parameters
|
||||||
- avoid_return_types_on_setters
|
- avoid_return_types_on_setters
|
||||||
# - avoid_returning_null # there are plenty of valid reasons to return null
|
# - avoid_returning_null # still violated by some pre-nnbd code that we haven't yet migrated
|
||||||
# - avoid_returning_null_for_future # not yet tested
|
- avoid_returning_null_for_future
|
||||||
- avoid_returning_null_for_void
|
- avoid_returning_null_for_void
|
||||||
# - avoid_returning_this # there are plenty of valid reasons to return this
|
# - avoid_returning_this # there are plenty of valid reasons to return this
|
||||||
# - avoid_setters_without_getters # not yet tested
|
- avoid_setters_without_getters
|
||||||
- avoid_shadowing_type_parameters
|
- avoid_shadowing_type_parameters
|
||||||
- avoid_single_cascade_in_expression_statements
|
- avoid_single_cascade_in_expression_statements
|
||||||
- avoid_slow_async_io
|
- avoid_slow_async_io
|
||||||
|
|
|
@ -2012,6 +2012,7 @@ class _RenderCupertinoDialogActions extends RenderBox
|
||||||
markNeedsLayout();
|
markNeedsLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color get dialogColor => _buttonBackgroundPaint.color;
|
||||||
final Paint _buttonBackgroundPaint;
|
final Paint _buttonBackgroundPaint;
|
||||||
set dialogColor(Color value) {
|
set dialogColor(Color value) {
|
||||||
if (value == _buttonBackgroundPaint.color)
|
if (value == _buttonBackgroundPaint.color)
|
||||||
|
@ -2021,6 +2022,7 @@ class _RenderCupertinoDialogActions extends RenderBox
|
||||||
markNeedsPaint();
|
markNeedsPaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color get dialogPressedColor => _pressedButtonBackgroundPaint.color;
|
||||||
final Paint _pressedButtonBackgroundPaint;
|
final Paint _pressedButtonBackgroundPaint;
|
||||||
set dialogPressedColor(Color value) {
|
set dialogPressedColor(Color value) {
|
||||||
if (value == _pressedButtonBackgroundPaint.color)
|
if (value == _pressedButtonBackgroundPaint.color)
|
||||||
|
@ -2030,6 +2032,7 @@ class _RenderCupertinoDialogActions extends RenderBox
|
||||||
markNeedsPaint();
|
markNeedsPaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color get dividerColor => _dividerPaint.color;
|
||||||
final Paint _dividerPaint;
|
final Paint _dividerPaint;
|
||||||
set dividerColor(Color value) {
|
set dividerColor(Color value) {
|
||||||
if (value == _dividerPaint.color)
|
if (value == _dividerPaint.color)
|
||||||
|
@ -2039,8 +2042,8 @@ class _RenderCupertinoDialogActions extends RenderBox
|
||||||
markNeedsPaint();
|
markNeedsPaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _isActionSheet;
|
|
||||||
bool get isActionSheet => _isActionSheet;
|
bool get isActionSheet => _isActionSheet;
|
||||||
|
bool _isActionSheet;
|
||||||
set isActionSheet(bool value) {
|
set isActionSheet(bool value) {
|
||||||
if (value == _isActionSheet)
|
if (value == _isActionSheet)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -196,6 +196,7 @@ class _RenderCupertinoTextSelectionToolbarShape extends RenderShiftedBox {
|
||||||
@override
|
@override
|
||||||
bool get isRepaintBoundary => true;
|
bool get isRepaintBoundary => true;
|
||||||
|
|
||||||
|
Offset get anchor => _anchor;
|
||||||
Offset _anchor;
|
Offset _anchor;
|
||||||
set anchor(Offset value) {
|
set anchor(Offset value) {
|
||||||
if (value == _anchor) {
|
if (value == _anchor) {
|
||||||
|
@ -205,6 +206,7 @@ class _RenderCupertinoTextSelectionToolbarShape extends RenderShiftedBox {
|
||||||
markNeedsLayout();
|
markNeedsLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool get isAbove => _isAbove;
|
||||||
bool _isAbove;
|
bool _isAbove;
|
||||||
set isAbove(bool value) {
|
set isAbove(bool value) {
|
||||||
if (_isAbove == value) {
|
if (_isAbove == value) {
|
||||||
|
|
|
@ -13,7 +13,6 @@ import 'box.dart';
|
||||||
import 'layer.dart';
|
import 'layer.dart';
|
||||||
import 'object.dart';
|
import 'object.dart';
|
||||||
|
|
||||||
|
|
||||||
/// How an embedded platform view behave during hit tests.
|
/// How an embedded platform view behave during hit tests.
|
||||||
enum PlatformViewHitTestBehavior {
|
enum PlatformViewHitTestBehavior {
|
||||||
/// Opaque targets can be hit by hit tests, causing them to both receive
|
/// Opaque targets can be hit by hit tests, causing them to both receive
|
||||||
|
@ -75,7 +74,6 @@ Set<Type> _factoriesTypeSet<T>(Set<Factory<T>> factories) {
|
||||||
/// * [AndroidView] which is a widget that is used to show an Android view.
|
/// * [AndroidView] which is a widget that is used to show an Android view.
|
||||||
/// * [PlatformViewsService] which is a service for controlling platform views.
|
/// * [PlatformViewsService] which is a service for controlling platform views.
|
||||||
class RenderAndroidView extends RenderBox with _PlatformViewGestureMixin {
|
class RenderAndroidView extends RenderBox with _PlatformViewGestureMixin {
|
||||||
|
|
||||||
/// Creates a render object for an Android view.
|
/// Creates a render object for an Android view.
|
||||||
RenderAndroidView({
|
RenderAndroidView({
|
||||||
required AndroidViewController viewController,
|
required AndroidViewController viewController,
|
||||||
|
@ -97,7 +95,7 @@ class RenderAndroidView extends RenderBox with _PlatformViewGestureMixin {
|
||||||
_PlatformViewState _state = _PlatformViewState.uninitialized;
|
_PlatformViewState _state = _PlatformViewState.uninitialized;
|
||||||
|
|
||||||
/// The Android view controller for the Android view associated with this render object.
|
/// The Android view controller for the Android view associated with this render object.
|
||||||
AndroidViewController get viewcontroller => _viewController;
|
AndroidViewController get viewController => _viewController;
|
||||||
AndroidViewController _viewController;
|
AndroidViewController _viewController;
|
||||||
/// Sets a new Android view controller.
|
/// Sets a new Android view controller.
|
||||||
///
|
///
|
||||||
|
@ -451,7 +449,6 @@ class _UiKitViewGestureRecognizer extends OneSequenceGestureRecognizer {
|
||||||
).toSet();
|
).toSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// We use OneSequenceGestureRecognizers as they support gesture arena teams.
|
// We use OneSequenceGestureRecognizers as they support gesture arena teams.
|
||||||
// TODO(amirh): get a list of GestureRecognizers here.
|
// TODO(amirh): get a list of GestureRecognizers here.
|
||||||
// https://github.com/flutter/flutter/issues/20953
|
// https://github.com/flutter/flutter/issues/20953
|
||||||
|
@ -615,7 +612,6 @@ class _PlatformViewGestureRecognizer extends OneSequenceGestureRecognizer {
|
||||||
/// [PlatformViewRenderBox] presents a platform view by adding a [PlatformViewLayer] layer,
|
/// [PlatformViewRenderBox] presents a platform view by adding a [PlatformViewLayer] layer,
|
||||||
/// integrates it with the gesture arenas system and adds relevant semantic nodes to the semantics tree.
|
/// integrates it with the gesture arenas system and adds relevant semantic nodes to the semantics tree.
|
||||||
class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin {
|
class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin {
|
||||||
|
|
||||||
/// Creating a render object for a [PlatformViewSurface].
|
/// Creating a render object for a [PlatformViewSurface].
|
||||||
///
|
///
|
||||||
/// The `controller` parameter must not be null.
|
/// The `controller` parameter must not be null.
|
||||||
|
@ -631,8 +627,9 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin {
|
||||||
updateGestureRecognizers(gestureRecognizers);
|
updateGestureRecognizers(gestureRecognizers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the [controller] for this render object.
|
/// The controller for this render object.
|
||||||
///
|
PlatformViewController get controller => _controller;
|
||||||
|
PlatformViewController _controller;
|
||||||
/// This value must not be null, and setting it to a new value will result in a repaint.
|
/// This value must not be null, and setting it to a new value will result in a repaint.
|
||||||
set controller(PlatformViewController controller) {
|
set controller(PlatformViewController controller) {
|
||||||
assert(controller != null);
|
assert(controller != null);
|
||||||
|
@ -657,8 +654,6 @@ class PlatformViewRenderBox extends RenderBox with _PlatformViewGestureMixin {
|
||||||
_updateGestureRecognizersWithCallBack(gestureRecognizers, _controller.dispatchPointerEvent);
|
_updateGestureRecognizersWithCallBack(gestureRecognizers, _controller.dispatchPointerEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
PlatformViewController _controller;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool get sizedByParent => true;
|
bool get sizedByParent => true;
|
||||||
|
|
||||||
|
|
|
@ -2265,11 +2265,14 @@ class RenderTransform extends RenderProxyBox {
|
||||||
/// always honor the transformation, regardless of the value of this property.
|
/// always honor the transformation, regardless of the value of this property.
|
||||||
bool transformHitTests;
|
bool transformHitTests;
|
||||||
|
|
||||||
// Note the lack of a getter for transform because Matrix4 is not immutable
|
|
||||||
Matrix4? _transform;
|
Matrix4? _transform;
|
||||||
|
/// The matrix to transform the child by during painting. The provided value
|
||||||
/// The matrix to transform the child by during painting.
|
/// is copied on assignment.
|
||||||
set transform(Matrix4 value) {
|
///
|
||||||
|
/// There is no getter for [transform], because [Matrix4] is mutable, and
|
||||||
|
/// mutations outside of the control of the render object could not reliably
|
||||||
|
/// be reflected in the rendering.
|
||||||
|
set transform(Matrix4 value) { // ignore: avoid_setters_without_getters
|
||||||
assert(value != null);
|
assert(value != null);
|
||||||
if (_transform == value)
|
if (_transform == value)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -522,8 +522,8 @@ class _AndroidMotionEventConverter {
|
||||||
<int, AndroidPointerProperties>{};
|
<int, AndroidPointerProperties>{};
|
||||||
final Set<int> usedAndroidPointerIds = <int>{};
|
final Set<int> usedAndroidPointerIds = <int>{};
|
||||||
|
|
||||||
|
PointTransformer get pointTransformer => _pointTransformer;
|
||||||
late PointTransformer _pointTransformer;
|
late PointTransformer _pointTransformer;
|
||||||
|
|
||||||
set pointTransformer(PointTransformer transformer) {
|
set pointTransformer(PointTransformer transformer) {
|
||||||
assert(transformer != null);
|
assert(transformer != null);
|
||||||
_pointTransformer = transformer;
|
_pointTransformer = transformer;
|
||||||
|
@ -813,10 +813,12 @@ abstract class AndroidViewController extends PlatformViewController {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts a given point from the global coordinate system in logical pixels to the local coordinate system for this box.
|
/// Converts a given point from the global coordinate system in logical pixels
|
||||||
|
/// to the local coordinate system for this box.
|
||||||
///
|
///
|
||||||
/// This is required to convert a [PointerEvent] to an [AndroidMotionEvent].
|
/// This is required to convert a [PointerEvent] to an [AndroidMotionEvent].
|
||||||
/// It is typically provided by using [RenderBox.globalToLocal].
|
/// It is typically provided by using [RenderBox.globalToLocal].
|
||||||
|
PointTransformer get pointTransformer => _motionEventConverter._pointTransformer;
|
||||||
set pointTransformer(PointTransformer transformer) {
|
set pointTransformer(PointTransformer transformer) {
|
||||||
assert(transformer != null);
|
assert(transformer != null);
|
||||||
_motionEventConverter._pointTransformer = transformer;
|
_motionEventConverter._pointTransformer = transformer;
|
||||||
|
@ -1146,18 +1148,17 @@ class UiKitViewController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An interface for a controlling a single platform view.
|
/// An interface for controlling a single platform view.
|
||||||
///
|
///
|
||||||
/// Used by [PlatformViewSurface] to interface with the platform view it embeds.
|
/// Used by [PlatformViewSurface] to interface with the platform view it embeds.
|
||||||
abstract class PlatformViewController {
|
abstract class PlatformViewController {
|
||||||
|
|
||||||
/// The viewId associated with this controller.
|
/// The viewId associated with this controller.
|
||||||
///
|
///
|
||||||
/// The viewId should always be unique and non-negative. And it must not be null.
|
/// The viewId should always be unique and non-negative.
|
||||||
///
|
///
|
||||||
/// See also:
|
/// See also:
|
||||||
///
|
///
|
||||||
/// * [PlatformViewsRegistry], which is a helper for managing platform view ids.
|
/// * [PlatformViewsRegistry], which is a helper for managing platform view IDs.
|
||||||
int get viewId;
|
int get viewId;
|
||||||
|
|
||||||
/// Dispatches the `event` to the platform view.
|
/// Dispatches the `event` to the platform view.
|
||||||
|
|
|
@ -160,13 +160,10 @@ abstract class Action<T extends Intent> with Diagnosticable {
|
||||||
final ObserverList<ActionListenerCallback> _listeners = ObserverList<ActionListenerCallback>();
|
final ObserverList<ActionListenerCallback> _listeners = ObserverList<ActionListenerCallback>();
|
||||||
|
|
||||||
Action<T>? _currentCallingAction;
|
Action<T>? _currentCallingAction;
|
||||||
set _callingAction(Action<T>? newAction) {
|
void _updateCallingAction(Action<T>? value) {
|
||||||
if (newAction == _currentCallingAction) {
|
_currentCallingAction = value;
|
||||||
return;
|
|
||||||
}
|
|
||||||
assert(newAction == null || _currentCallingAction == null);
|
|
||||||
_currentCallingAction = newAction;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The [Action] overridden by this [Action].
|
/// The [Action] overridden by this [Action].
|
||||||
///
|
///
|
||||||
/// The [Action.overridable] constructor creates an overridable [Action] that
|
/// The [Action.overridable] constructor creates an overridable [Action] that
|
||||||
|
@ -1526,9 +1523,9 @@ mixin _OverridableActionMixin<T extends Intent> on Action<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set _callingAction(Action<T>? newAction) {
|
void _updateCallingAction(Action<T>? value) {
|
||||||
super._callingAction = newAction;
|
super._updateCallingAction(value);
|
||||||
defaultAction._callingAction = newAction;
|
defaultAction._updateCallingAction(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Object? _invokeOverride(Action<T> overrideAction, T intent, BuildContext? context) {
|
Object? _invokeOverride(Action<T> overrideAction, T intent, BuildContext? context) {
|
||||||
|
@ -1537,11 +1534,11 @@ mixin _OverridableActionMixin<T extends Intent> on Action<T> {
|
||||||
debugAssertMutuallyRecursive = true;
|
debugAssertMutuallyRecursive = true;
|
||||||
return true;
|
return true;
|
||||||
}());
|
}());
|
||||||
overrideAction._callingAction = defaultAction;
|
overrideAction._updateCallingAction(defaultAction);
|
||||||
final Object? returnValue = overrideAction is ContextAction<T>
|
final Object? returnValue = overrideAction is ContextAction<T>
|
||||||
? overrideAction.invoke(intent, context)
|
? overrideAction.invoke(intent, context)
|
||||||
: overrideAction.invoke(intent);
|
: overrideAction.invoke(intent);
|
||||||
overrideAction._callingAction = null;
|
overrideAction._updateCallingAction(null);
|
||||||
assert(() {
|
assert(() {
|
||||||
debugAssertMutuallyRecursive = false;
|
debugAssertMutuallyRecursive = false;
|
||||||
return true;
|
return true;
|
||||||
|
@ -1564,9 +1561,9 @@ mixin _OverridableActionMixin<T extends Intent> on Action<T> {
|
||||||
debugAssertIsActionEnabledMutuallyRecursive = true;
|
debugAssertIsActionEnabledMutuallyRecursive = true;
|
||||||
return true;
|
return true;
|
||||||
}());
|
}());
|
||||||
overrideAction._callingAction = defaultAction;
|
overrideAction._updateCallingAction(defaultAction);
|
||||||
final bool isOverrideEnabled = overrideAction.isActionEnabled;
|
final bool isOverrideEnabled = overrideAction.isActionEnabled;
|
||||||
overrideAction._callingAction = null;
|
overrideAction._updateCallingAction(null);
|
||||||
assert(() {
|
assert(() {
|
||||||
debugAssertIsActionEnabledMutuallyRecursive = false;
|
debugAssertIsActionEnabledMutuallyRecursive = false;
|
||||||
return true;
|
return true;
|
||||||
|
@ -1592,9 +1589,9 @@ mixin _OverridableActionMixin<T extends Intent> on Action<T> {
|
||||||
}());
|
}());
|
||||||
|
|
||||||
final Action<T>? overrideAction = getOverrideAction();
|
final Action<T>? overrideAction = getOverrideAction();
|
||||||
overrideAction?._callingAction = defaultAction;
|
overrideAction?._updateCallingAction(defaultAction);
|
||||||
final bool returnValue = (overrideAction ?? defaultAction).isEnabled(intent);
|
final bool returnValue = (overrideAction ?? defaultAction).isEnabled(intent);
|
||||||
overrideAction?._callingAction = null;
|
overrideAction?._updateCallingAction(null);
|
||||||
assert(() {
|
assert(() {
|
||||||
debugAssertIsEnabledMutuallyRecursive = false;
|
debugAssertIsEnabledMutuallyRecursive = false;
|
||||||
return true;
|
return true;
|
||||||
|
@ -1610,9 +1607,9 @@ mixin _OverridableActionMixin<T extends Intent> on Action<T> {
|
||||||
return true;
|
return true;
|
||||||
}());
|
}());
|
||||||
final Action<T>? overrideAction = getOverrideAction();
|
final Action<T>? overrideAction = getOverrideAction();
|
||||||
overrideAction?._callingAction = defaultAction;
|
overrideAction?._updateCallingAction(defaultAction);
|
||||||
final bool isEnabled = (overrideAction ?? defaultAction).consumesKey(intent);
|
final bool isEnabled = (overrideAction ?? defaultAction).consumesKey(intent);
|
||||||
overrideAction?._callingAction = null;
|
overrideAction?._updateCallingAction(null);
|
||||||
assert(() {
|
assert(() {
|
||||||
debugAssertConsumeKeyMutuallyRecursive = false;
|
debugAssertConsumeKeyMutuallyRecursive = false;
|
||||||
return true;
|
return true;
|
||||||
|
@ -1674,11 +1671,11 @@ class _OverridableContextAction<T extends Intent> extends ContextAction<T> with
|
||||||
// overrideAction is not a ContextAction and thus have no access to the
|
// overrideAction is not a ContextAction and thus have no access to the
|
||||||
// calling BuildContext.
|
// calling BuildContext.
|
||||||
final Action<T> wrappedDefault = _ContextActionToActionAdapter<T>(invokeContext: context!, action: defaultAction);
|
final Action<T> wrappedDefault = _ContextActionToActionAdapter<T>(invokeContext: context!, action: defaultAction);
|
||||||
overrideAction._callingAction = wrappedDefault;
|
overrideAction._updateCallingAction(wrappedDefault);
|
||||||
final Object? returnValue = overrideAction is ContextAction<T>
|
final Object? returnValue = overrideAction is ContextAction<T>
|
||||||
? overrideAction.invoke(intent, context)
|
? overrideAction.invoke(intent, context)
|
||||||
: overrideAction.invoke(intent);
|
: overrideAction.invoke(intent);
|
||||||
overrideAction._callingAction = null;
|
overrideAction._updateCallingAction(null);
|
||||||
|
|
||||||
assert(() {
|
assert(() {
|
||||||
debugAssertMutuallyRecursive = false;
|
debugAssertMutuallyRecursive = false;
|
||||||
|
@ -1710,8 +1707,8 @@ class _ContextActionToActionAdapter<T extends Intent> extends Action<T> {
|
||||||
final ContextAction<T> action;
|
final ContextAction<T> action;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set _callingAction(Action<T>? newAction) {
|
void _updateCallingAction(Action<T>? value) {
|
||||||
action._callingAction = newAction;
|
action._updateCallingAction(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -59,7 +59,7 @@ class FakeAndroidViewController implements AndroidViewController {
|
||||||
final int viewId;
|
final int viewId;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Offset Function(Offset position)? pointTransformer;
|
late PointTransformer pointTransformer;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> dispatchPointerEvent(PointerEvent event) async {
|
Future<void> dispatchPointerEvent(PointerEvent event) async {
|
||||||
|
|
|
@ -92,7 +92,6 @@ class TestWidget extends SingleChildRenderObjectWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class RenderTest extends RenderProxyBox {
|
class RenderTest extends RenderProxyBox {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void describeSemanticsConfiguration(SemanticsConfiguration config) {
|
void describeSemanticsConfiguration(SemanticsConfiguration config) {
|
||||||
super.describeSemanticsConfiguration(config);
|
super.describeSemanticsConfiguration(config);
|
||||||
|
@ -107,6 +106,7 @@ class RenderTest extends RenderProxyBox {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get label => _label;
|
||||||
String _label = '<>';
|
String _label = '<>';
|
||||||
set label(String value) {
|
set label(String value) {
|
||||||
if (value == _label)
|
if (value == _label)
|
||||||
|
@ -116,6 +116,7 @@ class RenderTest extends RenderProxyBox {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool get isSemanticBoundary => _isSemanticBoundary;
|
||||||
bool _isSemanticBoundary = false;
|
bool _isSemanticBoundary = false;
|
||||||
set isSemanticBoundary(bool value) {
|
set isSemanticBoundary(bool value) {
|
||||||
if (_isSemanticBoundary == value)
|
if (_isSemanticBoundary == value)
|
||||||
|
|
|
@ -120,13 +120,13 @@ class _MockHttpClient implements HttpClient {
|
||||||
void addProxyCredentials(String host, int port, String realm, HttpClientCredentials credentials) { }
|
void addProxyCredentials(String host, int port, String realm, HttpClientCredentials credentials) { }
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set authenticate(Future<bool> Function(Uri url, String scheme, String realm)? f) { }
|
Future<bool> Function(Uri url, String scheme, String realm)? authenticate;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set authenticateProxy(Future<bool> Function(String host, int port, String scheme, String realm)? f) { }
|
Future<bool> Function(String host, int port, String scheme, String realm)? authenticateProxy;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set badCertificateCallback(bool Function(X509Certificate cert, String host, int port)? callback) { }
|
bool Function(X509Certificate cert, String host, int port)? badCertificateCallback;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void close({ bool force = false }) { }
|
void close({ bool force = false }) { }
|
||||||
|
@ -142,7 +142,7 @@ class _MockHttpClient implements HttpClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set findProxy(String Function(Uri url)? f) { }
|
String Function(Uri url)? findProxy;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<HttpClientRequest> get(String host, int port, String path) {
|
Future<HttpClientRequest> get(String host, int port, String path) {
|
||||||
|
|
|
@ -59,7 +59,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
double? _devicePixelRatio;
|
double? _devicePixelRatio;
|
||||||
/// Hides the real device pixel ratio and reports the given [devicePixelRatio]
|
/// Hides the real device pixel ratio and reports the given [devicePixelRatio]
|
||||||
/// instead.
|
/// instead.
|
||||||
set devicePixelRatioTestValue(double devicePixelRatio) {
|
set devicePixelRatioTestValue(double devicePixelRatio) { // ignore: avoid_setters_without_getters
|
||||||
_devicePixelRatio = devicePixelRatio;
|
_devicePixelRatio = devicePixelRatio;
|
||||||
onMetricsChanged?.call();
|
onMetricsChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
ui.Size? _physicalSizeTestValue;
|
ui.Size? _physicalSizeTestValue;
|
||||||
/// Hides the real physical size and reports the given [physicalSizeTestValue]
|
/// Hides the real physical size and reports the given [physicalSizeTestValue]
|
||||||
/// instead.
|
/// instead.
|
||||||
set physicalSizeTestValue (ui.Size physicalSizeTestValue) {
|
set physicalSizeTestValue (ui.Size physicalSizeTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_physicalSizeTestValue = physicalSizeTestValue;
|
_physicalSizeTestValue = physicalSizeTestValue;
|
||||||
onMetricsChanged?.call();
|
onMetricsChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
ui.WindowPadding? _viewInsetsTestValue;
|
ui.WindowPadding? _viewInsetsTestValue;
|
||||||
/// Hides the real view insets and reports the given [viewInsetsTestValue]
|
/// Hides the real view insets and reports the given [viewInsetsTestValue]
|
||||||
/// instead.
|
/// instead.
|
||||||
set viewInsetsTestValue(ui.WindowPadding viewInsetsTestValue) {
|
set viewInsetsTestValue(ui.WindowPadding viewInsetsTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_viewInsetsTestValue = viewInsetsTestValue;
|
_viewInsetsTestValue = viewInsetsTestValue;
|
||||||
onMetricsChanged?.call();
|
onMetricsChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
ui.WindowPadding? _viewPaddingTestValue;
|
ui.WindowPadding? _viewPaddingTestValue;
|
||||||
/// Hides the real view padding and reports the given [paddingTestValue]
|
/// Hides the real view padding and reports the given [paddingTestValue]
|
||||||
/// instead.
|
/// instead.
|
||||||
set viewPaddingTestValue(ui.WindowPadding viewPaddingTestValue) {
|
set viewPaddingTestValue(ui.WindowPadding viewPaddingTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_viewPaddingTestValue = viewPaddingTestValue;
|
_viewPaddingTestValue = viewPaddingTestValue;
|
||||||
onMetricsChanged?.call();
|
onMetricsChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
ui.WindowPadding get padding => _paddingTestValue ?? _window.padding;
|
ui.WindowPadding get padding => _paddingTestValue ?? _window.padding;
|
||||||
ui.WindowPadding? _paddingTestValue;
|
ui.WindowPadding? _paddingTestValue;
|
||||||
/// Hides the real padding and reports the given [paddingTestValue] instead.
|
/// Hides the real padding and reports the given [paddingTestValue] instead.
|
||||||
set paddingTestValue(ui.WindowPadding paddingTestValue) {
|
set paddingTestValue(ui.WindowPadding paddingTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_paddingTestValue = paddingTestValue;
|
_paddingTestValue = paddingTestValue;
|
||||||
onMetricsChanged?.call();
|
onMetricsChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
ui.WindowPadding get systemGestureInsets => _systemGestureInsetsTestValue ?? _window.systemGestureInsets;
|
ui.WindowPadding get systemGestureInsets => _systemGestureInsetsTestValue ?? _window.systemGestureInsets;
|
||||||
ui.WindowPadding? _systemGestureInsetsTestValue;
|
ui.WindowPadding? _systemGestureInsetsTestValue;
|
||||||
/// Hides the real system gesture insets and reports the given [systemGestureInsetsTestValue] instead.
|
/// Hides the real system gesture insets and reports the given [systemGestureInsetsTestValue] instead.
|
||||||
set systemGestureInsetsTestValue(ui.WindowPadding systemGestureInsetsTestValue) {
|
set systemGestureInsetsTestValue(ui.WindowPadding systemGestureInsetsTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_systemGestureInsetsTestValue = systemGestureInsetsTestValue;
|
_systemGestureInsetsTestValue = systemGestureInsetsTestValue;
|
||||||
onMetricsChanged?.call();
|
onMetricsChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
ui.Locale get locale => _localeTestValue ?? platformDispatcher.locale;
|
ui.Locale get locale => _localeTestValue ?? platformDispatcher.locale;
|
||||||
ui.Locale? _localeTestValue;
|
ui.Locale? _localeTestValue;
|
||||||
/// Hides the real locale and reports the given [localeTestValue] instead.
|
/// Hides the real locale and reports the given [localeTestValue] instead.
|
||||||
set localeTestValue(ui.Locale localeTestValue) {
|
set localeTestValue(ui.Locale localeTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_localeTestValue = localeTestValue;
|
_localeTestValue = localeTestValue;
|
||||||
onLocaleChanged?.call();
|
onLocaleChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
List<ui.Locale> get locales => _localesTestValue ?? platformDispatcher.locales;
|
List<ui.Locale> get locales => _localesTestValue ?? platformDispatcher.locales;
|
||||||
List<ui.Locale>? _localesTestValue;
|
List<ui.Locale>? _localesTestValue;
|
||||||
/// Hides the real locales and reports the given [localesTestValue] instead.
|
/// Hides the real locales and reports the given [localesTestValue] instead.
|
||||||
set localesTestValue(List<ui.Locale> localesTestValue) {
|
set localesTestValue(List<ui.Locale> localesTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_localesTestValue = localesTestValue;
|
_localesTestValue = localesTestValue;
|
||||||
onLocaleChanged?.call();
|
onLocaleChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -192,7 +192,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
String get initialLifecycleState => _initialLifecycleStateTestValue;
|
String get initialLifecycleState => _initialLifecycleStateTestValue;
|
||||||
String _initialLifecycleStateTestValue = '';
|
String _initialLifecycleStateTestValue = '';
|
||||||
/// Sets a faked initialLifecycleState for testing.
|
/// Sets a faked initialLifecycleState for testing.
|
||||||
set initialLifecycleStateTestValue(String state) {
|
set initialLifecycleStateTestValue(String state) { // ignore: avoid_setters_without_getters
|
||||||
_initialLifecycleStateTestValue = state;
|
_initialLifecycleStateTestValue = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
double? _textScaleFactorTestValue;
|
double? _textScaleFactorTestValue;
|
||||||
/// Hides the real text scale factor and reports the given
|
/// Hides the real text scale factor and reports the given
|
||||||
/// [textScaleFactorTestValue] instead.
|
/// [textScaleFactorTestValue] instead.
|
||||||
set textScaleFactorTestValue(double textScaleFactorTestValue) {
|
set textScaleFactorTestValue(double textScaleFactorTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_textScaleFactorTestValue = textScaleFactorTestValue;
|
_textScaleFactorTestValue = textScaleFactorTestValue;
|
||||||
onTextScaleFactorChanged?.call();
|
onTextScaleFactorChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
}
|
}
|
||||||
/// Hides the real text scale factor and reports the given
|
/// Hides the real text scale factor and reports the given
|
||||||
/// [platformBrightnessTestValue] instead.
|
/// [platformBrightnessTestValue] instead.
|
||||||
set platformBrightnessTestValue(ui.Brightness platformBrightnessTestValue) {
|
set platformBrightnessTestValue(ui.Brightness platformBrightnessTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_platformBrightnessTestValue = platformBrightnessTestValue;
|
_platformBrightnessTestValue = platformBrightnessTestValue;
|
||||||
onPlatformBrightnessChanged?.call();
|
onPlatformBrightnessChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
bool? _alwaysUse24HourFormatTestValue;
|
bool? _alwaysUse24HourFormatTestValue;
|
||||||
/// Hides the real clock format and reports the given
|
/// Hides the real clock format and reports the given
|
||||||
/// [alwaysUse24HourFormatTestValue] instead.
|
/// [alwaysUse24HourFormatTestValue] instead.
|
||||||
set alwaysUse24HourFormatTestValue(bool alwaysUse24HourFormatTestValue) {
|
set alwaysUse24HourFormatTestValue(bool alwaysUse24HourFormatTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_alwaysUse24HourFormatTestValue = alwaysUse24HourFormatTestValue;
|
_alwaysUse24HourFormatTestValue = alwaysUse24HourFormatTestValue;
|
||||||
}
|
}
|
||||||
/// Deletes any existing test clock format and returns to using the real clock
|
/// Deletes any existing test clock format and returns to using the real clock
|
||||||
|
@ -288,7 +288,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
String? _defaultRouteNameTestValue;
|
String? _defaultRouteNameTestValue;
|
||||||
/// Hides the real default route name and reports the given
|
/// Hides the real default route name and reports the given
|
||||||
/// [defaultRouteNameTestValue] instead.
|
/// [defaultRouteNameTestValue] instead.
|
||||||
set defaultRouteNameTestValue(String defaultRouteNameTestValue) {
|
set defaultRouteNameTestValue(String defaultRouteNameTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_defaultRouteNameTestValue = defaultRouteNameTestValue;
|
_defaultRouteNameTestValue = defaultRouteNameTestValue;
|
||||||
}
|
}
|
||||||
/// Deletes any existing test default route name and returns to using the real
|
/// Deletes any existing test default route name and returns to using the real
|
||||||
|
@ -312,7 +312,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
bool? _semanticsEnabledTestValue;
|
bool? _semanticsEnabledTestValue;
|
||||||
/// Hides the real semantics enabled and reports the given
|
/// Hides the real semantics enabled and reports the given
|
||||||
/// [semanticsEnabledTestValue] instead.
|
/// [semanticsEnabledTestValue] instead.
|
||||||
set semanticsEnabledTestValue(bool semanticsEnabledTestValue) {
|
set semanticsEnabledTestValue(bool semanticsEnabledTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_semanticsEnabledTestValue = semanticsEnabledTestValue;
|
_semanticsEnabledTestValue = semanticsEnabledTestValue;
|
||||||
onSemanticsEnabledChanged?.call();
|
onSemanticsEnabledChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -342,7 +342,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
ui.AccessibilityFeatures? _accessibilityFeaturesTestValue;
|
ui.AccessibilityFeatures? _accessibilityFeaturesTestValue;
|
||||||
/// Hides the real accessibility features and reports the given
|
/// Hides the real accessibility features and reports the given
|
||||||
/// [accessibilityFeaturesTestValue] instead.
|
/// [accessibilityFeaturesTestValue] instead.
|
||||||
set accessibilityFeaturesTestValue(ui.AccessibilityFeatures accessibilityFeaturesTestValue) {
|
set accessibilityFeaturesTestValue(ui.AccessibilityFeatures accessibilityFeaturesTestValue) { // ignore: avoid_setters_without_getters
|
||||||
_accessibilityFeaturesTestValue = accessibilityFeaturesTestValue;
|
_accessibilityFeaturesTestValue = accessibilityFeaturesTestValue;
|
||||||
onAccessibilityFeaturesChanged?.call();
|
onAccessibilityFeaturesChanged?.call();
|
||||||
}
|
}
|
||||||
|
@ -358,7 +358,7 @@ class TestWindow implements ui.SingletonFlutterWindow {
|
||||||
ui.ViewConfiguration? _viewConfiguration;
|
ui.ViewConfiguration? _viewConfiguration;
|
||||||
|
|
||||||
/// Hide the real view configuration and report the provided [value] instead.
|
/// Hide the real view configuration and report the provided [value] instead.
|
||||||
set viewConfigurationTestValue(ui.ViewConfiguration? value) {
|
set viewConfigurationTestValue(ui.ViewConfiguration? value) { // ignore: avoid_setters_without_getters
|
||||||
_viewConfiguration = value;
|
_viewConfiguration = value;
|
||||||
onMetricsChanged?.call();
|
onMetricsChanged?.call();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,14 +37,15 @@ class BotDetector {
|
||||||
// When set, GA logs to a local file (normally for tests) so we don't need to filter.
|
// When set, GA logs to a local file (normally for tests) so we don't need to filter.
|
||||||
|| _platform.environment.containsKey('FLUTTER_ANALYTICS_LOG_FILE')
|
|| _platform.environment.containsKey('FLUTTER_ANALYTICS_LOG_FILE')
|
||||||
) {
|
) {
|
||||||
return _persistentToolState.runningOnBot = false;
|
_persistentToolState.setIsRunningOnBot(false);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_persistentToolState.isRunningOnBot != null) {
|
if (_persistentToolState.isRunningOnBot != null) {
|
||||||
return _persistentToolState.isRunningOnBot!;
|
return _persistentToolState.isRunningOnBot!;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _persistentToolState.runningOnBot = _platform.environment['BOT'] == 'true'
|
final bool result = _platform.environment['BOT'] == 'true'
|
||||||
|
|
||||||
// https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
|
// https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
|
||||||
|| _platform.environment['TRAVIS'] == 'true'
|
|| _platform.environment['TRAVIS'] == 'true'
|
||||||
|
@ -77,6 +78,9 @@ class BotDetector {
|
||||||
|
|
||||||
// Property when running on Azure.
|
// Property when running on Azure.
|
||||||
|| await _azureDetector.isRunningOnAzure;
|
|| await _azureDetector.isRunningOnAzure;
|
||||||
|
|
||||||
|
_persistentToolState.setIsRunningOnBot(result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,6 +111,7 @@ abstract class Terminal {
|
||||||
|
|
||||||
String clearScreen();
|
String clearScreen();
|
||||||
|
|
||||||
|
bool get singleCharMode;
|
||||||
set singleCharMode(bool value);
|
set singleCharMode(bool value);
|
||||||
|
|
||||||
/// Return keystrokes from the console.
|
/// Return keystrokes from the console.
|
||||||
|
@ -269,6 +270,14 @@ class AnsiTerminal implements Terminal {
|
||||||
@override
|
@override
|
||||||
String clearScreen() => supportsColor ? clear : '\n\n';
|
String clearScreen() => supportsColor ? clear : '\n\n';
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get singleCharMode {
|
||||||
|
if (!_stdio.stdinHasTerminal) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final io.Stdin stdin = _stdio.stdin as io.Stdin;
|
||||||
|
return stdin.lineMode && stdin.echoMode;
|
||||||
|
}
|
||||||
@override
|
@override
|
||||||
set singleCharMode(bool value) {
|
set singleCharMode(bool value) {
|
||||||
if (!_stdio.stdinHasTerminal) {
|
if (!_stdio.stdinHasTerminal) {
|
||||||
|
@ -365,6 +374,8 @@ class _TestTerminal implements Terminal {
|
||||||
throw UnsupportedError('promptForCharInput not supported in the test terminal.');
|
throw UnsupportedError('promptForCharInput not supported in the test terminal.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get singleCharMode => false;
|
||||||
@override
|
@override
|
||||||
set singleCharMode(bool value) { }
|
set singleCharMode(bool value) { }
|
||||||
|
|
||||||
|
|
|
@ -198,12 +198,12 @@ class UpgradeCommandRunner {
|
||||||
// re-entrantly with the `--continue` flag
|
// re-entrantly with the `--continue` flag
|
||||||
Future<void> runCommandSecondHalf(FlutterVersion flutterVersion) async {
|
Future<void> runCommandSecondHalf(FlutterVersion flutterVersion) async {
|
||||||
// Make sure the welcome message re-display is delayed until the end.
|
// Make sure the welcome message re-display is delayed until the end.
|
||||||
globals.persistentToolState.redisplayWelcomeMessage = false;
|
globals.persistentToolState.setShouldRedisplayWelcomeMessage(false);
|
||||||
await precacheArtifacts();
|
await precacheArtifacts();
|
||||||
await updatePackages(flutterVersion);
|
await updatePackages(flutterVersion);
|
||||||
await runDoctor();
|
await runDoctor();
|
||||||
// Force the welcome message to re-display following the upgrade.
|
// Force the welcome message to re-display following the upgrade.
|
||||||
globals.persistentToolState.redisplayWelcomeMessage = true;
|
globals.persistentToolState.setShouldRedisplayWelcomeMessage(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> hasUncommittedChanges() async {
|
Future<bool> hasUncommittedChanges() async {
|
||||||
|
|
|
@ -704,6 +704,7 @@ class IOSDeviceLogReader extends DeviceLogReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Log reader will listen to [debugger.logLines] and will detach debugger on dispose.
|
/// Log reader will listen to [debugger.logLines] and will detach debugger on dispose.
|
||||||
|
IOSDeployDebugger get debuggerStream => _iosDeployDebugger;
|
||||||
set debuggerStream(IOSDeployDebugger debugger) {
|
set debuggerStream(IOSDeployDebugger debugger) {
|
||||||
// Logging is gathered from syslog on iOS 13 and earlier.
|
// Logging is gathered from syslog on iOS 13 and earlier.
|
||||||
if (_majorSdkVersion < minimumUniversalLoggingSdkVersion) {
|
if (_majorSdkVersion < minimumUniversalLoggingSdkVersion) {
|
||||||
|
@ -736,14 +737,13 @@ class IOSDeviceLogReader extends DeviceLogReader {
|
||||||
_linesController.close();
|
_linesController.close();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
assert(_idevicesyslogProcess == null);
|
assert(idevicesyslogProcess == null);
|
||||||
_idevicesyslogProcess = process;
|
idevicesyslogProcess = process;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@visibleForTesting
|
@visibleForTesting
|
||||||
set idevicesyslogProcess(Process process) => _idevicesyslogProcess = process;
|
Process idevicesyslogProcess;
|
||||||
Process _idevicesyslogProcess;
|
|
||||||
|
|
||||||
// Returns a stateful line handler to properly capture multiline output.
|
// Returns a stateful line handler to properly capture multiline output.
|
||||||
//
|
//
|
||||||
|
@ -781,7 +781,7 @@ class IOSDeviceLogReader extends DeviceLogReader {
|
||||||
for (final StreamSubscription<void> loggingSubscription in _loggingSubscriptions) {
|
for (final StreamSubscription<void> loggingSubscription in _loggingSubscriptions) {
|
||||||
loggingSubscription.cancel();
|
loggingSubscription.cancel();
|
||||||
}
|
}
|
||||||
_idevicesyslogProcess?.kill();
|
idevicesyslogProcess?.kill();
|
||||||
_iosDeployDebugger?.detach();
|
_iosDeployDebugger?.detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ abstract class PersistentToolState {
|
||||||
///
|
///
|
||||||
/// May give null if the value has not been set.
|
/// May give null if the value has not been set.
|
||||||
bool? get shouldRedisplayWelcomeMessage;
|
bool? get shouldRedisplayWelcomeMessage;
|
||||||
set redisplayWelcomeMessage(bool value); // Enforced nonnull setter.
|
void setShouldRedisplayWelcomeMessage(bool value); // Enforced nonnull setter.
|
||||||
|
|
||||||
/// Returns the last active version for a given [channel].
|
/// Returns the last active version for a given [channel].
|
||||||
///
|
///
|
||||||
|
@ -50,11 +50,11 @@ abstract class PersistentToolState {
|
||||||
|
|
||||||
/// Return the hash of the last active license terms.
|
/// Return the hash of the last active license terms.
|
||||||
String? get lastActiveLicenseTermsHash;
|
String? get lastActiveLicenseTermsHash;
|
||||||
set lastActiveLicenseTerms(String value); // Enforced nonnull setter.
|
void setLastActiveLicenseTermsHash(String value); // Enforced nonnull setter.
|
||||||
|
|
||||||
/// Whether this client was already determined to be or not be a bot.
|
/// Whether this client was already determined to be or not be a bot.
|
||||||
bool? get isRunningOnBot;
|
bool? get isRunningOnBot;
|
||||||
set runningOnBot(bool value); // Enforced nonnull setter.
|
void setIsRunningOnBot(bool value); // Enforced nonnull setter.
|
||||||
}
|
}
|
||||||
|
|
||||||
class _DefaultPersistentToolState implements PersistentToolState {
|
class _DefaultPersistentToolState implements PersistentToolState {
|
||||||
|
@ -98,7 +98,7 @@ class _DefaultPersistentToolState implements PersistentToolState {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set redisplayWelcomeMessage(bool value) {
|
void setShouldRedisplayWelcomeMessage(bool value) {
|
||||||
_config.setValue(_kRedisplayWelcomeMessage, value);
|
_config.setValue(_kRedisplayWelcomeMessage, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ class _DefaultPersistentToolState implements PersistentToolState {
|
||||||
String? get lastActiveLicenseTermsHash => _config.getValue(_kLicenseHash) as String?;
|
String? get lastActiveLicenseTermsHash => _config.getValue(_kLicenseHash) as String?;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set lastActiveLicenseTerms(String value) {
|
void setLastActiveLicenseTermsHash(String value) {
|
||||||
_config.setValue(_kLicenseHash, value);
|
_config.setValue(_kLicenseHash, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ class _DefaultPersistentToolState implements PersistentToolState {
|
||||||
bool? get isRunningOnBot => _config.getValue(_kBotKey) as bool?;
|
bool? get isRunningOnBot => _config.getValue(_kBotKey) as bool?;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set runningOnBot(bool value) {
|
void setIsRunningOnBot(bool value) {
|
||||||
_config.setValue(_kBotKey, value);
|
_config.setValue(_kBotKey, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ class FirstRunMessenger {
|
||||||
|
|
||||||
/// Update the cached license terms hash once the new terms have been displayed.
|
/// Update the cached license terms hash once the new terms have been displayed.
|
||||||
void confirmLicenseTermsDisplayed() {
|
void confirmLicenseTermsDisplayed() {
|
||||||
_persistentToolState.lastActiveLicenseTerms = _currentHash;
|
_persistentToolState.setLastActiveLicenseTermsHash(_currentHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The hash of the current license representation.
|
/// The hash of the current license representation.
|
||||||
|
|
|
@ -188,8 +188,6 @@ abstract class FlutterCommand extends Command<void> {
|
||||||
bool _excludeDebug = false;
|
bool _excludeDebug = false;
|
||||||
bool _excludeRelease = false;
|
bool _excludeRelease = false;
|
||||||
|
|
||||||
BuildMode _defaultBuildMode;
|
|
||||||
|
|
||||||
void requiresPubspecYaml() {
|
void requiresPubspecYaml() {
|
||||||
_requiresPubspecYaml = true;
|
_requiresPubspecYaml = true;
|
||||||
}
|
}
|
||||||
|
@ -833,9 +831,11 @@ abstract class FlutterCommand extends Command<void> {
|
||||||
usesTrackWidgetCreation(verboseHelp: verboseHelp);
|
usesTrackWidgetCreation(verboseHelp: verboseHelp);
|
||||||
}
|
}
|
||||||
|
|
||||||
set defaultBuildMode(BuildMode value) {
|
/// The build mode that this command will use if no build mode is
|
||||||
_defaultBuildMode = value;
|
/// explicitly specified.
|
||||||
}
|
///
|
||||||
|
/// Use [getBuildMode] to obtain the actual effective build mode.
|
||||||
|
BuildMode defaultBuildMode;
|
||||||
|
|
||||||
BuildMode getBuildMode() {
|
BuildMode getBuildMode() {
|
||||||
// No debug when _excludeDebug is true.
|
// No debug when _excludeDebug is true.
|
||||||
|
@ -865,7 +865,7 @@ abstract class FlutterCommand extends Command<void> {
|
||||||
if (jitReleaseResult) {
|
if (jitReleaseResult) {
|
||||||
return BuildMode.jitRelease;
|
return BuildMode.jitRelease;
|
||||||
}
|
}
|
||||||
return _defaultBuildMode;
|
return defaultBuildMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void usesFlavorOption() {
|
void usesFlavorOption() {
|
||||||
|
|
|
@ -81,7 +81,7 @@ class TestCompiler {
|
||||||
Future<String> compile(Uri mainDart) {
|
Future<String> compile(Uri mainDart) {
|
||||||
final Completer<String> completer = Completer<String>();
|
final Completer<String> completer = Completer<String>();
|
||||||
if (compilerController.isClosed) {
|
if (compilerController.isClosed) {
|
||||||
return null;
|
return Future<String>.value(null);
|
||||||
}
|
}
|
||||||
compilerController.add(CompilationRequest(mainDart, completer));
|
compilerController.add(CompilationRequest(mainDart, completer));
|
||||||
return completer.future;
|
return completer.future;
|
||||||
|
|
|
@ -394,7 +394,7 @@ class WebServerDevice extends Device {
|
||||||
void clearLogs() { }
|
void clearLogs() { }
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<String> get emulatorId => null;
|
Future<String> get emulatorId async => null;
|
||||||
|
|
||||||
DeviceLogReader _logReader;
|
DeviceLogReader _logReader;
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ class WindowsUWPDevice extends Device {
|
||||||
Future<void> dispose() async { }
|
Future<void> dispose() async { }
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<String> get emulatorId => null;
|
Future<String> get emulatorId async => null;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureOr<DeviceLogReader> getLogReader({covariant BuildableUwpApp app, bool includePastLogs = false}) {
|
FutureOr<DeviceLogReader> getLogReader({covariant BuildableUwpApp app, bool includePastLogs = false}) {
|
||||||
|
|
|
@ -233,6 +233,8 @@ class FakeTerminal implements Terminal {
|
||||||
displayAcceptedCharacters: displayAcceptedCharacters
|
displayAcceptedCharacters: displayAcceptedCharacters
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get singleCharMode => terminal.singleCharMode;
|
||||||
@override
|
@override
|
||||||
set singleCharMode(bool value) => terminal.singleCharMode = value;
|
set singleCharMode(bool value) => terminal.singleCharMode = value;
|
||||||
|
|
||||||
|
|
|
@ -672,7 +672,7 @@ class NoOpDoctor implements Doctor {
|
||||||
List<ValidatorTask> startValidatorTasks() => <ValidatorTask>[];
|
List<ValidatorTask> startValidatorTasks() => <ValidatorTask>[];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> summary() => null;
|
Future<void> summary() async { }
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<DoctorValidator> get validators => <DoctorValidator>[];
|
List<DoctorValidator> get validators => <DoctorValidator>[];
|
||||||
|
|
|
@ -1264,6 +1264,10 @@ class FakeFileSystem extends Fake implements FileSystem {
|
||||||
@override
|
@override
|
||||||
p.Context get path => p.Context();
|
p.Context get path => p.Context();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Directory get currentDirectory {
|
||||||
|
throw UnimplementedError();
|
||||||
|
}
|
||||||
@override
|
@override
|
||||||
set currentDirectory(dynamic path) { }
|
set currentDirectory(dynamic path) { }
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,6 +236,7 @@ class TestTerminal extends AnsiTerminal {
|
||||||
return mockStdInStream;
|
return mockStdInStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
bool singleCharMode = false;
|
bool singleCharMode = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -21,10 +21,10 @@ void main() {
|
||||||
logger: BufferLogger.test(),
|
logger: BufferLogger.test(),
|
||||||
);
|
);
|
||||||
expect(state1.shouldRedisplayWelcomeMessage, null);
|
expect(state1.shouldRedisplayWelcomeMessage, null);
|
||||||
state1.redisplayWelcomeMessage = true;
|
state1.setShouldRedisplayWelcomeMessage(true);
|
||||||
expect(stateFile.existsSync(), true);
|
expect(stateFile.existsSync(), true);
|
||||||
expect(state1.shouldRedisplayWelcomeMessage, true);
|
expect(state1.shouldRedisplayWelcomeMessage, true);
|
||||||
state1.redisplayWelcomeMessage = false;
|
state1.setShouldRedisplayWelcomeMessage(false);
|
||||||
expect(state1.shouldRedisplayWelcomeMessage, false);
|
expect(state1.shouldRedisplayWelcomeMessage, false);
|
||||||
|
|
||||||
final PersistentToolState state2 = PersistentToolState.test(
|
final PersistentToolState state2 = PersistentToolState.test(
|
||||||
|
|
|
@ -50,7 +50,7 @@ FirstRunMessenger setUpFirstRunMessenger({bool? redisplayWelcomeMessage, bool te
|
||||||
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
|
final MemoryFileSystem fileSystem = MemoryFileSystem.test();
|
||||||
final PersistentToolState state = PersistentToolState.test(directory: fileSystem.currentDirectory, logger: BufferLogger.test());
|
final PersistentToolState state = PersistentToolState.test(directory: fileSystem.currentDirectory, logger: BufferLogger.test());
|
||||||
if (redisplayWelcomeMessage != null) {
|
if (redisplayWelcomeMessage != null) {
|
||||||
state.redisplayWelcomeMessage = redisplayWelcomeMessage;
|
state.setShouldRedisplayWelcomeMessage(redisplayWelcomeMessage);
|
||||||
}
|
}
|
||||||
if (test) {
|
if (test) {
|
||||||
return TestFirstRunMessenger(state);
|
return TestFirstRunMessenger(state);
|
||||||
|
|
|
@ -444,9 +444,7 @@ class FakeDevtoolsLauncher extends Fake implements DevtoolsLauncher {
|
||||||
Uri devToolsUrl;
|
Uri devToolsUrl;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<DevToolsServerAddress> serve() {
|
Future<DevToolsServerAddress> serve() async => null;
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> get ready => readyCompleter.future;
|
Future<void> get ready => readyCompleter.future;
|
||||||
|
|
|
@ -494,7 +494,7 @@ void main() {
|
||||||
_setupMocks();
|
_setupMocks();
|
||||||
final TestChromiumLauncher chromiumLauncher = TestChromiumLauncher();
|
final TestChromiumLauncher chromiumLauncher = TestChromiumLauncher();
|
||||||
final Chromium chrome = Chromium(1, chromeConnection, chromiumLauncher: chromiumLauncher);
|
final Chromium chrome = Chromium(1, chromeConnection, chromiumLauncher: chromiumLauncher);
|
||||||
chromiumLauncher.instance = chrome;
|
chromiumLauncher.setInstance(chrome);
|
||||||
|
|
||||||
flutterDevice.device = GoogleChromeDevice(
|
flutterDevice.device = GoogleChromeDevice(
|
||||||
fileSystem: fileSystem,
|
fileSystem: fileSystem,
|
||||||
|
@ -551,7 +551,7 @@ void main() {
|
||||||
_setupMocks();
|
_setupMocks();
|
||||||
final TestChromiumLauncher chromiumLauncher = TestChromiumLauncher();
|
final TestChromiumLauncher chromiumLauncher = TestChromiumLauncher();
|
||||||
final Chromium chrome = Chromium(1, chromeConnection, chromiumLauncher: chromiumLauncher);
|
final Chromium chrome = Chromium(1, chromeConnection, chromiumLauncher: chromiumLauncher);
|
||||||
chromiumLauncher.instance = chrome;
|
chromiumLauncher.setInstance(chrome);
|
||||||
|
|
||||||
flutterDevice.device = GoogleChromeDevice(
|
flutterDevice.device = GoogleChromeDevice(
|
||||||
fileSystem: fileSystem,
|
fileSystem: fileSystem,
|
||||||
|
@ -848,7 +848,7 @@ void main() {
|
||||||
final FakeChromeConnection chromeConnection = FakeChromeConnection();
|
final FakeChromeConnection chromeConnection = FakeChromeConnection();
|
||||||
final TestChromiumLauncher chromiumLauncher = TestChromiumLauncher();
|
final TestChromiumLauncher chromiumLauncher = TestChromiumLauncher();
|
||||||
final Chromium chrome = Chromium(1, chromeConnection, chromiumLauncher: chromiumLauncher);
|
final Chromium chrome = Chromium(1, chromeConnection, chromiumLauncher: chromiumLauncher);
|
||||||
chromiumLauncher.instance = chrome;
|
chromiumLauncher.setInstance(chrome);
|
||||||
|
|
||||||
flutterDevice.device = GoogleChromeDevice(
|
flutterDevice.device = GoogleChromeDevice(
|
||||||
fileSystem: fileSystem,
|
fileSystem: fileSystem,
|
||||||
|
@ -1220,11 +1220,11 @@ class FakeWipConnection extends Fake implements WipConnection {
|
||||||
class TestChromiumLauncher implements ChromiumLauncher {
|
class TestChromiumLauncher implements ChromiumLauncher {
|
||||||
TestChromiumLauncher();
|
TestChromiumLauncher();
|
||||||
|
|
||||||
set instance(Chromium chromium) {
|
bool _hasInstance = false;
|
||||||
|
void setInstance(Chromium chromium) {
|
||||||
_hasInstance = true;
|
_hasInstance = true;
|
||||||
currentCompleter.complete(chromium);
|
currentCompleter.complete(chromium);
|
||||||
}
|
}
|
||||||
bool _hasInstance = false;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Completer<Chromium> currentCompleter = Completer<Chromium>();
|
Completer<Chromium> currentCompleter = Completer<Chromium>();
|
||||||
|
|
|
@ -312,9 +312,7 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> cleanWorkspace(String workspacePath, String scheme, { bool verbose = false }) {
|
Future<void> cleanWorkspace(String workspacePath, String scheme, { bool verbose = false }) async { }
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<XcodeProjectInfo> getInfo(String projectPath, {String projectFilename}) async {
|
Future<XcodeProjectInfo> getInfo(String projectPath, {String projectFilename}) async {
|
||||||
|
|
|
@ -161,19 +161,13 @@ class FakeHttpClient implements HttpClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set authenticate(Future<bool> Function(Uri url, String scheme, String realm)? f) {
|
Future<bool> Function(Uri url, String scheme, String realm)? authenticate;
|
||||||
throw UnimplementedError();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set authenticateProxy(Future<bool> Function(String host, int port, String scheme, String realm)? f) {
|
Future<bool> Function(String host, int port, String scheme, String realm)? authenticateProxy;
|
||||||
throw UnimplementedError();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set badCertificateCallback(bool Function(X509Certificate cert, String host, int port)? callback) {
|
bool Function(X509Certificate cert, String host, int port)? badCertificateCallback;
|
||||||
throw UnimplementedError();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void close({bool force = false}) { }
|
void close({bool force = false}) { }
|
||||||
|
@ -190,7 +184,7 @@ class FakeHttpClient implements HttpClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
set findProxy(String Function(Uri url)? f) { }
|
String Function(Uri url)? findProxy;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<HttpClientRequest> get(String host, int port, String path) {
|
Future<HttpClientRequest> get(String host, int port, String path) {
|
||||||
|
|
|
@ -71,7 +71,7 @@ class PluginEventChannel<T> {
|
||||||
'Replace calls to the "controller" setter with calls to the "setController" method. '
|
'Replace calls to the "controller" setter with calls to the "setController" method. '
|
||||||
'This feature was deprecated after v1.23.0-7.0.pre.'
|
'This feature was deprecated after v1.23.0-7.0.pre.'
|
||||||
)
|
)
|
||||||
set controller(StreamController<T> controller) {
|
set controller(StreamController<T> controller) { // ignore: avoid_setters_without_getters
|
||||||
setController(controller);
|
setController(controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue