Skip to content

Commit

Permalink
Add max width for action buttons on main pages
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsreichardt committed Jan 19, 2024
1 parent b20ddc7 commit e72b59b
Showing 1 changed file with 50 additions and 47 deletions.
97 changes: 50 additions & 47 deletions lib/sharezone_widgets/lib/src/widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -495,55 +495,58 @@ class CardListTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
final hasLeading = leading != null;
return SizedBox(
width: MediaQuery.of(context).size.width,
child: CustomCard(
onTap: onTap,
padding: const EdgeInsets.all(12),
child: Row(
children: <Widget>[
if (hasLeading) ...[
IconTheme(
data: Theme.of(context)
.iconTheme
.copyWith(color: Colors.grey[600]),
child: leading!,
),
const SizedBox(width: 16)
],
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
DefaultTextStyle(
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
fontFamily: rubik,
color: Theme.of(context).isDarkTheme
? Colors.white
: Colors.black),
child: centerTitle
? Padding(
padding:
EdgeInsets.only(right: hasLeading ? 30 : 0),
child: Center(child: title),
)
: title!,
),
if (subtitle != null)
return MaxWidthConstraintBox(
maxWidth: 550,
child: SizedBox(
width: MediaQuery.of(context).size.width,
child: CustomCard(
onTap: onTap,
padding: const EdgeInsets.all(12),
child: Row(
children: <Widget>[
if (hasLeading) ...[
IconTheme(
data: Theme.of(context)
.iconTheme
.copyWith(color: Colors.grey[600]),
child: leading!,
),
const SizedBox(width: 16)
],
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
DefaultTextStyle(
style: TextStyle(
color: Colors.grey.withOpacity(0.95),
fontSize: 12,
fontFamily: rubik,
),
child: subtitle!,
)
],
),
)
],
fontSize: 16,
fontWeight: FontWeight.w500,
fontFamily: rubik,
color: Theme.of(context).isDarkTheme
? Colors.white
: Colors.black),
child: centerTitle
? Padding(
padding:
EdgeInsets.only(right: hasLeading ? 30 : 0),
child: Center(child: title),
)
: title!,
),
if (subtitle != null)
DefaultTextStyle(
style: TextStyle(
color: Colors.grey.withOpacity(0.95),
fontSize: 12,
fontFamily: rubik,
),
child: subtitle!,
)
],
),
)
],
),
),
),
);
Expand Down

0 comments on commit e72b59b

Please sign in to comment.