Unverified Commit 2e80bf1d authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

unnessary parenthesis (#14475)

parent ede01a77
......@@ -57,7 +57,7 @@ String expandTemplate(String template, Map<String, String> values) {
if (match.groupCount != 1)
throw new SampleError('bad template keyword $match[0]');
final String keyword = match[1];
return (values[keyword] ?? '');
return values[keyword] ?? '';
});
}
......
......@@ -326,7 +326,7 @@ class _RecipePageState extends State<RecipePage> {
// 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,
......
......@@ -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;
......
......@@ -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 ? <Color>[swatch.shade50, swatch.shade900]
......
......@@ -196,7 +196,7 @@ abstract class DragGestureRecognizer extends OneSequenceGestureRecognizer {
invokeCallback<void>('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];
......
......@@ -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);
......
......@@ -129,7 +129,7 @@ class MaterialPageRoute<T> extends PageRoute<T> {
@override
bool canTransitionFrom(TransitionRoute<dynamic> previousRoute) {
return (previousRoute is MaterialPageRoute || previousRoute is CupertinoPageRoute);
return previousRoute is MaterialPageRoute || previousRoute is CupertinoPageRoute;
}
@override
......
......@@ -324,7 +324,7 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
final List<Widget> footerWidgets = <Widget>[];
if (widget.onRowsPerPageChanged != null) {
final List<Widget> availableRowsPerPage = widget.availableRowsPerPage
.where((int value) => (value <= _rowCount || value == widget.rowsPerPage))
.where((int value) => value <= _rowCount || value == widget.rowsPerPage)
.map<DropdownMenuItem<int>>((int value) {
return new DropdownMenuItem<int>(
value: value,
......
......@@ -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
);
}
......
......@@ -703,7 +703,7 @@ class TextStyle extends Diagnosticable {
if (decoration != null || decorationColor != null || decorationStyle != null) {
final List<String> decorationDescription = <String>[];
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.
......
......@@ -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
......
......@@ -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),
......
......@@ -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.
......
......@@ -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) {
......
......@@ -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
......
......@@ -356,9 +356,9 @@ class WidgetTester extends WidgetController implements HitTestDispatcher, Ticker
if (element.widget.key is ValueKey<dynamic>) {
final ValueKey<dynamic> key = element.widget.key;
String keyLabel;
if ((key is ValueKey<int> ||
key is ValueKey<double> ||
key is ValueKey<bool>)) {
if (key is ValueKey<int> ||
key is ValueKey<double> ||
key is ValueKey<bool>) {
keyLabel = 'const ${element.widget.key.runtimeType}(${key.value})';
} else if (key is ValueKey<String>) {
keyLabel = 'const Key(\'${key.value}\')';
......
......@@ -42,7 +42,7 @@ Future<Null> main(List<String> 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, <FlutterCommand>[
......
......@@ -42,7 +42,7 @@ abstract class AnalyzeBase {
void writeBenchmark(Stopwatch stopwatch, int errorCount, int membersMissingDocumentation) {
const String benchmarkOut = 'analysis_benchmark.json';
final Map<String, dynamic> data = <String, dynamic>{
'time': (stopwatch.elapsedMilliseconds / 1000.0),
'time': stopwatch.elapsedMilliseconds / 1000.0,
'issues': errorCount,
'missingDartDocs': membersMissingDocumentation
};
......
......@@ -82,7 +82,7 @@ List<Plugin> _findPlugins(String directory) {
bool _writeFlutterPluginsList(String directory, List<Plugin> 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<Plugin> plugins) {
}
}
final String currentFlutterPlugins =
(pluginsProperties.existsSync() ? pluginsProperties.readAsStringSync() : null);
pluginsProperties.existsSync() ? pluginsProperties.readAsStringSync() : null;
return currentFlutterPlugins != previousFlutterPlugins;
}
......
......@@ -269,7 +269,7 @@ bool _isServiceMap(Map<String, dynamic> 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<bool> flutterFrameworkPresent() async {
return (await invokeFlutterExtensionRpcRaw('ext.flutter.frameworkPresent') != null);
return await invokeFlutterExtensionRpcRaw('ext.flutter.frameworkPresent') != null;
}
Future<Map<String, dynamic>> uiWindowScheduleFrame() async {
......
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