From df669531d8138a5e545e8c4fd1807de502ddd966 Mon Sep 17 00:00:00 2001 From: Ahmed Elsayed Date: Sat, 9 Mar 2024 23:26:20 +0200 Subject: [PATCH] Avoid null assertion on barrierColor --- packages/dropdown_button2/lib/src/dropdown_route.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dropdown_button2/lib/src/dropdown_route.dart b/packages/dropdown_button2/lib/src/dropdown_route.dart index f8d1d9a..8499427 100644 --- a/packages/dropdown_button2/lib/src/dropdown_route.dart +++ b/packages/dropdown_button2/lib/src/dropdown_route.dart @@ -462,7 +462,7 @@ class _CustomModalBarrierState extends State<_CustomModalBarrier> { super.initState(); color = widget.animation!.drive( ColorTween( - begin: widget.barrierColor!.withOpacity(0.0), + begin: widget.barrierColor?.withOpacity(0.0), end: widget.barrierColor, ).chain(CurveTween(curve: widget.barrierCurve)), );