Unverified Commit 15aa3bfd authored by Pierre-Louis's avatar Pierre-Louis Committed by GitHub

turn on `curly_braces_in_flow_control_structures` for develop-facing code (#105113)

parent 3c6719ba
......@@ -98,7 +98,7 @@ linter:
# - conditional_uri_does_not_exist # not yet tested
# - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204
- control_flow_in_finally
# - curly_braces_in_flow_control_structures # not required by flutter style
# - curly_braces_in_flow_control_structures # not required by flutter style, but developer-facing code should have this on
- depend_on_referenced_packages
- deprecated_consistency
# - diagnostic_describe_all_properties # enabled only at the framework level (packages/flutter/lib)
......
......@@ -4,5 +4,7 @@ include: ../../analysis_options.yaml
linter:
rules:
# Developer-facing code
curly_braces_in_flow_control_structures: true
# Samples want to print things pretty often.
avoid_print: false
......@@ -5,5 +5,6 @@ include: ../analysis_options.yaml
linter:
rules:
- curly_braces_in_flow_control_structures # Developer-facing code
- public_member_api_docs # see https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#documentation-dartdocs-javadocs-etc
- no_runtimeType_toString # use objectRuntimeType from package:foundation
......@@ -212,8 +212,9 @@ class InkSparkle extends InteractiveInkFeature {
}
void _handleStatusChanged(AnimationStatus status) {
if (status == AnimationStatus.completed)
if (status == AnimationStatus.completed) {
dispose();
}
}
static const Duration _animationDuration = Duration(milliseconds: 617);
......
......@@ -561,8 +561,9 @@ class _RenderInkFeatures extends RenderProxyBox implements MaterialInkController
@visibleForTesting
List<InkFeature>? get debugInkFeatures {
if (kDebugMode)
if (kDebugMode) {
return _inkFeatures;
}
return null;
}
List<InkFeature>? _inkFeatures;
......
......@@ -56,8 +56,9 @@ class SelectionArea extends StatefulWidget {
class _SelectionAreaState extends State<SelectionArea> {
FocusNode get _effectiveFocusNode {
if (widget.focusNode != null)
if (widget.focusNode != null) {
return widget.focusNode!;
}
_internalNode ??= FocusNode();
return _internalNode!;
}
......
......@@ -3054,10 +3054,11 @@ class _CompositeRenderEditablePainter extends RenderEditablePainter {
final Iterator<RenderEditablePainter> oldPainters = oldDelegate.painters.iterator;
final Iterator<RenderEditablePainter> newPainters = painters.iterator;
while (oldPainters.moveNext() && newPainters.moveNext())
while (oldPainters.moveNext() && newPainters.moveNext()) {
if (newPainters.current.shouldRepaint(oldPainters.current)) {
return true;
}
}
return false;
}
......
......@@ -408,10 +408,11 @@ class MouseTracker extends ChangeNotifier {
// hit-test order.
final PointerExitEvent baseExitEvent = PointerExitEvent.fromMouseEvent(latestEvent);
lastAnnotations.forEach((MouseTrackerAnnotation annotation, Matrix4 transform) {
if (!nextAnnotations.containsKey(annotation))
if (!nextAnnotations.containsKey(annotation)) {
if (annotation.validForMouseTracker && annotation.onExit != null) {
annotation.onExit!(baseExitEvent.transformed(lastAnnotations[annotation]));
}
}
});
// Send enter events to annotations that are not in last but in next, in
......
......@@ -1292,8 +1292,9 @@ class RenderSelectAll extends RenderProxyBox
),
);
set value(SelectionGeometry other) {
if (other == _value)
if (other == _value) {
return;
}
_value = other;
for (final VoidCallback callback in listeners) {
callback();
......
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