If you truly think this variable can be null then you would change the type by adding a ? after it so that the required keyword is not needed, or you can add a default value to the parameter. The @required annotation marks named arguments that must be passed; if not, the analyzer reports a hint.
What is the difference between required and @required Flutter?
If you truly think this variable can be null then you would change the type by adding a ? after it so that the required keyword is not needed, or you can add a default value to the parameter. The @required annotation marks named arguments that must be passed; if not, the analyzer reports a hint.