ios – Flutter: override the non-public state implementation of a Cupertino widget?

I’ll first give a little bit of background of my downside after which ask the precise query which I’m attempting to realize:


I posted this earlier query about stopping rows from disappearing as quickly as they entered the padding space of the CupertinoScrollbar’s guardian Padding widget:

Flutter Padding on CupertinoScrollbar – forestall row from disappearing as quickly as they enter the padding space?

I’ve found out a workaround resolution which entails eradicating the guardian Padding widget solely and as an alternative wrapping the SliverList solely in SliverPadding which achieves the padding on the record. Nonetheless, this makes the scrollbar begin on the high as it is the guardian of the SliverPadding and thus does not know the padding for the internal SliverList.

I’ve found out an answer for this downside. I can edit the supply code of the CupertinoScrollbar and modify the next line within the updateScrollbarPainter technique:

..padding = MediaQuery.of(context).padding

to what I would like.


This updateScrollbarPainter is a part of the non-public state implementation _CupertinoScrollbarState, so I am unable to entry it outdoors from my app.

Is there a workaround for this?

If not, is the one attainable resolution to change the padding there’s to repeat the complete supply code from this file into my app after which modify it there? It appears a bit sophisticated for modifying a single line of code no?

This is the road I can modify:

enter image description here

See also  ios - Reassign TableView Cell Variable from one other ViewController

Leave a Reply