You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following code, I'd like the parameters to be nullable. This means that when I pass null or nothing to the parameters, default values should be used.
@freezed
class User with _$User {
factory User({
@Default(0) int? id,
@Default("") String? userName,
@Default("") String? image,
@Default("") String? token,
}) = _User;
}
Currently, when I implement this, it functions correctly. However, since default values are already provided, the generated code should not include nullable fields.
For example:
User user = User();
user.id // This field should not be nullable, as default values have already been provided.
Basically I don't want to use non nullable operator in UI.
user.id!
The text was updated successfully, but these errors were encountered:
In the following code, I'd like the parameters to be nullable. This means that when I pass null or nothing to the parameters, default values should be used.
Currently, when I implement this, it functions correctly. However, since default values are already provided, the generated code should not include nullable fields.
For example:
Basically I don't want to use non nullable operator in UI.
The text was updated successfully, but these errors were encountered: