Skip to content

Commit

Permalink
Deprecate @nullable annotation (#1309)
Browse files Browse the repository at this point in the history
Legacy Dart is already unsupported and the annotation already causes an error whenever built_value can detect it, *but* it's possible to put this annotation into a completely unrelated place and it will just stay there doing nothing. So the least we can do is to deprecate this annotation.
  • Loading branch information
oprypin authored Oct 3, 2024
1 parent 569aedd commit a798a62
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions built_value/lib/built_value.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ class BuiltValue {
this.defaultSerialize = true});
}

/// Nullable annotation for nullable Built Value fields in legacy code.
/// Annotation that was used to mark nullable Built Value fields.
///
/// In null safe code, instead make the field type nullable with `?`.
/// Now it does nothing or causes an error whenever used.
@Deprecated('Add `?` to the field type to make it nullable instead')
const String nullable = 'nullable';

/// Optionally, annotate a Built Value field with this to specify settings.
Expand Down

0 comments on commit a798a62

Please sign in to comment.