cBanner method

Widget cBanner({
  1. bool disable = false,
  2. required BannerLocation location,
  3. required String message,
  4. required Color color,
  5. double crop = 0,
})

Wraps the widget with a banner if not disabled.

If disable is true, the original widget is returned unchanged. Otherwise, a Banner widget is added with the specified location, message, color, and optional crop parameters.

Example:

Widget myWidget = ...;
Widget bannerWidget = myWidget.cBanner(
  disable: false,
  location: BannerLocation.topStart,
  message: 'Custom Banner',
  color: Colors.red
);

Implementation

Widget cBanner({
  bool disable = false,
  required BannerLocation location,
  required String message,
  required Color color,
  double crop = 0,
}) =>
    disable
        ? this
        : Banner(
            message: message,
            location: location,
            color: color,
            child: this,
          ).cClipAll(crop);