haptome / dot_navigation_bar

A bottom navigation bar that you can customize with the options you need, without any limits. You can also customize the appearance of the navigation bar with simple smooth animations, providing a nice and clean UI/UX.
https://github.com/haptome/dot_navigation_bar
MIT License
45 stars 17 forks source link

There is bug when using material 3 "Size Error" #20

Open ahmeddarafat opened 12 months ago

ahmeddarafat commented 12 months ago

The navigation bar makes a size error when using material 3

Leomhl commented 12 months ago

The same issue with me

The following assertion was thrown during layout: A RenderFlex overflowed by 43 pixels on the bottom.

The relevant error-causing widget was: DotNavigationBar DotNavigationBar: The overflowing RenderFlex has an orientation of Axis.vertical. The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.

Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size. This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.

The specific RenderFlex in question is: RenderFlex#08d48 OVERFLOWING ... parentData: offset=Offset(16.0, 12.0) (can use size) ... constraints: BoxConstraints(w=379.4, h=56.0) ... size: Size(379.4, 56.0) ... direction: vertical ... mainAxisAlignment: start ... mainAxisSize: min ... crossAxisAlignment: center ... verticalDirection: down

danielkiing3 commented 9 months ago

Currently facing the same issue

BOTTOM OVERFLOWED BY 43 PIXELS

Screenshot 2023-11-26 at 15 36 32
The following assertion was thrown during layout:
A RenderFlex overflowed by 43 pixels on the bottom.

The relevant error-causing widget was:
DotNavigationBar DotNavigationBar:
The overflowing RenderFlex has an orientation of Axis.vertical.
The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.

Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size.
This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.

Error disappear when I stop using Material3 for theming

Screenshot 2023-11-26 at 15 40 13
nhCoder commented 9 months ago

any progress on the issue . i m also facing this error

quarc0o commented 9 months ago

Also facing the same issue using material 3

RenTheProgrammer commented 9 months ago

A temporary fix for this is adding marginR and paddingR to the NavigationBar like so:

DotNavigationBar(
        marginR: const EdgeInsets.symmetric(vertical: 0, horizontal: 8),
        paddingR: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
        currentIndex: _currentIndex,
        onTap: _handleIndexChanged,
        dotIndicatorColor: Colors.black,
        items: [
          DotNavigationBarItem(
            icon: Icon(Icons.home),
            selectedColor: Colors.purple,
          ),

          /// Likes
          DotNavigationBarItem(
            icon: Icon(Icons.favorite_border),
            selectedColor: Colors.pink,
          ),

          /// Search
          DotNavigationBarItem(
            icon: Icon(Icons.search),
            selectedColor: Colors.orange,
          ),

          /// Profile
          DotNavigationBarItem(
            icon: Icon(Icons.person),
            selectedColor: Colors.teal,
          ),
        ],
      ),
reyelahmad commented 8 months ago

A temporary fix for this is adding marginR and paddingR to the NavigationBar like so:

DotNavigationBar(
        marginR: const EdgeInsets.symmetric(vertical: 0, horizontal: 8),
        paddingR: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
        currentIndex: _currentIndex,
        onTap: _handleIndexChanged,
        dotIndicatorColor: Colors.black,
        items: [
          DotNavigationBarItem(
            icon: Icon(Icons.home),
            selectedColor: Colors.purple,
          ),

          /// Likes
          DotNavigationBarItem(
            icon: Icon(Icons.favorite_border),
            selectedColor: Colors.pink,
          ),

          /// Search
          DotNavigationBarItem(
            icon: Icon(Icons.search),
            selectedColor: Colors.orange,
          ),

          /// Profile
          DotNavigationBarItem(
            icon: Icon(Icons.person),
            selectedColor: Colors.teal,
          ),
        ],
      ),

thanks man . love for you

thedarkknight197 commented 6 months ago

same issue here

thedarkknight197 commented 6 months ago

A temporary fix for this is adding marginR and paddingR to the NavigationBar like so:

DotNavigationBar(
        marginR: const EdgeInsets.symmetric(vertical: 0, horizontal: 8),
        paddingR: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
        currentIndex: _currentIndex,
        onTap: _handleIndexChanged,
        dotIndicatorColor: Colors.black,
        items: [
          DotNavigationBarItem(
            icon: Icon(Icons.home),
            selectedColor: Colors.purple,
          ),

          /// Likes
          DotNavigationBarItem(
            icon: Icon(Icons.favorite_border),
            selectedColor: Colors.pink,
          ),

          /// Search
          DotNavigationBarItem(
            icon: Icon(Icons.search),
            selectedColor: Colors.orange,
          ),

          /// Profile
          DotNavigationBarItem(
            icon: Icon(Icons.person),
            selectedColor: Colors.teal,
          ),
        ],
      ),

thanks man . love for you

this is working