diff --git a/lib/components/profile_card.dart b/lib/components/profile_card.dart index 12962c64f..70475a53f 100644 --- a/lib/components/profile_card.dart +++ b/lib/components/profile_card.dart @@ -774,38 +774,40 @@ class ProfileCardHeader extends StatelessWidget { final colorTokens = ArDriveTheme.of(context).themeData.colorTokens; final icon = _buildProfileIcon(state); - return SizedBox( - height: 46, - width: maxWidth, + return ConstrainedBox( + constraints: BoxConstraints(maxWidth: maxWidth), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, + mainAxisSize: MainAxisSize.min, children: [ if (icon != null) icon, - Expanded( + Flexible( child: SizedBox( height: 46, - width: maxWidth, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - primaryName, - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: typography.paragraphLarge( - fontWeight: ArFontWeight.semiBold, - color: colorTokens.textHigh, + Flexible( + child: Text( + primaryName, + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: typography.paragraphLarge( + fontWeight: ArFontWeight.semiBold, + color: colorTokens.textHigh, + ), ), ), - Text( - truncatedWalletAddress, - overflow: TextOverflow.clip, - maxLines: 1, - style: typography.paragraphSmall( - fontWeight: ArFontWeight.book, - color: colorTokens.textLow, + Flexible( + child: Text( + truncatedWalletAddress, + overflow: TextOverflow.clip, + maxLines: 1, + style: typography.paragraphSmall( + fontWeight: ArFontWeight.book, + color: colorTokens.textLow, + ), ), ), ], diff --git a/packages/ardrive_ui/lib/src/components/button.dart b/packages/ardrive_ui/lib/src/components/button.dart index 5ffcf9e33..c909e4b84 100644 --- a/packages/ardrive_ui/lib/src/components/button.dart +++ b/packages/ardrive_ui/lib/src/components/button.dart @@ -381,9 +381,11 @@ class _ArDriveButtonNewState extends State { final buttonH = widget.maxHeight ?? buttonDefaultHeight; if (widget.content != null) { - return SizedBox( - height: buttonH, - width: widget.maxWidth, + return ConstrainedBox( + constraints: BoxConstraints( + maxWidth: widget.maxWidth ?? double.infinity, + maxHeight: buttonH, + ), child: TextButton( onPressed: widget.onPressed, style: style,