> ## 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 Prefix Increment

The `++` operator in Dart is a unary operator that increments the value of an assignable expression by one. Because Dart numbers are immutable, the operator does not mutate the object in memory. Instead, it evaluates the addition and reassigns (rebinds) the reference to point to the newly created value. It exists in two distinct syntactic forms—prefix and postfix—which dictate whether the expression yields the original or the incremented value. Under the hood, the `++` operator acts as syntactic sugar for the assignment `x = x + 1`.

**Prefix Increment (`++var`)**
The prefix form increments the operand and completes the reassignment *before* yielding the result. The expression resolves to the newly incremented value.

```dart theme={"dark"}
int prefixVar = 10;
int result = ++prefixVar; 

// Evaluation sequence:
// 1. The right-hand expression (++prefixVar) is evaluated:
//    a. prefixVar is incremented and reassigned to 11.
//    b. The expression yields the new value (11).
// 2. result is assigned the yielded value (11).
```

**Postfix Increment (`var++`)**
The postfix form yields the operand's original value *before* completing the increment and reassignment. The expression resolves to the un-incremented value, even though the underlying variable has been updated.

```dart theme={"dark"}
int postfixVar = 10;
int result = postfixVar++; 

// Evaluation sequence:
// 1. The right-hand expression (postfixVar++) is evaluated:
//    a. The original value of postfixVar (10) is cached.
//    b. postfixVar is incremented and reassigned to 11.
//    c. The expression yields the cached original value (10).
// 2. result is assigned the yielded value (10).
```

**Technical Constraints and Behavior**

* **Assignable Expressions:** The operand must be a valid assignable expression. This includes standalone mutable variable identifiers, property accesses (e.g., `myObject.value++`), and index expressions (e.g., `myList[0]++`). The operator cannot be applied to literals (e.g., `5++` throws a compilation error), `final` variables, or `const` variables.
* **Type Requirements and Overloading:** The operand is not restricted to built-in numeric types (`int` or `double`). Because the operation `x++` or `++x` is evaluated as `x = x + 1`, the operator can be applied to any custom class or type that implements `operator +` (accepting an `int` or `num` argument), provided the return type of that operator can be assigned back to the original assignable expression. When applied to a built-in `double`, the operator effectively adds `1.0` to the floating-point value.
* **Underlying Equivalence:** While functionally equivalent to the standard assignment `x = x + 1` or the compound assignment `x += 1`, the `++` operator is parsed and evaluated as a single unary expression.

<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>
