ObjectFlagProperty<T> constructor Null safety

ObjectFlagProperty<T>(
  1. String name,
  2. T? value,
  3. {String? ifPresent,
  4. String? ifNull,
  5. bool showName = false,
  6. DiagnosticLevel level = DiagnosticLevel.info}
)

Create a diagnostics property for values that can be present (non-null) or absent (null), but for which the exact value's Object.toString representation is not very transparent (e.g. a callback).

The showName and level arguments must not be null. Additionally, at least one of ifPresent and ifNull must not be null.

Implementation

ObjectFlagProperty(
  String name,
  T? value, {
  this.ifPresent,
  String? ifNull,
  bool showName = false,
  DiagnosticLevel level  = DiagnosticLevel.info,
}) : assert(ifPresent != null || ifNull != null),
     assert(showName != null),
     assert(level != null),
     super(
  name,
  value,
  showName: showName,
  ifNull: ifNull,
  level: level,
);