some spaces formatting (#29452)
* some space formattings * always use blocks in if-else if a block is used * format spaces in for and while * allow multiline if conditions * fix missing space
This commit is contained in:
parent
4418ec467b
commit
a6af422874
@ -440,8 +440,8 @@ class RenderSectorSlice extends RenderSectorWithChildren {
|
|||||||
|
|
||||||
class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChildMixin<RenderSector> {
|
class RenderBoxToRenderSectorAdapter extends RenderBox with RenderObjectWithChildMixin<RenderSector> {
|
||||||
|
|
||||||
RenderBoxToRenderSectorAdapter({ double innerRadius = 0.0, RenderSector child }) :
|
RenderBoxToRenderSectorAdapter({ double innerRadius = 0.0, RenderSector child })
|
||||||
_innerRadius = innerRadius {
|
: _innerRadius = innerRadius {
|
||||||
this.child = child;
|
this.child = child;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,14 +279,14 @@ class CupertinoDatePicker extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case _PickerColumnType.hour:
|
case _PickerColumnType.hour:
|
||||||
for (int i = 0 ; i < 24; i++) {
|
for (int i = 0; i < 24; i++) {
|
||||||
final String hour = localizations.datePickerHour(i);
|
final String hour = localizations.datePickerHour(i);
|
||||||
if (longestText.length < hour.length)
|
if (longestText.length < hour.length)
|
||||||
longestText = hour;
|
longestText = hour;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case _PickerColumnType.minute:
|
case _PickerColumnType.minute:
|
||||||
for (int i = 0 ; i < 60; i++) {
|
for (int i = 0; i < 60; i++) {
|
||||||
final String minute = localizations.datePickerMinute(i);
|
final String minute = localizations.datePickerMinute(i);
|
||||||
if (longestText.length < minute.length)
|
if (longestText.length < minute.length)
|
||||||
longestText = minute;
|
longestText = minute;
|
||||||
@ -299,14 +299,14 @@ class CupertinoDatePicker extends StatefulWidget {
|
|||||||
: localizations.postMeridiemAbbreviation;
|
: localizations.postMeridiemAbbreviation;
|
||||||
break;
|
break;
|
||||||
case _PickerColumnType.dayOfMonth:
|
case _PickerColumnType.dayOfMonth:
|
||||||
for (int i = 1 ; i <=31; i++) {
|
for (int i = 1; i <=31; i++) {
|
||||||
final String dayOfMonth = localizations.datePickerDayOfMonth(i);
|
final String dayOfMonth = localizations.datePickerDayOfMonth(i);
|
||||||
if (longestText.length < dayOfMonth.length)
|
if (longestText.length < dayOfMonth.length)
|
||||||
longestText = dayOfMonth;
|
longestText = dayOfMonth;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case _PickerColumnType.month:
|
case _PickerColumnType.month:
|
||||||
for (int i = 1 ; i <=12; i++) {
|
for (int i = 1; i <=12; i++) {
|
||||||
final String month = localizations.datePickerMonth(i);
|
final String month = localizations.datePickerMonth(i);
|
||||||
if (longestText.length < month.length)
|
if (longestText.length < month.length)
|
||||||
longestText = month;
|
longestText = month;
|
||||||
@ -514,8 +514,7 @@ class _CupertinoDatePickerDateTimeState extends State<CupertinoDatePicker> {
|
|||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 300),
|
||||||
curve: Curves.easeOut,
|
curve: Curves.easeOut,
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
widget.onDateTimeChanged(_getDateTime());
|
widget.onDateTimeChanged(_getDateTime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -608,8 +607,7 @@ class _CupertinoDatePickerDateTimeState extends State<CupertinoDatePicker> {
|
|||||||
|| localizations.datePickerDateTimeOrder == DatePickerDateTimeOrder.time_dayPeriod_date) {
|
|| localizations.datePickerDateTimeOrder == DatePickerDateTimeOrder.time_dayPeriod_date) {
|
||||||
pickerBuilders.add(_buildAmPmPicker);
|
pickerBuilders.add(_buildAmPmPicker);
|
||||||
columnWidths.add(_getEstimatedColumnWidth(_PickerColumnType.dayPeriod));
|
columnWidths.add(_getEstimatedColumnWidth(_PickerColumnType.dayPeriod));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
pickerBuilders.insert(0, _buildAmPmPicker);
|
pickerBuilders.insert(0, _buildAmPmPicker);
|
||||||
columnWidths.insert(0, _getEstimatedColumnWidth(_PickerColumnType.dayPeriod));
|
columnWidths.insert(0, _getEstimatedColumnWidth(_PickerColumnType.dayPeriod));
|
||||||
}
|
}
|
||||||
@ -621,8 +619,7 @@ class _CupertinoDatePickerDateTimeState extends State<CupertinoDatePicker> {
|
|||||||
|| localizations.datePickerDateTimeOrder == DatePickerDateTimeOrder.dayPeriod_time_date) {
|
|| localizations.datePickerDateTimeOrder == DatePickerDateTimeOrder.dayPeriod_time_date) {
|
||||||
pickerBuilders.add(_buildMediumDatePicker);
|
pickerBuilders.add(_buildMediumDatePicker);
|
||||||
columnWidths.add(_getEstimatedColumnWidth(_PickerColumnType.date));
|
columnWidths.add(_getEstimatedColumnWidth(_PickerColumnType.date));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
pickerBuilders.insert(0, _buildMediumDatePicker);
|
pickerBuilders.insert(0, _buildMediumDatePicker);
|
||||||
columnWidths.insert(0, _getEstimatedColumnWidth(_PickerColumnType.date));
|
columnWidths.insert(0, _getEstimatedColumnWidth(_PickerColumnType.date));
|
||||||
}
|
}
|
||||||
@ -1181,8 +1178,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
return Semantics(
|
return Semantics(
|
||||||
label: semanticsLabel,
|
label: semanticsLabel,
|
||||||
excludeSemantics: true,
|
excludeSemantics: true,
|
||||||
@ -1199,6 +1195,7 @@ class _CupertinoTimerPickerState extends State<CupertinoTimerPicker> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -2001,8 +2001,7 @@ class _NavigationBarComponentsTransition {
|
|||||||
// text.
|
// text.
|
||||||
if (bottomLargeTitle != null &&
|
if (bottomLargeTitle != null &&
|
||||||
topBackLabel != null &&
|
topBackLabel != null &&
|
||||||
bottomLargeExpanded
|
bottomLargeExpanded) {
|
||||||
) {
|
|
||||||
return PositionedTransition(
|
return PositionedTransition(
|
||||||
rect: animation.drive(slideFromLeadingEdge(
|
rect: animation.drive(slideFromLeadingEdge(
|
||||||
fromKey: bottomComponents.largeTitleKey,
|
fromKey: bottomComponents.largeTitleKey,
|
||||||
|
@ -165,9 +165,9 @@ class _CupertinoTabViewState extends State<CupertinoTabView> {
|
|||||||
if (name == Navigator.defaultRouteName && widget.builder != null) {
|
if (name == Navigator.defaultRouteName && widget.builder != null) {
|
||||||
routeBuilder = widget.builder;
|
routeBuilder = widget.builder;
|
||||||
title = widget.defaultTitle;
|
title = widget.defaultTitle;
|
||||||
}
|
} else if (widget.routes != null) {
|
||||||
else if (widget.routes != null)
|
|
||||||
routeBuilder = widget.routes[name];
|
routeBuilder = widget.routes[name];
|
||||||
|
}
|
||||||
if (routeBuilder != null) {
|
if (routeBuilder != null) {
|
||||||
return CupertinoPageRoute<dynamic>(
|
return CupertinoPageRoute<dynamic>(
|
||||||
builder: routeBuilder,
|
builder: routeBuilder,
|
||||||
|
@ -323,7 +323,7 @@ abstract class BindingBase {
|
|||||||
await setter(parameters['enabled'] == 'true');
|
await setter(parameters['enabled'] == 'true');
|
||||||
_postExtensionStateChangedEvent(name, await getter() ? 'true' : 'false');
|
_postExtensionStateChangedEvent(name, await getter() ? 'true' : 'false');
|
||||||
}
|
}
|
||||||
return <String, dynamic>{ 'enabled': await getter() ? 'true' : 'false' };
|
return <String, dynamic>{'enabled': await getter() ? 'true' : 'false'};
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -357,7 +357,7 @@ abstract class BindingBase {
|
|||||||
await setter(double.parse(parameters[name]));
|
await setter(double.parse(parameters[name]));
|
||||||
_postExtensionStateChangedEvent(name, (await getter()).toString());
|
_postExtensionStateChangedEvent(name, (await getter()).toString());
|
||||||
}
|
}
|
||||||
return <String, dynamic>{ name: (await getter()).toString() };
|
return <String, dynamic>{name: (await getter()).toString()};
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -419,7 +419,7 @@ abstract class BindingBase {
|
|||||||
await setter(parameters['value']);
|
await setter(parameters['value']);
|
||||||
_postExtensionStateChangedEvent(name, await getter());
|
_postExtensionStateChangedEvent(name, await getter());
|
||||||
}
|
}
|
||||||
return <String, dynamic>{ 'value': await getter() };
|
return <String, dynamic>{'value': await getter()};
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ class EagerGestureRecognizer extends OneSequenceGestureRecognizer {
|
|||||||
/// Create an eager gesture recognizer.
|
/// Create an eager gesture recognizer.
|
||||||
///
|
///
|
||||||
/// {@macro flutter.gestures.gestureRecognizer.kind}
|
/// {@macro flutter.gestures.gestureRecognizer.kind}
|
||||||
EagerGestureRecognizer({ PointerDeviceKind kind }): super(kind: kind);
|
EagerGestureRecognizer({ PointerDeviceKind kind }) : super(kind: kind);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void addAllowedPointer(PointerDownEvent event) {
|
void addAllowedPointer(PointerDownEvent event) {
|
||||||
|
@ -203,7 +203,7 @@ class _ExpansionPanelListState extends State<ExpansionPanelList> {
|
|||||||
newChild.value == widget.initialOpenPanelValue)
|
newChild.value == widget.initialOpenPanelValue)
|
||||||
_currentOpenPanel = newChild;
|
_currentOpenPanel = newChild;
|
||||||
}
|
}
|
||||||
} else if(oldWidget._allowOnlyOnePanelOpen) {
|
} else if (oldWidget._allowOnlyOnePanelOpen) {
|
||||||
_currentOpenPanel = null;
|
_currentOpenPanel = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -760,8 +760,9 @@ class _RenderDecoration extends RenderBox {
|
|||||||
// label from changing when text is entered.
|
// label from changing when text is entered.
|
||||||
final RenderProxyBox typedHint = hint;
|
final RenderProxyBox typedHint = hint;
|
||||||
visitor(typedHint.child);
|
visitor(typedHint.child);
|
||||||
} else if (!isFocused && label != null)
|
} else if (!isFocused && label != null) {
|
||||||
visitor(label);
|
visitor(label);
|
||||||
|
}
|
||||||
if (input != null)
|
if (input != null)
|
||||||
visitor(input);
|
visitor(input);
|
||||||
if (suffixIcon != null)
|
if (suffixIcon != null)
|
||||||
@ -1699,9 +1700,8 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
|
|||||||
_effectiveDecoration = null;
|
_effectiveDecoration = null;
|
||||||
|
|
||||||
if (widget._labelShouldWithdraw != old._labelShouldWithdraw && widget.decoration.hasFloatingPlaceholder) {
|
if (widget._labelShouldWithdraw != old._labelShouldWithdraw && widget.decoration.hasFloatingPlaceholder) {
|
||||||
if (widget._labelShouldWithdraw) {
|
if (widget._labelShouldWithdraw)
|
||||||
_floatingLabelController.forward();
|
_floatingLabelController.forward();
|
||||||
}
|
|
||||||
else
|
else
|
||||||
_floatingLabelController.reverse();
|
_floatingLabelController.reverse();
|
||||||
}
|
}
|
||||||
|
@ -581,8 +581,7 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
|
|||||||
// If we start out with a child, have the child appear fully visible instead
|
// If we start out with a child, have the child appear fully visible instead
|
||||||
// of animating in.
|
// of animating in.
|
||||||
_currentController.value = 1.0;
|
_currentController.value = 1.0;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// If we start without a child we update the geometry object with a
|
// If we start without a child we update the geometry object with a
|
||||||
// floating action button scale of 0, as it is not showing on the screen.
|
// floating action button scale of 0, as it is not showing on the screen.
|
||||||
_updateGeometryScale(0.0);
|
_updateGeometryScale(0.0);
|
||||||
|
@ -445,7 +445,7 @@ class _RenderSwitch extends RenderToggleable {
|
|||||||
DragStartBehavior get dragStartBehavior => _drag.dragStartBehavior;
|
DragStartBehavior get dragStartBehavior => _drag.dragStartBehavior;
|
||||||
set dragStartBehavior(DragStartBehavior value) {
|
set dragStartBehavior(DragStartBehavior value) {
|
||||||
assert(value != null);
|
assert(value != null);
|
||||||
if(_drag.dragStartBehavior == value)
|
if (_drag.dragStartBehavior == value)
|
||||||
return;
|
return;
|
||||||
_drag.dragStartBehavior = value;
|
_drag.dragStartBehavior = value;
|
||||||
}
|
}
|
||||||
|
@ -260,8 +260,7 @@ class AssetImage extends AssetBundleImageProvider {
|
|||||||
static final RegExp _extractRatioRegExp = RegExp(r'/?(\d+(\.\d*)?)x$');
|
static final RegExp _extractRatioRegExp = RegExp(r'/?(\d+(\.\d*)?)x$');
|
||||||
|
|
||||||
double _parseScale(String key) {
|
double _parseScale(String key) {
|
||||||
|
if (key == assetName) {
|
||||||
if ( key == assetName){
|
|
||||||
return _naturalResolution;
|
return _naturalResolution;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -718,8 +718,7 @@ class RenderEditable extends RenderBox {
|
|||||||
assert(!_listenerAttached);
|
assert(!_listenerAttached);
|
||||||
RawKeyboard.instance.addListener(_handleKeyEvent);
|
RawKeyboard.instance.addListener(_handleKeyEvent);
|
||||||
_listenerAttached = true;
|
_listenerAttached = true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
assert(_listenerAttached);
|
assert(_listenerAttached);
|
||||||
RawKeyboard.instance.removeListener(_handleKeyEvent);
|
RawKeyboard.instance.removeListener(_handleKeyEvent);
|
||||||
_listenerAttached = false;
|
_listenerAttached = false;
|
||||||
@ -1565,7 +1564,7 @@ class RenderEditable extends RenderBox {
|
|||||||
}
|
}
|
||||||
_floatingCursorOn = state != FloatingCursorDragState.End;
|
_floatingCursorOn = state != FloatingCursorDragState.End;
|
||||||
_resetFloatingCursorAnimationValue = resetLerpValue;
|
_resetFloatingCursorAnimationValue = resetLerpValue;
|
||||||
if(_floatingCursorOn) {
|
if (_floatingCursorOn) {
|
||||||
_floatingCursorOffset = boundedOffset;
|
_floatingCursorOffset = boundedOffset;
|
||||||
_floatingCursorTextPosition = lastTextPosition;
|
_floatingCursorTextPosition = lastTextPosition;
|
||||||
}
|
}
|
||||||
@ -1582,7 +1581,7 @@ class RenderEditable extends RenderBox {
|
|||||||
double sizeAdjustmentX = _kFloatingCaretSizeIncrease.dx;
|
double sizeAdjustmentX = _kFloatingCaretSizeIncrease.dx;
|
||||||
double sizeAdjustmentY = _kFloatingCaretSizeIncrease.dy;
|
double sizeAdjustmentY = _kFloatingCaretSizeIncrease.dy;
|
||||||
|
|
||||||
if(_resetFloatingCursorAnimationValue != null) {
|
if (_resetFloatingCursorAnimationValue != null) {
|
||||||
sizeAdjustmentX = ui.lerpDouble(sizeAdjustmentX, 0, _resetFloatingCursorAnimationValue);
|
sizeAdjustmentX = ui.lerpDouble(sizeAdjustmentX, 0, _resetFloatingCursorAnimationValue);
|
||||||
sizeAdjustmentY = ui.lerpDouble(sizeAdjustmentY, 0, _resetFloatingCursorAnimationValue);
|
sizeAdjustmentY = ui.lerpDouble(sizeAdjustmentY, 0, _resetFloatingCursorAnimationValue);
|
||||||
}
|
}
|
||||||
@ -1645,9 +1644,9 @@ class RenderEditable extends RenderBox {
|
|||||||
final double adjustedY = math.min(math.max(currentY, topBound), bottomBound);
|
final double adjustedY = math.min(math.max(currentY, topBound), bottomBound);
|
||||||
final Offset adjustedOffset = Offset(adjustedX, adjustedY);
|
final Offset adjustedOffset = Offset(adjustedX, adjustedY);
|
||||||
|
|
||||||
if (currentX < leftBound && deltaPosition.dx < 0) {
|
if (currentX < leftBound && deltaPosition.dx < 0)
|
||||||
_resetOriginOnLeft = true;
|
_resetOriginOnLeft = true;
|
||||||
} else if(currentX > rightBound && deltaPosition.dx > 0)
|
else if (currentX > rightBound && deltaPosition.dx > 0)
|
||||||
_resetOriginOnRight = true;
|
_resetOriginOnRight = true;
|
||||||
if (currentY < topBound && deltaPosition.dy < 0)
|
if (currentY < topBound && deltaPosition.dy < 0)
|
||||||
_resetOriginOnTop = true;
|
_resetOriginOnTop = true;
|
||||||
|
@ -156,7 +156,7 @@ class RenderImage extends RenderBox {
|
|||||||
FilterQuality _filterQuality;
|
FilterQuality _filterQuality;
|
||||||
set filterQuality(FilterQuality value) {
|
set filterQuality(FilterQuality value) {
|
||||||
assert(value != null);
|
assert(value != null);
|
||||||
if(value == _filterQuality)
|
if (value == _filterQuality)
|
||||||
return;
|
return;
|
||||||
_filterQuality = value;
|
_filterQuality = value;
|
||||||
markNeedsPaint();
|
markNeedsPaint();
|
||||||
|
@ -386,7 +386,7 @@ class RenderUiKitView extends RenderBox {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Offset localOffset = globalToLocal(event.position);
|
final Offset localOffset = globalToLocal(event.position);
|
||||||
if(!(Offset.zero & size).contains(localOffset)) {
|
if (!(Offset.zero & size).contains(localOffset)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (event != _lastPointerDownEvent) {
|
if (event != _lastPointerDownEvent) {
|
||||||
@ -419,9 +419,11 @@ class RenderUiKitView extends RenderBox {
|
|||||||
// When the team wins a gesture the recognizer notifies the engine that it should release
|
// When the team wins a gesture the recognizer notifies the engine that it should release
|
||||||
// the touch sequence to the embedded UIView.
|
// the touch sequence to the embedded UIView.
|
||||||
class _UiKitViewGestureRecognizer extends OneSequenceGestureRecognizer {
|
class _UiKitViewGestureRecognizer extends OneSequenceGestureRecognizer {
|
||||||
_UiKitViewGestureRecognizer(this.controller, this.gestureRecognizerFactories, {
|
_UiKitViewGestureRecognizer(
|
||||||
|
this.controller,
|
||||||
|
this.gestureRecognizerFactories, {
|
||||||
PointerDeviceKind kind,
|
PointerDeviceKind kind,
|
||||||
}): super(kind: kind) {
|
}) : super(kind: kind) {
|
||||||
team = GestureArenaTeam();
|
team = GestureArenaTeam();
|
||||||
team.captain = this;
|
team.captain = this;
|
||||||
_gestureRecognizers = gestureRecognizerFactories.map(
|
_gestureRecognizers = gestureRecognizerFactories.map(
|
||||||
@ -481,9 +483,11 @@ class _UiKitViewGestureRecognizer extends OneSequenceGestureRecognizer {
|
|||||||
// When the team wins the recognizer sends all the cached point events to the embedded Android view, and
|
// When the team wins the recognizer sends all the cached point events to the embedded Android view, and
|
||||||
// sets itself to a "forwarding mode" where it will forward any new pointer event to the Android view.
|
// sets itself to a "forwarding mode" where it will forward any new pointer event to the Android view.
|
||||||
class _AndroidViewGestureRecognizer extends OneSequenceGestureRecognizer {
|
class _AndroidViewGestureRecognizer extends OneSequenceGestureRecognizer {
|
||||||
_AndroidViewGestureRecognizer(this.dispatcher, this.gestureRecognizerFactories, {
|
_AndroidViewGestureRecognizer(
|
||||||
|
this.dispatcher,
|
||||||
|
this.gestureRecognizerFactories, {
|
||||||
PointerDeviceKind kind,
|
PointerDeviceKind kind,
|
||||||
}): super(kind: kind) {
|
}) : super(kind: kind) {
|
||||||
team = GestureArenaTeam();
|
team = GestureArenaTeam();
|
||||||
team.captain = this;
|
team.captain = this;
|
||||||
_gestureRecognizers = gestureRecognizerFactories.map(
|
_gestureRecognizers = gestureRecognizerFactories.map(
|
||||||
|
@ -881,11 +881,11 @@ class RenderTable extends RenderBox {
|
|||||||
}
|
}
|
||||||
assert(tableWidth >= targetWidth);
|
assert(tableWidth >= targetWidth);
|
||||||
}
|
}
|
||||||
} else // step 2 and 3 are mutually exclusive
|
} // step 2 and 3 are mutually exclusive
|
||||||
|
|
||||||
// 3. if there were no flex columns, then grow the table to the
|
// 3. if there were no flex columns, then grow the table to the
|
||||||
// minWidth.
|
// minWidth.
|
||||||
if (tableWidth < minWidthConstraint) {
|
else if (tableWidth < minWidthConstraint) {
|
||||||
final double delta = (minWidthConstraint - tableWidth) / columns;
|
final double delta = (minWidthConstraint - tableWidth) / columns;
|
||||||
for (int x = 0; x < columns; x += 1)
|
for (int x = 0; x < columns; x += 1)
|
||||||
widths[x] += delta;
|
widths[x] += delta;
|
||||||
|
@ -1153,7 +1153,7 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
|
|||||||
_showCaretOnScreenScheduled = true;
|
_showCaretOnScreenScheduled = true;
|
||||||
SchedulerBinding.instance.addPostFrameCallback((Duration _) {
|
SchedulerBinding.instance.addPostFrameCallback((Duration _) {
|
||||||
_showCaretOnScreenScheduled = false;
|
_showCaretOnScreenScheduled = false;
|
||||||
if (_currentCaretRect == null || !_scrollController.hasClients){
|
if (_currentCaretRect == null || !_scrollController.hasClients) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final double scrollOffsetForCaret = _getScrollOffsetForCaret(_currentCaretRect);
|
final double scrollOffsetForCaret = _getScrollOffsetForCaret(_currentCaretRect);
|
||||||
|
@ -153,7 +153,7 @@ class FocusScopeNode extends Object with DiagnosticableTreeMixin {
|
|||||||
List<FocusScopeNode> _getFocusPath() {
|
List<FocusScopeNode> _getFocusPath() {
|
||||||
final List<FocusScopeNode> nodes = <FocusScopeNode>[this];
|
final List<FocusScopeNode> nodes = <FocusScopeNode>[this];
|
||||||
FocusScopeNode node = _parent;
|
FocusScopeNode node = _parent;
|
||||||
while(node != null && node != _manager?.rootScope) {
|
while (node != null && node != _manager?.rootScope) {
|
||||||
nodes.add(node);
|
nodes.add(node);
|
||||||
node = node._parent;
|
node = node._parent;
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ class DefaultWidgetsLocalizations implements WidgetsLocalizations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _LocalizationsScope extends InheritedWidget {
|
class _LocalizationsScope extends InheritedWidget {
|
||||||
const _LocalizationsScope ({
|
const _LocalizationsScope({
|
||||||
Key key,
|
Key key,
|
||||||
@required this.locale,
|
@required this.locale,
|
||||||
@required this.localizationsState,
|
@required this.localizationsState,
|
||||||
|
@ -733,9 +733,9 @@ class _RenderScrollSemantics extends RenderProxyBox {
|
|||||||
final List<SemanticsNode> included = <SemanticsNode>[];
|
final List<SemanticsNode> included = <SemanticsNode>[];
|
||||||
for (SemanticsNode child in children) {
|
for (SemanticsNode child in children) {
|
||||||
assert(child.isTagged(RenderViewport.useTwoPaneSemantics));
|
assert(child.isTagged(RenderViewport.useTwoPaneSemantics));
|
||||||
if (child.isTagged(RenderViewport.excludeFromScrolling))
|
if (child.isTagged(RenderViewport.excludeFromScrolling)) {
|
||||||
excluded.add(child);
|
excluded.add(child);
|
||||||
else {
|
} else {
|
||||||
if (!child.hasFlag(SemanticsFlag.isHidden))
|
if (!child.hasFlag(SemanticsFlag.isHidden))
|
||||||
firstVisibleIndex ??= child.indexInParent;
|
firstVisibleIndex ??= child.indexInParent;
|
||||||
included.add(child);
|
included.add(child);
|
||||||
|
@ -876,7 +876,7 @@ mixin WidgetInspectorService {
|
|||||||
await setter(value);
|
await setter(value);
|
||||||
_postExtensionStateChangedEvent(name, value);
|
_postExtensionStateChangedEvent(name, value);
|
||||||
}
|
}
|
||||||
return <String, dynamic>{ 'enabled': await getter() ? 'true' : 'false' };
|
return <String, dynamic>{'enabled': await getter() ? 'true' : 'false'};
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -126,13 +126,13 @@ void main() {
|
|||||||
Map<String, dynamic> firstFrameResult;
|
Map<String, dynamic> firstFrameResult;
|
||||||
expect(binding.debugDidSendFirstFrameEvent, isFalse);
|
expect(binding.debugDidSendFirstFrameEvent, isFalse);
|
||||||
firstFrameResult = await binding.testExtension('didSendFirstFrameEvent', <String, String>{});
|
firstFrameResult = await binding.testExtension('didSendFirstFrameEvent', <String, String>{});
|
||||||
expect(firstFrameResult, <String, String>{ 'enabled': 'false' });
|
expect(firstFrameResult, <String, String>{'enabled': 'false'});
|
||||||
|
|
||||||
await binding.doFrame(); // initial frame scheduled by creating the binding
|
await binding.doFrame(); // initial frame scheduled by creating the binding
|
||||||
|
|
||||||
expect(binding.debugDidSendFirstFrameEvent, isTrue);
|
expect(binding.debugDidSendFirstFrameEvent, isTrue);
|
||||||
firstFrameResult = await binding.testExtension('didSendFirstFrameEvent', <String, String>{});
|
firstFrameResult = await binding.testExtension('didSendFirstFrameEvent', <String, String>{});
|
||||||
expect(firstFrameResult, <String, String>{ 'enabled': 'true' });
|
expect(firstFrameResult, <String, String>{'enabled': 'true'});
|
||||||
|
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
|
|
||||||
@ -153,19 +153,19 @@ void main() {
|
|||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
expect(WidgetsApp.debugAllowBannerOverride, true);
|
expect(WidgetsApp.debugAllowBannerOverride, true);
|
||||||
result = await binding.testExtension('debugAllowBanner', <String, String>{});
|
result = await binding.testExtension('debugAllowBanner', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(WidgetsApp.debugAllowBannerOverride, true);
|
expect(WidgetsApp.debugAllowBannerOverride, true);
|
||||||
result = await binding.testExtension('debugAllowBanner', <String, String>{ 'enabled': 'false' });
|
result = await binding.testExtension('debugAllowBanner', <String, String>{'enabled': 'false'});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(WidgetsApp.debugAllowBannerOverride, false);
|
expect(WidgetsApp.debugAllowBannerOverride, false);
|
||||||
result = await binding.testExtension('debugAllowBanner', <String, String>{});
|
result = await binding.testExtension('debugAllowBanner', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(WidgetsApp.debugAllowBannerOverride, false);
|
expect(WidgetsApp.debugAllowBannerOverride, false);
|
||||||
result = await binding.testExtension('debugAllowBanner', <String, String>{ 'enabled': 'true' });
|
result = await binding.testExtension('debugAllowBanner', <String, String>{'enabled': 'true'});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(WidgetsApp.debugAllowBannerOverride, true);
|
expect(WidgetsApp.debugAllowBannerOverride, true);
|
||||||
result = await binding.testExtension('debugAllowBanner', <String, String>{});
|
result = await binding.testExtension('debugAllowBanner', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(WidgetsApp.debugAllowBannerOverride, true);
|
expect(WidgetsApp.debugAllowBannerOverride, true);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
});
|
});
|
||||||
@ -253,11 +253,11 @@ void main() {
|
|||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
expect(debugPaintSizeEnabled, false);
|
expect(debugPaintSizeEnabled, false);
|
||||||
result = await binding.testExtension('debugPaint', <String, String>{});
|
result = await binding.testExtension('debugPaint', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugPaintSizeEnabled, false);
|
expect(debugPaintSizeEnabled, false);
|
||||||
expect(extensionChangedEvents, isEmpty);
|
expect(extensionChangedEvents, isEmpty);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
pendingResult = binding.testExtension('debugPaint', <String, String>{ 'enabled': 'true' });
|
pendingResult = binding.testExtension('debugPaint', <String, String>{'enabled': 'true'});
|
||||||
completed = false;
|
completed = false;
|
||||||
pendingResult.whenComplete(() { completed = true; });
|
pendingResult.whenComplete(() { completed = true; });
|
||||||
await binding.flushMicrotasks();
|
await binding.flushMicrotasks();
|
||||||
@ -268,31 +268,31 @@ void main() {
|
|||||||
expect(completed, isTrue);
|
expect(completed, isTrue);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
result = await pendingResult;
|
result = await pendingResult;
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(debugPaintSizeEnabled, true);
|
expect(debugPaintSizeEnabled, true);
|
||||||
expect(extensionChangedEvents.length, 1);
|
expect(extensionChangedEvents.length, 1);
|
||||||
extensionChangedEvent = extensionChangedEvents.last;
|
extensionChangedEvent = extensionChangedEvents.last;
|
||||||
expect(extensionChangedEvent['extension'], 'ext.flutter.debugPaint');
|
expect(extensionChangedEvent['extension'], 'ext.flutter.debugPaint');
|
||||||
expect(extensionChangedEvent['value'], 'true');
|
expect(extensionChangedEvent['value'], 'true');
|
||||||
result = await binding.testExtension('debugPaint', <String, String>{});
|
result = await binding.testExtension('debugPaint', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(debugPaintSizeEnabled, true);
|
expect(debugPaintSizeEnabled, true);
|
||||||
expect(extensionChangedEvents.length, 1);
|
expect(extensionChangedEvents.length, 1);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
pendingResult = binding.testExtension('debugPaint', <String, String>{ 'enabled': 'false' });
|
pendingResult = binding.testExtension('debugPaint', <String, String>{'enabled': 'false'});
|
||||||
await binding.flushMicrotasks();
|
await binding.flushMicrotasks();
|
||||||
expect(binding.frameScheduled, isTrue);
|
expect(binding.frameScheduled, isTrue);
|
||||||
await binding.doFrame();
|
await binding.doFrame();
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
result = await pendingResult;
|
result = await pendingResult;
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugPaintSizeEnabled, false);
|
expect(debugPaintSizeEnabled, false);
|
||||||
expect(extensionChangedEvents.length, 2);
|
expect(extensionChangedEvents.length, 2);
|
||||||
extensionChangedEvent = extensionChangedEvents.last;
|
extensionChangedEvent = extensionChangedEvents.last;
|
||||||
expect(extensionChangedEvent['extension'], 'ext.flutter.debugPaint');
|
expect(extensionChangedEvent['extension'], 'ext.flutter.debugPaint');
|
||||||
expect(extensionChangedEvent['value'], 'false');
|
expect(extensionChangedEvent['value'], 'false');
|
||||||
result = await binding.testExtension('debugPaint', <String, String>{});
|
result = await binding.testExtension('debugPaint', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugPaintSizeEnabled, false);
|
expect(debugPaintSizeEnabled, false);
|
||||||
expect(extensionChangedEvents.length, 2);
|
expect(extensionChangedEvents.length, 2);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
@ -306,10 +306,10 @@ void main() {
|
|||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
expect(debugPaintBaselinesEnabled, false);
|
expect(debugPaintBaselinesEnabled, false);
|
||||||
result = await binding.testExtension('debugPaintBaselinesEnabled', <String, String>{});
|
result = await binding.testExtension('debugPaintBaselinesEnabled', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugPaintBaselinesEnabled, false);
|
expect(debugPaintBaselinesEnabled, false);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
pendingResult = binding.testExtension('debugPaintBaselinesEnabled', <String, String>{ 'enabled': 'true' });
|
pendingResult = binding.testExtension('debugPaintBaselinesEnabled', <String, String>{'enabled': 'true'});
|
||||||
completed = false;
|
completed = false;
|
||||||
pendingResult.whenComplete(() { completed = true; });
|
pendingResult.whenComplete(() { completed = true; });
|
||||||
await binding.flushMicrotasks();
|
await binding.flushMicrotasks();
|
||||||
@ -320,22 +320,22 @@ void main() {
|
|||||||
expect(completed, isTrue);
|
expect(completed, isTrue);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
result = await pendingResult;
|
result = await pendingResult;
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(debugPaintBaselinesEnabled, true);
|
expect(debugPaintBaselinesEnabled, true);
|
||||||
result = await binding.testExtension('debugPaintBaselinesEnabled', <String, String>{});
|
result = await binding.testExtension('debugPaintBaselinesEnabled', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(debugPaintBaselinesEnabled, true);
|
expect(debugPaintBaselinesEnabled, true);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
pendingResult = binding.testExtension('debugPaintBaselinesEnabled', <String, String>{ 'enabled': 'false' });
|
pendingResult = binding.testExtension('debugPaintBaselinesEnabled', <String, String>{'enabled': 'false'});
|
||||||
await binding.flushMicrotasks();
|
await binding.flushMicrotasks();
|
||||||
expect(binding.frameScheduled, isTrue);
|
expect(binding.frameScheduled, isTrue);
|
||||||
await binding.doFrame();
|
await binding.doFrame();
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
result = await pendingResult;
|
result = await pendingResult;
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugPaintBaselinesEnabled, false);
|
expect(debugPaintBaselinesEnabled, false);
|
||||||
result = await binding.testExtension('debugPaintBaselinesEnabled', <String, String>{});
|
result = await binding.testExtension('debugPaintBaselinesEnabled', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugPaintBaselinesEnabled, false);
|
expect(debugPaintBaselinesEnabled, false);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
});
|
});
|
||||||
@ -347,23 +347,23 @@ void main() {
|
|||||||
expect(debugProfileBuildsEnabled, false);
|
expect(debugProfileBuildsEnabled, false);
|
||||||
|
|
||||||
result = await binding.testExtension('profileWidgetBuilds', <String, String>{});
|
result = await binding.testExtension('profileWidgetBuilds', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugProfileBuildsEnabled, false);
|
expect(debugProfileBuildsEnabled, false);
|
||||||
|
|
||||||
result = await binding.testExtension('profileWidgetBuilds', <String, String>{ 'enabled': 'true' });
|
result = await binding.testExtension('profileWidgetBuilds', <String, String>{'enabled': 'true'});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(debugProfileBuildsEnabled, true);
|
expect(debugProfileBuildsEnabled, true);
|
||||||
|
|
||||||
result = await binding.testExtension('profileWidgetBuilds', <String, String>{});
|
result = await binding.testExtension('profileWidgetBuilds', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(debugProfileBuildsEnabled, true);
|
expect(debugProfileBuildsEnabled, true);
|
||||||
|
|
||||||
result = await binding.testExtension('profileWidgetBuilds', <String, String>{ 'enabled': 'false' });
|
result = await binding.testExtension('profileWidgetBuilds', <String, String>{'enabled': 'false'});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugProfileBuildsEnabled, false);
|
expect(debugProfileBuildsEnabled, false);
|
||||||
|
|
||||||
result = await binding.testExtension('profileWidgetBuilds', <String, String>{});
|
result = await binding.testExtension('profileWidgetBuilds', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugProfileBuildsEnabled, false);
|
expect(debugProfileBuildsEnabled, false);
|
||||||
|
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
@ -387,8 +387,8 @@ void main() {
|
|||||||
data = await rootBundle.loadStructuredData('test', (String value) async { expect(true, isFalse); return null; });
|
data = await rootBundle.loadStructuredData('test', (String value) async { expect(true, isFalse); return null; });
|
||||||
expect(data, isTrue);
|
expect(data, isTrue);
|
||||||
expect(completed, isFalse);
|
expect(completed, isFalse);
|
||||||
result = await binding.testExtension('evict', <String, String>{ 'value': 'test' });
|
result = await binding.testExtension('evict', <String, String>{'value': 'test'});
|
||||||
expect(result, <String, String>{ 'value': '' });
|
expect(result, <String, String>{'value': ''});
|
||||||
expect(completed, isFalse);
|
expect(completed, isFalse);
|
||||||
data = await rootBundle.loadStructuredData<bool>('test', (String value) async { expect(value, '\x00\x00\x00\x00\x00'); return false; });
|
data = await rootBundle.loadStructuredData<bool>('test', (String value) async { expect(value, '\x00\x00\x00\x00\x00'); return false; });
|
||||||
expect(data, isFalse);
|
expect(data, isFalse);
|
||||||
@ -471,23 +471,23 @@ void main() {
|
|||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
expect(debugRepaintRainbowEnabled, false);
|
expect(debugRepaintRainbowEnabled, false);
|
||||||
result = await binding.testExtension('repaintRainbow', <String, String>{});
|
result = await binding.testExtension('repaintRainbow', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugRepaintRainbowEnabled, false);
|
expect(debugRepaintRainbowEnabled, false);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
pendingResult = binding.testExtension('repaintRainbow', <String, String>{ 'enabled': 'true' });
|
pendingResult = binding.testExtension('repaintRainbow', <String, String>{'enabled': 'true'});
|
||||||
completed = false;
|
completed = false;
|
||||||
pendingResult.whenComplete(() { completed = true; });
|
pendingResult.whenComplete(() { completed = true; });
|
||||||
await binding.flushMicrotasks();
|
await binding.flushMicrotasks();
|
||||||
expect(completed, true);
|
expect(completed, true);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
result = await pendingResult;
|
result = await pendingResult;
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(debugRepaintRainbowEnabled, true);
|
expect(debugRepaintRainbowEnabled, true);
|
||||||
result = await binding.testExtension('repaintRainbow', <String, String>{});
|
result = await binding.testExtension('repaintRainbow', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(debugRepaintRainbowEnabled, true);
|
expect(debugRepaintRainbowEnabled, true);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
pendingResult = binding.testExtension('repaintRainbow', <String, String>{ 'enabled': 'false' });
|
pendingResult = binding.testExtension('repaintRainbow', <String, String>{'enabled': 'false'});
|
||||||
completed = false;
|
completed = false;
|
||||||
pendingResult.whenComplete(() { completed = true; });
|
pendingResult.whenComplete(() { completed = true; });
|
||||||
await binding.flushMicrotasks();
|
await binding.flushMicrotasks();
|
||||||
@ -498,10 +498,10 @@ void main() {
|
|||||||
expect(completed, true);
|
expect(completed, true);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
result = await pendingResult;
|
result = await pendingResult;
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugRepaintRainbowEnabled, false);
|
expect(debugRepaintRainbowEnabled, false);
|
||||||
result = await binding.testExtension('repaintRainbow', <String, String>{});
|
result = await binding.testExtension('repaintRainbow', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(debugRepaintRainbowEnabled, false);
|
expect(debugRepaintRainbowEnabled, false);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
});
|
});
|
||||||
@ -534,19 +534,19 @@ void main() {
|
|||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
expect(WidgetsApp.showPerformanceOverlayOverride, false);
|
expect(WidgetsApp.showPerformanceOverlayOverride, false);
|
||||||
result = await binding.testExtension('showPerformanceOverlay', <String, String>{});
|
result = await binding.testExtension('showPerformanceOverlay', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(WidgetsApp.showPerformanceOverlayOverride, false);
|
expect(WidgetsApp.showPerformanceOverlayOverride, false);
|
||||||
result = await binding.testExtension('showPerformanceOverlay', <String, String>{ 'enabled': 'true' });
|
result = await binding.testExtension('showPerformanceOverlay', <String, String>{'enabled': 'true'});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(WidgetsApp.showPerformanceOverlayOverride, true);
|
expect(WidgetsApp.showPerformanceOverlayOverride, true);
|
||||||
result = await binding.testExtension('showPerformanceOverlay', <String, String>{});
|
result = await binding.testExtension('showPerformanceOverlay', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(WidgetsApp.showPerformanceOverlayOverride, true);
|
expect(WidgetsApp.showPerformanceOverlayOverride, true);
|
||||||
result = await binding.testExtension('showPerformanceOverlay', <String, String>{ 'enabled': 'false' });
|
result = await binding.testExtension('showPerformanceOverlay', <String, String>{'enabled': 'false'});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(WidgetsApp.showPerformanceOverlayOverride, false);
|
expect(WidgetsApp.showPerformanceOverlayOverride, false);
|
||||||
result = await binding.testExtension('showPerformanceOverlay', <String, String>{});
|
result = await binding.testExtension('showPerformanceOverlay', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(WidgetsApp.showPerformanceOverlayOverride, false);
|
expect(WidgetsApp.showPerformanceOverlayOverride, false);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
});
|
});
|
||||||
@ -556,19 +556,19 @@ void main() {
|
|||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
expect(WidgetsApp.debugShowWidgetInspectorOverride, false);
|
expect(WidgetsApp.debugShowWidgetInspectorOverride, false);
|
||||||
result = await binding.testExtension('debugWidgetInspector', <String, String>{});
|
result = await binding.testExtension('debugWidgetInspector', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(WidgetsApp.debugShowWidgetInspectorOverride, false);
|
expect(WidgetsApp.debugShowWidgetInspectorOverride, false);
|
||||||
result = await binding.testExtension('debugWidgetInspector', <String, String>{ 'enabled': 'true' });
|
result = await binding.testExtension('debugWidgetInspector', <String, String>{'enabled': 'true'});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(WidgetsApp.debugShowWidgetInspectorOverride, true);
|
expect(WidgetsApp.debugShowWidgetInspectorOverride, true);
|
||||||
result = await binding.testExtension('debugWidgetInspector', <String, String>{});
|
result = await binding.testExtension('debugWidgetInspector', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'true' });
|
expect(result, <String, String>{'enabled': 'true'});
|
||||||
expect(WidgetsApp.debugShowWidgetInspectorOverride, true);
|
expect(WidgetsApp.debugShowWidgetInspectorOverride, true);
|
||||||
result = await binding.testExtension('debugWidgetInspector', <String, String>{ 'enabled': 'false' });
|
result = await binding.testExtension('debugWidgetInspector', <String, String>{'enabled': 'false'});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(WidgetsApp.debugShowWidgetInspectorOverride, false);
|
expect(WidgetsApp.debugShowWidgetInspectorOverride, false);
|
||||||
result = await binding.testExtension('debugWidgetInspector', <String, String>{});
|
result = await binding.testExtension('debugWidgetInspector', <String, String>{});
|
||||||
expect(result, <String, String>{ 'enabled': 'false' });
|
expect(result, <String, String>{'enabled': 'false'});
|
||||||
expect(WidgetsApp.debugShowWidgetInspectorOverride, false);
|
expect(WidgetsApp.debugShowWidgetInspectorOverride, false);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
});
|
});
|
||||||
@ -581,29 +581,29 @@ void main() {
|
|||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
expect(timeDilation, 1.0);
|
expect(timeDilation, 1.0);
|
||||||
result = await binding.testExtension('timeDilation', <String, String>{});
|
result = await binding.testExtension('timeDilation', <String, String>{});
|
||||||
expect(result, <String, String>{ 'timeDilation': '1.0' });
|
expect(result, <String, String>{'timeDilation': '1.0'});
|
||||||
expect(timeDilation, 1.0);
|
expect(timeDilation, 1.0);
|
||||||
expect(extensionChangedEvents, isEmpty);
|
expect(extensionChangedEvents, isEmpty);
|
||||||
result = await binding.testExtension('timeDilation', <String, String>{ 'timeDilation': '100.0' });
|
result = await binding.testExtension('timeDilation', <String, String>{'timeDilation': '100.0'});
|
||||||
expect(result, <String, String>{ 'timeDilation': '100.0' });
|
expect(result, <String, String>{'timeDilation': '100.0'});
|
||||||
expect(timeDilation, 100.0);
|
expect(timeDilation, 100.0);
|
||||||
expect(extensionChangedEvents.length, 1);
|
expect(extensionChangedEvents.length, 1);
|
||||||
extensionChangedEvent = extensionChangedEvents.last;
|
extensionChangedEvent = extensionChangedEvents.last;
|
||||||
expect(extensionChangedEvent['extension'], 'ext.flutter.timeDilation');
|
expect(extensionChangedEvent['extension'], 'ext.flutter.timeDilation');
|
||||||
expect(extensionChangedEvent['value'], '100.0');
|
expect(extensionChangedEvent['value'], '100.0');
|
||||||
result = await binding.testExtension('timeDilation', <String, String>{});
|
result = await binding.testExtension('timeDilation', <String, String>{});
|
||||||
expect(result, <String, String>{ 'timeDilation': '100.0' });
|
expect(result, <String, String>{'timeDilation': '100.0'});
|
||||||
expect(timeDilation, 100.0);
|
expect(timeDilation, 100.0);
|
||||||
expect(extensionChangedEvents.length, 1);
|
expect(extensionChangedEvents.length, 1);
|
||||||
result = await binding.testExtension('timeDilation', <String, String>{ 'timeDilation': '1.0' });
|
result = await binding.testExtension('timeDilation', <String, String>{'timeDilation': '1.0'});
|
||||||
expect(result, <String, String>{ 'timeDilation': '1.0' });
|
expect(result, <String, String>{'timeDilation': '1.0'});
|
||||||
expect(timeDilation, 1.0);
|
expect(timeDilation, 1.0);
|
||||||
expect(extensionChangedEvents.length, 2);
|
expect(extensionChangedEvents.length, 2);
|
||||||
extensionChangedEvent = extensionChangedEvents.last;
|
extensionChangedEvent = extensionChangedEvents.last;
|
||||||
expect(extensionChangedEvent['extension'], 'ext.flutter.timeDilation');
|
expect(extensionChangedEvent['extension'], 'ext.flutter.timeDilation');
|
||||||
expect(extensionChangedEvent['value'], '1.0');
|
expect(extensionChangedEvent['value'], '1.0');
|
||||||
result = await binding.testExtension('timeDilation', <String, String>{});
|
result = await binding.testExtension('timeDilation', <String, String>{});
|
||||||
expect(result, <String, String>{ 'timeDilation': '1.0' });
|
expect(result, <String, String>{'timeDilation': '1.0'});
|
||||||
expect(timeDilation, 1.0);
|
expect(timeDilation, 1.0);
|
||||||
expect(extensionChangedEvents.length, 2);
|
expect(extensionChangedEvents.length, 2);
|
||||||
expect(binding.frameScheduled, isFalse);
|
expect(binding.frameScheduled, isFalse);
|
||||||
|
@ -701,7 +701,7 @@ void _tests() {
|
|||||||
|
|
||||||
// Initial chevron animation state should be dismissed
|
// Initial chevron animation state should be dismissed
|
||||||
// An AlwaysStoppedAnimation is also found and is ignored
|
// An AlwaysStoppedAnimation is also found and is ignored
|
||||||
for(RenderAnimatedOpacity renderer in chevronRenderers) {
|
for (RenderAnimatedOpacity renderer in chevronRenderers) {
|
||||||
expect(renderer.opacity.value, equals(1.0));
|
expect(renderer.opacity.value, equals(1.0));
|
||||||
expect(renderer.opacity.status, equals(AnimationStatus.dismissed));
|
expect(renderer.opacity.status, equals(AnimationStatus.dismissed));
|
||||||
}
|
}
|
||||||
@ -710,7 +710,7 @@ void _tests() {
|
|||||||
final TestGesture gesture = await tester.startGesture(const Offset(100.0, 100.0));
|
final TestGesture gesture = await tester.startGesture(const Offset(100.0, 100.0));
|
||||||
await gesture.moveBy(const Offset(50.0, 100.0));
|
await gesture.moveBy(const Offset(50.0, 100.0));
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
for(RenderAnimatedOpacity renderer in chevronRenderers) {
|
for (RenderAnimatedOpacity renderer in chevronRenderers) {
|
||||||
expect(renderer.opacity.value, equals(0.0));
|
expect(renderer.opacity.value, equals(0.0));
|
||||||
expect(renderer.opacity.status, equals(AnimationStatus.completed));
|
expect(renderer.opacity.status, equals(AnimationStatus.completed));
|
||||||
}
|
}
|
||||||
@ -718,7 +718,7 @@ void _tests() {
|
|||||||
// Release the drag and test for the opacity to return to original value
|
// Release the drag and test for the opacity to return to original value
|
||||||
await gesture.up();
|
await gesture.up();
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
for(RenderAnimatedOpacity renderer in chevronRenderers) {
|
for (RenderAnimatedOpacity renderer in chevronRenderers) {
|
||||||
expect(renderer.opacity.value, equals(1.0));
|
expect(renderer.opacity.value, equals(1.0));
|
||||||
expect(renderer.opacity.status, equals(AnimationStatus.dismissed));
|
expect(renderer.opacity.status, equals(AnimationStatus.dismissed));
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@ void main() {
|
|||||||
key: radioKey,
|
key: radioKey,
|
||||||
value: 1,
|
value: 1,
|
||||||
groupValue: 1,
|
groupValue: 1,
|
||||||
onChanged: (int value) {},
|
onChanged: (int value) { },
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
@ -336,8 +336,9 @@ void main() {
|
|||||||
TextStyle effectiveStyle = textWidget.style;
|
TextStyle effectiveStyle = textWidget.style;
|
||||||
effectiveStyle = defaultTextStyle.style.merge(textWidget.style);
|
effectiveStyle = defaultTextStyle.style.merge(textWidget.style);
|
||||||
expect(effectiveStyle.color, Colors.lightBlue);
|
expect(effectiveStyle.color, Colors.lightBlue);
|
||||||
} else
|
} else {
|
||||||
expect(false, true);
|
expect(false, true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('SnackBar button text alignment', (WidgetTester tester) async {
|
testWidgets('SnackBar button text alignment', (WidgetTester tester) async {
|
||||||
|
@ -2551,7 +2551,7 @@ void main() {
|
|||||||
sendFakeKeyEvent(<String, dynamic>{
|
sendFakeKeyEvent(<String, dynamic>{
|
||||||
'type': down ? 'keydown' : 'keyup',
|
'type': down ? 'keydown' : 'keyup',
|
||||||
'keymap': 'android',
|
'keymap': 'android',
|
||||||
'keyCode' : code,
|
'keyCode': code,
|
||||||
'hidUsage': 0x04,
|
'hidUsage': 0x04,
|
||||||
'codePoint': 0x64,
|
'codePoint': 0x64,
|
||||||
'metaState': metaState,
|
'metaState': metaState,
|
||||||
|
@ -483,7 +483,7 @@ void main() {
|
|||||||
BoxFit.scaleDown,
|
BoxFit.scaleDown,
|
||||||
];
|
];
|
||||||
|
|
||||||
for(BoxFit boxFit in boxFits) {
|
for (BoxFit boxFit in boxFits) {
|
||||||
final TestCanvas canvas = TestCanvas(<Invocation>[]);
|
final TestCanvas canvas = TestCanvas(<Invocation>[]);
|
||||||
|
|
||||||
final Rect outputRect = Rect.fromLTWH(30.0, 30.0, 250.0, 250.0);
|
final Rect outputRect = Rect.fromLTWH(30.0, 30.0, 250.0, 250.0);
|
||||||
|
@ -573,7 +573,7 @@ class _TestRecordingCanvasPaintsCountMatcher extends _TestRecordingCanvasMatcher
|
|||||||
@override
|
@override
|
||||||
bool _evaluatePredicates(Iterable<RecordedInvocation> calls, StringBuffer description) {
|
bool _evaluatePredicates(Iterable<RecordedInvocation> calls, StringBuffer description) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for(RecordedInvocation call in calls) {
|
for (RecordedInvocation call in calls) {
|
||||||
if (call.invocation.isMethod && call.invocation.memberName == _methodName) {
|
if (call.invocation.isMethod && call.invocation.memberName == _methodName) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
@ -481,7 +481,7 @@ void main() {
|
|||||||
addSemanticIndexes: false,
|
addSemanticIndexes: false,
|
||||||
itemCount: 50,
|
itemCount: 50,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
if (index == 0){
|
if (index == 0) {
|
||||||
return const _AlwaysKeepAlive(
|
return const _AlwaysKeepAlive(
|
||||||
key: GlobalObjectKey<_AlwaysKeepAliveState>(0),
|
key: GlobalObjectKey<_AlwaysKeepAliveState>(0),
|
||||||
);
|
);
|
||||||
@ -515,7 +515,7 @@ void main() {
|
|||||||
addSemanticIndexes: false,
|
addSemanticIndexes: false,
|
||||||
itemCount: 250,
|
itemCount: 250,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
if (index % 2 == 0){
|
if (index % 2 == 0) {
|
||||||
return _AlwaysKeepAlive(
|
return _AlwaysKeepAlive(
|
||||||
key: GlobalObjectKey<_AlwaysKeepAliveState>(index),
|
key: GlobalObjectKey<_AlwaysKeepAliveState>(index),
|
||||||
);
|
);
|
||||||
|
@ -299,7 +299,7 @@ void main() {
|
|||||||
|
|
||||||
// ListView's height is 600, so items i0-i5 and s0-s4 fit.
|
// ListView's height is 600, so items i0-i5 and s0-s4 fit.
|
||||||
await tester.pumpWidget(buildFrame(itemCount: 25));
|
await tester.pumpWidget(buildFrame(itemCount: 25));
|
||||||
for(String s in <String>['i0', 's0', 'i1', 's1', 'i2', 's2', 'i3', 's3', 'i4', 's4', 'i5'])
|
for (String s in <String>['i0', 's0', 'i1', 's1', 'i2', 's2', 'i3', 's3', 'i4', 's4', 'i5'])
|
||||||
expect(find.text(s), findsOneWidget);
|
expect(find.text(s), findsOneWidget);
|
||||||
expect(find.text('s5'), findsNothing);
|
expect(find.text('s5'), findsNothing);
|
||||||
expect(find.text('i6'), findsNothing);
|
expect(find.text('i6'), findsNothing);
|
||||||
|
@ -221,7 +221,7 @@ void main() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
test('computes 90th frame rasterizer time in milliseconds', () {
|
test('computes 90th frame rasterizer time in milliseconds', () {
|
||||||
for(int i = 0; i < sequences.length; ++i) {
|
for (int i = 0; i < sequences.length; ++i) {
|
||||||
expect(
|
expect(
|
||||||
summarize(rasterizeTimeSequenceInMillis(sequences[i])).computePercentileFrameRasterizerTimeMillis(90.0),
|
summarize(rasterizeTimeSequenceInMillis(sequences[i])).computePercentileFrameRasterizerTimeMillis(90.0),
|
||||||
p90s[i],
|
p90s[i],
|
||||||
@ -231,7 +231,7 @@ void main() {
|
|||||||
|
|
||||||
test('compute 99th frame rasterizer time in milliseconds', () {
|
test('compute 99th frame rasterizer time in milliseconds', () {
|
||||||
final List<int> sequence = <int>[];
|
final List<int> sequence = <int>[];
|
||||||
for(int i = 1; i <= 100; ++i) {
|
for (int i = 1; i <= 100; ++i) {
|
||||||
sequence.add(i);
|
sequence.add(i);
|
||||||
}
|
}
|
||||||
expect(
|
expect(
|
||||||
|
@ -42,7 +42,7 @@ void main() {
|
|||||||
expect(e1.threadDuration, const Duration(microseconds: 245));
|
expect(e1.threadDuration, const Duration(microseconds: 245));
|
||||||
expect(e1.timestampMicros, 456);
|
expect(e1.timestampMicros, 456);
|
||||||
expect(e1.threadTimestampMicros, 567);
|
expect(e1.threadTimestampMicros, 567);
|
||||||
expect(e1.arguments, <String, dynamic>{ 'arg1': true });
|
expect(e1.arguments, <String, dynamic>{'arg1': true});
|
||||||
|
|
||||||
final TimelineEvent e2 = timeline.events[1];
|
final TimelineEvent e2 = timeline.events[1];
|
||||||
expect(e2.name, isNull);
|
expect(e2.name, isNull);
|
||||||
|
@ -1309,18 +1309,20 @@ class _RendersOnPhysicalModel extends _MatchRenderObject<RenderPhysicalShape, Re
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
borderRadius == null
|
borderRadius == null &&
|
||||||
&& shape == BoxShape.rectangle
|
shape == BoxShape.rectangle &&
|
||||||
&& !assertRoundedRectangle(shapeClipper, BorderRadius.zero, matchState)
|
!assertRoundedRectangle(shapeClipper, BorderRadius.zero, matchState)
|
||||||
)
|
) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
borderRadius == null
|
borderRadius == null &&
|
||||||
&& shape == BoxShape.circle
|
shape == BoxShape.circle &&
|
||||||
&& !assertCircle(shapeClipper, matchState)
|
!assertCircle(shapeClipper, matchState)
|
||||||
)
|
) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (elevation != null && renderObject.elevation != elevation)
|
if (elevation != null && renderObject.elevation != elevation)
|
||||||
return failWithDescription(matchState, 'had elevation: ${renderObject.elevation}');
|
return failWithDescription(matchState, 'had elevation: ${renderObject.elevation}');
|
||||||
|
@ -21,8 +21,7 @@ int reportExpectCall(StackTrace stack, StringBuffer information) {
|
|||||||
if (line0.firstMatch(stackLines[0]) != null &&
|
if (line0.firstMatch(stackLines[0]) != null &&
|
||||||
line1.firstMatch(stackLines[1]) != null &&
|
line1.firstMatch(stackLines[1]) != null &&
|
||||||
line2.firstMatch(stackLines[2]) != null &&
|
line2.firstMatch(stackLines[2]) != null &&
|
||||||
line3.firstMatch(stackLines[3]) != null
|
line3.firstMatch(stackLines[3]) != null) {
|
||||||
) {
|
|
||||||
final Match expectMatch = line4.firstMatch(stackLines[4]);
|
final Match expectMatch = line4.firstMatch(stackLines[4]);
|
||||||
assert(expectMatch != null);
|
assert(expectMatch != null);
|
||||||
assert(expectMatch.groupCount == 2);
|
assert(expectMatch.groupCount == 2);
|
||||||
|
@ -792,7 +792,7 @@ class _AdbLogReader extends DeviceLogReader {
|
|||||||
}
|
}
|
||||||
_acceptedLastLine = false;
|
_acceptedLastLine = false;
|
||||||
} else if (line == '--------- beginning of system' ||
|
} else if (line == '--------- beginning of system' ||
|
||||||
line == '--------- beginning of main' ) {
|
line == '--------- beginning of main') {
|
||||||
// hide the ugly adb logcat log boundaries at the start
|
// hide the ugly adb logcat log boundaries at the start
|
||||||
_acceptedLastLine = false;
|
_acceptedLastLine = false;
|
||||||
} else {
|
} else {
|
||||||
|
@ -478,7 +478,7 @@ Future<void> _buildGradleProjectV2(
|
|||||||
throwToolExit('Gradle task $assembleTask failed with exit code $exitCode', exitCode: exitCode);
|
throwToolExit('Gradle task $assembleTask failed with exit code $exitCode', exitCode: exitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isBuildingBundle) {
|
if (!isBuildingBundle) {
|
||||||
final File apkFile = _findApkFile(project, buildInfo);
|
final File apkFile = _findApkFile(project, buildInfo);
|
||||||
if (apkFile == null)
|
if (apkFile == null)
|
||||||
throwToolExit('Gradle build failed to produce an Android package.');
|
throwToolExit('Gradle build failed to produce an Android package.');
|
||||||
|
@ -458,7 +458,7 @@ class ApkManifestData {
|
|||||||
final int level = line.length - trimLine.length;
|
final int level = line.length - trimLine.length;
|
||||||
|
|
||||||
// Handle level out
|
// Handle level out
|
||||||
while(level <= currentElement.level) {
|
while (level <= currentElement.level) {
|
||||||
currentElement = currentElement.parent;
|
currentElement = currentElement.parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ Future<void> runShutdownHooks() async {
|
|||||||
Map<String, String> _environment(bool allowReentrantFlutter, [ Map<String, String> environment ]) {
|
Map<String, String> _environment(bool allowReentrantFlutter, [ Map<String, String> environment ]) {
|
||||||
if (allowReentrantFlutter) {
|
if (allowReentrantFlutter) {
|
||||||
if (environment == null)
|
if (environment == null)
|
||||||
environment = <String, String>{ 'FLUTTER_ALREADY_LOCKED': 'true' };
|
environment = <String, String>{'FLUTTER_ALREADY_LOCKED': 'true'};
|
||||||
else
|
else
|
||||||
environment['FLUTTER_ALREADY_LOCKED'] = 'true';
|
environment['FLUTTER_ALREADY_LOCKED'] = 'true';
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ abstract class Domain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void sendEvent(String name, [ dynamic args ]) {
|
void sendEvent(String name, [ dynamic args ]) {
|
||||||
final Map<String, dynamic> map = <String, dynamic>{ 'event': name };
|
final Map<String, dynamic> map = <String, dynamic>{'event': name};
|
||||||
if (args != null)
|
if (args != null)
|
||||||
map['params'] = _toJsonable(args);
|
map['params'] = _toJsonable(args);
|
||||||
_send(map);
|
_send(map);
|
||||||
@ -563,7 +563,7 @@ class AppDomain extends Domain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _sendAppEvent(AppInstance app, String name, [ Map<String, dynamic> args ]) {
|
void _sendAppEvent(AppInstance app, String name, [ Map<String, dynamic> args ]) {
|
||||||
final Map<String, dynamic> eventArgs = <String, dynamic> { 'appId': app.id };
|
final Map<String, dynamic> eventArgs = <String, dynamic> {'appId': app.id};
|
||||||
if (args != null)
|
if (args != null)
|
||||||
eventArgs.addAll(args);
|
eventArgs.addAll(args);
|
||||||
sendEvent('app.$name', eventArgs);
|
sendEvent('app.$name', eventArgs);
|
||||||
@ -652,7 +652,7 @@ class DeviceDomain extends Domain {
|
|||||||
|
|
||||||
hostPort = await device.portForwarder.forward(devicePort, hostPort: hostPort);
|
hostPort = await device.portForwarder.forward(devicePort, hostPort: hostPort);
|
||||||
|
|
||||||
return <String, dynamic>{ 'hostPort': hostPort };
|
return <String, dynamic>{'hostPort': hostPort};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes a forwarded port.
|
/// Removes a forwarded port.
|
||||||
|
@ -295,7 +295,7 @@ Future<void> _runTests(List<String> testArgs, String observatoryUri) async {
|
|||||||
'--packages=${PackageMap.globalPackagesPath}',
|
'--packages=${PackageMap.globalPackagesPath}',
|
||||||
'-rexpanded',
|
'-rexpanded',
|
||||||
]),
|
]),
|
||||||
environment: <String, String>{ 'VM_SERVICE_URL': observatoryUri },
|
environment: <String, String>{'VM_SERVICE_URL': observatoryUri},
|
||||||
);
|
);
|
||||||
if (result != 0)
|
if (result != 0)
|
||||||
throwToolExit('Driver tests failed: $result', exitCode: result);
|
throwToolExit('Driver tests failed: $result', exitCode: result);
|
||||||
|
@ -16,7 +16,7 @@ import '../runner/flutter_command.dart';
|
|||||||
import '../version.dart';
|
import '../version.dart';
|
||||||
|
|
||||||
class VersionCommand extends FlutterCommand {
|
class VersionCommand extends FlutterCommand {
|
||||||
VersionCommand(): super() {
|
VersionCommand() : super() {
|
||||||
argParser.addFlag('force',
|
argParser.addFlag('force',
|
||||||
abbr: 'f',
|
abbr: 'f',
|
||||||
help: 'Force switch to older Flutter versions that do not include a version command',
|
help: 'Force switch to older Flutter versions that do not include a version command',
|
||||||
|
@ -378,7 +378,7 @@ class _CompileExpressionRequest extends _CompilationRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _RejectRequest extends _CompilationRequest {
|
class _RejectRequest extends _CompilationRequest {
|
||||||
_RejectRequest(Completer<CompilerOutput> completer): super(completer);
|
_RejectRequest(Completer<CompilerOutput> completer) : super(completer);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<CompilerOutput> _run(ResidentCompiler compiler) async =>
|
Future<CompilerOutput> _run(ResidentCompiler compiler) async =>
|
||||||
|
@ -501,8 +501,8 @@ abstract class IntelliJValidator extends DoctorValidator {
|
|||||||
String get pluginsPath;
|
String get pluginsPath;
|
||||||
|
|
||||||
static final Map<String, String> _idToTitle = <String, String>{
|
static final Map<String, String> _idToTitle = <String, String>{
|
||||||
'IntelliJIdea' : 'IntelliJ IDEA Ultimate Edition',
|
'IntelliJIdea': 'IntelliJ IDEA Ultimate Edition',
|
||||||
'IdeaIC' : 'IntelliJ IDEA Community Edition',
|
'IdeaIC': 'IntelliJ IDEA Community Edition',
|
||||||
};
|
};
|
||||||
|
|
||||||
static final Version kMinIdeaVersion = Version(2017, 1, 0);
|
static final Version kMinIdeaVersion = Version(2017, 1, 0);
|
||||||
@ -615,9 +615,9 @@ class IntelliJValidatorOnMac extends IntelliJValidator {
|
|||||||
final String id;
|
final String id;
|
||||||
|
|
||||||
static final Map<String, String> _dirNameToId = <String, String>{
|
static final Map<String, String> _dirNameToId = <String, String>{
|
||||||
'IntelliJ IDEA.app' : 'IntelliJIdea',
|
'IntelliJ IDEA.app': 'IntelliJIdea',
|
||||||
'IntelliJ IDEA Ultimate.app' : 'IntelliJIdea',
|
'IntelliJ IDEA Ultimate.app': 'IntelliJIdea',
|
||||||
'IntelliJ IDEA CE.app' : 'IdeaIC',
|
'IntelliJ IDEA CE.app': 'IdeaIC',
|
||||||
};
|
};
|
||||||
|
|
||||||
static Iterable<DoctorValidator> get installed {
|
static Iterable<DoctorValidator> get installed {
|
||||||
|
@ -102,10 +102,9 @@ class FlutterManifest {
|
|||||||
String get buildName {
|
String get buildName {
|
||||||
if (appVersion != null && appVersion.contains('+'))
|
if (appVersion != null && appVersion.contains('+'))
|
||||||
return appVersion.split('+')?.elementAt(0);
|
return appVersion.split('+')?.elementAt(0);
|
||||||
else {
|
else
|
||||||
return appVersion;
|
return appVersion;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// The build version number from the `pubspec.yaml` file.
|
/// The build version number from the `pubspec.yaml` file.
|
||||||
/// Can be null if version isn't set or has a wrong format.
|
/// Can be null if version isn't set or has a wrong format.
|
||||||
|
@ -187,8 +187,7 @@ Future<String> _chooseSigningIdentity(List<String> validCodeSigningIdentities, b
|
|||||||
if (validCodeSigningIdentities.contains(savedCertChoice)) {
|
if (validCodeSigningIdentities.contains(savedCertChoice)) {
|
||||||
printStatus('Found saved certificate choice "$savedCertChoice". To clear, use "flutter config".');
|
printStatus('Found saved certificate choice "$savedCertChoice". To clear, use "flutter config".');
|
||||||
return savedCertChoice;
|
return savedCertChoice;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
printError('Saved signing certificate "$savedCertChoice" is not a valid development certificate');
|
printError('Saved signing certificate "$savedCertChoice" is not a valid development certificate');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -433,7 +433,7 @@ String decodeSyslog(String line) {
|
|||||||
try {
|
try {
|
||||||
final List<int> bytes = utf8.encode(line);
|
final List<int> bytes = utf8.encode(line);
|
||||||
final List<int> out = <int>[];
|
final List<int> out = <int>[];
|
||||||
for (int i = 0; i < bytes.length; ) {
|
for (int i = 0; i < bytes.length;) {
|
||||||
if (bytes[i] != kBackslash || i > bytes.length - 4) {
|
if (bytes[i] != kBackslash || i > bytes.length - 4) {
|
||||||
// Unmapped byte: copy as-is.
|
// Unmapped byte: copy as-is.
|
||||||
out.add(bytes[i++]);
|
out.add(bytes[i++]);
|
||||||
|
@ -192,8 +192,7 @@ class CocoaPodsValidator extends DoctorValidator {
|
|||||||
status = ValidationType.missing;
|
status = ValidationType.missing;
|
||||||
messages.add(ValidationMessage.error(
|
messages.add(ValidationMessage.error(
|
||||||
userMessages.cocoaPodsMissing(noCocoaPodsConsequence, cocoaPodsInstallInstructions)));
|
userMessages.cocoaPodsMissing(noCocoaPodsConsequence, cocoaPodsInstallInstructions)));
|
||||||
}
|
} else if (cocoaPodsStatus == CocoaPodsStatus.unknownVersion) {
|
||||||
else if (cocoaPodsStatus == CocoaPodsStatus.unknownVersion) {
|
|
||||||
status = ValidationType.partial;
|
status = ValidationType.partial;
|
||||||
messages.add(ValidationMessage.hint(
|
messages.add(ValidationMessage.hint(
|
||||||
userMessages.cocoaPodsUnknownVersion(unknownCocoaPodsConsequence, cocoaPodsUpgradeInstructions)));
|
userMessages.cocoaPodsUnknownVersion(unknownCocoaPodsConsequence, cocoaPodsUpgradeInstructions)));
|
||||||
|
@ -599,8 +599,7 @@ Future<void> diagnoseXcodeBuildFailure(XcodeBuildResult result) async {
|
|||||||
if (result.xcodeBuildExecution != null &&
|
if (result.xcodeBuildExecution != null &&
|
||||||
result.xcodeBuildExecution.buildForPhysicalDevice &&
|
result.xcodeBuildExecution.buildForPhysicalDevice &&
|
||||||
!<String>['DEVELOPMENT_TEAM', 'PROVISIONING_PROFILE'].any(
|
!<String>['DEVELOPMENT_TEAM', 'PROVISIONING_PROFILE'].any(
|
||||||
result.xcodeBuildExecution.buildSettings.containsKey)
|
result.xcodeBuildExecution.buildSettings.containsKey)) {
|
||||||
) {
|
|
||||||
printError(noDevelopmentTeamInstruction, emphasis: true);
|
printError(noDevelopmentTeamInstruction, emphasis: true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -722,7 +721,7 @@ void _copyServiceDefinitionsManifest(List<Map<String, String>> services, File ma
|
|||||||
// the directory and basenames.
|
// the directory and basenames.
|
||||||
'framework': fs.path.basenameWithoutExtension(service['ios-framework']),
|
'framework': fs.path.basenameWithoutExtension(service['ios-framework']),
|
||||||
}).toList();
|
}).toList();
|
||||||
final Map<String, dynamic> jsonObject = <String, dynamic>{ 'services' : jsonServices };
|
final Map<String, dynamic> jsonObject = <String, dynamic>{'services': jsonServices};
|
||||||
manifest.writeAsStringSync(json.encode(jsonObject), mode: FileMode.write, flush: true);
|
manifest.writeAsStringSync(json.encode(jsonObject), mode: FileMode.write, flush: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ String getValueFromFile(String plistFilePath, String key) {
|
|||||||
final List<String> args = <String>[
|
final List<String> args = <String>[
|
||||||
executable, 'read', normalizedPlistPath,
|
executable, 'read', normalizedPlistPath,
|
||||||
];
|
];
|
||||||
if (key != null && key.isNotEmpty){
|
if (key != null && key.isNotEmpty) {
|
||||||
args.add(key);
|
args.add(key);
|
||||||
}
|
}
|
||||||
final String value = runCheckedSync(args);
|
final String value = runCheckedSync(args);
|
||||||
|
@ -406,7 +406,7 @@ class HotRunner extends ResidentRunner {
|
|||||||
final Map<String, String> analyticsParameters =
|
final Map<String, String> analyticsParameters =
|
||||||
reason == null
|
reason == null
|
||||||
? null
|
? null
|
||||||
: <String, String>{ kEventReloadReasonParameterName: reason };
|
: <String, String>{kEventReloadReasonParameterName: reason};
|
||||||
|
|
||||||
if (!_isPaused()) {
|
if (!_isPaused()) {
|
||||||
printTrace('Refreshing active FlutterViews before restarting.');
|
printTrace('Refreshing active FlutterViews before restarting.');
|
||||||
|
@ -105,7 +105,7 @@ File generateServiceDefinitions(
|
|||||||
'class': service['android-class'],
|
'class': service['android-class'],
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
final Map<String, dynamic> jsonObject = <String, dynamic>{ 'services': services };
|
final Map<String, dynamic> jsonObject = <String, dynamic>{'services': services};
|
||||||
final File servicesFile = fs.file(fs.path.join(dir, 'services.json'));
|
final File servicesFile = fs.file(fs.path.join(dir, 'services.json'));
|
||||||
servicesFile.writeAsStringSync(json.encode(jsonObject), mode: FileMode.write, flush: true);
|
servicesFile.writeAsStringSync(json.encode(jsonObject), mode: FileMode.write, flush: true);
|
||||||
return servicesFile;
|
return servicesFile;
|
||||||
|
@ -19,7 +19,7 @@ class EventPrinter extends TestWatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _sendEvent(String name, [ dynamic params ]) {
|
void _sendEvent(String name, [ dynamic params ]) {
|
||||||
final Map<String, dynamic> map = <String, dynamic>{ 'event': name};
|
final Map<String, dynamic> map = <String, dynamic>{'event': name};
|
||||||
if (params != null) {
|
if (params != null) {
|
||||||
map['params'] = params;
|
map['params'] = params;
|
||||||
}
|
}
|
||||||
|
@ -352,7 +352,7 @@ class VMService {
|
|||||||
Future<void> _streamListen(String streamId) async {
|
Future<void> _streamListen(String streamId) async {
|
||||||
if (!_listeningFor.contains(streamId)) {
|
if (!_listeningFor.contains(streamId)) {
|
||||||
_listeningFor.add(streamId);
|
_listeningFor.add(streamId);
|
||||||
await _sendRequest('streamListen', <String, dynamic>{ 'streamId': streamId });
|
await _sendRequest('streamListen', <String, dynamic>{'streamId': streamId});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -873,7 +873,7 @@ class VM extends ServiceObjectOwner {
|
|||||||
|
|
||||||
/// Create a new development file system on the device.
|
/// Create a new development file system on the device.
|
||||||
Future<Map<String, dynamic>> createDevFS(String fsName) {
|
Future<Map<String, dynamic>> createDevFS(String fsName) {
|
||||||
return invokeRpcRaw('_createDevFS', params: <String, dynamic> { 'fsName': fsName });
|
return invokeRpcRaw('_createDevFS', params: <String, dynamic> {'fsName': fsName});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List the development file system son the device.
|
/// List the development file system son the device.
|
||||||
@ -913,12 +913,12 @@ class VM extends ServiceObjectOwner {
|
|||||||
|
|
||||||
/// The complete list of a file system.
|
/// The complete list of a file system.
|
||||||
Future<List<String>> listDevFSFiles(String fsName) async {
|
Future<List<String>> listDevFSFiles(String fsName) async {
|
||||||
return (await invokeRpcRaw('_listDevFSFiles', params: <String, dynamic>{ 'fsName': fsName }))['files'];
|
return (await invokeRpcRaw('_listDevFSFiles', params: <String, dynamic>{'fsName': fsName}))['files'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete an existing file system.
|
/// Delete an existing file system.
|
||||||
Future<Map<String, dynamic>> deleteDevFS(String fsName) {
|
Future<Map<String, dynamic>> deleteDevFS(String fsName) {
|
||||||
return invokeRpcRaw('_deleteDevFS', params: <String, dynamic>{ 'fsName': fsName });
|
return invokeRpcRaw('_deleteDevFS', params: <String, dynamic>{'fsName': fsName});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<ServiceMap> runInView(
|
Future<ServiceMap> runInView(
|
||||||
@ -1273,7 +1273,7 @@ class Isolate extends ServiceObjectOwner {
|
|||||||
if (state != null && state.containsKey('enabled') && state['enabled'] is String) {
|
if (state != null && state.containsKey('enabled') && state['enabled'] is String) {
|
||||||
state = await invokeFlutterExtensionRpcRaw(
|
state = await invokeFlutterExtensionRpcRaw(
|
||||||
'ext.flutter.$name',
|
'ext.flutter.$name',
|
||||||
params: <String, dynamic>{ 'enabled': state['enabled'] == 'true' ? 'false' : 'true' },
|
params: <String, dynamic>{'enabled': state['enabled'] == 'true' ? 'false' : 'true'},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
@ -1288,7 +1288,7 @@ class Isolate extends ServiceObjectOwner {
|
|||||||
Future<Map<String, dynamic>> flutterDebugAllowBanner(bool show) {
|
Future<Map<String, dynamic>> flutterDebugAllowBanner(bool show) {
|
||||||
return invokeFlutterExtensionRpcRaw(
|
return invokeFlutterExtensionRpcRaw(
|
||||||
'ext.flutter.debugAllowBanner',
|
'ext.flutter.debugAllowBanner',
|
||||||
params: <String, dynamic>{ 'enabled': show ? 'true' : 'false' },
|
params: <String, dynamic>{'enabled': show ? 'true' : 'false'},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1331,7 +1331,7 @@ class Isolate extends ServiceObjectOwner {
|
|||||||
Future<String> flutterPlatformOverride([ String platform ]) async {
|
Future<String> flutterPlatformOverride([ String platform ]) async {
|
||||||
final Map<String, dynamic> result = await invokeFlutterExtensionRpcRaw(
|
final Map<String, dynamic> result = await invokeFlutterExtensionRpcRaw(
|
||||||
'ext.flutter.platformOverride',
|
'ext.flutter.platformOverride',
|
||||||
params: platform != null ? <String, dynamic>{ 'value': platform } : <String, String>{},
|
params: platform != null ? <String, dynamic>{'value': platform} : <String, String>{},
|
||||||
);
|
);
|
||||||
if (result != null && result['value'] is String)
|
if (result != null && result['value'] is String)
|
||||||
return result['value'];
|
return result['value'];
|
||||||
|
@ -20,12 +20,12 @@ void main() {
|
|||||||
testUsingContext('recursively creates a directory if it does not exist', () async {
|
testUsingContext('recursively creates a directory if it does not exist', () async {
|
||||||
ensureDirectoryExists('foo/bar/baz.flx');
|
ensureDirectoryExists('foo/bar/baz.flx');
|
||||||
expect(fs.isDirectorySync('foo/bar'), true);
|
expect(fs.isDirectorySync('foo/bar'), true);
|
||||||
}, overrides: <Type, Generator>{ FileSystem: () => fs });
|
}, overrides: <Type, Generator>{FileSystem: () => fs});
|
||||||
|
|
||||||
testUsingContext('throws tool exit on failure to create', () async {
|
testUsingContext('throws tool exit on failure to create', () async {
|
||||||
fs.file('foo').createSync();
|
fs.file('foo').createSync();
|
||||||
expect(() => ensureDirectoryExists('foo/bar.flx'), throwsToolExit());
|
expect(() => ensureDirectoryExists('foo/bar.flx'), throwsToolExit());
|
||||||
}, overrides: <Type, Generator>{ FileSystem: () => fs });
|
}, overrides: <Type, Generator>{FileSystem: () => fs});
|
||||||
});
|
});
|
||||||
|
|
||||||
group('copyDirectorySync', () {
|
group('copyDirectorySync', () {
|
||||||
|
@ -247,7 +247,7 @@ void main() {
|
|||||||
() => Fingerprint.fromBuildInputs(<String, String>{}, <String>['a.dart', 'b.dart']),
|
() => Fingerprint.fromBuildInputs(<String, String>{}, <String>['a.dart', 'b.dart']),
|
||||||
throwsArgumentError,
|
throwsArgumentError,
|
||||||
);
|
);
|
||||||
}, overrides: <Type, Generator>{ FileSystem: () => fs });
|
}, overrides: <Type, Generator>{FileSystem: () => fs});
|
||||||
|
|
||||||
testUsingContext('populates checksums for valid files', () async {
|
testUsingContext('populates checksums for valid files', () async {
|
||||||
await fs.file('a.dart').writeAsString('This is a');
|
await fs.file('a.dart').writeAsString('This is a');
|
||||||
@ -258,14 +258,14 @@ void main() {
|
|||||||
expect(jsonObject['files'], hasLength(2));
|
expect(jsonObject['files'], hasLength(2));
|
||||||
expect(jsonObject['files']['a.dart'], '8a21a15fad560b799f6731d436c1b698');
|
expect(jsonObject['files']['a.dart'], '8a21a15fad560b799f6731d436c1b698');
|
||||||
expect(jsonObject['files']['b.dart'], '6f144e08b58cd0925328610fad7ac07c');
|
expect(jsonObject['files']['b.dart'], '6f144e08b58cd0925328610fad7ac07c');
|
||||||
}, overrides: <Type, Generator>{ FileSystem: () => fs });
|
}, overrides: <Type, Generator>{FileSystem: () => fs});
|
||||||
|
|
||||||
testUsingContext('includes framework version', () {
|
testUsingContext('includes framework version', () {
|
||||||
final Fingerprint fingerprint = Fingerprint.fromBuildInputs(<String, String>{}, <String>[]);
|
final Fingerprint fingerprint = Fingerprint.fromBuildInputs(<String, String>{}, <String>[]);
|
||||||
|
|
||||||
final Map<String, dynamic> jsonObject = json.decode(fingerprint.toJson());
|
final Map<String, dynamic> jsonObject = json.decode(fingerprint.toJson());
|
||||||
expect(jsonObject['version'], mockVersion.frameworkRevision);
|
expect(jsonObject['version'], mockVersion.frameworkRevision);
|
||||||
}, overrides: <Type, Generator>{ FlutterVersion: () => mockVersion });
|
}, overrides: <Type, Generator>{FlutterVersion: () => mockVersion});
|
||||||
|
|
||||||
testUsingContext('includes provided properties', () {
|
testUsingContext('includes provided properties', () {
|
||||||
final Fingerprint fingerprint = Fingerprint.fromBuildInputs(<String, String>{'a': 'A', 'b': 'B'}, <String>[]);
|
final Fingerprint fingerprint = Fingerprint.fromBuildInputs(<String, String>{'a': 'A', 'b': 'B'}, <String>[]);
|
||||||
@ -274,7 +274,7 @@ void main() {
|
|||||||
expect(jsonObject['properties'], hasLength(2));
|
expect(jsonObject['properties'], hasLength(2));
|
||||||
expect(jsonObject['properties']['a'], 'A');
|
expect(jsonObject['properties']['a'], 'A');
|
||||||
expect(jsonObject['properties']['b'], 'B');
|
expect(jsonObject['properties']['b'], 'B');
|
||||||
}, overrides: <Type, Generator>{ FlutterVersion: () => mockVersion });
|
}, overrides: <Type, Generator>{FlutterVersion: () => mockVersion});
|
||||||
});
|
});
|
||||||
|
|
||||||
group('fromJson', () {
|
group('fromJson', () {
|
||||||
@ -315,8 +315,8 @@ void main() {
|
|||||||
testUsingContext('throws ArgumentError for unknown versions', () async {
|
testUsingContext('throws ArgumentError for unknown versions', () async {
|
||||||
final String jsonString = json.encode(<String, dynamic>{
|
final String jsonString = json.encode(<String, dynamic>{
|
||||||
'version': 'bad',
|
'version': 'bad',
|
||||||
'properties':<String, String>{},
|
'properties': <String, String>{},
|
||||||
'files':<String, String>{},
|
'files': <String, String>{},
|
||||||
});
|
});
|
||||||
expect(() => Fingerprint.fromJson(jsonString), throwsArgumentError);
|
expect(() => Fingerprint.fromJson(jsonString), throwsArgumentError);
|
||||||
}, overrides: <Type, Generator>{
|
}, overrides: <Type, Generator>{
|
||||||
@ -325,8 +325,8 @@ void main() {
|
|||||||
|
|
||||||
testUsingContext('throws ArgumentError if version is not present', () async {
|
testUsingContext('throws ArgumentError if version is not present', () async {
|
||||||
final String jsonString = json.encode(<String, dynamic>{
|
final String jsonString = json.encode(<String, dynamic>{
|
||||||
'properties':<String, String>{},
|
'properties': <String, String>{},
|
||||||
'files':<String, String>{},
|
'files': <String, String>{},
|
||||||
});
|
});
|
||||||
expect(() => Fingerprint.fromJson(jsonString), throwsArgumentError);
|
expect(() => Fingerprint.fromJson(jsonString), throwsArgumentError);
|
||||||
}, overrides: <Type, Generator>{
|
}, overrides: <Type, Generator>{
|
||||||
@ -437,7 +437,7 @@ void main() {
|
|||||||
fs = MemoryFileSystem();
|
fs = MemoryFileSystem();
|
||||||
});
|
});
|
||||||
|
|
||||||
final Map<Type, Generator> contextOverrides = <Type, Generator>{ FileSystem: () => fs };
|
final Map<Type, Generator> contextOverrides = <Type, Generator>{FileSystem: () => fs};
|
||||||
|
|
||||||
testUsingContext('returns one file if only one is listed', () async {
|
testUsingContext('returns one file if only one is listed', () async {
|
||||||
await fs.file('a.d').writeAsString('snapshot.d: /foo/a.dart');
|
await fs.file('a.d').writeAsString('snapshot.d: /foo/a.dart');
|
||||||
|
@ -97,7 +97,7 @@ void main() {
|
|||||||
path: '/cr/report',
|
path: '/cr/report',
|
||||||
queryParameters: <String, String>{
|
queryParameters: <String, String>{
|
||||||
'product': 'Flutter_Tools',
|
'product': 'Flutter_Tools',
|
||||||
'version' : 'test-version',
|
'version': 'test-version',
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
expect(fields['uuid'], '00000000-0000-4000-0000-000000000000');
|
expect(fields['uuid'], '00000000-0000-4000-0000-000000000000');
|
||||||
@ -148,7 +148,7 @@ void main() {
|
|||||||
path: '/fake_server',
|
path: '/fake_server',
|
||||||
queryParameters: <String, String>{
|
queryParameters: <String, String>{
|
||||||
'product': 'Flutter_Tools',
|
'product': 'Flutter_Tools',
|
||||||
'version' : 'test-version',
|
'version': 'test-version',
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
}, overrides: <Type, Generator> {
|
}, overrides: <Type, Generator> {
|
||||||
|
@ -54,7 +54,7 @@ void main() {
|
|||||||
'success': false,
|
'success': false,
|
||||||
'details': <String, dynamic>{
|
'details': <String, dynamic>{
|
||||||
'notices': <Map<String, dynamic>>[
|
'notices': <Map<String, dynamic>>[
|
||||||
<String, dynamic>{ 'message': false, },
|
<String, dynamic>{'message': false},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}), false);
|
}), false);
|
||||||
@ -63,7 +63,7 @@ void main() {
|
|||||||
'success': false,
|
'success': false,
|
||||||
'details': <String, dynamic>{
|
'details': <String, dynamic>{
|
||||||
'notices': <Map<String, dynamic>>[
|
'notices': <Map<String, dynamic>>[
|
||||||
<String, dynamic>{ 'message': <String>['error'], },
|
<String, dynamic>{'message': <String>['error']},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}), false);
|
}), false);
|
||||||
@ -72,8 +72,8 @@ void main() {
|
|||||||
'success': false,
|
'success': false,
|
||||||
'details': <String, dynamic>{
|
'details': <String, dynamic>{
|
||||||
'notices': <Map<String, dynamic>>[
|
'notices': <Map<String, dynamic>>[
|
||||||
<String, dynamic>{ 'message': 'error', },
|
<String, dynamic>{'message': 'error'},
|
||||||
<String, dynamic>{ 'message': <String>['error'], },
|
<String, dynamic>{'message': <String>['error']},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}), false);
|
}), false);
|
||||||
@ -82,7 +82,7 @@ void main() {
|
|||||||
'success': false,
|
'success': false,
|
||||||
'details': <String, dynamic>{
|
'details': <String, dynamic>{
|
||||||
'notices': <Map<String, dynamic>>[
|
'notices': <Map<String, dynamic>>[
|
||||||
<String, dynamic>{ 'message': 'error', },
|
<String, dynamic>{'message': 'error'},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}), false);
|
}), false);
|
||||||
|
@ -217,7 +217,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
expect(testLogger.errorText, isEmpty);
|
expect(testLogger.errorText, isEmpty);
|
||||||
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
||||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM':'4444DDDD44'});
|
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||||
|
|
||||||
verify(config.setValue('ios-signing-cert', 'iPhone Developer: Profile 3 (3333CCCC33)'));
|
verify(config.setValue('ios-signing-cert', 'iPhone Developer: Profile 3 (3333CCCC33)'));
|
||||||
},
|
},
|
||||||
@ -288,7 +288,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
expect(testLogger.errorText, isEmpty);
|
expect(testLogger.errorText, isEmpty);
|
||||||
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
||||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM':'5555EEEE55'});
|
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '5555EEEE55'});
|
||||||
},
|
},
|
||||||
overrides: <Type, Generator>{
|
overrides: <Type, Generator>{
|
||||||
ProcessManager: () => mockProcessManager,
|
ProcessManager: () => mockProcessManager,
|
||||||
@ -360,7 +360,7 @@ void main() {
|
|||||||
);
|
);
|
||||||
expect(testLogger.errorText, isEmpty);
|
expect(testLogger.errorText, isEmpty);
|
||||||
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
||||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM':'4444DDDD44'});
|
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||||
},
|
},
|
||||||
overrides: <Type, Generator>{
|
overrides: <Type, Generator>{
|
||||||
ProcessManager: () => mockProcessManager,
|
ProcessManager: () => mockProcessManager,
|
||||||
@ -432,7 +432,7 @@ void main() {
|
|||||||
testLogger.statusText,
|
testLogger.statusText,
|
||||||
contains('Certificate choice "iPhone Developer: Profile 3 (3333CCCC33)"'),
|
contains('Certificate choice "iPhone Developer: Profile 3 (3333CCCC33)"'),
|
||||||
);
|
);
|
||||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM':'4444DDDD44'});
|
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||||
verify(config.setValue('ios-signing-cert', 'iPhone Developer: Profile 3 (3333CCCC33)'));
|
verify(config.setValue('ios-signing-cert', 'iPhone Developer: Profile 3 (3333CCCC33)'));
|
||||||
},
|
},
|
||||||
overrides: <Type, Generator>{
|
overrides: <Type, Generator>{
|
||||||
|
@ -102,7 +102,7 @@ void main() {}
|
|||||||
});
|
});
|
||||||
expect(invalidator.updateTime, <String, int>{
|
expect(invalidator.updateTime, <String, int>{
|
||||||
'/foo/lib/foo.dart': fooFile.statSync().modified.millisecondsSinceEpoch,
|
'/foo/lib/foo.dart': fooFile.statSync().modified.millisecondsSinceEpoch,
|
||||||
'/lib/main.dart':mainFile.statSync().modified.millisecondsSinceEpoch,
|
'/lib/main.dart': mainFile.statSync().modified.millisecondsSinceEpoch,
|
||||||
});
|
});
|
||||||
expect(invalidator.findInvalidated(), isEmpty);
|
expect(invalidator.findInvalidated(), isEmpty);
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ Future<void> main() async {
|
|||||||
if (words.length > 1) {
|
if (words.length > 1) {
|
||||||
_send(<String, dynamic>{
|
_send(<String, dynamic>{
|
||||||
'method': 'app.stop',
|
'method': 'app.stop',
|
||||||
'params': <String, dynamic> { 'appId': words[1] },
|
'params': <String, dynamic> {'appId': words[1]},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
_send(<String, dynamic>{'method': 'app.stop'});
|
_send(<String, dynamic>{'method': 'app.stop'});
|
||||||
@ -59,7 +59,7 @@ Future<void> main() async {
|
|||||||
if (words.length > 1) {
|
if (words.length > 1) {
|
||||||
_send(<String, dynamic>{
|
_send(<String, dynamic>{
|
||||||
'method': 'app.restart',
|
'method': 'app.restart',
|
||||||
'params': <String, dynamic> { 'appId': words[1] },
|
'params': <String, dynamic> {'appId': words[1]},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
_send(<String, dynamic>{'method': 'app.restart'});
|
_send(<String, dynamic>{'method': 'app.restart'});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user