# Dart: The argument type 'String?' can't be assigned to the parameter type 'String'

**Code:** `The argument type can't be assigned to the parameter type` · **Category:** Flutter / Dart · **Seen on:** Flutter

You passed a value whose type does not match what the function parameter requires.

## Meaning

Most often a nullable value (`String?`) is passed where a non-nullable type is expected, or `int`/`double`/`String` are mixed. Convert (`int.parse`, `.toString()`), handle null (`?? ''`), or change the parameter type.

## Common causes

- Nullable value passed to non-nullable parameter
- int vs double mismatch
- String vs num
- Wrong generic type (List<dynamic> vs List<String>)
- Passing a Future where a value is expected

## Quick fix

1. Provide a default: `value ?? ''`
2. Convert the type explicitly
3. Fix the function signature to accept the type

## Detailed fix by platform

### Dart

1. `Text(user.name ?? 'Unknown')` for `String?` values

## How to diagnose

1. **Types** — Argument vs parameter?
2. **Null** — Nullable involved?
3. **Conversion** — Needed?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/flutter/argument-type-cant-be-assigned)
