Flutter "argument type not assignable" Error with two identical types
It was a double slash in the import statement that generated this strange error.
LateBoy
Updated on December 21, 2022Comments
-
LateBoy over 1 year
Flutter shows me this error, but the two types are identical.
[CartItem it's just a simple model; there was a conflict since another widget had the same name but I resolved it using "as" in the import statement]
The argument type
List<CartItems>
(where CartItem is defined in /Users/marco/Documenti Locali/shop_app/lib/providers/cart.dart)' can't be assigned to the parameter typeList<CartItems>
(where CartItem is defined in /Users/marco/Documenti Locali/shop_app/lib/providers/cart.dart)'.dartargument_type_not_assignablelist.dart(56, 16): List is defined in /Users/marco/flutter/bin/cache/pkg/sky_engine/lib/core/list.dart
cart.dart(3, 7): CartItem is defined in /Users/marco/Documenti Locali/shop_app/lib/providers/cart.dart
list.dart(56, 16): List is defined in /Users/marco/flutter/bin/cache/pkg/sky_engine/lib/core/list.dart
cart.dart(3, 7): CartItem is defined in /Users/marco/Documenti Locali/shop_app/lib/providers/cart.dart
Peek Problem (⌥F8) No quick fixes available