Skip to content
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

Scaffold95 body behavior differs from Flutter's default Scaffold #27

Open
vaibhavppandey opened this issue Oct 30, 2023 · 1 comment
Open

Comments

@vaibhavppandey
Copy link

Hello,

I've observed that Scaffold95 doesn't mimic Flutter's default Scaffold behavior. Specifically:

Center in body doesn't actually center widgets.
Using double.infinity dimensions (in SizedBox) causes unbounded constraints errors.

Reproduction:

Scaffold95(
  title: 'Flutter95',
  body: Center(child: Text('Test', style: Flutter95.textStyle)),
)

For those familiar with Flutter's Scaffold Widget, this can be confusing.

Suggested Fix:
Consider updating Scaffold95 widget to automatically manage constraints, perhaps by wrapping the body with Expanded widget.

Proposed change in scaffold95.dart

children: <Widget>[
  WindowHeader95(title: title, onClosePressed: onClosePressed),
  const SizedBox(height: 4),
  if (toolbar != null) toolbar!,
  if (toolbar != null) const SizedBox(height: 4),
  Expanded(child: body),  // Wrap the body with an Expanded widget
],

This tweak might enhance its intuitiveness for Flutter developers.

@miquelbeltran
Copy link
Owner

Do you think you can provide a PR with the fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants