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

Add SafeArea modifier #558

Open
Maksimka101 opened this issue Feb 18, 2025 · 1 comment
Open

Add SafeArea modifier #558

Maksimka101 opened this issue Feb 18, 2025 · 1 comment

Comments

@Maksimka101
Copy link
Contributor

Use case

I suffer when I need to implement a footer/header. I have to use a box to set a color, safe area to avoid system UI and another HBox for content

Proposal

I'd like to use only one box like this:

    HBox(
      style: Style(
        $with.safeArea(),
        $box.chain
          ..color.black()
          ..padding(20),
      ),
      children: [],
    );
@tilucasoli
Copy link
Collaborator

tilucasoli commented Feb 19, 2025

I’m not sure how well this aligns with the general use of Modifiers. The SafeArea widget is usually used for full page layouts and is rarely implemented in component creation.

Another alternative is you make an extension of Modifiers and add safe area

Please take a look at this documentation and let me know if you have any questions.

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