Skip to content

Any way to remove space next to AppBar Title when leading is hidden? #81

@kthecoder

Description

@kthecoder

If you add the ResponsiveVisibility to an AppBar's 'leading' when you hide it, it takes up space with the "SizedBox.shrink". Since it won't be removed unless null.

leading: ResponsiveVisibility(
          hiddenWhen: const [Condition.largerThan(name: TABLET)],
          child: IconButton(
            icon: const Icon(Icons.menu),
            onPressed: () {},
          ),
        ),

But you can't assign null to a widget to disable it:

leading: ResponsiveVisibility(
          replacement: null,
          hiddenWhen: const [Condition.largerThan(name: TABLET)],
          child: IconButton(
            icon: const Icon(Icons.menu),
            onPressed: () {},
          ),
        ),

So is there any way to remove the space next to the title when leading is hidden?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions