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

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

Open
ahmeddarafat opened this issue Sep 19, 2023 · 8 comments
Open

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

ahmeddarafat opened this issue Sep 19, 2023 · 8 comments

Comments

@ahmeddarafat
Copy link

The navigation bar makes a size error when using material 3

@Leomhl
Copy link

Leomhl commented Sep 21, 2023

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
Copy link

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
Copy link

nhCoder commented Dec 13, 2023

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

@quarc0o
Copy link

quarc0o commented Dec 15, 2023

Also facing the same issue using material 3

@RenTheProgrammer
Copy link

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
Copy link

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
Copy link

same issue here

@thedarkknight197
Copy link

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

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

8 participants