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