How to add Scrollbar to Listview in Flutter?

This Article is posted by seven.srikanth at 10/1/2021 6:48:58 PM



<p>Here is an example of how to add ScrollBar to ListView in flutter. This can be achieved through Scrollbar widget in flutter and its simple to use.</p> <p>![](https://fluttercentral.com/Uploads/33a760c3-e7b6-48ee-9310-52bc55f2af78.pngwidth="50%height="auto](</p> <p>Complete Code:</p> <p id="4ec9b0;](MyApp());" color:="">color: #9cdcfe;](args) </p> <p>color: #569cd6;](class color: #4ec9b0;](MyApp color: #569cd6;](extends color: #4ec9b0;](StatelessWidget { color: #9cdcfe;](@ color: #9cdcfe;](override</p> <p>color: #4ec9b0;](Widget color: #dcdcaa;](build(color: #4ec9b0;](BuildContext color: #9cdcfe;](context) { color: #c586c0;](return color: #4ec9b0;](MaterialApp( color: #9cdcfe;](home: color: #4ec9b0;](MyHome(), ); } }</p> <p>color: #569cd6;](class color: #4ec9b0;](MyHome color: #569cd6;](extends color: #4ec9b0;](StatelessWidget { color: #9cdcfe;](@ color: #9cdcfe;](override</p> <p>color: #4ec9b0;](Widget color: #dcdcaa;](build(color: #4ec9b0;](BuildContext color: #9cdcfe;](context) { color: #c586c0;](return color: #4ec9b0;](Scaffold( color: #9cdcfe;](body: color: #4ec9b0;](Scrollbar( color: #9cdcfe;](thickness: color: #b5cea8;](10, color: #9cdcfe;](child: color: #4ec9b0;](ListView( color: #9cdcfe;](children: color: #4ec9b0;](List.color: #4ec9b0;](generate( color: #b5cea8;](20, (color: #4ec9b0;](int color: #9cdcfe;](i) => color: #4ec9b0;](Card( color: #9cdcfe;](child: color: #4ec9b0;](Center( color: #9cdcfe;](child: color: #4ec9b0;](ListTile( color: #9cdcfe;](title: color: #4ec9b0;](Text( color: #ce9178;]('This is item ' + color: #9cdcfe;](i.color: #dcdcaa;](toString(), ), ), ), ), ), ), ), ); } } ` Thanks,Srikanth</p>


Tags: How to add Scrollbar








0 Comments
Login to comment.
Recent Comments