-
Notifications
You must be signed in to change notification settings - Fork 5
Fix iOS Card Text Overlap Issue by Making Font Size Dynamic #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Hi @Laihu08, First off, a huge thank you for your contribution to NWT Reading! We truly appreciate you taking the time to help improve the project. Your effort is very valuable! I've recently added contribution guidelines to the repository, which you might find helpful for future contributions. They cover a range of topics, including how to ensure cross-platform compatibility. Regarding the changes in the To explore a cross-platform approach, I did a little experiment with the FittedBox widget. Here's the change I made to diff --git a/lib/src/plans/presentations/plan_card.dart b/lib/src/plans/presentations/plan_card.dart
index bc3d83b..618cf9f 100644
--- a/lib/src/plans/presentations/plan_card.dart
+++ b/lib/src/plans/presentations/plan_card.dart
@@ -50,12 +50,16 @@ class PlanCard extends ConsumerWidget {
)
]);
- buildYearText() => Text(
- plan.lastDate == null
- ? ''
- : MaterialLocalizations.of(context).formatYear(plan.lastDate!),
- style: TextStyle(
- fontSize: 80, color: Theme.of(context).colorScheme.primary),
+ buildYearText() => FittedBox(
+ fit: BoxFit.scaleDown,
+ alignment: Alignment.topLeft,
+ child: Text(
+ plan.lastDate == null
+ ? ''
+ : MaterialLocalizations.of(context).formatYear(plan.lastDate!),
+ style: TextStyle(
+ fontSize: 80, color: Theme.of(context).colorScheme.primary),
+ ),
);
buildRemainingDaysStatus() => isFinished
@@ -80,7 +84,7 @@ class PlanCard extends ConsumerWidget {
children: [
Positioned(left: 10, top: 10, child: buildNameTitle()),
Positioned(right: 15, bottom: 15, child: buildRemainingDaysStatus()),
- Positioned(left: 20, bottom: 0, child: buildYearText()),
+ Positioned(left: 20, right: 80, bottom: 0, child: buildYearText()),
],
),
);Here are the visual results of this experiment: Initial View: It seems like the FittedBox helps, but we might also need to apply it to the remaining days progress status to ensure it scales correctly in very tight spaces. I haven't had a chance to fully explore this approach yet, but I wanted to share it with you. Do you think using FittedBox might be a viable solution that works across all platforms? I'm very open to your thoughts and suggestions. Thanks again for your contribution, and I look forward to hearing your perspective. |
Laihu08
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback! I’ve applied the requested changes and pushed an update.
Laihu08
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated PlanEdit to support manual target date selection.
|
Hi @Laihu08, thanks so much for working on this patch! It looks like the pull request isn't compiling successfully at the moment. Could you please double-check that you're following our Contribution Guidelines? Let me know when you've had a chance to fix the compilation issues, and we'll be happy to review it! |



🔹 Pull Request Description:
Issue Reference:
This PR addresses [Issue #242](#242) where the year text overlaps with the "days left" indicator on iPhones, particularly when system font sizes are increased.
🔹 Problem Overview
PlanCardwidget displays a large, fixed-size year text (fontSize: 80), which does not scale dynamically.🔹 Solution Implemented
✅ Made Font Size Responsive
fontSize: 80withMediaQueryscaling:✅ Enabled Dynamic Type Support (Accessibility)
✅ Ensured UI Responsiveness
🔹 Testing & Verification
Settings → Accessibility → Display & Text Size → Larger Text).🔹 Why This Solution?
🚀 Next Steps
🎯 Final Notes
🚀 This fix ensures that the card text layout remains stable, readable, and accessible across all iOS devices! 🚀
🔥 Ready for review & merge! 🔥