pass style argument to super of IntProperty (#85414)

This commit is contained in:
Viren Khatri 2021-07-08 03:21:02 +05:30 committed by GitHub
parent 4d9a3753a4
commit de36e51155
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View file

@ -2032,6 +2032,7 @@ class IntProperty extends _NumProperty<int> {
showName: showName,
unit: unit,
defaultValue: defaultValue,
style: style,
level: level,
);

View file

@ -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));
});
}