0

I wanted to create a NestedScrollView. So it works as it should be but. it's overlapping. The thing is I really couldn't find how should I put this SliverOverlapInjector to the body of the NestedScrollView.

Here's my code:

NestedScrollView(
        headerSliverBuilder: (context, innerBoxIsScrolled) => [
          SliverToBoxAdapter(
            child: PatientHeader(
              patientData: patientData,
            ),
          ),
          SliverOverlapAbsorber(
            handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
            sliver: SliverPersistentHeader(
              pinned: true,
              delegate: CustomSliverAppBarDelegate(
                expandedHeight: 85,
                patientData: patientData,
              ),
            ),
          ),
        ],
        body: Builder(builder: (context) {
          return Column(
            children: [
              SliverOverlapInjector(
                  handle:
                      NestedScrollView.sliverOverlapAbsorberHandleFor(context),
                ),
             
              Obx(
                () => LazyLoadIndexedStack(
                    index: controller.tabIndex.value,
                    children: [
                      const ActivityTimeLine(),
                      PersonalInformationView(
                        patientData: patientData,
                      ),
                      const MedicalQuestionsView(),
                      const NoteView(),
                      const AccommodationView(),
                      const BeforeAfterView(),
                      const ArrivalDepartureView(),
                      const TestResultView(),
                      const OfferView(),
                      const AgentsView(),
                    ]),
              ),
            ],
          );
        }),
      ),

I don't want to use another CustomScrollView at body because I implemented scroll views already inside of tabs. So in my code I can not use SliverOverlapInjector because it's a sliver. So is there any other RenderBox widget that takes slivers parameter instead of children (Probably I am misunderstanding the concept of slivers) ? Or do I must change my implementation?

  • Check this out: https://api.flutter.dev/flutter/widgets/NestedScrollView-class.html#widgets.NestedScrollView.1 – Prashant Aug 29 '23 at 15:04
  • @Prashant So according to that does that mean I must use a CustomScrollView widget to use SliverOverlapInjector and my other widgets in the same child list? Is not there any other possible solutions? – Furkan Türkmen Aug 31 '23 at 06:17

0 Answers0