FlagProperty constructor

FlagProperty(
  1. String name,
  2. {@required bool value,
  3. String ifTrue,
  4. String ifFalse,
  5. bool showName: false,
  6. Object defaultValue,
  7. DiagnosticLevel level: DiagnosticLevel.info}
)

Constructs a FlagProperty with the given descriptions with the specified descriptions.

showName defaults to false as typically ifTrue and ifFalse should be descriptions that make the property name redundant.

The showName and level arguments must not be null.

Implementation

FlagProperty(
  String name, {
  @required bool value,
  this.ifTrue,
  this.ifFalse,
  bool showName = false,
  Object defaultValue,
  DiagnosticLevel level = DiagnosticLevel.info,
}) : assert(showName != null),
     assert(level != null),
     assert(ifTrue != null || ifFalse != null),
     super(
       name,
       value,
       showName: showName,
       defaultValue: defaultValue,
       level: level,
     );