@@ -508,18 +508,21 @@ class _CustomModalBarrierState extends State<_CustomModalBarrier> {
508
508
509
509
return Stack (
510
510
children: [
511
- ValueListenableBuilder (
512
- valueListenable: color,
513
- builder: (BuildContext context, Color ? value, Widget ? child) {
514
- return CustomPaint (
515
- painter: _DropdownBarrierPainter (
516
- barrierColor: value,
517
- buttonRect: widget.buttonRect,
518
- buttonBorderRadius: widget.buttonBorderRadius,
519
- pageSize: size,
520
- ),
521
- );
522
- },
511
+ IgnorePointer (
512
+ child: ValueListenableBuilder (
513
+ valueListenable: color,
514
+ builder: (BuildContext context, Color ? value, Widget ? child) {
515
+ return CustomPaint (
516
+ size: Size (size.width, size.height),
517
+ painter: _DropdownBarrierPainter (
518
+ barrierColor: value,
519
+ buttonRect: widget.buttonRect,
520
+ buttonBorderRadius: widget.buttonBorderRadius,
521
+ pageSize: size,
522
+ ),
523
+ );
524
+ },
525
+ ),
523
526
),
524
527
widget.child,
525
528
],
@@ -543,15 +546,10 @@ class _DropdownBarrierPainter extends CustomPainter {
543
546
@override
544
547
void paint (Canvas canvas, Size size) {
545
548
if (barrierColor != null ) {
546
- final Rect rect = Rect .fromLTRB (
547
- - buttonRect.left,
548
- - buttonRect.top,
549
- pageSize.width,
550
- pageSize.height,
551
- );
549
+ final Rect pageRect = Offset .zero & pageSize;
552
550
553
- canvas.saveLayer (rect , Paint ());
554
- canvas.drawRect (rect , Paint ()..color = barrierColor! );
551
+ canvas.saveLayer (pageRect , Paint ());
552
+ canvas.drawRect (pageRect , Paint ()..color = barrierColor! );
555
553
556
554
final RRect buttonRRect = RRect .fromRectAndCorners (
557
555
buttonRect,
0 commit comments