I will first give a bit of background of my problem and then ask the actual question which I am trying to achieve:
BACKGROUND:
I posted this earlier question about preventing rows from disappearing as soon as they entered the padding area of the CupertinoScrollbar's parent Padding widget:
I have figured out a workaround solution which involves removing the parent Padding widget entirely and instead wrapping the SliverList
only in SliverPadding
which achieves the padding on the list. However, this makes the scrollbar start at the top as it's the parent of the SliverPadding
and thus doesn't know the padding for the inner SliverList
.
I have figured out a solution for this problem. I can edit the source code of the CupertinoScrollbar
and modify the following line in the updateScrollbarPainter
method:
..padding = MediaQuery.of(context).padding
to what I need.
QUESTION:
This updateScrollbarPainter
is part of the private state implementation _CupertinoScrollbarState
, so I can't access it outside from my app.
Is there a workaround for this?
If not, is the only possible solution to modify the padding there is to copy the entire source code from this file into my app and then modify it there? It seems a bit complicated for modifying a single line of code no?
Here's the line I can modify: