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

The content are not fitted with the card #15

Closed
SirMajed opened this issue Mar 7, 2021 · 8 comments
Closed

The content are not fitted with the card #15

SirMajed opened this issue Mar 7, 2021 · 8 comments

Comments

@SirMajed
Copy link

SirMajed commented Mar 7, 2021

Hello, So I have this code

return Padding(
      padding: const EdgeInsets.symmetric(horizontal: 15),
      child: ExpansionCard(
        borderRadius: 20,
        background: Image.asset(
          "assets/solar.gif",
          fit: BoxFit.cover,
        ),
        title: Container(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Text(
                "${note.getTitle()}",
                style: TextStyle(
                  fontSize: 30,
                  color: Colors.white,
                  fontFamily: 'BalooBhai',
                ),
              ),
              Text(
                "${note.getReadableDate()}",
                style: TextStyle(
                  fontSize: 20,
                  color: Colors.white,
                  fontFamily: 'BalooBhai',
                ),
              ),
            ],
          ),
        ),
        children: <Widget>[
          Container(
            alignment: Alignment.centerLeft,
            margin: EdgeInsets.symmetric(horizontal: 7, vertical: 10),
            padding: EdgeInsets.symmetric(horizontal: 12),
            child: Text(
              "${note.getDescription()}",
              // overflow: TextOverflow.ellipsis,
              // maxLines: 4,
              style: TextStyle(
                fontSize: 20,
                fontFamily: 'BalooBhai',
                color: Colors.white,
              ),
            ),
          )
        ],
      ),
    );

but the content which is the description are going out of the card. any solutions for that?
Example:
Screenshot_1

@SirMajed
Copy link
Author

SirMajed commented Mar 8, 2021

Any help, please?

@SirMajed
Copy link
Author

SirMajed commented Mar 9, 2021

Still waiting for a response, thank you

@anirudhsharma392
Copy link
Owner

Sorry Ahmed !
But I am running a bit busy this week (due to workload), but I'll definitely try to update the package by this weekend.

@SirMajed
Copy link
Author

SirMajed commented Mar 9, 2021

Sorry Ahmed !
But I am running a bit busy this week (due to workload), but I'll definitely try to update the package by this weekend.

I really appreciate you, thank you so much! I'm waiting. and I hope you do well in your work

@lecuseasar
Copy link

lecuseasar commented Mar 11, 2021

children: [

    Container(
      alignment: Alignment.centerLeft,
      margin: EdgeInsets.symmetric(horizontal: 7, vertical: 10),
      padding: EdgeInsets.symmetric(horizontal: 12),
      child: FittedBox(
        child: Text(
          "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque feugiat libero arcu, vitae tristique quam volutpat sed. Curabitur velit enim, feugiat nec dui ac, pretium mattis lacus. Sed scelerisque ",
          // overflow: TextOverflow.ellipsis,
          // maxLines: 4,
          style: TextStyle(
            fontSize: 20,
            color: Colors.white,
          ),
        ),
      ),
    )
  ],

You can solve the problem if you wrap the Text widget with the FittedBox widget.

[Edit] the same way you can use the Expanded Widget.

@SirMajed
Copy link
Author

way you can

Thank you but it didn't work, the text are so small now and in one line only.
like this:
Screenshot_3

@lecuseasar
Copy link

way you can

Thank you but it didn't work, the text are so small now and in one line only.
like this:
Screenshot_3

I hope this will solve your problem

https://gist.github.com/EmrePbu/fd6c8fb064467a42473ce2313870c2f6

Screen_Recording_20210312-101914.mp4

@SirMajed
Copy link
Author

way you can

Thank you but it didn't work, the text are so small now and in one line only.
like this:
Screenshot_3

I hope this will solve your problem

https://gist.github.com/EmrePbu/fd6c8fb064467a42473ce2313870c2f6

Screen_Recording_20210312-101914.mp4

Thank you so so much that really worked and helped. I also wrapped the SingleChildScrollView with Scrollbar and it looks more awesome now!! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants