-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with displaying a list inside ShadSheet - Unbounded height error #191
Comments
Fixed in the v0.15.2 |
@nank1ro Thank you for addressing the previous issue. The fix has helped, but a new problem has arisen. When I add a widget in ShadSheet.title and/or ShadSheet.description, the list inside the ShadSheet no longer fills the available space as expected. After reviewing the changes, I believe this issue could be resolved by removing the Flexible widget on lines 372 and 378, or by adding flex: 0 to the Flexible widgets in those lines. This adjustment should allow the list to use the available space correctly. Thank you again for your help, and I appreciate your time looking into this! |
Can you share your code please? |
import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return ShadApp(
home: Scaffold(
body: LayoutBuilder(
builder: (context, constraints) {
return Center(
child: ShadButton.ghost(
onPressed: () {
showShadSheet(
context: context,
side: ShadSheetSide.right,
builder: (_) {
return ShadSheet(
title: const Text('title test'),
description: const Text('description test'),
constraints: BoxConstraints(
maxWidth: constraints.maxWidth * .8,
maxHeight: constraints.maxHeight,
),
child: ListView.builder(
itemBuilder: (_, __) => const Text('test'),
),
);
},
);
},
child: const Text('OPEN'),
),
);
},
),
),
);
}
}
|
Can you try the following branch? shadcn_ui:
git:
url: https://github.com/nank1ro/flutter-shadcn-ui
ref: fix/dialog-child-constraints Let me know if everything seems good now |
Thank you for making the adjustments! I tested the widget with and without title and description, and also with and without actions. Everything is now working perfectly. |
Released the new version, v0.15.3 |
Steps to reproduce
I'm encountering an issue when trying to display a list inside ShadSheet. The following code snippet demonstrates my setup.
Expected results
The list should be displayed correctly within the ShadSheet, occupying the available space and allowing vertical scrolling without any constraint issues.
Actual results
When pressing the "OPEN" button, the following error appears:
"Vertical viewport was given unbounded height."
If I wrap the list in a LayoutBuilder, the error changes to:
"BoxConstraints forces an infinite height."
The ShadSheet fails to display the list properly and seems unable to handle the height constraints required by the ListView.
shadcn_ui version
0.15.1
Platform
MacOS, Android, iOS, Web
Code sample
Code sample
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: