0

Hi this is my first Flutter app, and I am having a small issue getting my container to be scrollable.

I am wondering what I would need to add to make it possible?

    double c_width = MediaQuery.of(context).size.width;

return new Container (
  padding: const EdgeInsets.all(16.0),
  width: c_width,
  child: new Column (
    children: <Widget>[
            Row(
            children: <Widget>[
              new Text('DRN',style: TextStyle(color: Colors.black, fontSize: 20.0),),
               new Text('1', style: TextStyle(color: Colors.red, fontSize: 20.0),),
               new Text(': The Sound Of Indie',style: TextStyle(color: Colors.black, fontSize: 20.0),)

            ],
      ),
      Column (
        children: <Widget>[
          Padding(
            padding: EdgeInsets.all(8.0),
            child: Text ("When it comes to listening to music in this digital world there are so many ways to do it, either via YouTube, iTunes, Spotify, Google Music or the old fashioned Radio, where you get the commercial artists forced at you over and over again.", textAlign: TextAlign.left),
          ),
          Padding(
            padding: EdgeInsets.all(8.0),
            child: Text ("DRN1 is different. We are proud to show real talent, and artists that listeners may never of heard before but will quickly fall in love with. Sure, the music might not get publicised by major labels, and may not have the budget to get old styled radio stations playing. But, why should music come down to how much money you can throw at an artist just to hope that the listeners will end up buying said track or album?", textAlign: TextAlign.left),
          ),
      ],
      ),
      Row(
      children: <Widget>[
            new Text('The Sound of ',style: TextStyle(color: Colors.black, fontSize: 20.0),),
            new Text('Life', style: TextStyle(color: Colors.red, fontSize: 20.0),),

          ],
      ),
      Column (
          children: <Widget>[
            Padding(
             padding: EdgeInsets.all(8.0),
                  child: Text ("When it comes to listening to music in this digital world there are so many ways to do it, either via YouTube, iTunes, Spotify, Google Music or the old fashioned Radio, where you get the commercial artists forced at you over and over again.", textAlign: TextAlign.left),
      ),
              Padding(
                  padding: EdgeInsets.all(8.0),
                    child: Text ("DRN1 is different. We are proud to show real talent, and artists that listeners may never of heard before but will quickly fall in love with. Sure, the music might not get publicised by major labels, and may not have the budget to get old styled radio stations playing. But, why should music come down to how much money you can throw at an artist just to hope that the listeners will end up buying said track or album?", textAlign: TextAlign.left),
              ),
          ],
      ),
      Row(
        children: <Widget>[
          new Text('The Sound of ',style: TextStyle(color: Colors.black, fontSize: 20.0),),
          new Text('Life', style: TextStyle(color: Colors.red, fontSize: 20.0),),

        ],
      ),
      Column (
        children: <Widget>[
          Padding(
            padding: EdgeInsets.all(8.0),
            child: Text ("When it comes to listening to music in this digital world there are so many ways to do it, either via YouTube, iTunes, Spotify, Google Music or the old fashioned Radio, where you get the commercial artists forced at you over and over again.", textAlign: TextAlign.left),
          ),
          Padding(
            padding: EdgeInsets.all(8.0),
            child: Text ("DRN1 is different. We are proud to show real talent, and artists that listeners may never of heard before but will quickly fall in love with. Sure, the music might not get publicised by major labels, and may not have the budget to get old styled radio stations playing. But, why should music come down to how much money you can throw at an artist just to hope that the listeners will end up buying said track or album?", textAlign: TextAlign.left),
          ),
        ],
      ),

    ],
  ),
);
RussellHarrower
  • 6,470
  • 21
  • 102
  • 204

2 Answers2

0

You can nest your container inside ListView or SingleChildScrollView

Harsh Jatinder
  • 833
  • 9
  • 15
0

You can use the SingleChildScrollView widget:

return new Container (
  padding: const EdgeInsets.all(16.0),
  width: c_width,
  child: new SingleChildScrollView(
    child: new Column (
      children: <Widget>[
            Row(
            children: <Widget>[
              new Text('DRN',style: TextStyle(color: Colors.black, fontSize: 20.0),),
               new Text('1', style: TextStyle(color: Colors.red, fontSize: 20.0),),
               new Text(': The Sound Of Indie',style: TextStyle(color: Colors.black, fontSize: 20.0),)

            ],
      ),
....

You can find all the scrolling widget in the following link:

https://flutter.dev/docs/development/ui/widgets/scrolling

Peter Haddad
  • 78,874
  • 25
  • 140
  • 134