Skip to content

Commit

Permalink
fix alignment and button size
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocarvalhodev committed Dec 12, 2024
1 parent 9f3ba28 commit 142d903
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.
42 changes: 22 additions & 20 deletions lib/components/profile_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
),
),
],
Expand Down
8 changes: 5 additions & 3 deletions packages/ardrive_ui/lib/src/components/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,11 @@ class _ArDriveButtonNewState extends State<ArDriveButtonNew> {
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,
Expand Down

0 comments on commit 142d903

Please sign in to comment.