Skip to content

Some of our controls can't handle being built in 0x0 environments #6537

Description

@Hixie

We should create tests that put each UI control into a 0x0 container and make sure they don't crash.

See #6535.

Activity

  1. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    on Oct 26, 2016
  2. added this to the milestone on Oct 26, 2016
  3. Hixie commented on Oct 26, 2016

    @Hixie
    ContributorAuthor

    See also #5259 which triggers this in release and debug --no-hot mode.

  4. modified the milestones: 2: Make Early Adopters happy, on Nov 14, 2016
  5. modified the milestones: , 2: Make Early Adopters happy on Feb 27, 2017
  6. removed this from the milestone on Mar 17, 2020
  7. 310 remaining items

  8. flutter-triage-bot commented on Dec 27, 2025

    @flutter-triage-bot

    This issue is assigned to @ahmedsameha1 but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  9. ahmedsameha1 commented on Dec 28, 2025

    @ahmedsameha1
    Contributor

    This issue is assigned to @ahmedsameha1 but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

    I am actively working on the issue, as you can see from the linked PRs.

  10. flutter-triage-bot commented on Mar 15, 2026

    @flutter-triage-bot

    This issue was assigned to @ahmedsameha1 but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  11. ahmedsameha1 commented on Mar 15, 2026

    @ahmedsameha1
    Contributor

    This issue was assigned to @ahmedsameha1 but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

    I am actively working on this issue.
    @victorsanni @dkwingsmt

  12. dkwingsmt commented on Mar 16, 2026

    @dkwingsmt
    Contributor

    There sure has been tons of status updates, which can be seen from the related PRs. :)

  13. ahmedsameha1 commented on Mar 16, 2026

    @ahmedsameha1
    Contributor

    This issue was assigned to @ahmedsameha1 but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

    Hi @loic-sharma, would you reassign this issue to me?

  14. dkwingsmt commented on Mar 16, 2026

    @dkwingsmt
    Contributor

    Done!

  15. ahmedsameha1 commented on Mar 16, 2026

    @ahmedsameha1
    Contributor

    Done!

    Thank you.

  16. ahmedsameha1 commented on Jun 13, 2026

    @ahmedsameha1
    Contributor

    These are widgets that I think need to be handled in this issue. I will work on them one by one as I can, and if I fail, I will report my attempt here.
    Magnifier
    SliverReorderableList
    SnackBar
    TextSelectionToolbar
    CupertinoAdaptiveTextSelectionToolbar
    CupertinoDatePicker
    CupertinoActionSheet
    CupertinoTextMagnifier
    CupertinoSliverNavigationBar
    CupertinoNavigationBarBackButton
    CupertinoSlidingSegmentedControl
    CupertinoSliverRefreshControl
    CupertinoPageTransition
    CupertinoFullscreenDialogTransition
    CupertinoSheetTransition
    CupertinoTheme
    RenderObjectToWidgetAdapter
    DecoratedSliver
    PinnedHeaderSliver
    PreferredSize
    SliverAnimatedOpacity
    SliverAnimatedList
    SliverAnimatedGrid
    ViewAnchor
    ViewCollection
    RawView: Failed assertion
    SliverReorderableList
    SliverSafeArea
    RawScrollbar
    SliverFillViewport
    SliverFillRemaining
    SliverVisibility
    SliverFadeTransition
    SystemContextMenu
    SliverToBoxAdapter
    SliverPadding
    SliverSemantics
    ListBody
    I think that there are no widgets other than the above list and these widgets that are not handled for this issue.
    Please notice that I have a pending work that contains 8 widgets, and I am waiting to complete the suggested 10 widgets.
    @dkwingsmt @victorsanni

  17. ahmedsameha1 commented on Jun 13, 2026

    @ahmedsameha1
    Contributor

    This is my attempt to handle this issue for SnackBar:

      testWidgets('SnackBar does not crash at zero area', (WidgetTester tester) async {
        tester.view.physicalSize = Size.zero;
        addTearDown(tester.view.reset);
        await tester.pumpWidget(
          MaterialApp(
            home: Center(
              child: Scaffold(body: Builder(
                builder: (context) {
                  Timer.run(
                    () =>
                        [ScaffoldMessenger.of](http://scaffoldmessenger.of/)(context).showSnackBar(const SnackBar(content: Text('X'))),
                  );
                  return const Placeholder();
                },
              ),
              ),
            ),
          ),
        );
        await tester.pumpAndSettle();
        expect(tester.getSize(find.byType(SnackBar)), Size.zero);
      });

    The test fails with:
    The _ScaffoldLayout custom multichild layout delegate tried to lay out the child with id "_ScaffoldSlot.snackBar" more than once. Each child must be laid out exactly once.
    I need further guidance.
    This is my attempt to handle this issue for SnackBar:

      testWidgets('SnackBar does not crash at zero area', (WidgetTester tester) async {
        tester.view.physicalSize = Size.zero;
        addTearDown(tester.view.reset);
        await tester.pumpWidget(
          MaterialApp(
            home: Center(
              child: Scaffold(body: Builder(
                builder: (context) {
                  Timer.run(
                    () =>
                        [ScaffoldMessenger.of](http://scaffoldmessenger.of/)(context).showSnackBar(const SnackBar(content: Text('X'))),
                  );
                  return const Placeholder();
                },
              ),
              ),
            ),
          ),
        );
        await tester.pumpAndSettle();
        expect(tester.getSize(find.byType(SnackBar)), Size.zero);
      });

    The test fails with:
    The _ScaffoldLayout custom multichild layout delegate tried to lay out the child with id "_ScaffoldSlot.snackBar" more than once. Each child must be laid out exactly once.
    I need further guidance.

  18. flutter-triage-bot commented on Jul 27, 2026

    @flutter-triage-bot

    This issue is assigned to @ahmedsameha1 but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  19. flutter-triage-bot commented on Aug 18, 2026

    @flutter-triage-bot

    This issue is assigned to @ahmedsameha1 but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  20. justinmc commented on Aug 18, 2026

    @justinmc
    Contributor

    @ahmedsameha1 any idea where our progress is on getting this fixed for all of our relevant widgets?

  21. ahmedsameha1 commented on Aug 19, 2026

    @ahmedsameha1
    Contributor

    @justinmc Please check #6537 (comment)
    The 8 widgets that I did not push in a PR are: Viewport, ColoredBox, StatefulBuilder, Builder, RawImage, RichText, Flow, Wrap.
    Clearly I have not work on this issue for a while and I think I will need some help if I will complete the remaining widgets.

  22. justinmc commented on Aug 20, 2026

    @justinmc
    Contributor

    Got it, thanks! I'll go ahead and unassign you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our testsp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions