forked from firka/flutter
pass style argument to super of IntProperty (#85414)
This commit is contained in:
@@ -2032,6 +2032,7 @@ class IntProperty extends _NumProperty<int> {
|
||||
showName: showName,
|
||||
unit: unit,
|
||||
defaultValue: defaultValue,
|
||||
style: style,
|
||||
level: level,
|
||||
);
|
||||
|
||||
|
||||
@@ -491,7 +491,8 @@ void main() {
|
||||
' │ │\n'
|
||||
' │ └─child node B3: TestTree#00000\n'
|
||||
' │ <leaf node>\n'
|
||||
' │ foo: 42\n'
|
||||
' │ foo:\n'
|
||||
' │ 42\n'
|
||||
' │\n'
|
||||
' └─child node C: TestTree#00000\n'
|
||||
' foo:\n'
|
||||
@@ -2280,4 +2281,22 @@ void main() {
|
||||
expect(json['name'], 'string2');
|
||||
expect(json['value'], 'world');
|
||||
});
|
||||
|
||||
test('IntProperty arguments passed to super', () {
|
||||
final DiagnosticsProperty<num> property = IntProperty(
|
||||
'Example',
|
||||
0,
|
||||
ifNull: 'is null',
|
||||
showName: false,
|
||||
defaultValue: 1,
|
||||
style: DiagnosticsTreeStyle.none,
|
||||
level: DiagnosticLevel.off,
|
||||
);
|
||||
expect(property.value, equals(0));
|
||||
expect(property.ifNull, equals('is null'));
|
||||
expect(property.showName, equals(false));
|
||||
expect(property.defaultValue, equals(1));
|
||||
expect(property.style, equals(DiagnosticsTreeStyle.none));
|
||||
expect(property.level, equals(DiagnosticLevel.off));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user