PercentProperty constructor Null safety

PercentProperty(
  1. String name,
  2. double? fraction,
  3. {String? ifNull,
  4. bool showName = true,
  5. String? tooltip,
  6. String? unit,
  7. DiagnosticLevel level = DiagnosticLevel.info}
)

Create a diagnostics property for doubles that represent percentages or fractions.

Setting showName to false is often reasonable for PercentProperty objects, as the fact that the property is shown as a percentage tends to be sufficient to disambiguate its meaning.

The showName and level arguments must not be null.

Implementation

PercentProperty(
  String name,
  double? fraction, {
  String? ifNull,
  bool showName = true,
  String? tooltip,
  String? unit,
  DiagnosticLevel level  = DiagnosticLevel.info,
}) : assert(showName != null),
     assert(level != null),
     super(
  name,
  fraction,
  ifNull: ifNull,
  showName: showName,
  tooltip: tooltip,
  unit: unit,
  level: level,
);