# Dart: The getter 'name' isn't defined for the type 'User' / The method 'foo' isn't defined for the class

**Code:** `The getter/method isn't defined for the type` · **Category:** Flutter / Dart · **Seen on:** Flutter

The analyzer cannot find that property or method on the object's static type.

## Meaning

Typical reasons: a typo, the member was renamed in a package upgrade, the variable has type `dynamic`/`Object` and needs a cast, or you are missing an import or extension. Check autocomplete on the type and the package's changelog.

## Common causes

- Typo in the member name
- Property removed/renamed in a newer package version
- Object typed as Object/dynamic needing a cast
- Missing import providing an extension
- Using a widget parameter that doesn't exist in this Flutter version

## Quick fix

1. Check the class definition and spelling
2. Read the package changelog after upgrades
3. Cast: `(obj as User).name` or fix the declared type

## Detailed fix by platform

### Flutter

1. `flutter pub outdated` and check CHANGELOG.md of the package that changed

## How to diagnose

1. **Type** — Static type of the receiver?
2. **Package** — Upgraded recently?
3. **Import** — Extension imported?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/flutter/getter-isnt-defined)
