-
Notifications
You must be signed in to change notification settings - Fork 110
type 'Null' is not a subtype of type 'String' #13
Copy link
Copy link
Open
Description
i'm using a new version of flutter
i get this error: type 'Null' is not a subtype of type 'String'
at the 3rd this line of the code (plan_services.dart):
Plan createPlan(String name) {
final model = _repository.create();
print('my name $name'); //the name in not null here
final plan = Plan.fromModel(model)..name = name; //error here
savePlan(plan);
return plan;
}
after debugging, i got name=null here (plan.dart)
Plan.fromModel(Model model)
: id = model.id,
name = model.data['name'], //the name is null here
tasks = model.data['task']
?.map<Task>((task) => Task.fromModel(task))
?.toList() ??
<Task>[];
can you explain why? thank you
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels