> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dart Break Statement

The `break` statement is an unconditional control flow construct used to prematurely terminate the execution of the innermost enclosing loop (`for`, `while`, `do-while`) or `switch` statement. Upon execution, control is immediately transferred to the statement strictly following the terminated control structure, bypassing any remaining iterations or `case` blocks.

## Syntax

```dart theme={"dark"}
// Unlabeled break
break;

// Labeled break
break label_name;
```

## Mechanics

Dart supports two variations of the `break` statement: unlabeled and labeled.

### Unlabeled Break

When an unlabeled `break` is encountered, the Dart runtime halts the current iteration of the immediate enclosing loop and prevents any subsequent iterations. The loop's condition is not evaluated again.

```dart theme={"dark"}
for (int i = 0; i < 5; i++) {
  if (i == 3) {
    break; // Immediately terminates the 'for' loop
  }
  print(i); 
}
// Control transfers here after the break
```

In a `switch` statement, `break` prevents fall-through by terminating the `switch` block after a matching `case` is executed. *(Note: In Dart 3.0 and later, `break` is no longer strictly required at the end of non-empty `case` clauses, but it remains valid syntax).*

```dart theme={"dark"}
int value = 1;

switch (value) {
  case 1:
    print('One');
    break; // Terminates the switch statement
  case 2:
    print('Two');
}
```

### Labeled Break

Dart allows loops to be prefixed with an identifier followed by a colon, creating a **label**. A labeled `break` statement explicitly specifies which enclosing loop to terminate. This is strictly utilized within nested loop architectures to bypass the default "innermost-only" termination rule, allowing a deeply nested block to terminate an outer loop.

```dart theme={"dark"}
outerLoop: // Label declaration
for (int i = 0; i < 3; i++) {
  for (int j = 0; j < 3; j++) {
    if (i == 1 && j == 1) {
      break outerLoop; // Terminates the loop identified by 'outerLoop'
    }
    print('i: $i, j: $j');
  }
}
// Control transfers here after 'break outerLoop'
```

## Execution Rules

* A `break` statement must be lexically enclosed by a loop or `switch` statement.
* A labeled `break` must reference a valid, enclosing label within the same function scope. It cannot be used to transfer control to arbitrary labels outside its lexical hierarchy (it is not a `goto` statement).
* Executing a `break` does not execute the loop's update statement (e.g., the `i++` in a `for` loop) for the terminated iteration.

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor Dart Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
