refactor(chat): hoist shared MeasureSize wrapper out of bottom-bar branches

Both the fullscreen-overlay and BlurredContainer branches wrapped
bottomBarContent in an identical MeasureSize+onChange closure; build it
once and reuse. No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tommy Chow 2026-06-13 13:08:06 -07:00
parent 77b0126e35
commit 2fa1650ec2

View file

@ -394,6 +394,13 @@ class ChatBottomBar extends StatelessWidget {
final needsBottomPadding =
!chatStore.assetsStore.showEmoteMenu && !isHorizontalLandscape;
// Measured once here; the list pads itself by this height so the bar
// never overlaps messages. Shared by both container branches below.
final measuredBar = MeasureSize(
onChange: (size) => chatStore.setBottomBarHeight(size.height),
child: bottomBarContent,
);
return isFullscreenOverlay
? Padding(
padding: EdgeInsets.only(
@ -401,11 +408,7 @@ class ChatBottomBar extends StatelessWidget {
? MediaQuery.of(context).padding.bottom
: 0,
),
child: MeasureSize(
onChange: (size) =>
chatStore.setBottomBarHeight(size.height),
child: bottomBarContent,
),
child: measuredBar,
)
: BlurredContainer(
gradientDirection: GradientDirection.down,
@ -414,11 +417,7 @@ class ChatBottomBar extends StatelessWidget {
? MediaQuery.of(context).padding.bottom
: 0,
),
child: MeasureSize(
onChange: (size) =>
chatStore.setBottomBarHeight(size.height),
child: bottomBarContent,
),
child: measuredBar,
);
},
);