fix: Remove infinite minimumSize from ElevatedButton/OutlinedButton theme

The theme set minimumSize: Size(double.infinity, 52) which creates
an internal ConstrainedBox(w=Infinity) inside every button. This
crashes when any button is placed in unbounded width context (Row).
Changed to Size(0, 52) — GenexButton's LayoutBuilder handles width.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-11 07:15:20 -08:00
parent 665e494b4a
commit 87d54be200
1 changed files with 2 additions and 2 deletions

View File

@ -107,7 +107,7 @@ class AppTheme {
backgroundColor: AppColors.primary,
foregroundColor: Colors.white,
elevation: 0,
minimumSize: const Size(double.infinity, AppSpacing.buttonHeight),
minimumSize: const Size(0, AppSpacing.buttonHeight),
shape: RoundedRectangleBorder(
borderRadius: AppSpacing.borderRadiusMd,
),
@ -120,7 +120,7 @@ class AppTheme {
style: OutlinedButton.styleFrom(
foregroundColor: AppColors.primary,
side: const BorderSide(color: AppColors.primary, width: 1.5),
minimumSize: const Size(double.infinity, AppSpacing.buttonHeight),
minimumSize: const Size(0, AppSpacing.buttonHeight),
shape: RoundedRectangleBorder(
borderRadius: AppSpacing.borderRadiusMd,
),