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

A RenderFlex overflowed by 1.5 pixels on the right. #40

Open
r3zafa opened this issue Feb 14, 2023 · 1 comment
Open

A RenderFlex overflowed by 1.5 pixels on the right. #40

r3zafa opened this issue Feb 14, 2023 · 1 comment

Comments

@r3zafa
Copy link

r3zafa commented Feb 14, 2023

hey,
i'm getting following error as i'm expending my sidebar. i have add sidebarx as drawer.

======== Exception caught by rendering library =====================================================
The following assertion was thrown during layout:
A RenderFlex overflowed by 1.5 pixels on the right.

The relevant error-causing widget was: 
  SidebarX SidebarX:file:///Users/r3zafa/projects/flutter-elearning/app12/lib/screens/mobile/mobile_home.dart:34:15
The overflowing RenderFlex has an orientation of Axis.horizontal.
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#6ff4e relayoutBoundary=up11 OVERFLOWING
...  parentData: offset=Offset(16.0, 16.0) (can use size)
...  constraints: BoxConstraints(w=30.0, 0.0<=h<=Infinity)
...  size: Size(30.0, 31.5)
...  direction: horizontal
...  mainAxisAlignment: start
...  mainAxisSize: max
...  crossAxisAlignment: center
...  textDirection: ltr
...  verticalDirection: down
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢
=========================================================================================
SidebarX(
        showToggleButton: true,
        theme: SidebarXTheme(
          decoration: BoxDecoration(
            color: Colors.deepPurple.shade100,
          ),
          padding:
              const EdgeInsets.only(top: 24, bottom: 24, left: 0, right: 0),
          textStyle: GoogleFonts.poppins(
              fontSize: 14.sp,
              fontWeight: FontWeight.w600,
              color: Colors.black),
          selectedTextStyle: GoogleFonts.poppins(
            fontSize: 14.sp,
            fontWeight: FontWeight.w600,
            color: Colors.white,
          ),
          iconTheme: IconThemeData(
            color: Colors.black,
            size: 22.sp,
          ),
          selectedIconTheme: IconThemeData(
            color: Colors.white,
            size: 22.sp,
          ),
          itemPadding: const EdgeInsets.only(top: 16, bottom: 16),
          selectedItemPadding: const EdgeInsets.only(top: 16, bottom: 16),
          selectedItemDecoration: BoxDecoration(
            color: Colors.deepPurple.shade400,
            borderRadius: BorderRadius.circular(10),
          ),
          itemTextPadding: const EdgeInsets.only(left: 8),
          selectedItemTextPadding: const EdgeInsets.only(left: 8),
        ),
        extendedTheme: SidebarXTheme(
          selectedItemPadding: const EdgeInsets.all(16),
          itemPadding: const EdgeInsets.all(16),
          padding: const EdgeInsets.all(16),
          width: 70.w,
        ),
        controller: SidebarXController(
          selectedIndex: 0,
          extended: true,
        ),
        items: const [
          SidebarXItem(icon: Icons.home, label: 'Home'),
          SidebarXItem(icon: Icons.search, label: 'Search'),
        ],
      ),

grafik

@malavikaac
Copy link

Have you find the solution for overflow and rendering , Iam also facing same problem .

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