Search packages, repositories and app categories

colorful_safe_area cover
Package detailsv1.0.0

colorful_safe_area

A more customizable replacement for the SafeArea widget. It lets you set the color of your SafeArea without affecting the color of its child.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
10K
Likes
59
Pub points
150

Install package

flutter pub add colorful_safe_area

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

ColorfulSafeArea is a customizable alternative to the standard SafeArea widget, allowing developers to set a distinct background color for the safe area without influencing the child widget's appearance. It provides fine-grained control over padding and visual styling, making it ideal for apps requiring precise UI layouts across different devices. The package supports all major platforms and integrates seamlessly with Flutter’s rendering pipeline.

Use cases

  • Customizing safe area backgrounds
  • Creating visually distinct navigation bars
  • Designing immersive full-screen experiences
  • Implementing platform-specific padding adjustments
  • Enhancing UI consistency across devices

Key features

  • Separate color control for safe area
  • No impact on child widget styling
  • Cross-platform support
  • Simple integration with existing code
  • Flexible padding configuration

Suitable for

  • UI designers seeking visual precision
  • Developers building responsive layouts
  • Apps with complex navigation bars
  • Projects requiring consistent edge padding
  • Teams targeting multiple platforms

Considerations

  • May require additional testing on edge cases
  • Not suitable for nested safe area scenarios
  • Limited to background color customization
  • Does not replace SafeArea's core functionality
  • Best used when background color needs independent control

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

ColorfulSafeArea

Pub

A more customizable replacement for the SafeArea widget. It lets you set the color of your SafeArea without affecting the color of its child.

Example of ColorfulSafeArea

Use it just like a regular SafeArea widget.

Scaffold(
    body: ColorfulSafeArea(
        child: SomeWidget(),
    ),
);

Setting Color

The color of ColorfulSafeArea widgets are transparent by default. To change their color, set the color property.

Scaffold(
    body: ColorfulSafeArea(
        color: Colors.red,
        child: SomeWidget(),
    ),
);

Using Transparent Colors

You can use any color that has transparency

Scaffold(
    body: ColorfulSafeArea(
        color: Colors.red.withOpacity(0.7),
        child: SomeWidget(),
    ),
);

Overflow Rules

If you are using a transparent color and want the child of the ColorfulSafeArea to appear behind it, you can set overflowRules to define how the ColorfulSafeArea's child should appear. The default value is OverflowRules.all(false). The OverflowRules class works much like EdgeInsets.

// allows the child to overflow behind all sides
overflowRules: OverflowRules.all(true)

// allows the child to overflow only on the left and bottom sides
overflowRules: OverflowRules.only(left: true, bottom: true)

// allows the child to overflow on the top and bottom
overflowRules: OverflowRules.symmetric(vertical: true)

Blurring Overflow Area

If you want to apply a blur effect to the ColorfulSafeArea, you can apply a filter.

Scaffold(
    body: ColorfulSafeArea(
        overflowRules: OverflowRules.all(true),
        filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
        child: SomeWidget(),
    ),
);

Making Overflow Area Interactive

When you set overflowRules and would like for the parts of the child that have overflowed to be interactable behind the ColorfulSafeArea, you can set overflowTappable to true.

Scaffold(
    body: ColorfulSafeArea(
        overflowRules: OverflowRules.all(true),
        overflowTappable: true
        child: SomeWidget(),
    ),
);

Categories

Source repository

Projects using this package

No data available yet.