fix some bad indentations (#26921)

* fix some bad indentations

* remove suspicious line
This commit is contained in:
Alexandre Ardhuin 2019-01-23 15:43:27 +01:00 committed by GitHub
parent f329b4623a
commit 66f424f0f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 50 additions and 49 deletions

View file

@ -292,7 +292,7 @@ class DefaultCupertinoLocalizations implements CupertinoLocalizations {
@override
String datePickerMinuteSemanticsLabel(int minute) {
if (minute == 1)
return '1 minute';
return '1 minute';
return minute.toString() + ' minutes';
}

View file

@ -419,7 +419,7 @@ class _RenderCupertinoPickerSemantics extends RenderProxyBox {
_currentIndex = controller.selectedItem;
markNeedsSemanticsUpdate();
}
@override
@override
void describeSemanticsConfiguration(SemanticsConfiguration config) {
super.describeSemanticsConfiguration(config);
config.isSemanticBoundary = true;

View file

@ -83,4 +83,6 @@ class ValueKey<T> extends LocalKey {
}
}
class _TypeLiteral<T> { Type get type => T; }
class _TypeLiteral<T> {
Type get type => T;
}

View file

@ -54,7 +54,8 @@ abstract class LicenseEntry {
}
enum _LicenseEntryWithLineBreaksParserState {
beforeParagraph, inParagraph,
beforeParagraph,
inParagraph,
}
/// Variant of [LicenseEntry] for licenses that separate paragraphs with blank

View file

@ -168,7 +168,7 @@ class ScaleGestureRecognizer extends OneSequenceGestureRecognizer {
_LineBetweenPointers _initialLine;
_LineBetweenPointers _currentLine;
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>{};
double get _scaleFactor => _initialSpan > 0.0 ? _currentSpan / _initialSpan : 1.0;

View file

@ -3043,7 +3043,7 @@ class InputDecorationTheme extends Diagnosticable {
/// * [InputDecorator.isFocused], which is true if the [InputDecorator]'s child
/// has the focus.
/// * [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
/// line at the bottom of the input decorator's container.
/// * [OutlineInputBorder], an [InputDecorator] border which draws a
@ -3059,7 +3059,7 @@ class InputDecorationTheme extends Diagnosticable {
/// and [InputDecoration.errorText] is null.
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.
///
/// See also:

View file

@ -124,7 +124,7 @@ class RaisedButton extends MaterialButton {
@required Widget label,
}) = _RaisedButtonWithIcon;
@override
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final ButtonThemeData buttonTheme = ButtonTheme.of(context);

View file

@ -393,7 +393,7 @@ class _IndicatorPainter extends CustomPainter {
else if (value == index + 1.0)
_currentRect = next ?? middle;
else if (value == index)
_currentRect = middle;
_currentRect = middle;
else if (value < index)
_currentRect = previous == null ? middle : Rect.lerp(middle, previous, index - value);
else
@ -864,7 +864,7 @@ class _TabBarState extends State<TabBar> {
else if (value == index + 1.0)
offset = trailingPosition ?? middlePosition;
else if (value == index)
offset = middlePosition;
offset = middlePosition;
else if (value < index)
offset = leadingPosition == null ? middlePosition : lerpDouble(middlePosition, leadingPosition, index - value);
else

View file

@ -1736,7 +1736,7 @@ abstract class RenderBox extends RenderObject {
information.writeln('The nearest ancestor providing an unbounded width constraint is:');
information.write(' ');
information.writeln(node.toStringShallow(joiner: '\n '));
}
}
if (!constraints.hasBoundedHeight) {
RenderBox node = this;
while (!node.constraints.hasBoundedHeight && node.parent is RenderBox)
@ -1834,7 +1834,7 @@ abstract class RenderBox extends RenderObject {
// notify them again.
_cachedBaselines?.clear();
_cachedIntrinsicDimensions?.clear();
if (parent is RenderObject) {
if (parent is RenderObject) {
markParentNeedsLayout();
return;
}

View file

@ -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.');
break;
}
}
if (crossAxisAlignment == CrossAxisAlignment.start ||
}
if (crossAxisAlignment == CrossAxisAlignment.start ||
crossAxisAlignment == CrossAxisAlignment.end) {
switch (direction) {
case Axis.horizontal:

View file

@ -148,7 +148,7 @@ class RenderListBody extends RenderBox
child.layout(innerConstraints, parentUsesSize: true);
final ListBodyParentData childParentData = child.parentData;
childParentData.offset = Offset(0.0, mainAxisExtent);
mainAxisExtent += child.size.height;
mainAxisExtent += child.size.height;
assert(child.parentData == childParentData);
child = childParentData.nextSibling;
}

View file

@ -3098,7 +3098,7 @@ class RenderSemanticsGestureHandler extends RenderProxyBox {
markNeedsSemanticsUpdate();
}
/// Called when the user taps on the render object.
/// Called when the user taps on the render object.
GestureTapCallback get onTap => _onTap;
GestureTapCallback _onTap;
set onTap(GestureTapCallback value) {

View file

@ -50,7 +50,7 @@ mixin SemanticsBinding on BindingBase {
bool value = _accessibilityFeatures.disableAnimations;
assert(() {
if (debugSemanticsDisableAnimations != null)
value = debugSemanticsDisableAnimations;
value = debugSemanticsDisableAnimations;
return true;
}());
return value;

View file

@ -929,7 +929,7 @@ class _WidgetsAppState extends State<WidgetsApp> implements WidgetsBindingObserv
}
// Look for language+country match.
if (userLocale.countryCode != null) {
final Locale match = languageAndCountryLocales['${userLocale.languageCode}_${userLocale.countryCode}'];
final Locale match = languageAndCountryLocales['${userLocale.languageCode}_${userLocale.countryCode}'];
if (match != null) {
return match;
}

View file

@ -224,7 +224,7 @@ class ScrollController extends ChangeNotifier {
/// This is used when the environment has changed and the [Scrollable]
/// needs to recreate the [ScrollPosition] object. It is null the first
/// time the [ScrollPosition] is created.
ScrollPosition createScrollPosition(
ScrollPosition createScrollPosition(
ScrollPhysics physics,
ScrollContext context,
ScrollPosition oldPosition,

View file

@ -5,9 +5,7 @@
import 'package:flutter/foundation.dart';
import '../flutter_test_alternative.dart';
enum _TestEnum {
a, b, c, d, e, f, g, h,
}
enum _TestEnum { a, b, c, d, e, f, g, h, }
void main() {
test('BitField control test', () {

View file

@ -1182,10 +1182,10 @@ class _LinePaintPredicate extends _DrawCommandPaintPredicate {
final Offset p1Argument = arguments[0];
final Offset p2Argument = arguments[1];
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) {
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).';
}
}

View file

@ -10,9 +10,9 @@ class TestPaintingContext implements PaintingContext {
final List<Invocation> invocations = <Invocation>[];
@override
void noSuchMethod(Invocation invocation) {
invocations.add(invocation);
}
void noSuchMethod(Invocation invocation) {
invocations.add(invocation);
}
}
void main() {

View file

@ -12,9 +12,9 @@ class TestPaintingContext implements PaintingContext {
final List<Invocation> invocations = <Invocation>[];
@override
void noSuchMethod(Invocation invocation) {
invocations.add(invocation);
}
void noSuchMethod(Invocation invocation) {
invocations.add(invocation);
}
}
void main() {

View file

@ -676,9 +676,9 @@ class _AdbLogReader extends DeviceLogReader {
final List<String> args = <String>['shell', '-x', 'logcat', '-v', 'time'];
final String lastTimestamp = device.lastLogcatTimestamp;
if (lastTimestamp != null)
_timeOrigin = _adbTimestampToDateTime(lastTimestamp);
_timeOrigin = _adbTimestampToDateTime(lastTimestamp);
else
_timeOrigin = null;
_timeOrigin = null;
runCommand(device.adbCommandForDevice(args)).then<void>((Process process) {
_process = process;
const Utf8Decoder decoder = Utf8Decoder(allowMalformed: true);

View file

@ -448,8 +448,9 @@ Future<void> _buildGradleProjectV2(
if (buildInfo.createPatch) {
final AndroidApk package = AndroidApk.fromApk(apkFile);
final Directory baselineDir = fs.directory(buildInfo.baselineDir);
final File baselineApkFile = baselineDir.childFile('${package.versionCode}.apk');if (!baselineApkFile.existsSync())
final Directory baselineDir = fs.directory(buildInfo.baselineDir);
final File baselineApkFile = baselineDir.childFile('${package.versionCode}.apk');
if (!baselineApkFile.existsSync())
throwToolExit('Error: Could not find baseline package ${baselineApkFile.path}.');
printStatus('Found baseline package ${baselineApkFile.path}.');

View file

@ -381,8 +381,8 @@ class RunResult {
return out.toString().trimRight();
}
/// Throws a [ProcessException] with the given `message`.
void throwException(String message) {
/// Throws a [ProcessException] with the given `message`.
void throwException(String message) {
throw ProcessException(
_command.first,
_command.skip(1).toList(),

View file

@ -99,7 +99,7 @@ class Daemon {
_handleRequest,
onDone: () {
if (!_onExitCompleter.isCompleted)
_onExitCompleter.complete(0);
_onExitCompleter.complete(0);
}
);
}

View file

@ -640,7 +640,6 @@ class PubspecYaml {
// place to insert our transitive dependencies.
if (section == Section.dependencies)
endOfDirectDependencies = output.length;
endOfDevDependencies = output.length;
if (section == Section.devDependencies)
endOfDevDependencies = output.length;
section = data.section; // track which section we're now in.

View file

@ -224,7 +224,7 @@ class KernelCompiler {
Uri mainUri;
if (packagesPath != null) {
command.addAll(<String>['--packages', packagesPath]);
mainUri = _PackageUriMapper.findUri(mainPath, packagesPath);
mainUri = _PackageUriMapper.findUri(mainPath, packagesPath);
}
if (outputFilePath != null) {
command.addAll(<String>['--output-dill', outputFilePath]);

View file

@ -68,7 +68,7 @@ class _DefaultDoctorValidatorsProvider implements DoctorValidatorsProvider {
_validators.add(NoIdeValidator());
if (ProxyValidator.shouldShow)
_validators.add(ProxyValidator());
_validators.add(ProxyValidator());
if (deviceManager.canListAnything)
_validators.add(DeviceValidator());

View file

@ -1305,7 +1305,7 @@ class Isolate extends ServiceObjectOwner {
final Map<String, dynamic> result =
await invokeFlutterExtensionRpcRaw('ext.flutter.saveCompilationTrace');
if (result != null && result['value'] is List<dynamic>)
return result['value'].cast<int>();
return result['value'].cast<int>();
return null;
}

View file

@ -45,9 +45,9 @@ void main() {
expect(_proc.stdout, 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')
&& !_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");
}
&& !_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");
}
});
test('writes pid-file', () async {

View file

@ -41,8 +41,8 @@ void main() {
final StringBuffer stdout = StringBuffer();
final StreamSubscription<String> subscription = _flutter.stdout.listen(stdout.writeln);
try {
await _flutter.hotReload();
expect(stdout.toString(), contains('(((((RELOAD WORKED)))))'));
await _flutter.hotReload();
expect(stdout.toString(), contains('(((((RELOAD WORKED)))))'));
} finally {
await subscription.cancel();
}

View file

@ -82,11 +82,11 @@ abstract class FlutterTestDriver {
}) async {
final String flutterBin = fs.path.join(getFlutterRoot(), 'bin', 'flutter');
if (withDebugger)
arguments.add('--start-paused');
arguments.add('--start-paused');
if (_printDebugOutputToStdOut)
arguments.add('--verbose');
arguments.add('--verbose');
if (pidFile != null) {
arguments.addAll(<String>['--pid-file', pidFile.path]);
arguments.addAll(<String>['--pid-file', pidFile.path]);
}
if (script != null) {
arguments.add(script);