Flutter - Fixed position in a bidirectional scroll
2,861
You can wrap your scrollable into a Stack
with positioned children to render that fixed position content
new Stack(
children: [
myScrollable,
new Positioned(
top: .0,
right: .0,
bottom: .0,
child: new Container(width: 42.0, color: Colors.red),
),
],
)
Author by
Jesús Martín
Updated on December 04, 2022Comments
-
Jesús Martín over 1 year
is there any way I can implement a bidirectional scroll list where a part of it has a fixed position? I mean, for example a table that has a legend in the top for each column, I want to keep that legend when I scroll up/down but I also want it to have functionality with the scroll right/left with the rest of the content. (I know how to implement a bidirectional scroll list, that is not what I am asking for)
-
Achintha Isuru about 4 yearsstackoverflow.com/questions/49566752/… try the answers in this question, the question seems a bit similar
-
-
Jesús Martín about 6 yearsBut if I scroll the listview the positioned won't move with it, it will keep its position static, won't it?
-
Rémi Rousselet about 6 yearsYes. That's what a fixed position is in css anyway.
-
Jesús Martín about 6 yearsI was looking for something fixed in a axis but scrollable in the other