OverlayPainter constructor

OverlayPainter({
  1. required double padding,
  2. required Animation<double> animation,
  3. required BuildContext context,
  4. List<WidgetData>? widgetsData,
  5. Color? bgColor,
})

Implementation

OverlayPainter({
  required this.padding,
  required this.animation,
  required this.context,
  this.widgetsData,
  Color? bgColor,
})  : this.bgColor = bgColor ?? colorBlack,
      super(repaint: animation) {
  if (widgetsData!.isNotEmpty) {
    widgetsData!.forEach((widgetData) {
      if (!widgetData.isEnabled) {
        final GlobalKey key = widgetData.key;
        if (key.currentWidget == null) {
          //throw new Exception("GlobalKey is not assigned to a Widget!");
        } else {
          areas.add(HoleArea.getHoleArea(
              key: key,
              padding: widgetData.padding,
              shape: widgetData.shape));
        }
      }
    });
  }
}