dot_navigation_bar icon indicating copy to clipboard operation
dot_navigation_bar copied to clipboard

There is bug when using material 3 "Size Error"

Open ahmeddarafat opened this issue 2 years ago • 8 comments

The navigation bar makes a size error when using material 3

ahmeddarafat avatar Sep 19 '23 17:09 ahmeddarafat

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

Leomhl avatar Sep 21 '23 20:09 Leomhl

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

danielkiing3 avatar Nov 26 '23 14:11 danielkiing3

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

nhCoder avatar Dec 13 '23 18:12 nhCoder

Also facing the same issue using material 3

quarc0o avatar Dec 15 '23 09:12 quarc0o

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,
          ),
        ],
      ),

RenTheProgrammer avatar Dec 19 '23 13:12 RenTheProgrammer

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

reyelahmad avatar Jan 18 '24 01:01 reyelahmad

same issue here

thedarkknight197 avatar Mar 09 '24 23:03 thedarkknight197

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

thedarkknight197 avatar Mar 09 '24 23:03 thedarkknight197