Reputation:
I am new in Flutter. How to apply a Horizontal scroll view in Row. Please give me a solution if it works then I accept your answer Anyone here with a solution for this? Thanks in Advance. Here is my code.
Row(
// crossAxisAlignment: CrossAxisAlignment.start,
children: categoryData.map((i) {
print('i====>>>>>>>>>>>>>>>>>.${i['name']}');
scrollDirection:
Axis.horizontal;
return FlatButton(
color: Colors.blue,
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.black,
padding: EdgeInsets.all(8.0),
splashColor: Colors.blueAccent,
onPressed: () {
/*...*/
},
child: Text(
'${i['name']}',
style: TextStyle(fontSize: 12.0),
),
);
}).toList(),
),
Upvotes: 1
Views: 298
Reputation: 2117
There is no argument scrollDirection
in Row. Put scrollview on top of ROW. Like
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(.....),
)
Upvotes: 2
Reputation: 1075
Use ListView instead of Row
ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
FlatButton(...),
FlatButton(...),
FlatButton(...),
],
)
...
Upvotes: 1