Enough-Software / enough_platform_widgets

More cross platform widgets for Flutter. Extends flutter_platform_widgets.
MIT License
18 stars 20 forks source link

PlatformTabScaffold overflows PlatformNavBar in Material 3 [Android only] #18

Closed LahaLuhem closed 8 months ago

LahaLuhem commented 1 year ago

The following is my HomeView:

PlatformTabScaffold(
        tabController: PlatformTabController(),
        bodyBuilder: (context, tabIndex) => AppRouter.tabs[tabIndex],
        iosContentBottomPadding: true,
        iosContentPadding: true,
        appBarBuilder: (_, __) => AdcAppBar(),
        material: (_, __) => MaterialTabScaffoldData(
          drawer: const SideMenu(),
          drawerEnableOpenDragGesture: true,
          resizeToAvoidBottomInset: true,
          primary: true,
        ),
        cupertino: (_, __) => CupertinoTabScaffoldData(
          resizeToAvoidBottomInset: true,
          resizeToAvoidBottomInsetTab: true,
        ),
        items: [
          BottomNavigationBarItem(
            icon: Icon(
              PlatformIcons(context).home,
            ),
            label: context.strings.home,
          ),
          BottomNavigationBarItem(
            icon: PlatformWidget(
              material: (_, __) => const Icon(
                Icons.history,
              ),
              cupertino: (_, __) => const Icon(
                CupertinoIcons.time_solid,
              ),
            ),
            label: context.strings.history,
          ),
        ],
      ),


This uses the default sizes for everything, yet, on Android, it overflows by 2.0 pixel at the bottom, with the following stackTrace:

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

The relevant error-causing widget was: 
  Column Column:##################################/packages/flutter/lib/src/material/bottom_navigation_bar.dart:610:12
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#bb33f relayoutBoundary=up8 OVERFLOWING
...  parentData: offset=Offset(0.0, 7.0) (can use size)
...  constraints: BoxConstraints(0.0<=w<=189.7, 0.0<=h<=42.0)
...  size: Size(189.7, 42.0)
...  direction: vertical
...  mainAxisAlignment: spaceBetween
...  mainAxisSize: min
...  crossAxisAlignment: center
...  verticalDirection: down
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
====================================================================================================
Reloaded 1 of 1195 libraries in 558ms (compile: 21 ms, reload: 245 ms, reassemble: 190 ms).
robert-virkus commented 8 months ago

Sorry for the late response, this is/was a problem in flutter_platform_widgets