Almog
Almog

Reputation: 2837

Can't get text to scroll in Flutter

I'm trying to get my text to scroll in my Flutter app but it's not working I am using a ListView so it should work, but I keep getting the following message - A RenderFlex overflowed by 147 pixels on the bottom. Also attached screenshot

Widget build(BuildContext context) {
    return new Column(
      mainAxisAlignment: MainAxisAlignment.start,
      children: <Widget>[
        new Container(
          padding: const EdgeInsets.only(top: 25.0),
          child: Center(
            child: Text(
              'Shelf Companies Australia',
              style: TextStyle(
                fontSize: 25.0,
                color: Colors.black87,
              ),
            ),
          ),
        ),
        new Container(
          padding: const EdgeInsets.only(top: 10.0),
          child: Center(
            child: Text(
              'Experience and Professionalism',
              style: TextStyle(
                fontSize: 20.0,
                color: Colors.black87,
              ),
            ),
          ),
        ),
        new ListView(
          shrinkWrap: true,
          padding: const EdgeInsets.all(20.0),
          children: <Widget>[
            const Text(
              'Since 1987 Shelf Companies Australia has developed an impressive reputation for providing a quality service, personalised to suit your firm’s requirements. We have tailored our business over the years to ensure your firm receives the type of service expected in today\'s demanding business world. We strive to deliver Instant electronic company registration with ASIC and a complete company register on your desk the next day throughout Australia! While our trusted partner firms ensure all our Trust deeds and Superannuation deeds are completely up to date with all ATO rulings and industry standards. With clients including some of Australia\'s top legal and accounting practices Shelf Companies Australia is the leader in high quality customer service and products within the corporate services arena. With an experienced and knowledgeable team, including ex ASIC employees, we pride ourselves on being able to complete not only your standard Company, Trust and Business setup but those complex secretarial services where other online providers balk Shelf Companies Australia, your corporate services specialists.',
              style: TextStyle(
                fontSize: 18.0,
                color: Colors.black87,
              ),
            ),
          ],
        )
      ],
    );
  }

enter image description here

Upvotes: 0

Views: 257

Answers (1)

anmol.majhail
anmol.majhail

Reputation: 51186

Solution is to wrap your ListView in - Expanded widget.

updated code:

Column(
        mainAxisAlignment: MainAxisAlignment.start,
        children: <Widget>[
          new Container(
            padding: const EdgeInsets.only(top: 25.0),
            child: Center(
              child: Text(
                'Shelf Companies Australia',
                style: TextStyle(
                  fontSize: 25.0,
                  color: Colors.black87,
                ),
              ),
            ),
          ),
          new Container(
            padding: const EdgeInsets.only(top: 10.0),
            child: Center(
              child: Text(
                'Experience and Professionalism',
                style: TextStyle(
                  fontSize: 20.0,
                  color: Colors.black87,
                ),
              ),
            ),
          ),
          Expanded(                         // wrap the ListView
            child: new ListView(
              shrinkWrap: true,
              padding: const EdgeInsets.all(20.0),
              children: <Widget>[
                const Text(
                  'Since 1987 Shelf Companies Australia has developed an impressive reputation for providing a quality service, personalised to suit your firm’s requirements. We have tailored our business over the years to ensure your firm receives the type of service expected in today\'s demanding business world. We strive to deliver Instant electronic company registration with ASIC and a complete company register on your desk the next day throughout Australia! While our trusted partner firms ensure all our Trust deeds and Superannuation deeds are completely up to date with all ATO rulings and industry standards. With clients including some of Australia\'s top legal and accounting practices Shelf Companies Australia is the leader in high quality customer service and products within the corporate services arena. With an experienced and knowledgeable team, including ex ASIC employees, we pride ourselves on being able to complete not only your standard Company, Trust and Business setup but those complex secretarial services where other online providers balk Shelf Companies Australia, your corporate services specialists.',
                  style: TextStyle(
                    fontSize: 18.0,
                    color: Colors.black87,
                  ),
                ),
              ],
            ),
          )
        ],
      ),

Upvotes: 1

Related Questions