From 70a15093c622c38202c41daa7fe5e582db99ca08 Mon Sep 17 00:00:00 2001 From: Joshua Miller Date: Mon, 20 Apr 2026 20:11:42 -0400 Subject: [PATCH 1/2] Fixed credit-card spanning --- lib/features/loyalty/widgets/credit_card.dart | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/lib/features/loyalty/widgets/credit_card.dart b/lib/features/loyalty/widgets/credit_card.dart index e2f2afa..ca73d18 100644 --- a/lib/features/loyalty/widgets/credit_card.dart +++ b/lib/features/loyalty/widgets/credit_card.dart @@ -41,23 +41,18 @@ class CreditCard extends StatelessWidget { top: 65, child: SvgPicture.asset("assets/CardChip.svg", width: 60, height: 45,key: Key("cardChip")), ), - Positioned( - left: -4, - right: 0, - top: 120, - child: Container( - padding: const EdgeInsets.symmetric(vertical: 4), - color: Theme.of(context).colorScheme.cardSecondary, - child: Text( - "1234 5678 9012 3456", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 26, - fontWeight: FontWeight.w400, - color: Theme.of(context).colorScheme.fontInverted, - ), - ), - ) + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.center, + child: Text( + "1234 5678 9012 3456", + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 26, + fontWeight: FontWeight.w400, + color: Theme.of(context).colorScheme.fontInverted, + ), + ), ), Positioned( left: 15, @@ -68,14 +63,17 @@ class CreditCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( - child: Text( - (username == null || username!.isEmpty) ? 'John Doe' : username!, - textAlign: TextAlign.left, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 26, - fontWeight: FontWeight.w500, - color: Colors.black87, + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + (username == null || username!.isEmpty) ? 'John Doe' : username!, + textAlign: TextAlign.left, + style: TextStyle( + fontSize: 26, + fontWeight: FontWeight.w500, + color: Colors.black87, + ), ), ), ), From 6e3a59d9f9c7f9c7517b3b0bc927dd49112e84c2 Mon Sep 17 00:00:00 2001 From: Joshua Miller Date: Mon, 20 Apr 2026 20:12:43 -0400 Subject: [PATCH 2/2] Fixed home page spanning issues --- lib/features/home/widgets/header.dart | 101 ++++++++++++++------------ 1 file changed, 55 insertions(+), 46 deletions(-) diff --git a/lib/features/home/widgets/header.dart b/lib/features/home/widgets/header.dart index 63c89fb..ffd8d8d 100644 --- a/lib/features/home/widgets/header.dart +++ b/lib/features/home/widgets/header.dart @@ -17,63 +17,72 @@ class Header extends StatelessWidget { Widget build(BuildContext context) { return Column( children: [ - Text( - controller.username == null - ? 'Welcome!' - : 'Welcome ${controller.username}!', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 28, - color: Theme.of(context).colorScheme.fontInverted, + FittedBox( + fit: BoxFit.scaleDown, + child: Text( + controller.username == null + ? 'Welcome!' + : 'Welcome ${controller.username}!', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 28, + color: Theme.of(context).colorScheme.fontInverted, + ), ), ), + const SizedBox(height: 8), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Flexible( - child: Text( - 'Current balance: \$' - '${controller.balance?["balance"] != null ? (controller.balance!["balance"] as num).toStringAsFixed(2) : 'Loading...'}', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 15, - color: Theme.of(context).colorScheme.fontInverted, + child: FittedBox( + fit: BoxFit.scaleDown, + child: Text( + 'Current balance: \$' + '${controller.balance?["balance"] != null ? (controller.balance!["balance"] as num).toStringAsFixed(2) : 'Loading...'}', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 15, + color: Theme.of(context).colorScheme.fontInverted, + ), ), - overflow: TextOverflow.ellipsis, ), ), const SizedBox(width: 12), - InkWell( - onTap: onNearestLocationTap, - borderRadius: BorderRadius.circular(14), - child: Padding( - padding: - const EdgeInsets.symmetric(horizontal: 8, vertical: 4), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - 'Nearest Location', - style: TextStyle( - fontSize: 15, - fontWeight: FontWeight.bold, - color: Theme.of(context).colorScheme.primary, - decoration: TextDecoration.underline, - decorationColor: - Theme.of(context).colorScheme.primary, - ), - ), - const SizedBox(width: 6), - SvgPicture.asset( - 'assets/locationPin.svg', - width: 24, - height: 24, - colorFilter: ColorFilter.mode( - Theme.of(context).colorScheme.primary, - BlendMode.srcIn, - ), + Flexible( + child: InkWell( + onTap: onNearestLocationTap, + borderRadius: BorderRadius.circular(14), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + child: FittedBox( + fit: BoxFit.scaleDown, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'Nearest Location', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + color: Theme.of(context).colorScheme.primary, + decoration: TextDecoration.underline, + decorationColor: Theme.of(context).colorScheme.primary, + ), + ), + const SizedBox(width: 6), + SvgPicture.asset( + 'assets/locationPin.svg', + width: 24, + height: 24, + colorFilter: ColorFilter.mode( + Theme.of(context).colorScheme.primary, + BlendMode.srcIn, + ), + ), + ], ), - ], + ), ), ), ),