FlagProperty constructor

FlagProperty(String name, { @required bool value, String ifTrue, String ifFalse, bool showName: false, Object defaultValue, 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,
     );