Unverified Commit 66f424f0 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

fix some bad indentations (#26921)

* fix some bad indentations

* remove suspicious line
parent f329b462
...@@ -292,7 +292,7 @@ class DefaultCupertinoLocalizations implements CupertinoLocalizations { ...@@ -292,7 +292,7 @@ class DefaultCupertinoLocalizations implements CupertinoLocalizations {
@override @override
String datePickerMinuteSemanticsLabel(int minute) { String datePickerMinuteSemanticsLabel(int minute) {
if (minute == 1) if (minute == 1)
return '1 minute'; return '1 minute';
return minute.toString() + ' minutes'; return minute.toString() + ' minutes';
} }
......
...@@ -419,7 +419,7 @@ class _RenderCupertinoPickerSemantics extends RenderProxyBox { ...@@ -419,7 +419,7 @@ class _RenderCupertinoPickerSemantics extends RenderProxyBox {
_currentIndex = controller.selectedItem; _currentIndex = controller.selectedItem;
markNeedsSemanticsUpdate(); markNeedsSemanticsUpdate();
} }
@override @override
void describeSemanticsConfiguration(SemanticsConfiguration config) { void describeSemanticsConfiguration(SemanticsConfiguration config) {
super.describeSemanticsConfiguration(config); super.describeSemanticsConfiguration(config);
config.isSemanticBoundary = true; config.isSemanticBoundary = true;
......
...@@ -83,4 +83,6 @@ class ValueKey<T> extends LocalKey { ...@@ -83,4 +83,6 @@ class ValueKey<T> extends LocalKey {
} }
} }
class _TypeLiteral<T> { Type get type => T; } class _TypeLiteral<T> {
Type get type => T;
}
...@@ -54,7 +54,8 @@ abstract class LicenseEntry { ...@@ -54,7 +54,8 @@ abstract class LicenseEntry {
} }
enum _LicenseEntryWithLineBreaksParserState { enum _LicenseEntryWithLineBreaksParserState {
beforeParagraph, inParagraph, beforeParagraph,
inParagraph,
} }
/// Variant of [LicenseEntry] for licenses that separate paragraphs with blank /// Variant of [LicenseEntry] for licenses that separate paragraphs with blank
......
...@@ -168,7 +168,7 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer { ...@@ -168,7 +168,7 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
_LineBetweenPointers _initialLine; _LineBetweenPointers _initialLine;
_LineBetweenPointers _currentLine; _LineBetweenPointers _currentLine;
Map<int, Offset> _pointerLocations; Map<int, Offset> _pointerLocations;
List<int> _pointerQueue; /// A queue to sort pointers in order of entrance List<int> _pointerQueue; // A queue to sort pointers in order of entrance
final Map<int, VelocityTracker> _velocityTrackers = <int, VelocityTracker>{}; final Map<int, VelocityTracker> _velocityTrackers = <int, VelocityTracker>{};
double get _scaleFactor => _initialSpan > 0.0 ? _currentSpan / _initialSpan : 1.0; double get _scaleFactor => _initialSpan > 0.0 ? _currentSpan / _initialSpan : 1.0;
......
...@@ -3043,7 +3043,7 @@ class InputDecorationTheme extends Diagnosticable { ...@@ -3043,7 +3043,7 @@ class InputDecorationTheme extends Diagnosticable {
/// * [InputDecorator.isFocused], which is true if the [InputDecorator]'s child /// * [InputDecorator.isFocused], which is true if the [InputDecorator]'s child
/// has the focus. /// has the focus.
/// * [InputDecoration.errorText], the error shown by the [InputDecorator], if non-null. /// * [InputDecoration.errorText], the error shown by the [InputDecorator], if non-null.
/// * [border], for a description of where the [InputDecorator] border appears. /// * [border], for a description of where the [InputDecorator] border appears.
/// * [UnderlineInputBorder], an [InputDecorator] border which draws a horizontal /// * [UnderlineInputBorder], an [InputDecorator] border which draws a horizontal
/// line at the bottom of the input decorator's container. /// line at the bottom of the input decorator's container.
/// * [OutlineInputBorder], an [InputDecorator] border which draws a /// * [OutlineInputBorder], an [InputDecorator] border which draws a
...@@ -3059,7 +3059,7 @@ class InputDecorationTheme extends Diagnosticable { ...@@ -3059,7 +3059,7 @@ class InputDecorationTheme extends Diagnosticable {
/// and [InputDecoration.errorText] is null. /// and [InputDecoration.errorText] is null.
final InputBorder focusedErrorBorder; final InputBorder focusedErrorBorder;
/// The border to display when the [InputDecorator] is disabled and is not /// The border to display when the [InputDecorator] is disabled and is not
/// showing an error. /// showing an error.
/// ///
/// See also: /// See also:
......
...@@ -124,7 +124,7 @@ class RaisedButton extends MaterialButton { ...@@ -124,7 +124,7 @@ class RaisedButton extends MaterialButton {
@required Widget label, @required Widget label,
}) = _RaisedButtonWithIcon; }) = _RaisedButtonWithIcon;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final ButtonThemeData buttonTheme = ButtonTheme.of(context); final ButtonThemeData buttonTheme = ButtonTheme.of(context);
......
...@@ -393,7 +393,7 @@ class _IndicatorPainter extends CustomPainter { ...@@ -393,7 +393,7 @@ class _IndicatorPainter extends CustomPainter {
else if (value == index + 1.0) else if (value == index + 1.0)
_currentRect = next ?? middle; _currentRect = next ?? middle;
else if (value == index) else if (value == index)
_currentRect = middle; _currentRect = middle;
else if (value < index) else if (value < index)
_currentRect = previous == null ? middle : Rect.lerp(middle, previous, index - value); _currentRect = previous == null ? middle : Rect.lerp(middle, previous, index - value);
else else
...@@ -864,7 +864,7 @@ class _TabBarState extends State<TabBar> { ...@@ -864,7 +864,7 @@ class _TabBarState extends State<TabBar> {
else if (value == index + 1.0) else if (value == index + 1.0)
offset = trailingPosition ?? middlePosition; offset = trailingPosition ?? middlePosition;
else if (value == index) else if (value == index)
offset = middlePosition; offset = middlePosition;
else if (value < index) else if (value < index)
offset = leadingPosition == null ? middlePosition : lerpDouble(middlePosition, leadingPosition, index - value); offset = leadingPosition == null ? middlePosition : lerpDouble(middlePosition, leadingPosition, index - value);
else else
......
...@@ -1736,7 +1736,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1736,7 +1736,7 @@ abstract class RenderBox extends RenderObject {
information.writeln('The nearest ancestor providing an unbounded width constraint is:'); information.writeln('The nearest ancestor providing an unbounded width constraint is:');
information.write(' '); information.write(' ');
information.writeln(node.toStringShallow(joiner: '\n ')); information.writeln(node.toStringShallow(joiner: '\n '));
} }
if (!constraints.hasBoundedHeight) { if (!constraints.hasBoundedHeight) {
RenderBox node = this; RenderBox node = this;
while (!node.constraints.hasBoundedHeight && node.parent is RenderBox) while (!node.constraints.hasBoundedHeight && node.parent is RenderBox)
...@@ -1834,7 +1834,7 @@ abstract class RenderBox extends RenderObject { ...@@ -1834,7 +1834,7 @@ abstract class RenderBox extends RenderObject {
// notify them again. // notify them again.
_cachedBaselines?.clear(); _cachedBaselines?.clear();
_cachedIntrinsicDimensions?.clear(); _cachedIntrinsicDimensions?.clear();
if (parent is RenderObject) { if (parent is RenderObject) {
markParentNeedsLayout(); markParentNeedsLayout();
return; return;
} }
......
...@@ -453,8 +453,8 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -453,8 +453,8 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
assert(verticalDirection != null, 'Vertical $runtimeType with $mainAxisAlignment has a null verticalDirection, so the alignment cannot be resolved.'); assert(verticalDirection != null, 'Vertical $runtimeType with $mainAxisAlignment has a null verticalDirection, so the alignment cannot be resolved.');
break; break;
} }
} }
if (crossAxisAlignment == CrossAxisAlignment.start || if (crossAxisAlignment == CrossAxisAlignment.start ||
crossAxisAlignment == CrossAxisAlignment.end) { crossAxisAlignment == CrossAxisAlignment.end) {
switch (direction) { switch (direction) {
case Axis.horizontal: case Axis.horizontal:
......
...@@ -148,7 +148,7 @@ class RenderListBody extends RenderBox ...@@ -148,7 +148,7 @@ class RenderListBody extends RenderBox
child.layout(innerConstraints, parentUsesSize: true); child.layout(innerConstraints, parentUsesSize: true);
final ListBodyParentData childParentData = child.parentData; final ListBodyParentData childParentData = child.parentData;
childParentData.offset = Offset(0.0, mainAxisExtent); childParentData.offset = Offset(0.0, mainAxisExtent);
mainAxisExtent += child.size.height; mainAxisExtent += child.size.height;
assert(child.parentData == childParentData); assert(child.parentData == childParentData);
child = childParentData.nextSibling; child = childParentData.nextSibling;
} }
......
...@@ -3098,7 +3098,7 @@ class RenderSemanticsGestureHandler extends RenderProxyBox { ...@@ -3098,7 +3098,7 @@ class RenderSemanticsGestureHandler extends RenderProxyBox {
markNeedsSemanticsUpdate(); markNeedsSemanticsUpdate();
} }
/// Called when the user taps on the render object. /// Called when the user taps on the render object.
GestureTapCallback get onTap => _onTap; GestureTapCallback get onTap => _onTap;
GestureTapCallback _onTap; GestureTapCallback _onTap;
set onTap(GestureTapCallback value) { set onTap(GestureTapCallback value) {
......
...@@ -50,7 +50,7 @@ mixin SemanticsBinding on BindingBase { ...@@ -50,7 +50,7 @@ mixin SemanticsBinding on BindingBase {
bool value = _accessibilityFeatures.disableAnimations; bool value = _accessibilityFeatures.disableAnimations;
assert(() { assert(() {
if (debugSemanticsDisableAnimations != null) if (debugSemanticsDisableAnimations != null)
value = debugSemanticsDisableAnimations; value = debugSemanticsDisableAnimations;
return true; return true;
}()); }());
return value; return value;
......
...@@ -929,7 +929,7 @@ class _WidgetsAppState extends State<WidgetsApp> implements WidgetsBindingObserv ...@@ -929,7 +929,7 @@ class _WidgetsAppState extends State<WidgetsApp> implements WidgetsBindingObserv
} }
// Look for language+country match. // Look for language+country match.
if (userLocale.countryCode != null) { if (userLocale.countryCode != null) {
final Locale match = languageAndCountryLocales['${userLocale.languageCode}_${userLocale.countryCode}']; final Locale match = languageAndCountryLocales['${userLocale.languageCode}_${userLocale.countryCode}'];
if (match != null) { if (match != null) {
return match; return match;
} }
......
...@@ -224,7 +224,7 @@ class ScrollController extends ChangeNotifier { ...@@ -224,7 +224,7 @@ class ScrollController extends ChangeNotifier {
/// This is used when the environment has changed and the [Scrollable] /// This is used when the environment has changed and the [Scrollable]
/// needs to recreate the [ScrollPosition] object. It is null the first /// needs to recreate the [ScrollPosition] object. It is null the first
/// time the [ScrollPosition] is created. /// time the [ScrollPosition] is created.
ScrollPosition createScrollPosition( ScrollPosition createScrollPosition(
ScrollPhysics physics, ScrollPhysics physics,
ScrollContext context, ScrollContext context,
ScrollPosition oldPosition, ScrollPosition oldPosition,
......
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import '../flutter_test_alternative.dart'; import '../flutter_test_alternative.dart';
enum _TestEnum { enum _TestEnum { a, b, c, d, e, f, g, h, }
a, b, c, d, e, f, g, h,
}
void main() { void main() {
test('BitField control test', () { test('BitField control test', () {
......
...@@ -1182,10 +1182,10 @@ class _LinePaintPredicate extends _DrawCommandPaintPredicate { ...@@ -1182,10 +1182,10 @@ class _LinePaintPredicate extends _DrawCommandPaintPredicate {
final Offset p1Argument = arguments[0]; final Offset p1Argument = arguments[0];
final Offset p2Argument = arguments[1]; final Offset p2Argument = arguments[1];
if (p1 != null && p1Argument != p1) { if (p1 != null && p1Argument != p1) {
throw 'It called $methodName with p1 endpoint, $p1Argument, which was not exactly the expected endpoint ($p1).'; throw 'It called $methodName with p1 endpoint, $p1Argument, which was not exactly the expected endpoint ($p1).';
} }
if (p2 != null && p2Argument != p2) { if (p2 != null && p2Argument != p2) {
throw 'It called $methodName with p2 endpoint, $p2Argument, which was not exactly the expected endpoint ($p2).'; throw 'It called $methodName with p2 endpoint, $p2Argument, which was not exactly the expected endpoint ($p2).';
} }
} }
......
...@@ -10,9 +10,9 @@ class TestPaintingContext implements PaintingContext { ...@@ -10,9 +10,9 @@ class TestPaintingContext implements PaintingContext {
final List<Invocation> invocations = <Invocation>[]; final List<Invocation> invocations = <Invocation>[];
@override @override
void noSuchMethod(Invocation invocation) { void noSuchMethod(Invocation invocation) {
invocations.add(invocation); invocations.add(invocation);
} }
} }
void main() { void main() {
......
...@@ -12,9 +12,9 @@ class TestPaintingContext implements PaintingContext { ...@@ -12,9 +12,9 @@ class TestPaintingContext implements PaintingContext {
final List<Invocation> invocations = <Invocation>[]; final List<Invocation> invocations = <Invocation>[];
@override @override
void noSuchMethod(Invocation invocation) { void noSuchMethod(Invocation invocation) {
invocations.add(invocation); invocations.add(invocation);
} }
} }
void main() { void main() {
......
...@@ -676,9 +676,9 @@ class _AdbLogReader extends DeviceLogReader { ...@@ -676,9 +676,9 @@ class _AdbLogReader extends DeviceLogReader {
final List<String> args = <String>['shell', '-x', 'logcat', '-v', 'time']; final List<String> args = <String>['shell', '-x', 'logcat', '-v', 'time'];
final String lastTimestamp = device.lastLogcatTimestamp; final String lastTimestamp = device.lastLogcatTimestamp;
if (lastTimestamp != null) if (lastTimestamp != null)
_timeOrigin = _adbTimestampToDateTime(lastTimestamp); _timeOrigin = _adbTimestampToDateTime(lastTimestamp);
else else
_timeOrigin = null; _timeOrigin = null;
runCommand(device.adbCommandForDevice(args)).then<void>((Process process) { runCommand(device.adbCommandForDevice(args)).then<void>((Process process) {
_process = process; _process = process;
const Utf8Decoder decoder = Utf8Decoder(allowMalformed: true); const Utf8Decoder decoder = Utf8Decoder(allowMalformed: true);
......
...@@ -448,8 +448,9 @@ Future<void> _buildGradleProjectV2( ...@@ -448,8 +448,9 @@ Future<void> _buildGradleProjectV2(
if (buildInfo.createPatch) { if (buildInfo.createPatch) {
final AndroidApk package = AndroidApk.fromApk(apkFile); final AndroidApk package = AndroidApk.fromApk(apkFile);
final Directory baselineDir = fs.directory(buildInfo.baselineDir); final Directory baselineDir = fs.directory(buildInfo.baselineDir);
final File baselineApkFile = baselineDir.childFile('${package.versionCode}.apk');if (!baselineApkFile.existsSync()) final File baselineApkFile = baselineDir.childFile('${package.versionCode}.apk');
if (!baselineApkFile.existsSync())
throwToolExit('Error: Could not find baseline package ${baselineApkFile.path}.'); throwToolExit('Error: Could not find baseline package ${baselineApkFile.path}.');
printStatus('Found baseline package ${baselineApkFile.path}.'); printStatus('Found baseline package ${baselineApkFile.path}.');
......
...@@ -381,8 +381,8 @@ class RunResult { ...@@ -381,8 +381,8 @@ class RunResult {
return out.toString().trimRight(); return out.toString().trimRight();
} }
/// Throws a [ProcessException] with the given `message`. /// Throws a [ProcessException] with the given `message`.
void throwException(String message) { void throwException(String message) {
throw ProcessException( throw ProcessException(
_command.first, _command.first,
_command.skip(1).toList(), _command.skip(1).toList(),
......
...@@ -99,7 +99,7 @@ class Daemon { ...@@ -99,7 +99,7 @@ class Daemon {
_handleRequest, _handleRequest,
onDone: () { onDone: () {
if (!_onExitCompleter.isCompleted) if (!_onExitCompleter.isCompleted)
_onExitCompleter.complete(0); _onExitCompleter.complete(0);
} }
); );
} }
......
...@@ -640,7 +640,6 @@ class PubspecYaml { ...@@ -640,7 +640,6 @@ class PubspecYaml {
// place to insert our transitive dependencies. // place to insert our transitive dependencies.
if (section == Section.dependencies) if (section == Section.dependencies)
endOfDirectDependencies = output.length; endOfDirectDependencies = output.length;
endOfDevDependencies = output.length;
if (section == Section.devDependencies) if (section == Section.devDependencies)
endOfDevDependencies = output.length; endOfDevDependencies = output.length;
section = data.section; // track which section we're now in. section = data.section; // track which section we're now in.
......
...@@ -224,7 +224,7 @@ class KernelCompiler { ...@@ -224,7 +224,7 @@ class KernelCompiler {
Uri mainUri; Uri mainUri;
if (packagesPath != null) { if (packagesPath != null) {
command.addAll(<String>['--packages', packagesPath]); command.addAll(<String>['--packages', packagesPath]);
mainUri = _PackageUriMapper.findUri(mainPath, packagesPath); mainUri = _PackageUriMapper.findUri(mainPath, packagesPath);
} }
if (outputFilePath != null) { if (outputFilePath != null) {
command.addAll(<String>['--output-dill', outputFilePath]); command.addAll(<String>['--output-dill', outputFilePath]);
......
...@@ -68,7 +68,7 @@ class _DefaultDoctorValidatorsProvider implements DoctorValidatorsProvider { ...@@ -68,7 +68,7 @@ class _DefaultDoctorValidatorsProvider implements DoctorValidatorsProvider {
_validators.add(NoIdeValidator()); _validators.add(NoIdeValidator());
if (ProxyValidator.shouldShow) if (ProxyValidator.shouldShow)
_validators.add(ProxyValidator()); _validators.add(ProxyValidator());
if (deviceManager.canListAnything) if (deviceManager.canListAnything)
_validators.add(DeviceValidator()); _validators.add(DeviceValidator());
......
...@@ -1305,7 +1305,7 @@ class Isolate extends ServiceObjectOwner { ...@@ -1305,7 +1305,7 @@ class Isolate extends ServiceObjectOwner {
final Map<String, dynamic> result = final Map<String, dynamic> result =
await invokeFlutterExtensionRpcRaw('ext.flutter.saveCompilationTrace'); await invokeFlutterExtensionRpcRaw('ext.flutter.saveCompilationTrace');
if (result != null && result['value'] is List<dynamic>) if (result != null && result['value'] is List<dynamic>)
return result['value'].cast<int>(); return result['value'].cast<int>();
return null; return null;
} }
......
...@@ -45,9 +45,9 @@ void main() { ...@@ -45,9 +45,9 @@ void main() {
expect(_proc.stdout, isNot(contains('flutter has exited unexpectedly'))); expect(_proc.stdout, isNot(contains('flutter has exited unexpectedly')));
expect(_proc.stderr, isNot(contains('flutter has exited unexpectedly'))); expect(_proc.stderr, isNot(contains('flutter has exited unexpectedly')));
if (!_proc.stderr.toString().contains('Unable to locate a development') if (!_proc.stderr.toString().contains('Unable to locate a development')
&& !_proc.stdout.toString().contains('No devices found with name or id matching')) { && !_proc.stdout.toString().contains('No devices found with name or id matching')) {
fail("'flutter run -d invalid-device-id' did not produce the expected error"); fail("'flutter run -d invalid-device-id' did not produce the expected error");
} }
}); });
test('writes pid-file', () async { test('writes pid-file', () async {
......
...@@ -41,8 +41,8 @@ void main() { ...@@ -41,8 +41,8 @@ void main() {
final StringBuffer stdout = StringBuffer(); final StringBuffer stdout = StringBuffer();
final StreamSubscription<String> subscription = _flutter.stdout.listen(stdout.writeln); final StreamSubscription<String> subscription = _flutter.stdout.listen(stdout.writeln);
try { try {
await _flutter.hotReload(); await _flutter.hotReload();
expect(stdout.toString(), contains('(((((RELOAD WORKED)))))')); expect(stdout.toString(), contains('(((((RELOAD WORKED)))))'));
} finally { } finally {
await subscription.cancel(); await subscription.cancel();
} }
......
...@@ -82,11 +82,11 @@ abstract class FlutterTestDriver { ...@@ -82,11 +82,11 @@ abstract class FlutterTestDriver {
}) async { }) async {
final String flutterBin = fs.path.join(getFlutterRoot(), 'bin', 'flutter'); final String flutterBin = fs.path.join(getFlutterRoot(), 'bin', 'flutter');
if (withDebugger) if (withDebugger)
arguments.add('--start-paused'); arguments.add('--start-paused');
if (_printDebugOutputToStdOut) if (_printDebugOutputToStdOut)
arguments.add('--verbose'); arguments.add('--verbose');
if (pidFile != null) { if (pidFile != null) {
arguments.addAll(<String>['--pid-file', pidFile.path]); arguments.addAll(<String>['--pid-file', pidFile.path]);
} }
if (script != null) { if (script != null) {
arguments.add(script); arguments.add(script);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment