Nested Scroll View Takes unwanted bottom space

46 Views Asked by At

I am making a screen with nestedscrollview but the body of nestedscrollview takes unwanted empty space. I tried with giving a container with height as 100 but it takes full space>

The code is below

Scaffold(
      body: NestedScrollView(
        controller: controller,
        headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
          return [
            SliverOverlapAbsorber(
              handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
              sliver: SliverAppBar(
                forceElevated: innerBoxIsScrolled,
                surfaceTintColor: AppColors.whiteColor,
                pinned: true,
                floating: true,
                backgroundColor: AppColors.whiteColor,
                leading: leading,
                title: title,
                actions: actions,
                flexibleSpace: FlexibleSpaceBar(
                  background: Stack(
                    children: [
                      Container(
                        color: AppColors.primaryColor,
                        height: MediaQuery.of(context).size.height * 0.23,
                        width: double.infinity,
                        child: Padding(
                          padding: EdgeInsets.only(
                            top: MediaQuery.of(context).size.height * 0.02,
                            left: 13,
                          ),
                        ),
                      ),
                      Positioned(
                        left: MediaQuery.of(context).size.width * 0.15,
                        child: CustomPaint(
                          size: Size(500, GetPlatform.isAndroid ? 180 : 280),
                          painter: ProfileScreenPainter(
                            color: AppColors.primaryColor.withOpacity(0.7),
                          ),
                        ),
                      ),
                      SafeArea(
                        child: stackedCircleAvatar(
                          const EdgeInsets.only(top: 8, right: 16),
                          Alignment.topRight,
                          const Icon(
                            Icons.help_outline_rounded,
                            color: AppColors.whiteColor,
                            size: 20,
                          ),
                          () {},
                        ),
                      ),
                      SafeArea(
                        child: stackedCircleAvatar(
                          const EdgeInsets.only(top: 8, right: 55),
                          Alignment.topRight,
                          const Image(
                            image: AssetImage('assets/icons/search.png'),
                            color: AppColors.whiteColor,
                            height: 22,
                          ),
                          () {},
                        ),
                      ),
                      SafeArea(
                        child: stackedCircleAvatar(
                          const EdgeInsets.only(top: 8, left: 16),
                          Alignment.topLeft,
                          const Icon(
                            Icons.arrow_back,
                            color: AppColors.whiteColor,
                            size: 20,
                          ),
                          () {
                            Navigator.pop(context);
                          },
                        ),
                      ),
                    ],
                  ),
                ),
                expandedHeight: 150,
              ),
            ),
            SliverPersistentHeader(
              pinned: true,
              delegate: DividerDeligate(),
            ),
            SliverToBoxAdapter(
              child: child,
            )
          ];
        },
        body: Container(
height:100,
color: Colors.red),
      ),
    );
0

There are 0 best solutions below