No default value for List type property in the generated RealmModel?

@RealmModel()
class _MyModel {
  @PrimaryKey()
  late int id;
  late List<String> tagList;
}

For that model, the generated model’s constructor has empty list as default value for tagList. How to disable this behavior? I want tagList property to be required. And what’s the reason you guys set default value to List type?

Lists always exist in Realm, so the ctor argument is only there as a convenience. If you’d prefer to customize that, one option would be to create a factory constructor in an extension class.

For models with many properties, I frequently forgot to provide values for list. This lead to subtle bugs. It would be more convenience if all properties are required as constructor arguments. And if we still want default values, we should be able to annotate like…

@Default([])
late List<String> tagList;