createCupertinoColorProperty function

DiagnosticsProperty<Color> createCupertinoColorProperty(
  1. String name,
  2. Color? value, {
  3. bool showName = true,
  4. Object? defaultValue = kNoDefaultValue,
  5. DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine,
  6. DiagnosticLevel level = DiagnosticLevel.info,
})

Creates a diagnostics property for CupertinoDynamicColor.

Implementation

DiagnosticsProperty<Color> createCupertinoColorProperty(
  String name,
  Color? value, {
  bool showName = true,
  Object? defaultValue = kNoDefaultValue,
  DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine,
  DiagnosticLevel level = DiagnosticLevel.info,
}) {
  if (value is CupertinoDynamicColor) {
    return DiagnosticsProperty<CupertinoDynamicColor>(
      name,
      value,
      description: value._debugLabel,
      showName: showName,
      defaultValue: defaultValue,
      style: style,
      level: level,
    );
  } else {
    return ColorProperty(
      name,
      value,
      showName: showName,
      defaultValue: defaultValue,
      style: style,
      level: level,
    );
  }
}