Thursday, October 25, 2018

Flutter creating a horizontal list

Sample is like below

Class MyApp extends StatelessWidget {

@override
Widget build (BuildContext context)
{
  final title = 'MyApp';
  return MaterialApp( title: title, home : Scaffold (appBar: AppBar(title:Text(title)),
  Body : Container (margin: EdgeInsets.symmetric(vertical:20.0, height : 200.0, child:ListView(scrollDirection:Axis.horizontal, children:[Container(width:160.0,color:Color.red),Container(width:160,color:Color.blue)])
}

}

References:
https://flutter.io/cookbook/lists/horizontal-list/

No comments:

Post a Comment