Skip to content

Commit d99c01a

Browse files
committed
Remove old nesting logic
Fixes #2
1 parent f57c17e commit d99c01a

1 file changed

Lines changed: 2 additions & 22 deletions

File tree

lib/auto_layout_frame.dart

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ class AutoLayoutFrame extends StatelessWidget {
103103
/// The background color of this frame. Defaults to transparent.
104104
final Color? backgroundColor;
105105

106-
/// Whether this frame is nested inside another [AutoLayoutFrame]
107-
final ValueNotifier<bool?> _isNested = ValueNotifier(null);
108-
109106
/// Creates an [AutoLayoutFrame] widget.
110107
AutoLayoutFrame({
111108
super.key,
@@ -143,18 +140,10 @@ class AutoLayoutFrame extends StatelessWidget {
143140
"height must not be specified when verticalResizing is not fixed");
144141
}
145142

146-
@override
147-
Widget build(final BuildContext context) {
148-
// Check if nested (unless already checked)
149-
_isNested.value ??=
150-
context.findAncestorWidgetOfExactType<AutoLayoutFrame>() != null;
151-
152-
return _buildOuterLayout(context);
153-
}
154-
155143
/// Builds the outer layout of the frame,
156144
/// taking care of resizing behavior and background color.
157-
Widget _buildOuterLayout(final BuildContext context) {
145+
@override
146+
Widget build(final BuildContext context) {
158147
return LayoutBuilder(builder: (context, constraints) {
159148
// debugPrint('Frame constraints:${constraints}');
160149

@@ -179,15 +168,6 @@ class AutoLayoutFrame extends StatelessWidget {
179168
},
180169
child: child);
181170

182-
// If not nested in another [AutoLayoutFrame], wrap in Align to make sure the size is respected
183-
// (source: https://stackoverflow.com/questions/54717748/why-flutter-container-does-not-respects-its-width-and-height-constraints-when-it)
184-
// if (!(_isNested.value ?? false)) {
185-
// return Align(
186-
// alignment: alignSelf,
187-
// child: outerLayout,
188-
// );
189-
// }
190-
//
191171
return outerLayout;
192172
});
193173
}

0 commit comments

Comments
 (0)