Skip to content

Commit 1be8690

Browse files
committed
Lint: const constructors in the text field node and the JSON size test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011WedhUVWdWR5swqZYMuGfP
1 parent c61552a commit 1be8690

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

‎lib/src/api/nodes/text_field_node.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class TextFieldNode extends SceneNode
124124
value: properties.decoration.errorText ?? '',
125125
),
126126
// Shows the error borders without a message when true.
127-
BoolValue(name: 'error', value: false),
127+
const BoolValue(name: 'error', value: false),
128128
];
129129

130130
@override

‎test/node_json_size_test.dart‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,17 @@ void main() {
2121
padding: const EdgeInsetsModel.all(16),
2222
horizontalFit: SizeFit.expanded,
2323
verticalFit: SizeFit.shrinkWrap,
24-
fills: [PaintModel.solid(color: ColorRGB(r: 1, g: 1, b: 1), id: 'p1')],
24+
fills: [
25+
PaintModel.solid(color: const ColorRGB(r: 1, g: 1, b: 1), id: 'p1'),
26+
],
2527
strokes: [
26-
PaintModel.solid(color: ColorRGB(r: 0.9, g: 0.9, b: 0.9), id: 'p4'),
28+
PaintModel.solid(
29+
color: const ColorRGB(r: 0.9, g: 0.9, b: 0.9),
30+
id: 'p4',
31+
),
2732
],
2833
strokeWeight: 1,
29-
cornerRadius: CornerRadius.all(RadiusModel.circular(12)),
34+
cornerRadius: const CornerRadius.all(const RadiusModel.circular(12)),
3035
reactions: [
3136
Reaction(
3237
trigger: TriggerModel(type: TriggerType.click),
@@ -48,14 +53,14 @@ void main() {
4853
fontSize: 16,
4954
lineHeight: LineHeight.auto,
5055
letterSpacing: LetterSpacing.zero,
51-
fontName: FontName(
56+
fontName: const FontName(
5257
family: 'Inter',
5358
style: 'Bold',
5459
weight: FontWeightNumeric.w700,
5560
),
5661
fills: [
5762
PaintModel.solid(
58-
color: ColorRGB(r: 0.1, g: 0.1, b: 0.1),
63+
color: const ColorRGB(r: 0.1, g: 0.1, b: 0.1),
5964
id: 'p2',
6065
),
6166
],
@@ -67,7 +72,10 @@ void main() {
6772
name: 'Divider',
6873
basicBoxLocal: box,
6974
fills: [
70-
PaintModel.solid(color: ColorRGB(r: 0.9, g: 0.9, b: 0.9), id: 'p3'),
75+
PaintModel.solid(
76+
color: const ColorRGB(r: 0.9, g: 0.9, b: 0.9),
77+
id: 'p3',
78+
),
7179
],
7280
),
7381
];

0 commit comments

Comments
 (0)