diff --git a/examples/catalog/bin/sample_page.dart b/examples/catalog/bin/sample_page.dart index 8bd7025469..7f67d24603 100644 --- a/examples/catalog/bin/sample_page.dart +++ b/examples/catalog/bin/sample_page.dart @@ -57,7 +57,7 @@ String expandTemplate(String template, Map values) { if (match.groupCount != 1) throw new SampleError('bad template keyword $match[0]'); final String keyword = match[1]; - return (values[keyword] ?? ''); + return values[keyword] ?? ''; }); } diff --git a/examples/flutter_gallery/lib/demo/pesto_demo.dart b/examples/flutter_gallery/lib/demo/pesto_demo.dart index 5dce4d03d3..3b53440bc5 100644 --- a/examples/flutter_gallery/lib/demo/pesto_demo.dart +++ b/examples/flutter_gallery/lib/demo/pesto_demo.dart @@ -326,7 +326,7 @@ class _RecipePageState extends State { // the edge of the screen, use a slightly different layout. final double appBarHeight = _getAppBarHeight(context); final Size screenSize = MediaQuery.of(context).size; - final bool fullWidth = (screenSize.width < _kRecipePageMaxWidth); + final bool fullWidth = screenSize.width < _kRecipePageMaxWidth; final bool isFavorite = _favoriteRecipes.contains(widget.recipe); return new Scaffold( key: _scaffoldKey, diff --git a/examples/layers/rendering/src/sector_layout.dart b/examples/layers/rendering/src/sector_layout.dart index 3987fe4f6a..2745648408 100644 --- a/examples/layers/rendering/src/sector_layout.dart +++ b/examples/layers/rendering/src/sector_layout.dart @@ -170,7 +170,7 @@ abstract class RenderDecoratedSector extends RenderSector { final Canvas canvas = context.canvas; final Paint paint = new Paint()..color = _decoration.color; final Path path = new Path(); - final double outerRadius = (parentData.radius + deltaRadius); + final double outerRadius = parentData.radius + deltaRadius; final Rect outerBounds = new Rect.fromLTRB(offset.dx-outerRadius, offset.dy-outerRadius, offset.dx+outerRadius, offset.dy+outerRadius); path.arcTo(outerBounds, parentData.theta, deltaTheta, true); final double innerRadius = parentData.radius; diff --git a/examples/layers/widgets/gestures.dart b/examples/layers/widgets/gestures.dart index 3b97be7fd9..af54123e30 100644 --- a/examples/layers/widgets/gestures.dart +++ b/examples/layers/widgets/gestures.dart @@ -27,7 +27,7 @@ class _GesturePainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { - final Offset center = (size.center(Offset.zero) * zoom + offset); + final Offset center = size.center(Offset.zero) * zoom + offset; final double radius = size.width / 2.0 * zoom; final Gradient gradient = new RadialGradient( colors: forward ? [swatch.shade50, swatch.shade900] diff --git a/packages/flutter/lib/src/gestures/monodrag.dart b/packages/flutter/lib/src/gestures/monodrag.dart index f73d9332cf..88fc5d7943 100644 --- a/packages/flutter/lib/src/gestures/monodrag.dart +++ b/packages/flutter/lib/src/gestures/monodrag.dart @@ -196,7 +196,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer { invokeCallback('onCancel', onCancel); return; } - final bool wasAccepted = (_state == _DragState.accepted); + final bool wasAccepted = _state == _DragState.accepted; _state = _DragState.ready; if (wasAccepted && onEnd != null) { final VelocityTracker tracker = _velocityTrackers[pointer]; diff --git a/packages/flutter/lib/src/material/ink_highlight.dart b/packages/flutter/lib/src/material/ink_highlight.dart index 196808b1e8..2c04322d5c 100644 --- a/packages/flutter/lib/src/material/ink_highlight.dart +++ b/packages/flutter/lib/src/material/ink_highlight.dart @@ -121,7 +121,7 @@ class InkHighlight extends InteractiveInkFeature { void paintFeature(Canvas canvas, Matrix4 transform) { final Paint paint = new Paint()..color = color.withAlpha(_alpha.value); final Offset originOffset = MatrixUtils.getAsTranslation(transform); - final Rect rect = (_rectCallback != null ? _rectCallback() : Offset.zero & referenceBox.size); + final Rect rect = _rectCallback != null ? _rectCallback() : Offset.zero & referenceBox.size; if (originOffset == null) { canvas.save(); canvas.transform(transform.storage); diff --git a/packages/flutter/lib/src/material/page.dart b/packages/flutter/lib/src/material/page.dart index 54a2849ff5..59cecb6a0c 100644 --- a/packages/flutter/lib/src/material/page.dart +++ b/packages/flutter/lib/src/material/page.dart @@ -129,7 +129,7 @@ class MaterialPageRoute extends PageRoute { @override bool canTransitionFrom(TransitionRoute previousRoute) { - return (previousRoute is MaterialPageRoute || previousRoute is CupertinoPageRoute); + return previousRoute is MaterialPageRoute || previousRoute is CupertinoPageRoute; } @override diff --git a/packages/flutter/lib/src/material/paginated_data_table.dart b/packages/flutter/lib/src/material/paginated_data_table.dart index 142ec0f1b1..0e5cd07533 100644 --- a/packages/flutter/lib/src/material/paginated_data_table.dart +++ b/packages/flutter/lib/src/material/paginated_data_table.dart @@ -324,7 +324,7 @@ class PaginatedDataTableState extends State { final List footerWidgets = []; if (widget.onRowsPerPageChanged != null) { final List availableRowsPerPage = widget.availableRowsPerPage - .where((int value) => (value <= _rowCount || value == widget.rowsPerPage)) + .where((int value) => value <= _rowCount || value == widget.rowsPerPage) .map>((int value) { return new DropdownMenuItem( value: value, diff --git a/packages/flutter/lib/src/painting/stadium_border.dart b/packages/flutter/lib/src/painting/stadium_border.dart index c4422a9fe3..13d76c01a8 100644 --- a/packages/flutter/lib/src/painting/stadium_border.dart +++ b/packages/flutter/lib/src/painting/stadium_border.dart @@ -363,7 +363,7 @@ class _StadiumToRoundedRectangleBorder extends ShapeBorder { return BorderRadius.lerp( borderRadius, new BorderRadius.all(new Radius.circular(rect.shortestSide / 2.0)), - (1.0 - rectness) + 1.0 - rectness ); } diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart index 251ecd6409..6074c3c4d5 100644 --- a/packages/flutter/lib/src/painting/text_style.dart +++ b/packages/flutter/lib/src/painting/text_style.dart @@ -703,7 +703,7 @@ class TextStyle extends Diagnosticable { if (decoration != null || decorationColor != null || decorationStyle != null) { final List decorationDescription = []; if (decorationStyle != null) - decorationDescription.add(describeEnum((decorationStyle))); + decorationDescription.add(describeEnum(decorationStyle)); // Hide decorationColor from the default text view as it is shown in the // terse decoration summary as well. diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart index 977a10de73..976230fbbf 100644 --- a/packages/flutter/lib/src/rendering/object.dart +++ b/packages/flutter/lib/src/rendering/object.dart @@ -168,7 +168,7 @@ class PaintingContext { } bool get _isRecording { - final bool hasCanvas = (_canvas != null); + final bool hasCanvas = _canvas != null; assert(() { if (hasCanvas) { assert(_currentLayer != null); @@ -2222,7 +2222,7 @@ abstract class RenderObject extends AbstractNode with DiagnosticableTreeMixin im /// any way to update the semantics tree. void markNeedsSemanticsUpdate() { assert(!attached || !owner._debugDoingSemantics); - if ((attached && owner._semanticsOwner == null)) + if (attached && owner._semanticsOwner == null) return; // Dirty the semantics tree starting at `this` until we have reached a diff --git a/packages/flutter/lib/src/rendering/sliver_persistent_header.dart b/packages/flutter/lib/src/rendering/sliver_persistent_header.dart index a831d8e473..b67841305f 100644 --- a/packages/flutter/lib/src/rendering/sliver_persistent_header.dart +++ b/packages/flutter/lib/src/rendering/sliver_persistent_header.dart @@ -515,8 +515,8 @@ abstract class RenderSliverFloatingPinnedPersistentHeader extends RenderSliverFl double updateGeometry() { final double minExtent = this.minExtent; final double maxExtent = this.maxExtent; - final double paintExtent = (maxExtent - _effectiveScrollOffset); - final double layoutExtent = (maxExtent - constraints.scrollOffset); + final double paintExtent = maxExtent - _effectiveScrollOffset; + final double layoutExtent = maxExtent - constraints.scrollOffset; geometry = new SliverGeometry( scrollExtent: maxExtent, paintExtent: paintExtent.clamp(minExtent, constraints.remainingPaintExtent), diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 49f026f0fe..af63ffa0f3 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -2965,7 +2965,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { assert(owner != null); assert(depth != null); assert(!_active); - final bool hadDependencies = ((_dependencies != null && _dependencies.isNotEmpty) || _hadUnsatisfiedDependencies); + final bool hadDependencies = (_dependencies != null && _dependencies.isNotEmpty) || _hadUnsatisfiedDependencies; _active = true; // We unregistered our dependencies in deactivate, but never cleared the list. // Since we're going to be reused, let's clear our list now. diff --git a/packages/flutter/lib/src/widgets/overscroll_indicator.dart b/packages/flutter/lib/src/widgets/overscroll_indicator.dart index 0a102a9bfb..bc1ee99707 100644 --- a/packages/flutter/lib/src/widgets/overscroll_indicator.dart +++ b/packages/flutter/lib/src/widgets/overscroll_indicator.dart @@ -362,7 +362,7 @@ class _GlowController extends ChangeNotifier { _glowOpacityTween.end = math.min(_glowOpacity.value + overscroll / extent * _pullOpacityGlowFactor, _maxOpacity); final double height = math.min(extent, crossExtent * _kWidthToHeightFactor); _glowSizeTween.begin = _glowSize.value; - _glowSizeTween.end = math.max((1.0 - 1.0 / (0.7 * math.sqrt(_pullDistance * height))), _glowSize.value); + _glowSizeTween.end = math.max(1.0 - 1.0 / (0.7 * math.sqrt(_pullDistance * height)), _glowSize.value); _displacementTarget = crossAxisOffset / crossExtent; if (_displacementTarget != _displacement) { if (!_displacementTicker.isTicking) { diff --git a/packages/flutter/lib/src/widgets/performance_overlay.dart b/packages/flutter/lib/src/widgets/performance_overlay.dart index ea0f62c052..c253d2874a 100644 --- a/packages/flutter/lib/src/widgets/performance_overlay.dart +++ b/packages/flutter/lib/src/widgets/performance_overlay.dart @@ -40,12 +40,11 @@ class PerformanceOverlay extends LeafRenderObjectWidget { this.rasterizerThreshold: 0, this.checkerboardRasterCacheImages: false, this.checkerboardOffscreenLayers: false }) - : optionsMask = ( + : optionsMask = 1 << PerformanceOverlayOption.displayRasterizerStatistics.index | 1 << PerformanceOverlayOption.visualizeRasterizerStatistics.index | 1 << PerformanceOverlayOption.displayEngineStatistics.index | - 1 << PerformanceOverlayOption.visualizeEngineStatistics.index - ), + 1 << PerformanceOverlayOption.visualizeEngineStatistics.index, super(key: key); /// The mask is created by shifting 1 by the index of the specific diff --git a/packages/flutter_test/lib/src/widget_tester.dart b/packages/flutter_test/lib/src/widget_tester.dart index c5a9b09a1d..7bc929b808 100644 --- a/packages/flutter_test/lib/src/widget_tester.dart +++ b/packages/flutter_test/lib/src/widget_tester.dart @@ -356,9 +356,9 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker if (element.widget.key is ValueKey) { final ValueKey key = element.widget.key; String keyLabel; - if ((key is ValueKey || - key is ValueKey || - key is ValueKey)) { + if (key is ValueKey || + key is ValueKey || + key is ValueKey) { keyLabel = 'const ${element.widget.key.runtimeType}(${key.value})'; } else if (key is ValueKey) { keyLabel = 'const Key(\'${key.value}\')'; diff --git a/packages/flutter_tools/lib/executable.dart b/packages/flutter_tools/lib/executable.dart index c26443b321..195fc4a02a 100644 --- a/packages/flutter_tools/lib/executable.dart +++ b/packages/flutter_tools/lib/executable.dart @@ -42,7 +42,7 @@ Future main(List args) async { (args.length == 2 && verbose && args.last == 'doctor'); final bool help = args.contains('-h') || args.contains('--help') || (args.isNotEmpty && args.first == 'help') || (args.length == 1 && verbose); - final bool muteCommandLogging = (help || doctor); + final bool muteCommandLogging = help || doctor; final bool verboseHelp = help && verbose; await runner.run(args, [ diff --git a/packages/flutter_tools/lib/src/commands/analyze_base.dart b/packages/flutter_tools/lib/src/commands/analyze_base.dart index 22874b0c4c..0aeb29eb09 100644 --- a/packages/flutter_tools/lib/src/commands/analyze_base.dart +++ b/packages/flutter_tools/lib/src/commands/analyze_base.dart @@ -42,7 +42,7 @@ abstract class AnalyzeBase { void writeBenchmark(Stopwatch stopwatch, int errorCount, int membersMissingDocumentation) { const String benchmarkOut = 'analysis_benchmark.json'; final Map data = { - 'time': (stopwatch.elapsedMilliseconds / 1000.0), + 'time': stopwatch.elapsedMilliseconds / 1000.0, 'issues': errorCount, 'missingDartDocs': membersMissingDocumentation }; diff --git a/packages/flutter_tools/lib/src/plugins.dart b/packages/flutter_tools/lib/src/plugins.dart index 7ad51d667e..0d03f04fc2 100644 --- a/packages/flutter_tools/lib/src/plugins.dart +++ b/packages/flutter_tools/lib/src/plugins.dart @@ -82,7 +82,7 @@ List _findPlugins(String directory) { bool _writeFlutterPluginsList(String directory, List plugins) { final File pluginsProperties = fs.file(fs.path.join(directory, '.flutter-plugins')); final String previousFlutterPlugins = - (pluginsProperties.existsSync() ? pluginsProperties.readAsStringSync() : null); + pluginsProperties.existsSync() ? pluginsProperties.readAsStringSync() : null; final String pluginManifest = plugins.map((Plugin p) => '${p.name}=${escapePath(p.path)}').join('\n'); if (pluginManifest.isNotEmpty) { @@ -93,7 +93,7 @@ bool _writeFlutterPluginsList(String directory, List plugins) { } } final String currentFlutterPlugins = - (pluginsProperties.existsSync() ? pluginsProperties.readAsStringSync() : null); + pluginsProperties.existsSync() ? pluginsProperties.readAsStringSync() : null; return currentFlutterPlugins != previousFlutterPlugins; } diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart index 60d54d8b67..ae7610f16c 100644 --- a/packages/flutter_tools/lib/src/vmservice.dart +++ b/packages/flutter_tools/lib/src/vmservice.dart @@ -269,7 +269,7 @@ bool _isServiceMap(Map m) { return (m != null) && (m['type'] != null); } bool _hasRef(String type) => (type != null) && type.startsWith('@'); -String _stripRef(String type) => (_hasRef(type) ? type.substring(1) : type); +String _stripRef(String type) => _hasRef(type) ? type.substring(1) : type; /// Given a raw response from the service protocol and a [ServiceObjectOwner], /// recursively walk the response and replace values that are service maps with @@ -522,13 +522,13 @@ class ServiceEvent extends ServiceObject { } bool get isPauseEvent { - return (kind == kPauseStart || - kind == kPauseExit || - kind == kPauseBreakpoint || - kind == kPauseInterrupted || - kind == kPauseException || - kind == kPausePostRequest || - kind == kNone); + return kind == kPauseStart || + kind == kPauseExit || + kind == kPauseBreakpoint || + kind == kPauseInterrupted || + kind == kPauseException || + kind == kPausePostRequest || + kind == kNone; } } @@ -1192,7 +1192,7 @@ class Isolate extends ServiceObjectOwner { } Future flutterFrameworkPresent() async { - return (await invokeFlutterExtensionRpcRaw('ext.flutter.frameworkPresent') != null); + return await invokeFlutterExtensionRpcRaw('ext.flutter.frameworkPresent') != null; } Future> uiWindowScheduleFrame() async {