I am new to flutter, I need to add an horizontal scroll bar as in the image, how can I go about in doing so. https://i.stack.imgur.com/rfsNB.png
you can test with a ListView, and using the property scrollDirection: Axis.horizontal.
You can get more info in this link:
https://flutter.dev/docs/cookbook/lists/horizontal-list
you can just wrap your widget with the Scrollbar() widget and it will do your job
for further information you can read the docs here
https://api.flutter.dev/flutter/material/Scrollbar-class.html
Related
I want to achieve following layout in a flutter app:
App bar
Text widget
Row of chip widgets
Tab bar with three labels
Three tab views with each one ElevatedButton and a GridView.
The debugger starts bleeding once I try to place the GridView inside the tab view. The debugger complains about 'hasSize' etc.
As far as I know the problem is that I use GridView inside SingleChildScrollView. After that I tried many things, using CustomScrollView and slivers. But it got uglier and uglier. I used SingleChildScrollView because I want the view to be scrollable as far as the GridView goes.
I would appreciate it if someone who did something similar guided me to the right direction.
Here's an image of what I try to get:
I need a DraggableSheet but not scrollable, so it does not require any scrollable widget inside it.
What I need is a DraggableSheet that only scrollable until it expands and not the content inside.
is there any native widget or 3rd party library for it?
Since the builder for the DraggableScrollableSheet requires you to return a Scrollable widget, you could return a ListView with NeverScrollableScrollPhysics assigned to the physics argument. Or any other widget you require that allows you to set the physics to NeverScrollableScrollPhysics
More info and code samples on the Flutter docs
More info and code samples on the NeverScrollPhysics docs
Have you try to just using a Container ?
I am making an app whose structure is very simple.
A ListView with Listtiles in it.
I want to add animation such that when the screen is opened the listtiles slide in.
Flutter provides a AnimatedList Widget.
Perhaps this native widget will give you the desired output
My question is similar to this How to make my page scrollable when i show overlay element, that have too many items in flutter? but it has no answers so I'll try to ask as well:
I have an Overlay showing a list of questions using ListView. The list of questions is long and I need to enable scrolling inside the Overlay.
Now it's static and part of it disappears at the bottom of the mobile device.
Why is not just scrollable (since the list inside the Overlay is inside a ListView) and is there a way to make it scrollable?
Thanks in advance for any help!
UPDATE (SOLVED) :
The problem was that the ListView widget is inside a Positioned widget and the top, left, bottom and width values (in my case) need to be set in order for the content to be scrollable.
The problem was that the ListView widget is inside a Positioned widget and the top, left,bottom and width values (in my case) need to be set in order for the content to be scrollable.
Can a bottomsheet be made scrollable? For example it opens initially upto a particular height and scrolls up as the content is scrolled. If yes, please help!
The DraggableScrollableSheet is here for that purpose.
This widget can be dragged along the vertical axis between its minChildSize, which defaults to 0.25 and maxChildSize, which defaults to 1.0.
You can use any Scrollable widget as child of DraggableScrollableSheet.
See the official video from Flutter team.