Skip to content
Boring Doc
BreakingHigh impactOfficial migration guidesince 3.32.0landed 3.31.0-0.1.pre

Underdamped spring formula changed

Framework · Official source

The formula for `SpringDescription` changed to correct an earlier error, affecting underdamped springs (damping ratio less than 1) with mass values other than 1. Springs created prior to this change may exhibit different bouncing behaviors after upgrading.

Who is affected
Applications and packages relying on the previous behaviour or signature. Code that uses SpringDescription, SpringDescription.withDampingRatio.
Practical impact
Behaviour or API differences that can break builds or change runtime behaviour.
What action should I take?
Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.

Before and after (from the official guide)

dart+3−3
Before
1 const spring = SpringDescription(
2− mass: 20.0,
3− stiffness: 10,
4− damping: 1,
5 );
After
1 const spring = SpringDescription(
2+ mass: 1.0,
3+ stiffness: 100.499375,
4+ damping: 20,
5 );
Raw before / after
const spring = SpringDescription(
  mass: 20.0,
  stiffness: 10,
  damping: 1,
);
const spring = SpringDescription(
  mass: 1.0,
  stiffness: 100.499375,
  damping: 20,
);
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)

Migration is necessary only for springs with damping ratios less than 1 and masses other than 1.

To restore previous animation behavior, update your spring parameters accordingly. You can calculate the required parameter adjustments using the provided [JSFiddle for migration][]. Detailed formulas and explanations follow in the next sections.

Default constructor

If the SpringDescription was built with the default constructor with mass m, stiffness k, and damping c, then it should be changed with the following formula:

new_m = 1
new_c = c * m
new_k = (4 * (k / m) - (c / m)^2 + (c * m)^2) / 4

Code before migration:

const spring = SpringDescription(
  mass: 20.0,
  stiffness: 10,
  damping: 1,
);

Code after migration:

const spring = SpringDescription(
  mass: 1.0,
  stiffness: 100.499375,
  damping: 20,
);

.withDampingRatio constructor

If the SpringDescription was built with the .withDampingRatio constructor with mass m, stiffness k, and ratio z, then first calculate damping:

c = z * 2 * sqrt(m * k)

Then apply the formula above. Optionally, you might convert the result back to damping ratio with:

new_z = new_c / 2 / sqrt(new_m * new_k)

Code before migration:

const spring = SpringDescription.withDampingRatio(
  mass: 5.0,
  stiffness: 6.0,
  damping: 0.03,
);

Code after migration:

const spring = SpringDescription.withDampingRatio(
  mass: 1,
  stiffness: 1.87392,
  ratio: 0.60017287468545,
);
Migration assistantAI-generated · grounded in cited sources
AI explanations are not configured
Set AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.
Official migration guide·Verified classification (95%)

Listed in the official breaking-changes index (docs.flutter.dev/release/breaking-changes).

An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.

Source commit
b3045439b7c0
Source last updated
Oct 21, 2026
Last synchronized
Oct 21, 2026
Publication status
published
Publication history
  • Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI explanationAI-generated · grounded in cited sources
AI explanations are not configured
Set AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.
Was this useful?