Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling menu for multiple tabs #5

Closed
Hijodelalunah opened this issue Dec 20, 2020 · 3 comments
Closed

Scrolling menu for multiple tabs #5

Hijodelalunah opened this issue Dec 20, 2020 · 3 comments
Assignees

Comments

@Hijodelalunah
Copy link

When you add multiple items to the list you get pixels overflow error
I made a little change here :

https://github.com/RyuuKenshi/flutter_collapsible_sidebar/blob/00f5e8fa929ea05e5dcc9da3362e59f7a90ca278/lib/collapsible_sidebar.dart#L172-L184

So now it looks like

                    Stack(
                      children: [
                        /**
                        CollapsibleItemSelection(
                          height: _maxOffsetY,
                          offsetY: _maxOffsetY * _selectedItemIndex,
                          color: widget.selectedIconBox,
                          duration: widget.duration,
                          curve: widget.curve,
                        ),*/

                        ConstrainedBox(
                          constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height / 3),
                          child: ListView.builder(
                          itemCount: _items.length,
                          shrinkWrap: true,
                          itemBuilder: (BuildContext context, int index) {
                          return _items[index];
                          }
                          ),
                        ),
                      ],
                    ),

I commented the selected item highlighting because it doesn't scroll with the list so if you have better answers that would be great !

@DrunkOnBytes
Copy link
Owner

Hi @Hijodelalunah,

Thank you very much for pointing out this mistake of mine.

I saw the changes you suggested. Your changes are not making the selected item highlighting scroll, hence I did not use it as it is but used a modified version of that.

The code I changed also enabled the highlighting to scroll. Do check it once:

Expanded(
                    child: SingleChildScrollView(
                      physics: BouncingScrollPhysics(),
                      reverse: widget.fitItemsToBottom,
                      child: Stack(
                        children: [
                          CollapsibleItemSelection(
                            height: _maxOffsetY,
                            offsetY: _maxOffsetY * _selectedItemIndex,
                            color: widget.selectedIconBox,
                            duration: widget.duration,
                            curve: widget.curve,
                          ),
                          Column(
                            children: _items,
                          ),
                        ],
                      ),
                    ),
                  ),

Also do checkout the new features I added at https://pub.dev/packages/collapsible_sidebar

@DrunkOnBytes DrunkOnBytes self-assigned this Dec 20, 2020
@Hijodelalunah
Copy link
Author

Very nice work, such a creative answer 👏👏.

@DrunkOnBytes
Copy link
Owner

Thanks a lot @Hijodelalunah.
Will try to update this package as much as possible and make it the most customizable collapsible sidebar for Flutter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants