diagnostic_ describe_ all_ properties
The public property isn't described by either 'debugFillProperties' or 'debugDescribeChildren'.
Description
#
The analyzer produces this diagnostic when a class that implements
Diagnosticable has a public property that isn't added as a property in
either a debugFillProperties or debugDescribeChildren method.
Example
#
The following code produces this diagnostic because the property p2
isn't added in the debugFillProperties method:
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
class C extends Widget {
bool get p1 => true;
bool get p2 => false;
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(DiagnosticsProperty<bool>('p1', p1));
}
}
Common fixes
#
If there isn't on override of either the debugFillProperties or
debugDescribeChildren method, then add one.
Add a description of the property in the debugFillProperties or
debugDescribeChildren method:
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
class C extends Widget {
bool get p1 => true;
bool get p2 => false;
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(DiagnosticsProperty<bool>('p1', p1));
properties.add(DiagnosticsProperty<bool>('p2', p2));
}
}
Unless stated otherwise, the documentation on this site reflects Dart 3.9.2. Page last updated on 2025-9-4. View source or report an issue.