Skip to content

Commit 3e0f67a

Browse files
committed
No children shrink-wrapping #3
- Implement a registry for LayoutModel creation. - Add code docs. - Enable shrink-wrapping for slider, switch and radio button.
1 parent c4d069f commit 3e0f67a

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

lib/src/api/nodes/slider_node.dart

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// All rights reserved. Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE.md file.
44

5-
import 'dart:math';
6-
75
import 'package:equatable/equatable.dart';
86
import 'package:json_annotation/json_annotation.dart';
97

@@ -118,27 +116,6 @@ class SliderNode extends SceneNode with CustomPropertiesMixin {
118116

119117
@override
120118
Map toJson() => _$SliderNodeToJson(this);
121-
122-
@override
123-
BoxConstraintsModel internalConstraints({
124-
required SizeFit horizontalFit,
125-
required SizeFit verticalFit,
126-
}) {
127-
const trackBleedingPixels = 2;
128-
final double thumbSize = properties.thumbRadius * 2;
129-
final double width = properties.showThumb
130-
? thumbSize + (trackBleedingPixels * 2)
131-
: trackBleedingPixels * 2;
132-
final double height = properties.showThumb
133-
? max(thumbSize, properties.trackHeight + trackBleedingPixels)
134-
: properties.trackHeight + trackBleedingPixels;
135-
return super
136-
.internalConstraints(
137-
horizontalFit: horizontalFit,
138-
verticalFit: verticalFit,
139-
)
140-
.union(BoxConstraintsModel(minWidth: width, minHeight: height));
141-
}
142119
}
143120

144121
/// Holds configurable properties of the slider.

0 commit comments

Comments
 (0)