i tried creating scrollable row in flutter
but after trying multiple methods in some i am facing issue of height being fixed or list is not scrolling
posting one of the code i tried.
looking forward for a way where i can scroll in a row and don't need to fix a height for the widget.
new Column(
children: [
new Container(
height: 100.0,
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
new Text("text 1"),
new Text("text 2"),
new Text("text 3"),
],
),
),
],
),
I have already answered somewhat related question where you don't need to give a fix height to the widgets and your widgets can scroll in horizontal direction
you can check it here
https://stackoverflow.com/a/51937651/9236994
TIP: Use SingleChildScrollView widget
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: <Widget>[
Text('hi'),
Text('hi'),
Text('hi'),
]
)
)
Replace the Column widget by ListView.
You can take a look at https://api.flutter.dev/flutter/widgets/ListView-class.html
Regards
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With