zeba_academy_safe_area

A powerful Flutter utility package for handling dynamic safe areas, notch detection, status bar information, and bottom insets with simple and reusable APIs.

Build responsive Flutter applications that automatically adapt to:

  • šŸ“± Notched devices
  • šŸŽ iPhone Dynamic Island
  • šŸ¤– Android display cutouts
  • āŒØļø Keyboard insets
  • 🧭 Gesture navigation areas
  • šŸ“ Dynamic system padding

Features

āœ… Dynamic Safe Area padding
āœ… Notch detection
āœ… Dynamic Island detection
āœ… Status bar helpers
āœ… Bottom inset helpers
āœ… Keyboard visibility detection
āœ… Context extension utilities
āœ… Reusable DynamicSafeArea widget
āœ… Lightweight and dependency-free

Installation

Add this package to your pubspec.yaml:

dependencies:
  zeba_academy_safe_area: ^0.0.1

Then run:

flutter pub get

Import

import 'package:zeba_academy_safe_area/zeba_academy_safe_area.dart';

Usage

Dynamic Safe Area Widget

Automatically applies device safe padding.

DynamicSafeArea(
  child: Scaffold(
    body: Center(
      child: Text(
        "Hello Safe Area",
      ),
    ),
  ),
);

With custom minimum padding:

DynamicSafeArea(
  minimumPadding: 16,
  child: YourWidget(),
);

Safe Area Helpers

Get top safe area:

double top =
    SafeAreaHelper.top(context);

Get bottom safe area:

double bottom =
    SafeAreaHelper.bottom(context);

Get complete padding:

EdgeInsets padding =
    SafeAreaHelper.padding(context);

Check if device has safe area:

bool value =
    SafeAreaHelper.hasSafeArea(context);

Notch Detection

Check device notch:

bool hasNotch =
    NotchHelper.hasNotch(context);

Detect Dynamic Island:

bool dynamicIsland =
    NotchHelper.hasDynamicIsland(context);

Check bottom gesture area:

bool gestureArea =
    NotchHelper.hasBottomGestureArea(context);

Status Bar Helpers

Get status bar height:

double height =
    StatusBarHelper.height(context);

Check status bar availability:

bool visible =
    StatusBarHelper.isVisible(context);

Get navigation bar height:

double navigation =
    StatusBarHelper.navigationBarHeight(context);

Bottom Insets

Keyboard height:

double keyboard =
    BottomInsetHelper.keyboard(context);

Check keyboard visibility:

bool opened =
    BottomInsetHelper.keyboardVisible(context);

Bottom safe padding:

double bottom =
    BottomInsetHelper.safeBottom(context);

Context Extensions

The package provides simple BuildContext extensions.

Example:

double top = context.safeTop;

double bottom = context.safeBottom;

bool notch = context.hasNotch;

bool keyboard =
    context.keyboardVisible;

Supported Platforms

Platform Supported
Android āœ…
iOS āœ…
Web āœ…
Windows āœ…
macOS āœ…
Linux āœ…

Why use zeba_academy_safe_area?

Flutter's default SafeArea widget works well for basic layouts, but many applications need:

  • Device notch information
  • Status bar measurements
  • Keyboard detection
  • Bottom navigation handling
  • Reusable responsive helpers

This package provides all these utilities in one clean API.

Example

class HomePage extends StatelessWidget {

  const HomePage({
    super.key,
  });


  @override
  Widget build(BuildContext context) {

    return DynamicSafeArea(

      child: Scaffold(

        body: Center(

          child: Column(

            mainAxisAlignment:
                MainAxisAlignment.center,

            children: [

              Text(
                "Top: ${context.safeTop}",
              ),

              Text(
                "Bottom: ${context.safeBottom}",
              ),

              Text(
                "Notch: ${context.hasNotch}",
              ),

            ],
          ),
        ),
      ),
    );
  }
}

Contributing

Contributions are welcome.

Steps:

  1. Fork the repository
  2. Create a feature branch
git checkout -b feature/new-feature
  1. Commit changes
git commit -m "Add new feature"
  1. Push branch
git push origin feature/new-feature
  1. Create a Pull Request

About Me

✨ I’m Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects.

Learn more about my work:

Website: https://sufyanism.com/

LinkedIn: https://www.linkedin.com/in/sufyanism

Zeba Academy

Your all-in-one learning hub!

šŸš€ Explore courses and resources in coding, technology, and development.

Zeba Academy helps developers improve practical skills through:

  • Programming tutorials
  • Real-world projects
  • Development resources
  • Hands-on learning

Visit:

Website: https://zeba.academy

Coding resources:

https://code.zeba.academy

YouTube:

https://www.youtube.com/@zeba.academy

Instagram:

https://www.instagram.com/zeba.academy/

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).

You are free to:

  • Use this software
  • Study the source code
  • Modify the software
  • Distribute copies

Under the GPL-3.0 license, modified versions must also be distributed under the same license.

See the full license:

https://www.gnu.org/licenses/gpl-3.0.html

Thank You

Thank you for using zeba_academy_safe_area.

If this package helps your Flutter development, consider supporting the project by sharing it with the Flutter community.