-1

i have a list using sticky headers. i want to place a custome made shadow under each header so i did the following:

return StickyHeader(
      header: Material(
        color: Colors.transparent,
        child: Container(
          color: Colors.transparent,
          child: Column(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Container(
                color: AppColors.todaysTasks,
                height: 60.0,
                padding: EdgeInsets.symmetric(horizontal: spacing),
                alignment: Alignment.centerLeft,
                child: Text(
                  title,
                  style: FontStyles.taskListItemName.copyWith(color: Colors.black),
                ),
              ),
              Image.asset(
                'assets/images/BlurCropped.png',
              ),
            ],
          ),
        ),
      ),
      content: Column(

the problem is that my shadow expands the header's container and creates a large margin between each header and the first task. I've provided an image. please help me im lost here.

i was trying to put a shadow image under a header but it created a weird margin.

2 Answers 2

1

Since you are using an image as a shadow, it is not laid over the content. Here are two solutions:

  1. Using decoration: BoxDecoration for the container instead of the image (an example can be found here: https://stackoverflow.com/a/52228086/13755145)
  2. Or, if you want to keep using the image as a shadow, you could use a Stack in content and wrap the image with Positioned. (an example can be found here: https://stackoverflow.com/a/57233221/13755145)

I would try to use the first approach, because positioning is not that easy.

Sign up to request clarification or add additional context in comments.

Comments

0

ive just implemented Sliding up panel wrong never mind

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.