include::../rule.adoc[]

=== Exceptions

The rule does not apply to single-line `if` statements. It does apply, however, to single-line `for`, `while` and `do while` statements.

== Resources

* Dart Docs - https://dart.dev/tools/linter-rules/curly_braces_in_flow_control_structures[Dart Linter rule - curly_braces_in_flow_control_structures]
* Dart Docs - https://dart.dev/language/loops[Dart language - Control flow - Loops]
* Dart Docs - https://dart.dev/language/branches[Dart language - Control flow - Branches]
* Wikipedia - https://en.wikipedia.org/wiki/Dangling_else[Dangling else]

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

=== Message

Statements in a [if|for|while|do] should be enclosed in a block.

=== Highlighting

The body of the [if|for|while|do] statement, including the statement-ending `;`.

'''
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]

endif::env-github,rspecator-view[]
