Skip to content
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

Fixed the right overflow of small cards in the cards section. #199

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/ui_components/cards/All Cards/blog_card/card_2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ class SecondCard extends StatelessWidget {
children: [
Container(
padding: const EdgeInsets.only(left: 5, top: 2, bottom: 2),
height: (MediaQuery.of(context).size.width / 2.4) * 0.83,
height: (MediaQuery.of(context).size.width / 2.4) * 0.95,
width: MediaQuery.of(context).size.width -
MediaQuery.of(context).size.width / 2.4 -
8,
child: const Column(
32,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand Down Expand Up @@ -66,7 +66,7 @@ class SecondCard extends StatelessWidget {
),
),
SizedBox(
width: MediaQuery.of(context).size.width / 2.4,
width: (MediaQuery.of(context).size.width / 2.4) * 0.95,
child: Image.asset(
'assets/card_image/cardo.png',
fit: BoxFit.cover,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ class SixthCard extends StatelessWidget {
Container(
color: Colors.black,
padding: const EdgeInsets.only(left: 5, top: 2, bottom: 2),
height: (MediaQuery.of(context).size.width / 2.4) * 0.83,
height: (MediaQuery.of(context).size.width / 2.4) * 0.95,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cards are still overflowing in my phone . Please fix it .

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image
image
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After fixing these let me know

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashdude1401 Sir, I've implemented the changed for each specific card. Have confirmed it by running the app on smaller sized emulators. Please have a review!!

Also, I've implemented the const wherever possible. However, im using the latest version of flutter, and as per it, there have been modifications made by the dart and flutter in its new versions, which does not allow const in specific places, like in line 17 above as you mentioned. Thanks!

Screenshot_20230526_110707
Screenshot_20230526_110714
Screenshot_20230526_110721
Screenshot_20230526_110659
Screenshot_20230526_110648
Screenshot_20230526_104308

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaivsh I have checked again it is still overflowing in phone, you have make make it responsive for all the screen .All phone screen are not covered by emulator I think mine is one of them .My screen screen size is 6.8 inch. Some screen you have to handle separately and secondly , I on the latest version of flutter and dart , it is still showing me the suggestion of adding const at line 17 .So, please these issue again and let me know once you are done.

width: MediaQuery.of(context).size.width -
MediaQuery.of(context).size.width / 2.4 -
8,
child: const Column(
32,
child: Column(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use const before Column as there is not dynamic data associated with it .

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello Sir, I've modified the PR and implemented the const wherever possible. However, im using the latest version of flutter, and as per it, there have been modifications made by the dart and flutter in its new versions, which does not allow const in specific places, like in line 17-18 above as you mentioned. Thank you!

crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand Down Expand Up @@ -68,6 +68,7 @@ class SixthCard extends StatelessWidget {
),
SizedBox(
width: MediaQuery.of(context).size.width / 2.4,
height: (MediaQuery.of(context).size.width / 2.4) * 0.95,
child: Image.asset(
'assets/card_image/cardo.png',
fit: BoxFit.cover,
Expand Down