Skip to content

fix: Add staticContent to SmoothModalSheet and constrain navbar reord… #6482

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

TapItNinja
Copy link

Fixes navbar reordering crash (#6451) due to unbounded height post-#6443:

  • Added staticContent to SmoothModalSheet (@monsieurtanuki’s suggestion).
  • Capped _computeContentSize at 80% screen height.
  • Replaced SmoothAnimatedList with ListView.separated (shrinkWrap: true).

Tested across devices—no errors. Balances #6443’s fix with functionality. Open to reverting #6443 if @g123k prefers!

Fixes #6451, updates #6462.

Simulator.Screen.Recording.-.iPhone.16.-.2025-03-27.at.16.22.45.mp4

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @TapItNinja!

Please

@@ -60,12 +64,17 @@ class ProductFooterSettingsButton extends StatelessWidget {
/// Header + list padding + for each action: height + separator
/// + bottom padding (nav bar)
double _computeContentSize(BuildContext context) {
return SmoothModalSheetHeader.MIN_HEIGHT +
final double availableHeight =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep your comments to the very very very minimum, in general for this PR.

@@ -49,8 +49,12 @@ class ProductFooterSettingsButton extends StatelessWidget {
title: appLocalizations.product_page_action_bar_setting_modal_title,
prefixIndicator: true,
closeButton: true,
expandBody: true,
body: const _ProductActionBarModal(),
expandBody: false, // Avoid unbounded expansion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I were you I wouldn't recode this part with your personal tastes.
The point here is not to change the way it used to be, the point is to put it how it was before.
The only thing you should do here is say "btw it's dynamic content" (or "not static", whatever), with an additional parameter.

@@ -318,6 +318,7 @@ class SmoothModalSheet extends StatelessWidget {
Color? headerForegroundColor,
this.bodyPadding,
this.expandBody = false,
this.staticContent = false, // New parameter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come is it false by default?
Most of the time it's stupid static content like "blablabla click-ok", isn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 💬 To discuss and validate
Development

Successfully merging this pull request may close these issues.

The reordering system in the navbar is broken
2 participants