The argument type can't be assigned to the parameter type Flutter / Dart Origin: On your device OSI layer 7 · Application Last updated 4 Nov 2026

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

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

Exact message you may see The argument type 'String?' can't be assigned to the parameter type 'String'The argument type 'int' can't be assigned to the parameter type 'double'A value of type 'int?' can't be assigned to a variable of type 'int'The argument type 'Future<String>' can't be assigned to the parameter type 'String'
Seen on: Flutter

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?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Bad state: No element — Dart: Bad state: No element — .first, .last or .single on an empty list (Flutter / Dart)Bad state: No elementBad state: Stream has already been listened to — Dart: Bad state: Stream has already been listened to (Flutter / Dart)Bad state: Stream has…Cannot convert value of type — Swift: Cannot convert value of type 'X' to expected argument type 'Y' (iOS)Cannot convert value …Error: Couldn't resolve the package — Dart: Error: Couldn't resolve the package 'x' in 'package:x/x.dart' (Flutter / Dart)Error: Couldn't resol…FormatException: Unexpected character — Dart: FormatException: Unexpected character (at character 1) <!DOCTYPE html> — jsonDecode of an HTML page (Flutter / Dart)FormatException: Unex…Illegal argument in isolate message: object is unsendable — Dart: Invalid argument(s): Illegal argument in isolate message: object is unsendable - Library:'dart:async' Class: _Future@4048458 (Flutter / Dart)Illegal argument in i…LateInitializationError: Field has not been initialized — Dart: LateInitializationError: Field 'controller' has not been initialized (Flutter / Dart)LateInitializationErr…Non-nullable instance field must be initialized — Dart: Non-nullable instance field 'name' must be initialized. Try adding an initializer expression, or a generative constructor that initializes it, or mark it 'late' (Flutter / Dart)Non-nullable instance…The argum…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.