How to use Expandable with flutter?

1

I want to have a expansion behaviour in my app. But on expansion, it throws a RenderOverFlow error.

Here is my code

ExpandableNotifier(
      child: Container(
        height: 400.0,
        width: double.infinity,
        alignment: Alignment.bottomCenter,
        padding: EdgeInsets.all(15.0),
        margin: EdgeInsets.all(8.0),
        decoration: BoxDecoration(
          color: Color(0xFFFFA5A4),
          image: DecorationImage(
            fit: BoxFit.cover,
            image: AssetImage('assets/images/illus.png'),
          ),
          borderRadius: BorderRadius.circular(15.0),
        ),
        child: Align(
          alignment: Alignment.bottomCenter,
          child: ScrollOnExpand(
            child: Container(
              height: 300.0,
              width: double.infinity,
              padding: EdgeInsets.all(10.0),
              margin:
                  EdgeInsets.only(top: 8.0, bottom: 0, left: 8.0, right: 8.0),
              decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(15.0),
                  color: Color(0xFFFFFFFF)),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Text(
                        'Text',
                        style: TextStyle(
                          fontSize: 15,
                          color: Color(0xFFFFA5A4),
                        ),
                      ),
                      Row(
                        children: [
                          MoreWidgets();
                        //removed bracktes to make ques cleaner
                  
                  ExpandablePanel(
                    header: Padding(
                      padding: const EdgeInsets.symmetric(
                          horizontal: 0, vertical: 0.0)
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            "Title",
                            overflow: TextOverflow.ellipsis,
                           
                              //removed bracktes to make ques cleaner
                    collapsed: Padding(
                      padding: const EdgeInsets.all(8.0),
                      child: Text(
                        "Some more text",
                        overflow: TextOverflow.ellipsis,
                        maxLines: 3,
                        
                         //removed bracktes to make ques cleaner
                    expanded: Padding(
                      padding: const EdgeInsets.all(8.0),
                      child: Text(
                        "very big text",
                        overflow: TextOverflow.ellipsis,
                        maxLines: 90,
                        )
                           //removed bracktes to make ques cleaner
                 SomeMoreWidgets();
                     //removed bracktes to make ques cleaner

I tried wrapping my text in a SingleChildScrollView, but it didn't help.

I've tried everything, but it just doesn't work.I tried reading the documentation, but it was not useful.i couldn't find anything useful in it.

Please help, I'm stuck on this for 2 days.

flutter
dart
flutter-layout
asked on Stack Overflow Dec 27, 2020 by Rohan • edited Dec 29, 2020 by Soni Sol

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0